209 lines
13 KiB
TypeScript
209 lines
13 KiB
TypeScript
/* Metro module 11048; source: modules/stickers/native/StickerPicker.tsx; dependencies: [57, 31, 27, 1878, 6583, 3832, 661, 33, 4501, 697, 683, 11049, 11051, 566, 6771, 6789, 11032, 690, 11055, 6943, 4643, 11056, 7882, 6796, 11065, 6984, 1244, 11075, 11076, 11081, 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 StickersStore from '../StickersStore.tsx'; /* Metro dependency 6583 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
import TidaWebformExperiment from '../../guild/TidaWebformExperiment.tsx'; /* Metro dependency 6796 */
|
|
import UseExpressionPickerInsets from '../../expression_picker/native/useExpressionPickerInsets.tsx'; /* Metro dependency 11032 */
|
|
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as StickersConstantsModule from '../StickersConstants.tsx'; /* Metro dependency 3832 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as UseAnalyticsLocationsModule from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import * as StickerSendabilityModule from '../StickerSendability.tsx'; /* Metro dependency 6943 */
|
|
import * as StickersHooksModule from '../StickersHooks.tsx'; /* Metro dependency 11049 */
|
|
import * as StickersUtilsModule from './StickersUtils.tsx'; /* Metro dependency 11051 */
|
|
import * as ShowStickerDetailActionSheetModule from './showStickerDetailActionSheet.tsx'; /* Metro dependency 11065 */
|
|
|
|
function _fun84543(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:6, offset: 0x01f4f02f, size: 435 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const STICKER_SEARCH_HEADER_HEIGHT = (StickersConstantsModule).STICKER_SEARCH_HEADER_HEIGHT;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
const PX_8 = (Native).space.PX_8;
|
|
const env0_16 = Reflect.apply(createStyles, CreateStylesModule, [{container: {flex: 1},
|
|
header: {paddingVertical: PX_8}, loadingIndicator: {'alignItems': 'center', 'justifyContent': 'center',
|
|
'flex': 1}, emptyState: {'marginTop': null, 'alignItems': 'center', 'justifyContent': 'center', 'flex': 1,
|
|
marginTop: STICKER_SEARCH_HEADER_HEIGHT}}]);
|
|
value = value.memo(StickerPicker);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/stickers/native/StickerPicker.tsx');
|
|
exports.default = value;
|
|
function StickerPicker({bottomSheetRef, bottomSheetIndex, channel, paddingTop, onPressSticker, stickerFormats, inPortalKeyboard}) { // fn#84544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:612, offset: 0x01f4f1e2, size: 1014 bytes, params: 2, frame: 49
|
|
var r10;
|
|
var SearchField;
|
|
var intl;
|
|
const styles = useStyles();
|
|
(StickersHooksModule).useFetchStickerPacks();
|
|
const value3 = (StickersUtilsModule).useStickerCategories(channel);
|
|
const hasLoadedStickerPacks = (require(566) /* metro dependency 566: flux */).useStateFromStores([StickersStore],
|
|
function() {
|
|
return StickersStore.hasLoadedStickerPacks;
|
|
});
|
|
const binding = env0_4;
|
|
let useState = binding.useState;
|
|
const value4 = Reflect.apply(useState, binding, [0]);
|
|
const value5 = Module00057(value4, 2);
|
|
const property = value5[0];
|
|
const property2 = value5[1];
|
|
let defaultImport = UseAnalyticsLocations;
|
|
const STICKER_PICKER = (AnalyticsLocation).STICKER_PICKER;
|
|
const analyticsLocations = defaultImport(STICKER_PICKER).analyticsLocations;
|
|
useState = binding.useState;
|
|
const value7 = Module00057(Reflect.apply(useState, binding, [null]), 2);
|
|
const property3 = value7[0];
|
|
var env0_4 = value7[1];
|
|
const {safeAreaStyle,
|
|
safeAreaBottomKeyboardAware} = (UseExpressionPickerInsets)({hasCategories: true});
|
|
const value9 = binding.useCallback(_fun84546, []);
|
|
binding.useEffect(function() {
|
|
var defaultImport = importDefault(dependencyMap[10]);
|
|
var CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
|
|
var channelBinding = channel;
|
|
defaultImport.track(CHAT_INPUT_COMPONENT_VIEWED, {type: ChatInputComponentViewedTypes.STICKER,
|
|
channel_id: channelBinding.id, guild_id: channelBinding.guild_id});
|
|
}, [channel.id, channel.guild_id]);
|
|
const value10 = binding.useCallback(_fun84549, [channel, onPressSticker, analyticsLocations]);
|
|
const value11 = binding.useCallback(function() {
|
|
var channelBinding = channel;
|
|
var defaultImport = importDefault(dependencyMap[10]);
|
|
var CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
|
|
defaultImport.track(CHAT_INPUT_COMPONENT_VIEWED, {type: ChatInputComponentViewedTypes.STICKER_SEARCH,
|
|
channel_id: channelBinding.id, guild_id: channelBinding.guild_id});
|
|
}, [channel]);
|
|
const defaultImport3 = TidaWebformExperiment;
|
|
const useExperiment = defaultImport3.useExperiment;
|
|
const tidaWebformEnabled = Reflect.apply(useExperiment, defaultImport3, [{location: 'StickerPicker'},
|
|
{autoTrackExposure: false}]).tidaWebformEnabled;
|
|
const value12 = binding.useCallback(_fun84551, [channel]);
|
|
const AnalyticsLocationProvider = (UseAnalyticsLocationsModule).AnalyticsLocationProvider;
|
|
if (value3.length === 0) {
|
|
r10 = null;
|
|
} else {
|
|
var viewBinding2Props = {style: styles.header};
|
|
SearchField = (require(6984) /* metro dependency 6984: SearchFieldNative */).SearchField;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r10 = (
|
|
<View {...viewBinding2Props}>
|
|
<SearchField
|
|
size="md"
|
|
placeholder={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dt5h1C)}
|
|
onChange={value9}
|
|
onFocus={value11}
|
|
isRound
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
return (
|
|
<AnalyticsLocationProvider value={analyticsLocations}>
|
|
<View style={styles.container}>
|
|
{r10}
|
|
{
|
|
hasLoadedStickerPacks
|
|
? (
|
|
value3.length === 0
|
|
? (
|
|
<View style={styles.emptyState}>
|
|
{((Component) => <Component />)(importDefault(11075) /* metro dependency 11075: StickerPickerEmptyState */)}
|
|
</View>
|
|
)
|
|
: ((Component) => <Component bottomSheetRef={bottomSheetRef} bottomSheetIndex={bottomSheetIndex} setCategoryIndex={property2} onPressSticker={value10} onLongPressStickerDetail={tidaWebformEnabled ? value12 : undefined} insetBottom={safeAreaBottomKeyboardAware} insetTop={paddingTop} channel={channel} stickerFormats={stickerFormats} searchResults={property3} inPortalKeyboard={inPortalKeyboard} />)(importDefault(11076) /* metro dependency 11076: StickerPickerList */)
|
|
)
|
|
: (
|
|
<ActivityIndicator
|
|
animating
|
|
size="large"
|
|
style={styles.loadingIndicator}
|
|
/>
|
|
)
|
|
}
|
|
{((Component) => <Component categories={value3} categoryIndex={property} style={safeAreaStyle} />)(importDefault(11081) /* metro dependency 11081: StickerPickerCategories */)}
|
|
</View>
|
|
</AnalyticsLocationProvider>
|
|
);
|
|
function _fun84546(a0) { // fn#84546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:1130, offset: 0x01f4f5e7, size: 110 bytes, params: 2, frame: 13
|
|
var environment;
|
|
var value;
|
|
var binding;
|
|
if (a0 === '') {
|
|
value = environment.__proto__;
|
|
value = require(690) /* metro dependency 690: ReactBatchUpdatesNative */;
|
|
value.batchUpdates(_fun84547);
|
|
} else {
|
|
binding = env0_4;
|
|
value = environment.__proto__;
|
|
value = require(11055) /* metro dependency 11055: StickersSearchUtils */;
|
|
binding(value.searchAllStickers(a0));
|
|
}
|
|
function _fun84547() { // fn#84547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:1164, offset: 0x01f4f655, size: 29 bytes, params: 1, frame: 12
|
|
env1_2(0);
|
|
env1_4(null);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun84549(a0) { // fn#84549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:1383, offset: 0x01f4f6cb, size: 477 bytes, params: 2, frame: 21
|
|
var object;
|
|
var stickersStoreBinding;
|
|
var value5;
|
|
var defaultImport2;
|
|
const stickerSendability = (StickerSendabilityModule).getStickerSendability(a0,
|
|
UserStore.getCurrentUser(), channel);
|
|
const StickerSendability = (StickerSendabilityModule).StickerSendability;
|
|
const SENDABLE = StickerSendability.SENDABLE;
|
|
if (stickerSendability === SENDABLE) {
|
|
onPressSticker(a0);
|
|
} else {
|
|
var SENDABLE_WITH_PREMIUM = StickerSendability.SENDABLE_WITH_PREMIUM;
|
|
if (stickerSendability !== SENDABLE_WITH_PREMIUM) {
|
|
return undefined;
|
|
}
|
|
var moduleValue2 = require(4643) /* metro dependency 4643: StickersUtils */;
|
|
if (moduleValue2.isStandardSticker(a0)) {
|
|
stickersStoreBinding = StickersStore;
|
|
value5 = stickersStoreBinding.getStickerPack(a0.pack_id);
|
|
if (value5 == null) {
|
|
return undefined;
|
|
}
|
|
defaultImport2 = importDefault(11056) /* metro dependency 11056: openStickerPackDetailActionSheet */;
|
|
object = {};
|
|
object.analyticsLocation = {page: channel.guild_id != null ? AnalyticsPages.GUILD_CHANNEL : AnalyticsPages.DM_CHANNEL};
|
|
object.analyticsPopoutType = (require(11056) /* metro dependency 11056: openStickerPackDetailActionSheet */).AnalyticsPopoutType.STICKER_PACK_DETAIL;
|
|
object.stickerPack = value5;
|
|
defaultImport2(object);
|
|
return undefined;
|
|
}
|
|
var moduleValue3 = require(4643) /* metro dependency 4643: StickersUtils */;
|
|
if (moduleValue3.isGuildSticker(a0)) {
|
|
(importDefault(7882) /* metro dependency 7882: PremiumUpsellUtils */).handleShowUpsellAlert({initialUpsellKey: UpsellTypes.GLOBAL_STICKER,
|
|
|
|
|
|
analyticsLocation: {page: channel.guild_id != null ? AnalyticsPages.GUILD_CHANNEL : AnalyticsPages.DM_CHANNEL,
|
|
|
|
|
|
section: AnalyticsSections.STICKER_PICKER_UPSELL}, analyticsLocations: analyticsLocations});
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun84551(a0) { // fn#84551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:2304, offset: 0x01f4f901, size: 59 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(ShowStickerDetailActionSheetModule).showStickerDetailActionSheet({renderableSticker: a0,
|
|
channel: channel});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun84543, 11048, [57, 31, 27, 1878, 6583, 3832, 661, 33, 4501, 697, 683, 11049, 11051, 566, 6771, 6789,
|
|
11032, 690, 11055, 6943, 4643, 11056, 7882, 6796, 11065, 6984, 1244, 11075, 11076, 11081,
|
|
2]) /* metro module 11048, dependencies: [57, 31, 27, 1878, 6583, 3832, 661, 33, 4501, 697, 683, 11049, 11051, 566, 6771, 6789, 11032, 690, 11055, 6943, 4643, 11056, 7882, 6796, 11065, 6984, 1244, 11075, 11076, 11081, 2] */;
|