Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,58 @@
/* Metro module 11760; source: modules/media_keyboard/native/MediaKeyboardButtonIcon.tsx; dependencies: [31, 33, 4022, 1357, 4017, 1583, 4504, 4507, 11761, 2] */
function _fun90092(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11946:6, offset: 0x0202a9e0, size: 154 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
object = {code: "function MediaKeyboardButtonIconTsx1(){const{keyboard,KeyboardTypes,chatInputFloating,withTiming,timingStandard}=this.__closure;const isActive=keyboard===KeyboardTypes.MEDIA||chatInputFloating&&keyboard===KeyboardTypes.APP_LAUNCHER;return{transform:[{rotate:withTiming(isActive?'45deg':'0deg',timingStandard)}]};}"};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/MediaKeyboardButtonIcon.tsx');
exports.MediaKeyboardButtonIcon = MediaKeyboardButtonIcon;
}
function MediaKeyboardButtonIcon(a0) { // fn#90093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11946:560, offset: 0x0202aa7a, size: 340 bytes, params: 2, frame: 24
var object2;
if (a0 == null) {
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", undefined);
throw undefined;
}
const value = copyDataProperties({}, a0, undefined, undefined);
const value3 = (importDefault(4022) /* metro dependency 4022: useKeyboardType */)();
const mobileVisualRefreshExperimentModule = require(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */;
const useMobileVisualRefreshConfig = mobileVisualRefreshExperimentModule.useMobileVisualRefreshConfig;
const chatInputFloating = Reflect.apply(useMobileVisualRefreshConfig, mobileVisualRefreshExperimentModule,
[{location: 'MediaKeyboardButtonIcon'}]).chatInputFloating;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = MediaKeyboardButtonIconS;
object2 = {keyboard: value3};
const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes;
object2.KeyboardTypes = KeyboardTypes;
object2.chatInputFloating = chatInputFloating;
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.timingStandard = (require(4507) /* metro dependency 4507: timingPresets */).timingStandard;
closure.__closure = object2;
closure.__workletHash = 12686941860647;
closure.__initData = env0_4;
const value4 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const PlusLargeIcon = (require(11761) /* metro dependency 11761: PlusLargeIcon */).PlusLargeIcon;
return (
<View style={value4}>
<PlusLargeIcon {...value} />
</View>
);
}
function MediaKeyboardButtonIconS() { // fn#90094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11946:715, owner: MediaKeyboardButtonIcon.s, offset: 0x0202abce, size: 193 bytes, params: 1, frame: 18
const binding = env0_0;
const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes;
const MEDIA = KeyboardTypes.MEDIA;
const r6 = binding === MEDIA || chatInputFloating && env0_0 === KeyboardTypes.APP_LAUNCHER;
const object = {};
const value = require(4504) /* metro dependency 4504: timing */;
object.rotate = value.withTiming(r6 ? '45deg' : '0deg',
(require(4507) /* metro dependency 4507: timingPresets */).timingStandard);
return {transform: [object]};
}
@@ -0,0 +1,52 @@
/* Metro module 1580; source: modules/media_keyboard/native/MediaKeyboardConstants.tsx; dependencies: [1581, 697, 2] */
function _fun17594(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1707:6, offset: 0x00e70b17, size: 544 bytes, params: 8, frame: 22
var object3;
var space;
var PX_4;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */;
value = value.isMetaQuest();
object3 = {};
if (value) {
object3.slotHeight = 24;
object3.barColor = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG;
space = (importDefault(697) /* metro dependency 697: native */).space;
object3.barWidth = space.PX_64;
space = (importDefault(697) /* metro dependency 697: native */).space;
object3.barHeight = space.PX_8;
space = (importDefault(697) /* metro dependency 697: native */).space;
object3.barMarginTop = space.PX_16;
} else {
object3.slotHeight = 16;
object3.barColor = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
space = (importDefault(697) /* metro dependency 697: native */).space;
object3.barWidth = space.PX_32;
space = (importDefault(697) /* metro dependency 697: native */).space;
PX_4 = space.PX_4;
object3.barHeight = PX_4;
space = (importDefault(697) /* metro dependency 697: native */).space;
PX_4 = space.PX_4;
object3.barMarginTop = PX_4;
}
const slotHeight = object3.slotHeight;
const object4 = {CHAT: 0};
object4[0] = 'CHAT';
object4.COMMAND = 1;
object4[1] = 'COMMAND';
object4.APP_LAUNCHER = 2;
object4[2] = 'APP_LAUNCHER';
object4.INTERACTION_MODAL = 3;
object4[3] = 'INTERACTION_MODAL';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/MediaKeyboardConstants.tsx');
exports.DRAG_HANDLE = object3;
exports.HEADER_HANDLE_HEIGHT = slotHeight;
exports.MediaKeyboardTarget = object4;
exports.InAppCameraUsedViews = {FULLY_EXPANDED: 'fully expanded'};
exports.InAppCameraUsedCameraPreviewTypes = {CAMERA_TILE: 'camera tile', CAMERA_BUTTON: 'camera button',
TAKE_A_PHOTO_BUTTON: 'take a photo button'};
exports.MediaPickerActionSheetEngagedActions = {FULLY_EXPANDED: 'fully expanded',
VIEW_ALL_CLICKED: 'view all clicked', MEDIA_SELECTED: 'media selected'};
exports.MEDIA_PICKER_SEND_BUTTON_SPRING = {'mass': 1, 'damping': 25, 'stiffness': 400, 'overshootClamping': false};
}
@@ -0,0 +1,881 @@
/* Metro module 11095; source: modules/media_keyboard/native/MediaKeyboardUtils.tsx; dependencies: [5, 1312, 1379, 4645, 1934, 4644, 1580, 661, 4661, 4650, 7879, 4658, 4651, 4662, 683, 4673, 4660, 477, 4092, 11096, 1239, 10381, 4570, 11120, 11121, 22, 2] */
function _fun84949(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:6, offset: 0x01f5e24c, size: 621 bytes, params: 8, frame: 27
const env0_0 = require;
const _arrayLikeToArray_84952 = 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 closure = addImagesFromPicker;
const closure2 = handleCameraDialog;
const closure3 = handleViewAllDialog;
const closure4 = function() {
return _handleLimitedPickerDialog.apply(this, arguments);
};
const closure5 = function() {
return _handleAttachFile.apply(this, arguments);
};
const closure6 = mediaNodeToUploadItem;
const closure7 = handleSelectKeyboardItem;
const closure8 = function(a0) {
if (MediaKeyboardTarget.CHAT === a0) {
return DraftType.ChannelMessage;
}
if (MediaKeyboardTarget.COMMAND === a0) {
return DraftType.SlashCommand;
}
if (MediaKeyboardTarget.APP_LAUNCHER === a0) {
return DraftType.ApplicationLauncherCommand;
}
if (MediaKeyboardTarget.INTERACTION_MODAL === a0) {
return DraftType.InteractionModal;
}
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const unsyncedUserSettingsStore = importDefault(1312) /* metro dependency 1312: UnsyncedUserSettingsStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_6 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
let value = require(1580) /* metro dependency 1580: MediaKeyboardConstants */;
const env0_9 = value.MediaKeyboardTarget;
const env0_10 = value.InAppCameraUsedViews;
value = require(661) /* metro dependency 661: Constants */;
const env0_11 = value.AnalyticEvents;
const env0_12 = value.AnalyticsObjects;
const env0_13 = value.AnalyticsObjectTypes;
const env0_14 = value.AnalyticsPages;
const env0_15 = value.AnalyticsSections;
const env0_16 = value.ChatInputComponentViewedTypes;
const env0_17 = value.ComponentActions;
const env0_18 = value.MAX_UPLOAD_COUNT;
const env0_19 = (require(4661) /* metro dependency 4661: NativePermissionConstants */).NativePermissionTypes;
object = {code: 'function animatedIndexThreshold_MediaKeyboardUtilsTsx1(animatedSnapPoints,thresholdPercent){return animatedSnapPoints.get().length===1?thresholdPercent-1:thresholdPercent*(animatedSnapPoints.get().length-1);}'};
value = _fun84984();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/MediaKeyboardUtils.tsx');
exports.addImagesFromPicker = closure;
exports.addAttachmentForCommand = addAttachmentForCommand;
exports.handleCameraDialog = closure2;
exports.handleViewAllDialog = closure3;
exports.handleLimitedPickerDialog = closure4;
exports.handleSelectGift = handleSelectGift;
exports.handleSelectThread = handleSelectThread;
exports.handleAttachFile = closure5;
exports.mediaNodeToUploadItem = closure6;
exports.cropResultToUploadItem = cropResultToUploadItem;
exports.handleSelectKeyboardItem = closure7;
exports.showSimpleMediaKeyboard = showSimpleMediaKeyboard;
exports.animatedIndexThreshold = value;
exports.getMediaKeyboardDraftType = closure8;
}
function _createForOfIteratorHelperLoose_84950(a0, a1) { // fn#84950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:457, offset: 0x01f5e4b9, 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 _fun84951;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_84952(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_84952(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_84952(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun84951;
}
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 addImagesFromPicker(a0, a1, a2) { // fn#84953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:1367, offset: 0x01f5e62d, size: 212 bytes, params: 4, frame: 17
const env0_0 = a0;
const env0_1 = a2;
const UploadOrigin = (require(4650) /* metro dependency 4650: Upload */).UploadOrigin;
const FILE_ATTACHMENT = UploadOrigin.FILE_ATTACHMENT;
if (a2 !== FILE_ATTACHMENT) {
(importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */).addFiles({files: a1.filter(_fun84954).map(function(a0) {
var r2;
var object = {};
copyDataProperties(object, a0, r2);
object['origin'] = importDefault;
return object;
}), channelId: a0, draftType: DraftType.ChannelMessage});
} else {
(importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */).addFiles({files: a1,
channelId: a0, draftType: DraftType.ChannelMessage});
}
}
function handleCameraDialog({channel, previewType, onDismissKeyboard, onRestoreKeyboard, onSelectFiles}) { // fn#84957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:1753, offset: 0x01f5e7b4, size: 121 bytes, params: 2, frame: 13
const defaultImport = importDefault(4662) /* metro dependency 4662: NativePermissionUtils */;
const requestPermission = defaultImport.requestPermission;
const CAMERA = NativePermissionTypes.CAMERA;
Reflect.apply(requestPermission, defaultImport, [CAMERA]).then(_fun84958);
}
function handleViewAllDialog({channel, draftType, uploadLimit, includedUploadIds, onDismissKeyboard, onRestoreKeyboard, onSelectFiles}) { // fn#84960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:2949, offset: 0x01f5eb38, size: 231 bytes, params: 2, frame: 14
var r3;
var defaultImport;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isIOS()) {
if ((require(4092) /* metro dependency 4092: DeviceUtils */).getSystemVersionMajor() >= 14) {
r3 = global.Promise.resolve(true);
} else {
defaultImport = importDefault(4662) /* metro dependency 4662: NativePermissionUtils */;
r3 = defaultImport.requestPermission(NativePermissionTypes.PHOTOS);
}
} else {
defaultImport = importDefault(4662) /* metro dependency 4662: NativePermissionUtils */;
r3 = defaultImport.requestPermission(NativePermissionTypes.PHOTOS);
}
r3.then(_fun84961);
}
function _handleLimitedPickerDialog() { // fn#84969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:4394, offset: 0x01f5f020, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun84971).apply(this, arguments);
}
function _handleAttachFile() { // fn#84973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:4677, offset: 0x01f5f0c7, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun84975).apply(this, arguments);
}
function mediaNodeToUploadItem(a0, a1) { // fn#84980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:5625, offset: 0x01f5f3b3, size: 213 bytes, params: 3, frame: 18
const image = a0.node.image;
const object2 = {};
object2.id = a0.node.id ?? image.uri;
const UploadOrigin = (require(4650) /* metro dependency 4650: Upload */).UploadOrigin;
const IMAGE_PICKER = UploadOrigin.IMAGE_PICKER;
object2.origin = IMAGE_PICKER;
object2.uri = image.uri;
object2.originalUri = image.uri;
object2.mimeType = image.mimeType;
object2.width = image.width;
object2.height = image.height;
const filename = image.filename;
object2.filename = filename;
object2.playableDuration = image.playableDuration;
const UploadPlatform = (require(4650) /* metro dependency 4650: Upload */).UploadPlatform;
const REACT_NATIVE = UploadPlatform.REACT_NATIVE;
object2.platform = REACT_NATIVE;
copyDataProperties(object2, a1 != null && ({createdUsingInAppCamera: a1}), filename);
return object2;
}
function handleSelectKeyboardItem(a0, a1, a2, a3) { // fn#84981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:5983, offset: 0x01f5f488, size: 201 bytes, params: 5, frame: 20
var defaultImport;
var addFile;
var object2;
var upload;
var defaultImport2;
const env0_0 = a1.node.image;
if (a2) {
upload = UploadAttachmentStore.findUpload(a0, DraftType.ChannelMessage, _fun84982);
if (upload != null) {
defaultImport2 = importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */;
defaultImport2.remove(a0, upload.id, DraftType.ChannelMessage);
}
} else {
defaultImport = importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */;
addFile = defaultImport.addFile;
object2 = {channelId: a0};
object2.file = mediaNodeToUploadItem(a1, a3);
object2.draftType = DraftType.ChannelMessage;
Reflect.apply(addFile, defaultImport, [object2]);
}
}
function _fun84984() { // fn#84984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:6503, offset: 0x01f5f5f4, size: 48 bytes, params: 1, frame: 2
const closure = function(a0, a1) {
return a0.get().length === 1 ? a1 - 1 : a1 * (a0.get().length - 1);
};
closure.__closure = {};
closure.__workletHash = 97398083076;
closure.__initData = env0_20;
return closure;
}
function addAttachmentForCommand(a0, a1, a2, a3, a4) { // fn#84986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:7148, offset: 0x01f5f65d, size: 322 bytes, params: 6, frame: 23
var r13;
var applicationCommandManager;
var value3;
const option = a3.option;
const uploadUtilsModule = require(4651) /* metro dependency 4651: UploadUtils */;
const getFile = uploadUtilsModule.getFile;
let filename = a2.filename;
filename = Reflect.apply(getFile, uploadUtilsModule, [{uri: a2.uri, overrideFilename: filename,
overrideType: a2.mimeType}]).filename;
const target = a3.target;
const COMMAND = MediaKeyboardTarget.COMMAND;
if (target === COMMAND) {
applicationCommandManager = a1.current.getApplicationCommandManager();
if (applicationCommandManager != null) {
value3 = false;
applicationCommandManager.insertOrJumpCommandOption(option, undefined, value3, {displayText: filename,
preferred: true});
r13 = value3;
}
}
const mediaKeyboardDraftType = getMediaKeyboardDraftType(a3.target);
let value = importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */;
value.remove(a0, a3.option.name, mediaKeyboardDraftType);
value = importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */;
const addFile = value.addFile;
const object = {};
copyDataProperties(object, a2, r13);
object['origin'] = a4;
object['id'] = option.name;
object['filename'] = filename;
Reflect.apply(addFile, value, [{channelId: a0, file: object, draftType: mediaKeyboardDraftType,
allowOptimization: false}]);
}
function handleSelectGift(a0, {current}, a2) { // fn#84987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:7793, offset: 0x01f5f79f, size: 431 bytes, params: 4, frame: 22
const env0_0 = a2;
const channelId = SelectedChannelStore.getChannelId();
current.closeCustomKeyboard();
const channel = ChannelStore.getChannel(channelId);
const ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
const dispatch = ComponentDispatch.dispatch;
const MEDIA_KEYBOARD_GIFT_SELECTED = ComponentActions.MEDIA_KEYBOARD_GIFT_SELECTED;
Reflect.apply(dispatch, ComponentDispatch, [MEDIA_KEYBOARD_GIFT_SELECTED]);
const object2 = {};
const CHANNEL_TEXT_AREA = AnalyticsSections.CHANNEL_TEXT_AREA;
object2.section = CHANNEL_TEXT_AREA;
const BUTTON_ICON = AnalyticsObjects.BUTTON_ICON;
object2.object = BUTTON_ICON;
const GIFT = AnalyticsObjectTypes.GIFT;
object2.objectType = GIFT;
object2.page = channel?.guild_id != null ? AnalyticsPages.GUILD_CHANNEL : AnalyticsPages.DM_CHANNEL;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
const NITRO_GIFTING = ChatInputComponentViewedTypes.NITRO_GIFTING;
Reflect.apply(track, defaultImport, [CHAT_INPUT_COMPONENT_VIEWED, {type: NITRO_GIFTING, channel_id: channel?.id,
guild_id: channel?.guild_id}]);
const openGiftModalModule = require(10381) /* metro dependency 10381: openGiftModal */;
openGiftModalModule.openGiftModal({recipientUserId: channel != null && channel.isDM() ? channel.getRecipientId() : undefined,
analyticsLocation: object2, analyticsLocations: a0, navigationParams: {presentation: 'card'},
onDismiss: a2?.current != null ? _fun84988 : undefined});
}
function handleSelectThread(a0, a1) { // fn#84989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:8512, offset: 0x01f5f981, size: 204 bytes, params: 3, frame: 20
var moduleValue;
const value2 = undefined;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
const START_THREAD = ChatInputComponentViewedTypes.START_THREAD;
Reflect.apply(track, defaultImport, [CHAT_INPUT_COMPONENT_VIEWED, {type: START_THREAD, channel_id: a0.id,
guild_id: a0 == null ? value2 : a0.guild_id}]);
if (a0 != null) {
a1.current.openSystemKeyboard();
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue.isIOS()) {
a1.current.blur();
}
(require(11120) /* metro dependency 11120: navigateToThreadCreation */).navigateToThreadCreation(a0,
'Plus Button');
}
return value2;
}
function cropResultToUploadItem(a0) { // fn#84990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:8905, offset: 0x01f5fa4d, size: 214 bytes, params: 2, frame: 18
let path = a0.path;
let value = path.startsWith('file://');
path = a0.path;
const r6 = value ? path : 'file://' + path;
value = a0.path.split('/');
value = value.pop();
const object2 = {};
const defaultImport = importDefault(22) /* metro dependency 22 */;
object2.id = defaultImport.uniqueId(a0.path);
object2.uri = r6;
object2.originalUri = r6;
object2.mimeType = a0.mime;
object2.width = a0.width;
object2.height = a0.height;
object2.filename = value;
const UploadPlatform = (require(4650) /* metro dependency 4650: Upload */).UploadPlatform;
const REACT_NATIVE = UploadPlatform.REACT_NATIVE;
object2.platform = REACT_NATIVE;
return object2;
}
function showSimpleMediaKeyboard(a0) { // fn#84991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:9268, offset: 0x01f5fb23, size: 221 bytes, params: 2, frame: 19
var object2;
const env0_0 = a0;
const getMediaKeyboardDraftTypeBinding = getMediaKeyboardDraftType;
const CHAT = MediaKeyboardTarget.CHAT;
const mediaKeyboardDraftTypeBinding = getMediaKeyboardDraftTypeBinding(({target: CHAT}).target);
const onAttachFileParams = function(a0) {
return {channel: a0, uploadLimit: MAX_UPLOAD_COUNT, onDismissKeyboard: _fun84993, onRestoreKeyboard: _fun84994,
onSelectFiles: _fun84995};
};
const showMediaKeyboardActionSheetModule = require(11096) /* metro dependency 11096: showMediaKeyboardActionSheet */;
const showMediaKeyboardActionSheet = showMediaKeyboardActionSheetModule.showMediaKeyboardActionSheet;
object2 = {channel: a0, draftType: mediaKeyboardDraftTypeBinding};
object2.uploadLimit = MAX_UPLOAD_COUNT;
object2.disableWhenReachedLimit = true;
object2.onAttachPress = function() {
var handleAttachFileBinding = handleAttachFile;
var object = {};
copyDataProperties(object, onAttachFileParams(require(dependencyMap[9]).UploadOrigin.FILE_ATTACHMENT), require);
handleAttachFileBinding(object);
};
object2.onPressCamera = function(a0) {
var handleCameraDialogBinding = handleCameraDialog;
var object = {};
copyDataProperties(object, onAttachFileParams(require(dependencyMap[9]).UploadOrigin.IMAGE_PICKER), require);
object['previewType'] = a0;
handleCameraDialogBinding(object);
};
object2.onPressItem = function({channelId, item, isIncluded}) {
require(dependencyMap[19]).hideMediaKeyboardActionSheet();
handleSelectKeyboardItem(channelId, item, isIncluded);
};
object2.onViewAll = onViewAll;
object2.onManageLimited = function() {
var handleLimitedPickerDialogBinding = handleLimitedPickerDialog;
var object = {};
object.onDismissKeyboard = require(dependencyMap[19]).hideMediaKeyboardActionSheet;
object.onRestoreKeyboard = _fun85001;
handleLimitedPickerDialogBinding(object);
};
const hideMediaKeyboardActionSheet = showMediaKeyboardActionSheetModule.hideMediaKeyboardActionSheet;
object2.onClose = hideMediaKeyboardActionSheet;
object2.onBack = hideMediaKeyboardActionSheet;
Reflect.apply(showMediaKeyboardActionSheet, showMediaKeyboardActionSheetModule, [object2]);
}
function _fun84954(a0) { // fn#84954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:1465, offset: 0x01f5e701, size: 100 bytes, params: 2, frame: 17
const env0_0 = a0;
return env0_0 != null && a0.uri != null && a0.uri !== '' && UploadAttachmentStore.findUpload(env0_0,
DraftType.ChannelMessage, _fun84955) == null;
}
function _fun84958(a0) { // fn#84958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:1907, offset: 0x01f5e82d, size: 203 bytes, params: 2, frame: 20
var environment;
var value;
var defaultImport;
var track;
var CHAT_INPUT_COMPONENT_VIEWED;
var object2;
var channelBinding;
var defaultImport2;
var launchCamera;
if (a0) {
value = environment.__proto__;
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport.track;
CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
channelBinding = channel;
Reflect.apply(track, defaultImport, [CHAT_INPUT_COMPONENT_VIEWED, {type: ChatInputComponentViewedTypes.CAMERA,
channel_id: channelBinding.id, guild_id: channelBinding.guild_id}]);
onDismissKeyboard();
defaultImport2 = importDefault(4673) /* metro dependency 4673: ImagePicker */;
launchCamera = defaultImport2.launchCamera;
object2 = {'mediaType': 'mixed', 'includeBase64': false, 'quality': null, 'videoQuality': 'high',
'saveToPhotos': null, 'skipProcessing': true};
object2.quality = (require(4660) /* metro dependency 4660: UploadUtils */).getImageCompressionQuality();
object2.saveToPhotos = UnsyncedUserSettingsStore.saveCameraUploadsToDevice;
Reflect.apply(launchCamera, defaultImport2, [object2, _fun84959]);
}
}
function _fun84961(a0) { // fn#84961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:3215, offset: 0x01f5ec1f, size: 381 bytes, params: 2, frame: 19
var environment;
var r6;
var r2;
var value;
var defaultImport;
var track;
var CHAT_INPUT_COMPONENT_VIEWED;
var object2;
var channelBinding;
var id;
var getUploads;
var value3;
var uploadLimitBinding;
var value5;
var moduleValue;
var moduleValue2;
if (a0) {
value = environment.__proto__;
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport.track;
CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
channelBinding = channel;
id = channelBinding.id;
Reflect.apply(track, defaultImport, [CHAT_INPUT_COMPONENT_VIEWED,
{type: ChatInputComponentViewedTypes.NATIVE_MEDIA_PICKER, channel_id: id,
guild_id: channelBinding.guild_id}]);
onDismissKeyboard();
getUploads = UploadAttachmentStore.getUploads;
id = channelBinding.id;
value3 = Reflect.apply(getUploads, UploadAttachmentStore, [id, draftType]);
r6 = includedUploadIds == null ? value3 : value3.filter(function(a0) {
return includedUploadIds.includes(a0.id);
});
object2 = {'mediaType': 'any', 'includeBase64': false};
uploadLimitBinding = uploadLimit;
value5 = 1;
if (uploadLimitBinding > value5) {
uploadLimitBinding = uploadLimit;
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
r2 = uploadLimitBinding - (moduleValue.isIOS() ? r6.filter(_fun84963).length : r6.length);
} else {
r2 = value5;
}
object2.selectionLimit = r2;
object2.selections = r6.map(_fun84964);
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
object2.includeExtra = !moduleValue2.isIOS();
object2.skipProcessing = true;
value = importDefault(4673) /* metro dependency 4673: ImagePicker */;
value.launchImageLibrary(object2, _fun84965);
}
}
async function _fun84971({onDismissKeyboard, onRestoreKeyboard}) { // fn#84971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:4469, offset: 0x01f5f066, size: 97 bytes, params: 2, frame: 15
if (true) {
await undefined;
if (false) {
return undefined;
}
onDismissKeyboard();
value = environment.__proto__.__proto__;
value = env2_0(env2_2[19]);
await value.presentLimitedLibraryPicker();
if (false) {
return undefined;
}
onRestoreKeyboard();
}
}
async function _fun84975({channel, uploadLimit, extensions, onDismissKeyboard, onRestoreKeyboard, onSelectFiles}) { // fn#84975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:4734, offset: 0x01f5f10d, size: 314 bytes, params: 2, frame: 25
var environment;
if (true) {
await undefined;
if (false) {
return undefined;
}
onDismissKeyboard();
value = environment.__proto__.__proto__;
var binding = env2_1;
var binding2 = env2_2;
var value4 = binding(binding2[14]);
var track = value4.track;
var CHAT_INPUT_COMPONENT_VIEWED = env2_11.CHAT_INPUT_COMPONENT_VIEWED;
var ATTACH_FILE = env2_16.ATTACH_FILE;
Reflect.apply(track, value4, [CHAT_INPUT_COMPONENT_VIEWED, {type: ATTACH_FILE, channel_id: channel.id,
guild_id: channel.guild_id}]);
value = env2_0(binding2[24]);
await value.handleDocumentSelection({pickMultiple: uploadLimit > 1, extensions: extensions});
if (false) {
return undefined;
}
onRestoreKeyboard();
if (value != null) {
if (value.length < 1) {
return undefined;
}
var Promise = global.Promise;
var all = Promise.all;
var Array = global.Array;
value = Array.from(value);
await Reflect.apply(all, Promise, [value.map(_fun84976())]);
value = undefined;
if (false) {
return value;
}
onSelectFiles(value);
}
}
}
function _fun84982(a0) { // fn#84982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:6090, offset: 0x01f5f551, size: 49 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = require(4658) /* metro dependency 4658: UploadUtils */;
return value.doesImageMatchUpload(image, a0);
}
function _fun84988() { // fn#84988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:8435, offset: 0x01f5f94e, size: 51 bytes, params: 1, frame: 12
const value = environment.__proto__;
return (require(4570) /* metro dependency 4570: setAccessibilityFocusAndroid */).setAccessibilityFocus({ref: importDefault});
}
function onAttachFileParams(a0) { // fn#84992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:9379, owner: showSimpleMediaKeyboard.onAttachFileParams, offset: 0x01f5fc00, size: 72 bytes, params: 2, frame: 3
return {channel: a0, uploadLimit: MAX_UPLOAD_COUNT, onDismissKeyboard: onDismissKeyboard_84993,
onRestoreKeyboard: onRestoreKeyboard_84994, onSelectFiles: onSelectFiles_84995};
}
function onViewAll() { // fn#84999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:10022, owner: showSimpleMediaKeyboard.onViewAll, offset: 0x01f5fd87, size: 82 bytes, params: 1, frame: 16
const handleViewAllDialogBinding = handleViewAllDialog;
const object2 = {};
const onAttachFileParamsBinding = onAttachFileParams;
const UploadOrigin = (require(4650) /* metro dependency 4650: Upload */).UploadOrigin;
const IMAGE_PICKER = UploadOrigin.IMAGE_PICKER;
copyDataProperties(object2, onAttachFileParamsBinding(IMAGE_PICKER), require);
object2['draftType'] = env0_1;
handleViewAllDialogBinding(object2);
}
function onManageLimited() { // fn#85000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:10137, owner: showSimpleMediaKeyboard.onManageLimited, offset: 0x01f5fdd9, size: 63 bytes, params: 1, frame: 13
const handleLimitedPickerDialogBinding = handleLimitedPickerDialog;
const object2 = {};
object2.onDismissKeyboard = (require(11096) /* metro dependency 11096: showMediaKeyboardActionSheet */).hideMediaKeyboardActionSheet;
object2.onRestoreKeyboard = onRestoreKeyboard_85001;
handleLimitedPickerDialogBinding(object2);
}
function _fun84955(a0) { // fn#84955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:1541, offset: 0x01f5e765, size: 49 bytes, params: 2, frame: 13
const value = environment.__proto__.__proto__;
return (require(4658) /* metro dependency 4658: UploadUtils */).doesImageMatchUpload(env0_0, a0);
}
function _fun84959(a0) { // fn#84959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:2203, offset: 0x01f5e8f8, size: 576 bytes, params: 2, frame: 20
var r9;
var r0;
var value;
var property;
var uri;
var type;
var fileName;
var object2;
var value10;
var value11;
var defaultImport;
if (a0.didCancel) {
value = environment.__proto__;
onRestoreKeyboard();
} else if (a0.errorCode == null) {
if (a0.assets != null) {
if (a0.assets.length > 0) {
property = a0.assets[0];
if (property != null) {
uri = property.uri;
if (uri != null) {
if (property.height != null) {
if (property.width != null) {
type = property.type;
if (type != null) {
r0 = type;
} else {
fileName = property.fileName;
r9 = fileName == null ? undefined : fileName.split('.').pop();
r0 = r9 != null && property.fileType != null ? ('' + property.fileType + '/' + r9).toLowerCase() : 'image/jpeg';
}
object2 = {};
object2.id = property.id;
uri = property.uri;
object2.uri = uri;
uri = property.uri;
object2.originalUri = uri;
object2.width = property.width;
object2.height = property.height;
fileName = property.fileName;
object2.filename = fileName == null ? 'camera_upload.' + (r0.split('/')[1] ?? 'jpeg') : property.fileName !== '' ? property.fileName : 'camera_upload.' + (r0.split('/')[1] ?? 'jpeg');
object2.playableDuration = property.duration;
value10 = environment.__proto__.__proto__;
object2.platform = (require(4650) /* metro dependency 4650: Upload */).UploadPlatform.REACT_NATIVE;
object2.createdUsingInAppCamera = true;
object2.mimeType = r0;
value11 = environment.__proto__;
onSelectFiles([object2]);
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.IN_APP_CAMERA_USED,
{camera_view: InAppCameraUsedViews.FULLY_EXPANDED,
camera_preview_type: previewType});
onRestoreKeyboard();
}
}
}
}
}
}
}
}
function _fun84963({origin}) { // fn#84963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:3502, offset: 0x01f5edb7, size: 52 bytes, params: 2, frame: 12
const UploadOrigin = (require(4650) /* metro dependency 4650: Upload */).UploadOrigin;
const IMAGE_PICKER = UploadOrigin.IMAGE_PICKER;
return origin !== IMAGE_PICKER;
}
function _fun84965(a0) { // fn#84965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:3682, offset: 0x01f5edeb, size: 349 bytes, params: 2, frame: 21
var environment;
var r5;
var errorCode;
var value2;
var length;
var assets;
var replaceSelection;
var binding;
var forEach;
var items2;
var value3;
var _createForOfIteratorHelperLoose_84950Binding;
var value4;
var value5;
var done;
var value6;
var uri;
var push;
var object2;
var id;
var mimeType;
var width;
var height;
var fileName;
var duration;
var UploadPlatform;
var REACT_NATIVE;
var value7;
const env0_0 = a0;
onRestoreKeyboard();
reducibleJoin13: while (true) {
if (a0.didCancel) {
break reducibleJoin13;
}
errorCode = a0.errorCode;
if (errorCode != null) {
break reducibleJoin13;
}
value2 = environment;
length = env0_0.length;
if (length === 0) {
if (a0.assets == null) {
break reducibleJoin13;
}
if (a0.assets.length === 0) {
break reducibleJoin13;
}
}
replaceSelection = a0.replaceSelection;
reducibleJoin7: while (true) {
if (replaceSelection) {
binding = env0_0;
forEach = binding.forEach;
Reflect.apply(forEach, binding, [_fun84966]);
break reducibleJoin7;
}
break reducibleJoin7;
}
items2 = [];
value3 = environment.__proto__.__proto__;
_createForOfIteratorHelperLoose_84950Binding = _createForOfIteratorHelperLoose_84950;
assets = a0.assets;
value4 = _createForOfIteratorHelperLoose_84950Binding(assets);
value5 = value4();
done = value5.done;
if (!done) {
r5 = value5;
reducibleLoop8: while (true) {
value6 = r5.value;
uri = value6.uri;
reducibleJoin10: while (true) {
if (uri == null) {
break reducibleJoin10;
}
push = items2.push;
object2 = {};
id = value6.id;
object2.id = id;
uri = value6.uri;
object2.uri = uri;
uri = value6.uri;
object2.originalUri = uri;
mimeType = value6.mimeType;
object2.mimeType = mimeType;
width = value6.width;
object2.width = width;
height = value6.height;
object2.height = height;
fileName = value6.fileName;
object2.filename = fileName;
duration = value6.duration;
object2.playableDuration = duration;
UploadPlatform = (require(4650) /* metro dependency 4650: Upload */).UploadPlatform;
REACT_NATIVE = UploadPlatform.REACT_NATIVE;
object2.platform = REACT_NATIVE;
Reflect.apply(push, items2, [object2]);
break reducibleJoin10;
}
value7 = value4();
done = value7.done;
if (done) {
break reducibleLoop8;
}
r5 = value7;
continue reducibleLoop8;
}
}
length = items2.length;
if (length > 0) {
onSelectFiles(items2);
break reducibleJoin13;
}
break reducibleJoin13;
}
}
function _fun84976() { // fn#84976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:5099, offset: 0x01f5f247, size: 36 bytes, params: 1, frame: 12
const env0_0 = env3_3(_fun84978);
return _fun84979;
}
function onAttachFileParamsOnDismissKeyboard() { // fn#84993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:9426, owner: showSimpleMediaKeyboard.onAttachFileParams.onDismissKeyboard, offset: 0x01f5fc48, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
return (require(11096) /* metro dependency 11096: showMediaKeyboardActionSheet */).hideMediaKeyboardActionSheet();
}
function onAttachFileParamsOnRestoreKeyboard() { // fn#84994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:9489, owner: showSimpleMediaKeyboard.onAttachFileParams.onRestoreKeyboard, offset: 0x01f5fc6d, size: 23 bytes, params: 1, frame: 11
showSimpleMediaKeyboard(env1_0);
}
function onAttachFileParamsOnSelectFiles(a0) { // fn#84995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:9534, owner: showSimpleMediaKeyboard.onAttachFileParams.onSelectFiles, offset: 0x01f5fc84, size: 40 bytes, params: 2, frame: 15
addImagesFromPicker(env1_0.id, a0, env0_0);
}
function _fun84966(a0) { // fn#84966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:3810, offset: 0x01f5ef48, size: 167 bytes, params: 2, frame: 18
var environment;
var defaultImport;
var remove;
var value6;
const env0_0 = a0;
const origin = a0.origin;
const UploadOrigin = (require(4650) /* metro dependency 4650: Upload */).UploadOrigin;
const IMAGE_PICKER = UploadOrigin.IMAGE_PICKER;
if (!(origin !== IMAGE_PICKER || env0_0.assets != null && env0_0.assets.some(_fun84967))) {
defaultImport = importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */;
remove = defaultImport.remove;
value6 = environment.__proto__.__proto__;
Reflect.apply(remove, defaultImport, [channel.id, a0.id, DraftType.ChannelMessage]);
}
}
function* _fun84978(a0) { // fn#84978, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:5119, offset: 0x01f5f276, size: 317 bytes, params: 2, frame: 24
if (false) {
return undefined;
}
const uri = a0.uri;
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
let binding = env5_0;
const value3 = undefined;
const value4 = binding(env5_2[16]);
const getImageDimensionsIfMissing = value4.getImageDimensionsIfMissing;
yield Reflect.apply(getImageDimensionsIfMissing, value4, [uri, value3, value3, a0.name ?? value3]);
const value5 = undefined;
if (false) {
return value5;
}
const width = value5.width;
const height = value5.height;
const object2 = {};
object2.id = env5_1(env5_2[25]).uniqueId(uri);
object2.uri = uri;
object2.originalUri = uri;
object2.filename = a0.name ?? uri.split('/').at(-1);
object2.mimeType = a0.type ?? value3;
object2.channelId = env2_0.id;
binding = env5_0;
const binding2 = env5_2;
const UploadPlatform = binding(binding2[9]).UploadPlatform;
const REACT_NATIVE = UploadPlatform.REACT_NATIVE;
object2.platform = REACT_NATIVE;
const UploadOrigin = binding(binding2[9]).UploadOrigin;
const FILE_ATTACHMENT = UploadOrigin.FILE_ATTACHMENT;
object2.origin = FILE_ATTACHMENT;
object2.width = width;
object2.height = height;
return object2;
}
function _fun84967(a0) { // fn#84967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11281:3895, offset: 0x01f5efef, size: 49 bytes, params: 2, frame: 13
const value = environment.__proto__.__proto__.__proto__.__proto__;
return (require(4658) /* metro dependency 4658: UploadUtils */).doesImageMatchUpload(a0, env0_0);
}
@@ -0,0 +1,371 @@
/* Metro module 15145; source: modules/media_keyboard/native/components/MediaKeyboard.tsx; dependencies: [31, 4645, 4644, 1580, 661, 1483, 11576, 33, 683, 4017, 4022, 1583, 15146, 1357, 3860, 697, 8448, 15147, 11095, 4015, 4650, 477, 4648, 11093, 11733, 1244, 8840, 6684, 11098, 9786, 6697, 11100, 15149, 15150, 11102, 15151, 11103, 2] */
function _fun115478(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:6, offset: 0x02461ec6, size: 307 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
const mediaKeyboardConstantsModule = require(1580) /* metro dependency 1580: MediaKeyboardConstants */;
const env0_6 = mediaKeyboardConstantsModule.MediaKeyboardTarget;
const env0_7 = mediaKeyboardConstantsModule.MediaPickerActionSheetEngagedActions;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_8 = constantsModule.AnalyticEvents;
const env0_9 = constantsModule.ChatInputComponentViewedTypes;
const env0_10 = (require(1483) /* metro dependency 1483: AppLauncherNativeConstants */).AppLauncherRouteName;
const env0_11 = (require(11576) /* metro dependency 11576: PortalKeyboardConstants */).KEYBOARD_ANIMATION_CONFIG;
const value4 = require(33) /* metro dependency 33 */;
const env0_12 = value4.jsx;
const env0_13 = value4.jsxs;
value = value.memo(MediaKeyboard);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboard.tsx');
exports.default = value;
}
function MediaKeyboard({channel, chatInputRef, onClose, transitionState}) { // fn#115479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:382, offset: 0x02461ff9, size: 921 bytes, params: 2, frame: 30
let binding = env0_3;
binding.useEffect(function() {
var defaultImport = importDefault(dependencyMap[8]);
var CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
var channelBinding = channel;
defaultImport.track(CHAT_INPUT_COMPONENT_VIEWED, {type: ChatInputComponentViewedTypes.MEDIA_PICKER,
channel_id: channelBinding.id, guild_id: channelBinding.guild_id});
}, [channel.id, channel.guild_id]);
const value2 = binding.useRef(null);
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
var env0_3 = value3;
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const useKeyboardTypeModule = require(4022) /* metro dependency 4022: useKeyboardType */;
const useKeyboardContextForType = useKeyboardTypeModule.useKeyboardContextForType;
const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes;
const MEDIA = KeyboardTypes.MEDIA;
const value5 = Reflect.apply(useKeyboardContextForType, useKeyboardTypeModule, [MEDIA]);
const appLauncherActionSheetModule = require(15146) /* metro dependency 15146: AppLauncherActionSheet */;
const useAppLauncherActionSheet = appLauncherActionSheetModule.useAppLauncherActionSheet;
const appLauncherActionSheet = Reflect.apply(useAppLauncherActionSheet, appLauncherActionSheetModule,
[{chatInputRef: chatInputRef, channel: channel}]).appLauncherActionSheet;
const mobileVisualRefreshExperimentModule = require(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */;
const useMobileVisualRefreshConfig = mobileVisualRefreshExperimentModule.useMobileVisualRefreshConfig;
const chatInputFloating = Reflect.apply(useMobileVisualRefreshConfig, mobileVisualRefreshExperimentModule,
[{location: 'MediaKeyboard'}]).chatInputFloating;
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const MEDIA_KEYBOARD_SEND_VERTICAL_INSET = (importDefault(697) /* metro dependency 697: native */).modules.mobile.MEDIA_KEYBOARD_SEND_VERTICAL_INSET;
const value6 = Reflect.apply(useToken, useTokenModule, [MEDIA_KEYBOARD_SEND_VERTICAL_INSET]);
const r18 = chatInputFloating && (require(8448) /* metro dependency 8448: ActivitiesInTextUtils */).getIsAppLauncherEnabled(channel);
const value8 = (importDefault(15147) /* metro dependency 15147: useMediaKeyboardConfig */)({channel: channel,
context: value5});
const value9 = env0_3.useMemo(_fun115481, [value3, channel, chatInputRef, value5, value2, value8]);
const r1 = chatInputFloating && value8.canStartThreads;
binding = env0_3;
const value10 = binding.useMemo(_fun115502, [value9, value8.uploadDisabled, value8.canPostPolls, r18, r1]);
const env0_12 = binding.useRef(null);
let useCallback = binding.useCallback;
const value11 = Reflect.apply(useCallback, binding, [_fun115503, [value9]]);
useCallback = binding.useCallback;
return ((Component) => <Component animationConfigs={KEYBOARD_ANIMATION_CONFIG} animatedIndex={value3} animatedPosition={value4} bottomSheetRef={value2} accessoriesComponent={Reflect.apply(useCallback,
binding, [_fun115504, [value3, value4, value9, channel.id, value8, value10,
value6]])} handleComponent={value11} overlayComponent={appLauncherActionSheet} onClose={onClose} transitionState={transitionState}>{((Component) => <Component channel={channel} draftType={value8.draftType} onPressCamera={value9.onPressCamera} onAttachPress={value9.onAttachPress} onPressItem={value9.onPressItem} onLongPressItem={value9.onLongPressItem} onViewAll={value9.onViewAll} onManageLimited={value9.onManageLimited} includedUploadIds={value8.includedUploadIds} uploadDisabled={value8.uploadDisabled} uploadLimit={value8.uploadLimit} disableWhenReachedLimit={value8.disableWhenReachedLimit} />)(importDefault(11103) /* metro dependency 11103: MediaKeyboardList */)}</Component>)(importDefault(15151) /* metro dependency 15151: MediaKeyboardBottomSheet */);
}
function _fun115481() { // fn#115481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:1090, offset: 0x024623eb, size: 182 bytes, params: 1, frame: 3
return {onAttachPress: onAttachPress_115488, onPressCamera: onPressCamera_115489, onPressHeader: onPressHeader,
onViewAll: onViewAll_115491, onManageLimited: onManageLimited_115492, onPressItem: function({channelId, item,
isIncluded}) {
onSelectItem({channelId: channelId, item: item, isIncluded: isIncluded});
}, onLongPressItem: onLongPressItem, onPollsPress: onPollsPress, onAppsPress: function() {
var current = chatInputRef.current;
var object = {};
object.type = require(dependencyMap[11]).KeyboardTypes.APP_LAUNCHER;
object.context = {initialRouteName: AppLauncherRouteName.HOME};
current.openCustomKeyboard(object);
}, onThreadPress: onThreadPress, onSend: onSend_115501};
}
function _fun115502() { // fn#115502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:3704, offset: 0x02462c8f, size: 652 bytes, params: 1, frame: 22
var items;
var items2;
var object2;
var value2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var value3;
if (env0_7) {
object2 = {};
value2 = environment.__proto__;
object2.text = intl.string(t.PHjkRE);
object2.IconComponent = (require(8840) /* metro dependency 8840: AppsIcon */).AppsIcon;
object2.onPress = env0_9.onAppsPress;
object2.disabled = false;
items = [object2];
} else {
items = [];
}
if (env0_10) {
object2 = {};
value3 = environment.__proto__;
object2.text = intl.string(t['7Xm5QI']);
object2.IconComponent = (require(6684) /* metro dependency 6684: ThreadIcon */).ThreadIcon;
object2.onPress = env0_9.onThreadPress;
object2.disabled = false;
items2 = [object2];
} else {
items2 = [];
}
object2 = {};
let string = intl.string;
const RgIi2B = t.RgIi2B;
object2.text = Reflect.apply(string, intl, [RgIi2B]);
const PollsIcon = (require(11098) /* metro dependency 11098: PollsIcon */).PollsIcon;
object2.IconComponent = PollsIcon;
object2.onPress = env0_9.onPollsPress;
object2.disabled = !env0_8.canPostPolls;
const items3 = [object2];
const value5 = arraySpread(items3, items, arraySpread(items3, items2, 1, undefined), undefined);
object2 = {};
object2.text = intl.string(t['8Hvr3+']);
const AttachmentIcon = (require(9786) /* metro dependency 9786: AttachmentIcon */).AttachmentIcon;
object2.IconComponent = AttachmentIcon;
object2.onPress = env0_9.onAttachPress;
object2.disabled = env0_8.uploadDisabled;
items3[value5] = object2;
value5 + 1;
object2 = {};
const intl2 = (require(1244) /* metro dependency 1244: indexNative */).intl;
string = intl2.string;
const Zmm6dN = t.Zmm6dN;
object2.text = Reflect.apply(string, intl2, [Zmm6dN]);
const ImageIcon = (require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon;
object2.IconComponent = ImageIcon;
object2.onPress = env0_9.onViewAll;
object2.disabled = env0_8.uploadDisabled;
const items4 = [object2];
arraySpread(items4, items3, 1, intl);
return items4;
}
function _fun115503(a0) { // fn#115503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:4460, offset: 0x02462f1b, size: 70 bytes, params: 2, frame: 14
const value = environment.__proto__;
return ((Component) => <Component animatedIndex={a0.animatedIndex} onPress={env0_9.onPressHeader} />)(importDefault(11100) /* metro dependency 11100: MediaKeyboardBottomSheetHeaderSimple */);
}
function _fun115504({animateOnMount, initialPosition}) { // fn#115504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:4554, offset: 0x02462f61, size: 260 bytes, params: 2, frame: 21
var environment;
animateOnMount = !(animateOnMount === undefined) && animateOnMount;
let value = environment.__proto__;
const MediaKeyboardAccessoriesContainer = importDefault(15149) /* metro dependency 15149: MediaKeyboardAccessoriesContainer */;
const object2 = {animateOnMount: animateOnMount};
const binding = env0_3;
object2.animatedIndex = binding;
object2.animatedPosition = env0_4;
object2.initialPosition = initialPosition;
value = importDefault(15150) /* metro dependency 15150: MediaKeyboardFloatingSend */;
value = ((Component) => <Component ref={env0_12} animatedIndex={binding} channelId={channel.id} draftType={env0_8.draftType} onSend={env0_9.onSend} />)(value);
return (
<MediaKeyboardAccessoriesContainer {...object2}>
{value}
{((Component) => <Component canPostPolls={env0_8.canPostPolls} onHeightChange={onHeightChange_115505} uploadDisabled={env0_8.uploadDisabled} overflowButtons={env0_11} />)(importDefault(11102) /* metro dependency 11102: MediaKeyboardBottomSheetActions */)}
</MediaKeyboardAccessoriesContainer>
);
}
function onRestoreKeyboard() { // fn#115482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:1117, offset: 0x024624a1, size: 102 bytes, params: 1, frame: 15
var current;
var openCustomKeyboard;
var object2;
const target = env1_5.target;
const APP_LAUNCHER = MediaKeyboardTarget.APP_LAUNCHER;
if (target !== APP_LAUNCHER) {
current = chatInputRef.current;
openCustomKeyboard = current.openCustomKeyboard;
object2 = {};
object2.type = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.MEDIA;
object2.context = env1_5;
Reflect.apply(openCustomKeyboard, current, [object2]);
}
}
function onSelectFiles(a0, a1) { // fn#115483, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:1240, offset: 0x02462507, size: 171 bytes, params: 3, frame: 22
var moduleValue;
var moduleValue2;
const target = env1_5.target;
const CHAT = MediaKeyboardTarget.CHAT;
if (target === CHAT) {
moduleValue2 = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
moduleValue2.addImagesFromPicker(channel.id, a0, a1);
} else if (env1_5.target === MediaKeyboardTarget.COMMAND) {
moduleValue = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
moduleValue.addAttachmentForCommand(channel.id, chatInputRef, a0[0], env1_5, a1);
}
}
function onAttachFileParams_115484(a0) { // fn#115484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:1397, offset: 0x024625b2, size: 75 bytes, params: 2, frame: 4
const env0_0 = a0;
return {channel: channel, uploadLimit: env1_8.uploadLimit, onDismissKeyboard: onDismissKeyboard_115485,
onRestoreKeyboard: onRestoreKeyboard, onSelectFiles: onSelectFiles_115486};
}
function onSelectItem({channelId, item, isIncluded}) { // fn#115487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:1574, offset: 0x0246263d, size: 271 bytes, params: 2, frame: 25
var moduleValue;
let value = environment.__proto__.__proto__;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_PICKER_ACTION_SHEET_ENGAGED = AnalyticEvents.MEDIA_PICKER_ACTION_SHEET_ENGAGED;
const MEDIA_SELECTED = MediaPickerActionSheetEngagedActions.MEDIA_SELECTED;
Reflect.apply(track, defaultImport, [MEDIA_PICKER_ACTION_SHEET_ENGAGED, {action: MEDIA_SELECTED}]);
const target = env1_5.target;
const CHAT = MediaKeyboardTarget.CHAT;
if (target === CHAT) {
(require(11095) /* metro dependency 11095: MediaKeyboardUtils */).handleSelectKeyboardItem(channelId, item,
isIncluded, false);
} else if (env1_5.target === MediaKeyboardTarget.COMMAND) {
value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
value = value.mediaNodeToUploadItem(item);
moduleValue = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
moduleValue.addAttachmentForCommand(channelId, chatInputRef, value, env1_5,
(require(4650) /* metro dependency 4650: Upload */).UploadOrigin.IMAGE_PICKER);
}
}
function onAttachPress_115488() { // fn#115488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:1924, offset: 0x0246274c, size: 83 bytes, params: 1, frame: 17
let value = environment.__proto__.__proto__;
value = require(dependencyMap[18]);
const handleAttachFile = value.handleAttachFile;
const object2 = {};
const onAttachFileParams_115484Binding = onAttachFileParams_115484;
const UploadOrigin = require(dependencyMap[20]).UploadOrigin;
const FILE_ATTACHMENT = UploadOrigin.FILE_ATTACHMENT;
copyDataProperties(object2, onAttachFileParams_115484Binding(FILE_ATTACHMENT), dependencyMap);
Reflect.apply(handleAttachFile, value, [object2]);
}
function onPressCamera_115489(a0) { // fn#115489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:2034, offset: 0x0246279f, size: 97 bytes, params: 2, frame: 17
let value = environment.__proto__.__proto__;
value = require(dependencyMap[18]);
const handleCameraDialog = value.handleCameraDialog;
const object2 = {};
const onAttachFileParams_115484Binding = onAttachFileParams_115484;
const UploadOrigin = require(dependencyMap[20]).UploadOrigin;
const IMAGE_PICKER = UploadOrigin.IMAGE_PICKER;
copyDataProperties(object2, onAttachFileParams_115484Binding(IMAGE_PICKER), dependencyMap);
object2['previewType'] = a0;
Reflect.apply(handleCameraDialog, value, [object2]);
}
function onPressHeader() { // fn#115490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:2156, offset: 0x02462800, size: 78 bytes, params: 1, frame: 10
var current;
if (env1_3.get() === 0) {
current = env1_2.current;
if (current != null) {
current.expand();
}
} else {
current = env1_2.current;
if (current != null) {
current.collapse();
}
}
}
function onViewAll_115491() { // fn#115491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:2258, offset: 0x0246284e, size: 155 bytes, params: 1, frame: 18
var current;
let value = environment.__proto__.__proto__;
value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
const handleViewAllDialog = value.handleViewAllDialog;
const object2 = {};
const onAttachFileParams_115484Binding = onAttachFileParams_115484;
const UploadOrigin = (require(4650) /* metro dependency 4650: Upload */).UploadOrigin;
const IMAGE_PICKER = UploadOrigin.IMAGE_PICKER;
copyDataProperties(object2, onAttachFileParams_115484Binding(IMAGE_PICKER), undefined);
object2['draftType'] = env1_8.draftType;
Reflect.apply(handleViewAllDialog, value, [object2]);
value = require(477) /* metro dependency 477: PlatformUtils */;
if (value.isAndroid()) {
current = env1_2.current;
if (current != null) {
current.collapse();
}
}
}
function onManageLimited_115492() { // fn#115492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:2458, offset: 0x024628e9, size: 75 bytes, params: 1, frame: 15
let value = environment.__proto__.__proto__;
value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
const handleLimitedPickerDialog = value.handleLimitedPickerDialog;
const object2 = {};
object2.onDismissKeyboard = (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard;
object2.onRestoreKeyboard = onRestoreKeyboard;
Reflect.apply(handleLimitedPickerDialog, value, [object2]);
}
function onLongPressItem({channelId, item, isIncluded}) { // fn#115494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:2696, offset: 0x02462966, size: 277 bytes, params: 2, frame: 20
const value3 = (require(11095) /* metro dependency 11095: MediaKeyboardUtils */).mediaNodeToUploadItem(item);
const CloudUpload = (require(4648) /* metro dependency 4648: CloudUpload */).CloudUpload;
const cloudUpload = new CloudUpload(value3, channelId);
const r6 = isIncluded ? UploadAttachmentStore.getUpload(channelId, cloudUpload.id,
DraftType.ChannelMessage) : undefined;
(importDefault(11093) /* metro dependency 11093: showUploadPreviewActionSheet */)({channelId: channelId,
disableAddDescription: r6 == null, disableSpoiler: r6 == null, upload: r6 ?? cloudUpload,
onAdd: r6 == null ? function() {
onSelectItem({channelId: channelId, item: item, isIncluded: isIncluded});
} : undefined, onEdit: onEdit_115497, onRemove: r6 == null ? undefined : _fun115495});
}
function onPollsPress() { // fn#115498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:3193, offset: 0x02462b38, size: 153 bytes, params: 1, frame: 19
const value = environment.__proto__.__proto__;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
const POLLS = ChatInputComponentViewedTypes.POLLS;
const channelBinding = channel;
Reflect.apply(track, defaultImport, [CHAT_INPUT_COMPONENT_VIEWED, {type: POLLS, channel_id: channelBinding.id,
guild_id: channelBinding.guild_id}]);
chatInputRef.current.closeCustomKeyboard();
(require(11733) /* metro dependency 11733: PollCreationModalActionCreators */).openCreatePollModal({channel: channelBinding,
onCancel: onRestoreKeyboard});
}
function onThreadPress() { // fn#115500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:3535, offset: 0x02462c2a, size: 50 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
value.handleSelectThread(channel, chatInputRef);
}
function onSend_115501() { // fn#115501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:3581, offset: 0x02462c5c, size: 51 bytes, params: 1, frame: 10
const current = env1_2.current;
if (current != null) {
current.collapse();
}
chatInputRef.current.handleSend();
}
function onHeightChange_115505(a0) { // fn#115505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:4833, offset: 0x02463065, size: 47 bytes, params: 2, frame: 13
const value = environment.__proto__;
return env1_12.current?.setInsetFab(a0 + env1_6);
}
function onAttachFileParams_115484OnDismissKeyboard() { // fn#115485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:1456, owner: onAttachFileParams_115484.onDismissKeyboard, offset: 0x024625fd, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__.__proto__;
return (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard();
}
function onAttachFileParams_115484OnSelectFiles(a0) { // fn#115486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:1537, owner: onAttachFileParams_115484.onSelectFiles, offset: 0x02462622, size: 27 bytes, params: 2, frame: 13
onSelectFiles(a0, env0_0);
}
function _fun115495() { // fn#115495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:2872, offset: 0x02462a7b, size: 57 bytes, params: 1, frame: 17
let value = environment.__proto__.__proto__.__proto__;
value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
return value.handleSelectKeyboardItem(channelId, item, isIncluded, false);
}
function onLongPressItemOnEdit(a0) { // fn#115497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15342:3094, owner: onLongPressItem.onEdit, offset: 0x02462ae2, size: 86 bytes, params: 2, frame: 14
if (env0_3 != null) {
env0_3();
}
const onSelectFilesBinding = onSelectFiles;
const UploadOrigin = (require(4650) /* metro dependency 4650: Upload */).UploadOrigin;
const IMAGE_EDITOR = UploadOrigin.IMAGE_EDITOR;
onSelectFilesBinding([a0], IMAGE_EDITOR);
}
@@ -0,0 +1,94 @@
/* Metro module 15149; source: modules/media_keyboard/native/components/MediaKeyboardAccessoriesContainer.tsx; dependencies: [31, 27, 10738, 33, 477, 4501, 4017, 566, 2] */
function _fun115523(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15346:6, offset: 0x02463971, size: 277 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const StyleSheet = (require(27) /* metro dependency 27 */).StyleSheet;
const nativeMenuStore = importDefault(10738) /* metro dependency 10738: NativeMenuStore */;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
const env0_6 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const object2 = {};
copyDataProperties(object2, StyleSheet.absoluteFillObject, undefined);
const env0_7 = Reflect.apply(createStyles, value, [{androidContainer: {flex: 1}, iosContainer: object2}]);
object = {code: 'function MediaKeyboardAccessoriesContainerTsx1(){const{animateOnMount,initialLayout,animatedIndex,initialPosition,animatedPosition,interpolate,IS_ANDROID}=this.__closure;const animatedMountDisabledAndNotInitialLayout=!animateOnMount&&!initialLayout.get();const animatedSheetIndexOrDefault=animatedMountDisabledAndNotInitialLayout?0:Math.min(animatedIndex.get(),0);const animatedSheetPositionOrDefault=animatedMountDisabledAndNotInitialLayout?initialPosition:animatedPosition.get();const transform=[{translateY:interpolate(animatedSheetIndexOrDefault,[-1,0],[100,0])}];if(IS_ANDROID){return{marginTop:animatedSheetPositionOrDefault,transform:transform};}return{top:animatedSheetPositionOrDefault,transform:transform};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardAccessoriesContainer.tsx');
exports.default = MediaKeyboardAccessoriesContainer;
}
function MediaKeyboardAccessoriesContainer({animatedIndex, animatedPosition, animateOnMount, children, initialPosition}) { // fn#115524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15346:999, offset: 0x02463a86, size: 415 bytes, params: 2, frame: 27
var object2;
const env0_3 = initialPosition;
const styles = useStyles();
const binding = env0_3;
const value3 = binding.useMemo(_fun115525, [styles]);
const env0_5 = binding.useRef(false);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const env0_6 = value4;
const value5 = binding.useCallback(_fun115526, [value4]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = MediaKeyboardAccessoriesContainer_;
object2 = {animateOnMount: animateOnMount, initialLayout: value4, animatedIndex: animatedIndex,
initialPosition: initialPosition, animatedPosition: animatedPosition};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.IS_ANDROID = env0_6;
closure.__closure = object2;
closure.__workletHash = 10575537164844;
closure.__initData = env0_8;
const value6 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value7 = (require(566) /* metro dependency 566: flux */).useStateFromStores([NativeMenuStore], function() {
return NativeMenuStore.isOpen();
});
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View
importantForAccessibility={value7 ? 'no-hide-descendants' : undefined}
style={[value3, value6]}
onLayout={value5}
pointerEvents="box-none"
>
{children}
</View>
);
}
function _fun115525() { // fn#115525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15346:1151, offset: 0x02463c25, size: 58 bytes, params: 1, frame: 13
const object2 = {};
const binding = env1_6;
const stylesBinding = styles;
copyDataProperties(object2, binding ? stylesBinding.androidContainer : stylesBinding.iosContainer, undefined);
object2['overflow'] = 'hidden';
return object2;
}
function _fun115526() { // fn#115526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15346:1283, offset: 0x02463c5f, size: 45 bytes, params: 1, frame: 11
if (!env0_5.current) {
env0_5.current = true;
env0_6.set(true);
}
}
function MediaKeyboardAccessoriesContainer_() { // fn#115527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15346:1362, owner: MediaKeyboardAccessoriesContainer._, offset: 0x02463c8c, size: 206 bytes, params: 1, frame: 19
var object2;
const r1 = !animateOnMount && !env0_6.get();
const value4 = 0;
const r7 = r1 ? value4 : global.Math.min(animatedIndex.get(), value4);
const r3 = r1 ? initialPosition : animatedPosition.get();
const value = environment.__proto__;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const items2 = [{translateY: reanimatedRexportModule.interpolate(r7, [-1, value4], [100, 0])}];
const binding = env1_6;
object2 = {};
if (binding) {
object2.marginTop = r3;
object2.transform = items2;
} else {
object2.top = r3;
object2.transform = items2;
}
return object2;
}
@@ -0,0 +1,112 @@
/* Metro module 11097; source: modules/media_keyboard/native/components/MediaKeyboardActionSheet.tsx; dependencies: [31, 1580, 661, 33, 4017, 1244, 11098, 9786, 11100, 4081, 4082, 683, 4594, 11102, 6697, 6275, 1581, 11103, 2] */
function _fun85006(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11283:6, offset: 0x01f5ff75, size: 186 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(1580) /* metro dependency 1580: MediaKeyboardConstants */).MediaPickerActionSheetEngagedActions;
const env0_5 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardActionSheet.tsx');
exports.default = MediaKeyboardActionSheet;
}
function MediaKeyboardActionSheet({channel, draftType, uploadLimit, disableWhenReachedLimit, includedUploadIds, extensions, allowCamera, onPressCamera, onAttachPress, onPressItem, onLongPressItem, onViewAll, onManageLimited, onClose, onBack}) { // fn#85007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11283:306, offset: 0x01f6002f, size: 509 bytes, params: 2, frame: 37
const env0_3 = onBack;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
const binding = env0_3;
const value3 = binding.useMemo(_fun85008, [onAttachPress]);
const value4 = binding.useCallback(_fun85010, [value2, onBack]);
const value5 = binding.useCallback(function() {
require(dependencyMap[9]).triggerHapticFeedback(importDefault(dependencyMap[10]).IMPACT_LIGHT);
var defaultImport = importDefault(dependencyMap[11]);
var MEDIA_PICKER_ACTION_SHEET_ENGAGED = AnalyticEvents.MEDIA_PICKER_ACTION_SHEET_ENGAGED;
defaultImport.track(MEDIA_PICKER_ACTION_SHEET_ENGAGED,
{action: MediaPickerActionSheetEngagedActions.FULLY_EXPANDED});
}, []);
const value6 = binding.useCallback(function() {
if (onClose != null) {
onClose();
}
}, [onClose]);
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
return _fun85014;
});
const value7 = binding.useMemo(_fun85015, [onViewAll, value3]);
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
return (
<BottomSheet
handleComponent={value4}
scrollable
startExpanded={(require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */).isMetaQuest()}
onExpand={value5}
onDismiss={value6}
animatedIndex={value2}
footer={value7}
>
{((Component) => <Component channel={channel} draftType={draftType} onPressCamera={onPressCamera} onAttachPress={onAttachPress} onPressItem={onPressItem} onLongPressItem={onLongPressItem} onViewAll={onViewAll} onManageLimited={onManageLimited} includedUploadIds={includedUploadIds} extensions={extensions} allowCamera={allowCamera} uploadLimit={uploadLimit} disableWhenReachedLimit={disableWhenReachedLimit} />)(importDefault(11103) /* metro dependency 11103: MediaKeyboardList */)}
</BottomSheet>
);
}
function _fun85008() { // fn#85008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11283:611, offset: 0x01f6022c, size: 210 bytes, params: 1, frame: 16
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const RgIi2B = t.RgIi2B;
object2.text = Reflect.apply(string, intl, [RgIi2B]);
const PollsIcon = (require(11098) /* metro dependency 11098: PollsIcon */).PollsIcon;
object2.IconComponent = PollsIcon;
object2.onPress = function() {
};
object2.disabled = true;
const items2 = [object2];
object2 = {};
object2.text = intl.string(t['8Hvr3+']);
const AttachmentIcon = (require(9786) /* metro dependency 9786: AttachmentIcon */).AttachmentIcon;
object2.IconComponent = AttachmentIcon;
object2.onPress = onAttachPress;
object2.disabled = false;
items2[1] = object2;
return items2;
}
function _fun85010() { // fn#85010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11283:851, offset: 0x01f602fe, size: 59 bytes, params: 1, frame: 15
const value = environment.__proto__;
return ((Component) => <Component animatedIndex={env0_4} onPress={onBack} />)(importDefault(11100) /* metro dependency 11100: MediaKeyboardBottomSheetHeaderSimple */);
}
function _fun85013() { // fn#85013, offset: 0x01f603c1, size: 11 bytes, params: 1, frame: 1
return _fun85014;
}
function _fun85015() { // fn#85015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11283:1159, offset: 0x01f603ea, size: 189 bytes, params: 1, frame: 21
const MediaKeyboardBottomSheetActions = importDefault(11102) /* metro dependency 11102: MediaKeyboardBottomSheetActions */;
const object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const Zmm6dN = (require(1244) /* metro dependency 1244: indexNative */).t.Zmm6dN;
object.text = Reflect.apply(string, intl, [Zmm6dN]);
const ImageIcon = (require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon;
object.IconComponent = ImageIcon;
object.onPress = onViewAll;
object.disabled = false;
const items2 = [object];
arraySpread(items2, env0_5, 1, intl);
return (
<MediaKeyboardBottomSheetActions
canPostPolls={false}
onHeightChange={function() {
}}
uploadDisabled={false}
overflowButtons={items2}
/>
);
}
function _fun85014() { // fn#85014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11283:1117, offset: 0x01f603cc, size: 30 bytes, params: 1, frame: 11
const value = environment.__proto__;
return env1_6?.();
}
@@ -0,0 +1,200 @@
/* Metro module 15151; source: modules/media_keyboard/native/components/MediaKeyboardBottomSheet.tsx; dependencies: [57, 31, 27, 1580, 661, 33, 1581, 4501, 697, 1244, 11621, 4508, 6277, 4018, 4081, 4082, 683, 4559, 4017, 4594, 1585, 4556, 2] */
function _fun115539(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15348:6, offset: 0x02464462, size: 400 bytes, params: 8, frame: 22
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 mediaKeyboardConstantsModule = require(1580) /* metro dependency 1580: MediaKeyboardConstants */;
const env0_6 = mediaKeyboardConstantsModule.HEADER_HANDLE_HEIGHT;
const env0_7 = mediaKeyboardConstantsModule.MediaPickerActionSheetEngagedActions;
const env0_8 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
const value3 = require(33) /* metro dependency 33 */;
const env0_9 = value3.jsx;
const env0_10 = value3.Fragment;
const env0_11 = value3.jsxs;
const env0_12 = (require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */).isMetaQuest();
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const MOBILE_KEYBOARD_PANEL_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_KEYBOARD_PANEL_BACKGROUND;
const env0_13 = Reflect.apply(createStyles, createStylesModule,
[{background: {backgroundColor: MOBILE_KEYBOARD_PANEL_BACKGROUND, borderRadius: 15}}]);
object = {code: 'function MediaKeyboardBottomSheetTsx1(){const{animatedIndex}=this.__closure;return Math.max(animatedIndex.get(),0)>0;}'};
object = {code: 'function MediaKeyboardBottomSheetTsx2(result,previous){const{runOnJS,setAccessibilityViewIsModal}=this.__closure;if(result===previous)return;runOnJS(setAccessibilityViewIsModal)(result);}'};
value = value.memo(MediaKeyboardBottomSheet);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardBottomSheet.tsx');
exports.default = value;
}
function MediaKeyboardBackground({pointerEvents, style}) { // fn#115540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15348:415, offset: 0x024645f2, size: 118 bytes, params: 2, frame: 19
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const XONG6A = (require(1244) /* metro dependency 1244: indexNative */).t.XONG6A;
return (
<View
pointerEvents={pointerEvents}
accessible
accessibilityRole="adjustable"
accessibilityLabel={Reflect.apply(string, intl, [XONG6A])}
style={style}
/>
);
}
function MediaKeyboardBottomSheet({accessoriesComponent, animatedIndex, animatedPosition, bottomSheetRef, children, handleComponent, onClose, transitionState, animationConfigs, overlayComponent}) { // fn#115541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15348:962, offset: 0x02464668, size: 823 bytes, params: 2, frame: 39
const styles = useStyles();
const value2 = (importDefault(11621) /* metro dependency 11621: useCustomKeyboardBottomSheetConfig */)({forceMaxHeight: false});
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
const YEETED = TransitionStates.YEETED;
const value3 = transitionState === YEETED;
let binding = undefined;
let closure = _fun115542;
const value4 = binding.useCallback(closure, []);
const value5 = binding.useCallback(_fun115543, []);
const value6 = binding.useCallback(_fun115544, [value3, onClose]);
const r20 = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).useIsScreenReaderEnabled() || value3;
binding = undefined;
let [property, property2] = env0_3(binding.useState(false), 2);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
closure = MediaKeyboardBottomSheetD;
closure.__closure = {animatedIndex: animatedIndex};
closure.__workletHash = 6409838147176;
closure.__initData = env0_14;
const closure2 = MediaKeyboardBottomSheetB;
closure2.__closure = {runOnJS: reanimatedRexportModule.runOnJS, setAccessibilityViewIsModal: property2};
closure2.__workletHash = 4155361737130;
closure2.__initData = env0_15;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
return _fun115548;
});
binding.useLayoutEffect(function() {
var property;
if (result) {
if (bottomSheetRef.current != null) {
property = bottomSheetRef.current;
property.forceClose();
property = global.setTimeout;
var env0_0 = property(_fun115550, 500);
return _fun115551;
}
if (onClose != null) {
onClose();
}
}
}, [bottomSheetRef, value3, onClose]);
const {left, right} = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const defaultImport3 = importDefault(6277) /* metro dependency 6277 */;
const defaultImport3Props = {style: {marginLeft: left, marginRight: right},
BodyComponent: importDefault(4018) /* metro dependency 4018: REAWorkaroundView */, ref: bottomSheetRef,
animationConfigs: animationConfigs, animatedIndex: animatedIndex, animatedPosition: animatedPosition};
const value11 = !r20;
defaultImport3Props.enableContentPanningGesture = r20 ? value11 : !env0_12;
defaultImport3Props.enableHandlePanningGesture = value11;
defaultImport3Props.handleComponent = handleComponent;
defaultImport3Props.backgroundComponent = value4;
defaultImport3Props.backgroundStyle = styles.background;
defaultImport3Props.backdropComponent = value5;
defaultImport3Props.onAnimate = value6;
defaultImport3Props.handleHeight = HEADER_HANDLE_HEIGHT;
defaultImport3Props.onClose = onClose;
copyDataProperties(defaultImport3Props, value2, left);
const AccessibilityViewAnimated = (require(4556) /* metro dependency 4556: AccessibilityViewNative */).AccessibilityViewAnimated;
let value = <AccessibilityViewAnimated nativeID="media-keyboard-sheet" onAccessibilityEscape={function() {
var current = bottomSheetRef.current;
if (current != null) {
current.collapse();
}
}} accessibilityViewIsModal={property}>{children}</AccessibilityViewAnimated>;
value = ((Component) => <Component {...defaultImport3Props}>{value}</Component>)(defaultImport3);
return (
<>
{[value, accessoriesComponent(value2), overlayComponent]}
</>
);
}
function _fun115542(a0) { // fn#115542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15348:1271, offset: 0x0246499f, size: 33 bytes, params: 2, frame: 13
return <MediaKeyboardBackground {...a0} />;
}
function _fun115543(a0) { // fn#115543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15348:1330, offset: 0x024649c0, size: 95 bytes, params: 2, frame: 16
const value = environment.__proto__;
const BottomSheetBackdrop = (require(6277) /* metro dependency 6277 */).BottomSheetBackdrop;
const bottomSheetBackdropProps = {...a0};
bottomSheetBackdropProps['ViewComponent'] = importDefault(4018) /* metro dependency 4018: REAWorkaroundView */;
bottomSheetBackdropProps['pressBehavior'] = 'collapse';
return <BottomSheetBackdrop {...bottomSheetBackdropProps} />;
}
function _fun115544(a0, a1) { // fn#115544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15348:1442, offset: 0x02464a1f, size: 181 bytes, params: 3, frame: 17
var moduleValue;
var defaultImport;
var value;
if (result) {
if (a1 !== -1) {
if (onClose != null) {
onClose();
}
} else {
value = a0 !== a1;
if (value && a0 === 0) {
value = environment.__proto__;
moduleValue = require(4081) /* metro dependency 4081: HapticUtilsNative */;
moduleValue.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.MEDIA_PICKER_ACTION_SHEET_ENGAGED,
{action: MediaPickerActionSheetEngagedActions.FULLY_EXPANDED});
}
}
} else {
value = a0 !== a1;
if (value && a0 === 0) {
value = environment.__proto__;
moduleValue = require(4081) /* metro dependency 4081: HapticUtilsNative */;
moduleValue.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.MEDIA_PICKER_ACTION_SHEET_ENGAGED,
{action: MediaPickerActionSheetEngagedActions.FULLY_EXPANDED});
}
}
}
function MediaKeyboardBottomSheetB(a0, a1) { // fn#115546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15348:1851, owner: MediaKeyboardBottomSheet.B, offset: 0x02464ad4, size: 61 bytes, params: 3, frame: 13
var value;
if (a0 !== a1) {
value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env0_4)(a0);
}
}
function _fun115547() { // fn#115547, offset: 0x02464b11, size: 11 bytes, params: 1, frame: 1
return function() {
if (onClose != null) {
onClose();
}
};
}
function _fun115549() { // fn#115549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15348:2067, offset: 0x02464b1c, size: 110 bytes, params: 1, frame: 14
if (result) {
if (bottomSheetRef.current != null) {
bottomSheetRef.current.forceClose();
var env0_0 = global.setTimeout(_fun115550, 500);
return _fun115551;
}
if (onClose != null) {
onClose();
}
}
}
function _fun115550() { // fn#115550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15348:2139, offset: 0x02464b8a, size: 30 bytes, params: 1, frame: 11
const value = environment.__proto__;
return onClose?.();
}
@@ -0,0 +1,172 @@
/* Metro module 11102; source: modules/media_keyboard/native/components/MediaKeyboardBottomSheetActions.tsx; dependencies: [31, 27, 33, 4501, 697, 477, 3963, 674, 3860, 1585, 1357, 4589, 5278, 4573, 2] */
function _fun85025(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11288:6, offset: 0x01f60942, size: 225 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.StyleSheet;
const env0_5 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun85026);
value = value.memo(MediaKeyboardBottomSheetActions);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardBottomSheetActions.tsx');
exports.default = value;
}
function _fun85026(a0, a1, a2, a3) { // fn#85026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11288:191, offset: 0x01f60a23, size: 643 bytes, params: 5, frame: 20
const value = a0;
const value2 = a1;
const value3 = a2;
const object8 = {};
const object9 = {};
copyDataProperties(object9, StyleSheet.absoluteFillObject, undefined);
object9['alignItems'] = 'center';
object9['top'] = undefined;
object8.wrap = object9;
const object10 = {};
const PX_8 = importDefault(dependencyMap[4]).space.PX_8;
object10.paddingVertical = PX_8;
const MEDIA_KEYBOARD_BAR_MARGIN_HORIZONTAL = importDefault(dependencyMap[4]).modules.mobile.MEDIA_KEYBOARD_BAR_MARGIN_HORIZONTAL;
object10.marginHorizontal = MEDIA_KEYBOARD_BAR_MARGIN_HORIZONTAL;
const moduleValue = require(dependencyMap[5]);
object10.marginBottom = moduleValue.isIOS() ? importDefault(dependencyMap[4]).space.PX_24 : value;
const MEDIA_KEYBOARD_BAR_BORDER_RADIUS = importDefault(dependencyMap[4]).modules.mobile.MEDIA_KEYBOARD_BAR_BORDER_RADIUS;
object10.borderRadius = MEDIA_KEYBOARD_BAR_BORDER_RADIUS;
object10.backgroundColor = value3 ?? value2;
const MEDIA_KEYBOARD_BAR_PADDING_HORIZONTAL = importDefault(dependencyMap[4]).modules.mobile.MEDIA_KEYBOARD_BAR_PADDING_HORIZONTAL;
object10.paddingHorizontal = MEDIA_KEYBOARD_BAR_PADDING_HORIZONTAL;
const MEDIA_KEYBOARD_BAR_BORDER_WIDTH = importDefault(dependencyMap[4]).modules.mobile.MEDIA_KEYBOARD_BAR_BORDER_WIDTH;
object10.borderWidth = MEDIA_KEYBOARD_BAR_BORDER_WIDTH;
const SHADOW_HIGH = importDefault(dependencyMap[4]).shadows.SHADOW_HIGH;
copyDataProperties(object10, SHADOW_HIGH, dependencyMap);
const object11 = {};
const BORDER_MUTED = importDefault(dependencyMap[4]).colors.BORDER_MUTED;
if (a3) {
object11.borderColor = BORDER_MUTED;
} else {
object11.borderTopColor = BORDER_MUTED;
}
copyDataProperties(object10, object11, dependencyMap);
object8.container = object10;
const object12 = {'gap': null, 'alignItems': 'stretch', 'flexDirection': 'row'};
const MEDIA_KEYBOARD_BAR_GAP = importDefault(dependencyMap[4]).modules.mobile.MEDIA_KEYBOARD_BAR_GAP;
object12.gap = MEDIA_KEYBOARD_BAR_GAP;
const MEDIA_KEYBOARD_BAR_BUTTONS_MARGIN_HORIZONTAL = importDefault(dependencyMap[4]).modules.mobile.MEDIA_KEYBOARD_BAR_BUTTONS_MARGIN_HORIZONTAL;
object12.marginHorizontal = MEDIA_KEYBOARD_BAR_BUTTONS_MARGIN_HORIZONTAL;
object8.buttonsContainer = object12;
const object13 = {'flexBasis': 64, 'minHeight': 48, 'flexGrow': 1, 'justifyContent': 'center',
'flexDirection': 'column', 'alignItems': 'center', 'padding': null, 'borderRadius': null, 'gap': 4};
const MEDIA_KEYBOARD_BUTTON_PADDING = importDefault(dependencyMap[4]).modules.mobile.MEDIA_KEYBOARD_BUTTON_PADDING;
object13.padding = MEDIA_KEYBOARD_BUTTON_PADDING;
const MEDIA_KEYBOARD_BUTTON_BORDER_RADIUS = importDefault(dependencyMap[4]).modules.mobile.MEDIA_KEYBOARD_BUTTON_BORDER_RADIUS;
object13.borderRadius = MEDIA_KEYBOARD_BUTTON_BORDER_RADIUS;
object8.button = object13;
const object14 = {};
copyDataProperties(object14, StyleSheet.absoluteFillObject, dependencyMap);
const BACKGROUND_BASE_LOW = importDefault(dependencyMap[4]).colors.BACKGROUND_BASE_LOW;
object14['color'] = BACKGROUND_BASE_LOW;
object8.gradient = object14;
return object8;
}
function MediaKeyboardBottomSheetActions({onHeightChange, overflowButtons}) { // fn#85027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11288:1348, offset: 0x01f60ca6, size: 807 bytes, params: 2, frame: 28
const clientThemesUtilsModule = require(3963) /* metro dependency 3963: ClientThemesUtils */;
const useGradientValue = clientThemesUtilsModule.useGradientValue;
const GradientPercentage = clientThemesUtilsModule.GradientPercentage;
const END = GradientPercentage.END;
const value2 = Reflect.apply(useGradientValue, clientThemesUtilsModule, [END]);
const r11 = value2 != null ? (importDefault(674) /* metro dependency 674 */)(value2).alpha(0.95).hex() : null;
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
let useToken = useTokenModule.useToken;
const CARD_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BACKGROUND_DEFAULT;
const value10 = (importDefault(674) /* metro dependency 674 */)(Reflect.apply(useToken, useTokenModule,
[CARD_BACKGROUND_DEFAULT])).alpha(0.95).hex();
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
const mobileVisualRefreshExperimentModule = require(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */;
const useMobileVisualRefreshConfig = mobileVisualRefreshExperimentModule.useMobileVisualRefreshConfig;
const enabled = Reflect.apply(useMobileVisualRefreshConfig, mobileVisualRefreshExperimentModule,
[{location: 'MediaKeyboardBottomSheetActions'}]).enabled;
const moduleValue4 = useTokenModule;
useToken = moduleValue4.useToken;
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
const styles = useStyles(bottom, enabled ? Reflect.apply(useToken, moduleValue4,
[BACKGROUND_SURFACE_HIGH]) : value10, r11, enabled);
const moduleValue5 = useTokenModule;
useToken = moduleValue5.useToken;
const MEDIA_KEYBOARD_BUTTON_ICON_COLOR_ACTIVE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.MEDIA_KEYBOARD_BUTTON_ICON_COLOR_ACTIVE;
const env0_2 = Reflect.apply(useToken, moduleValue5, [MEDIA_KEYBOARD_BUTTON_ICON_COLOR_ACTIVE]);
const moduleValue6 = useTokenModule;
useToken = moduleValue6.useToken;
const MEDIA_KEYBOARD_BUTTON_TEXT_COLOR_ACTIVE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.MEDIA_KEYBOARD_BUTTON_TEXT_COLOR_ACTIVE;
const env0_3 = Reflect.apply(useToken, moduleValue6, [MEDIA_KEYBOARD_BUTTON_TEXT_COLOR_ACTIVE]);
const moduleValue7 = useTokenModule;
useToken = moduleValue7.useToken;
const MEDIA_KEYBOARD_BUTTON_TEXT_VARIANT = (importDefault(697) /* metro dependency 697: native */).modules.mobile.MEDIA_KEYBOARD_BUTTON_TEXT_VARIANT;
const env0_4 = Reflect.apply(useToken, moduleValue7, [MEDIA_KEYBOARD_BUTTON_TEXT_VARIANT]);
const binding = env0_3;
const value12 = binding.useMemo(_fun85028, [styles.gradient.color]);
const value13 = binding.useCallback(function({nativeEvent}) {
onHeightChange(nativeEvent.layout.height);
}, [onHeightChange]);
let value = importDefault(4589) /* metro dependency 4589 */;
value = ((Component) => <Component style={styles.gradient} {...value12} {...{['pointerEvents']: 'none'}} />)(value);
return (
<View
style={styles.wrap}
pointerEvents="box-none"
onLayout={value13}
>
{value}
<View style={styles.container}>
<View style={styles.buttonsContainer}>
{overflowButtons.map(_fun85030)}
</View>
</View>
</View>
);
}
function _fun85028() { // fn#85028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11288:2068, offset: 0x01f60fcd, size: 172 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = importDefault(674) /* metro dependency 674 */;
value = value(styles.gradient.color);
value = value.alpha(0);
value = value.hex();
const items2 = [value];
value = importDefault(674) /* metro dependency 674 */;
value = value(styles.gradient.color);
value = value.alpha(1);
items2[1] = value.hex();
return {start: {'x': 0, 'y': 0}, end: {'x': 0, 'y': 1}, colors: items2};
}
function _fun85030(a0, a1) { // fn#85030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11288:2487, offset: 0x01f6109d, size: 264 bytes, params: 3, frame: 23
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const pressableOpacityProps = {accessibilityRole: 'button', accessibilityLabel: a0.text};
let disabled = a0.disabled;
pressableOpacityProps.accessibilityState = {disabled: disabled};
pressableOpacityProps.disabled = a0.disabled;
pressableOpacityProps.style = styles.button;
pressableOpacityProps.onPress = a0.onPress;
const IconComponent = a0.IconComponent;
disabled = a0.disabled;
const value3 = 'text-muted';
const iconComponent = <IconComponent size="md" color={disabled ? value3 : env0_2} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<PressableOpacity {...pressableOpacityProps} key={a1}>
{iconComponent}
<Text
lineClamp={1}
variant={env0_4}
color={a0.disabled ? value3 : env0_3}
>
{a0.text}
</Text>
</PressableOpacity>
);
}
@@ -0,0 +1,59 @@
/* Metro module 11101; source: modules/media_keyboard/native/components/MediaKeyboardBottomSheetHandle.tsx; dependencies: [31, 27, 1580, 33, 4501, 697, 7701, 8621, 1244, 2] */
function _fun85022(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11287:6, offset: 0x01f606d1, size: 371 bytes, params: 8, frame: 23
var object4;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_2 = value2.Pressable;
const env0_3 = value2.View;
const StyleSheet = value2.StyleSheet;
const DRAG_HANDLE = (require(1580) /* metro dependency 1580: MediaKeyboardConstants */).DRAG_HANDLE;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object4 = {};
const object5 = {};
copyDataProperties(object5, StyleSheet.absoluteFillObject, undefined);
object5['backgroundColor'] = 'transparent';
object5['height'] = DRAG_HANDLE.slotHeight;
object5['alignItems'] = 'center';
object5['bottom'] = undefined;
object4.headerHandleWrap = object5;
const object6 = {};
object6.backgroundColor = DRAG_HANDLE.barColor;
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
object6.marginTop = DRAG_HANDLE.barMarginTop;
object6.height = DRAG_HANDLE.barHeight;
object6.width = DRAG_HANDLE.barWidth;
object4.dragHandleBar = object6;
const env0_5 = Reflect.apply(createStyles, createStylesModule, [object4]);
value = value.memo(MediaKeyboardBottomSheetHandle);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardBottomSheetHandle.tsx');
exports.default = value;
}
function MediaKeyboardBottomSheetHandle({animatedIndex, onPress}) { // fn#85023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11287:491, offset: 0x01f60844, size: 254 bytes, params: 2, frame: 23
const styles = useStyles();
const value2 = (require(7701) /* metro dependency 7701: ClientThemesOverrides */).useGradientBottom();
const value3 = (require(8621) /* metro dependency 8621: useStateFromSharedValue */).useDerivedStateFromSharedValue(animatedIndex,
function(a0) {
return a0 > 0;
});
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
return (
<Pressable
accessibilityLabel={value3 ? Reflect.apply(string, intl, [t.iTcuma]) : Reflect.apply(string, intl,
[t.dcl9MQ])}
{...{['aria-hidden']: onPress == null}}
style={[styles.headerHandleWrap, value2]}
onPress={onPress}
>
<View style={styles.dragHandleBar} />
</Pressable>
);
}
@@ -0,0 +1,28 @@
/* Metro module 11100; source: modules/media_keyboard/native/components/MediaKeyboardBottomSheetHeaderSimple.tsx; dependencies: [31, 27, 1580, 33, 4501, 697, 11101, 2] */
function _fun85020(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11286:6, offset: 0x01f60577, size: 250 bytes, params: 8, frame: 22
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_2 = (require(27) /* metro dependency 27 */).View;
const HEADER_HANDLE_HEIGHT = (require(1580) /* metro dependency 1580: MediaKeyboardConstants */).HEADER_HANDLE_HEIGHT;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const object = {height: HEADER_HANDLE_HEIGHT};
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object.paddingBottom = PX_4;
const env0_4 = Reflect.apply(createStyles, createStylesModule, [{headerHandleOnlyWrap: object}]);
value = value.memo(MediaKeyboardBottomSheetHeaderSimple);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardBottomSheetHeaderSimple.tsx');
exports.default = value;
}
function MediaKeyboardBottomSheetHeaderSimple({animatedIndex, onPress}) { // fn#85021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11286:271, offset: 0x01f60671, size: 96 bytes, params: 2, frame: 18
const styles = useStyles();
return (
<View style={styles.headerHandleOnlyWrap}>
{((Component) => <Component animatedIndex={animatedIndex} onPress={onPress} />)(importDefault(11101) /* metro dependency 11101: MediaKeyboardBottomSheetHandle */)}
</View>
);
}
@@ -0,0 +1,103 @@
/* Metro module 11117; source: modules/media_keyboard/native/components/MediaKeyboardEmptyState.tsx; dependencies: [31, 27, 4661, 33, 4501, 697, 4573, 4578, 7002, 1244, 11118, 11112, 11119, 2] */
function _fun85114(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11303:6, offset: 0x01f64948, size: 349 bytes, params: 8, frame: 24
var object3;
const env0_0 = require;
const closure = MediaKeyboardEmptyState;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_3 = value.Image;
const env0_4 = value.View;
const env0_5 = (require(4661) /* metro dependency 4661: NativePermissionConstants */).NativePermissionStatus;
value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {};
const object4 = {};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object4.marginHorizontal = PX_8;
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object4.marginVertical = PX_32;
object4.justifyContent = 'center';
object4.alignItems = 'center';
object3.container = object4;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.label = {textAlign: 'center', marginVertical: PX_16};
const env0_8 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardEmptyState.tsx');
exports.default = closure;
exports.getMediaEmptyStateComponentOrNull = getMediaEmptyStateComponentOrNull;
}
function MediaKeyboardEmptyState({actionIcon, actionLabel, actionPress, imageSource, label}) { // fn#85115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11303:408, offset: 0x01f64aa5, size: 223 bytes, params: 2, frame: 25
const styles = useStyles();
const items2 = [<Image source={imageSource} />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[1] = <Text variant="text-sm/semibold" color="text-muted" style={styles.label}>{label}</Text>;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
items2[2] = <Button icon={actionIcon} size="sm" text={actionLabel} onPress={actionPress} />;
return (
<View style={styles.container}>
{items2}
</View>
);
}
function getMediaEmptyStateComponentOrNull({photoPermissionStatus, photosEmpty, showCameraButton, onPressCamera, onManageLimited, onPressPrivacySettings}) { // fn#85116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11303:892, offset: 0x01f64b84, size: 702 bytes, params: 2, frame: 23
var object;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
showCameraButton = showCameraButton === undefined || showCameraButton;
const DENIED = NativePermissionStatus.DENIED;
if (photoPermissionStatus === DENIED) {
return (
<MediaKeyboardEmptyState
actionIcon={((SettingsIcon) => <SettingsIcon color="white" size="sm" />)((require(7002) /* metro dependency 7002: SettingsIcon */).SettingsIcon)}
actionLabel={intl.string(t['457oeG'])}
actionPress={onPressPrivacySettings}
imageSource={importDefault(11118) /* metro dependency 11118 */}
label={intl.string(t['8p9jGu'])}
/>
);
}
const RESTRICTED = NativePermissionStatus.RESTRICTED;
if (photoPermissionStatus === RESTRICTED) {
return (
<MediaKeyboardEmptyState
actionIcon={((SettingsIcon) => <SettingsIcon color="white" size="sm" />)((require(7002) /* metro dependency 7002: SettingsIcon */).SettingsIcon)}
actionLabel={intl.string(t['457oeG'])}
actionPress={onPressPrivacySettings}
imageSource={importDefault(11118) /* metro dependency 11118 */}
label={intl.string(t['8p9jGu'])}
/>
);
}
if (photosEmpty) {
if (photoPermissionStatus === NativePermissionStatus.LIMITED) {
return (
<MediaKeyboardEmptyState
actionIcon={((SettingsIcon) => <SettingsIcon color="white" size="sm" />)((require(7002) /* metro dependency 7002: SettingsIcon */).SettingsIcon)}
actionLabel={intl.string(t.JuXTi6)}
actionPress={onManageLimited}
imageSource={importDefault(11118) /* metro dependency 11118 */}
label={intl.string(t['5g7NcN'])}
/>
);
}
if (showCameraButton) {
return (
<MediaKeyboardEmptyState
actionIcon={((CameraIcon) => <CameraIcon color="white" size="sm" />)((require(11112) /* metro dependency 11112: CameraIcon */).CameraIcon)}
actionLabel={intl.string(t.tpoWUd)}
actionPress={onPressCamera}
imageSource={importDefault(11119) /* metro dependency 11119 */}
label={intl.string(t.YOvRBZ)}
/>
);
}
}
}
@@ -0,0 +1,153 @@
/* Metro module 15150; source: modules/media_keyboard/native/components/MediaKeyboardFloatingSend.tsx; dependencies: [57, 31, 27, 4644, 33, 4501, 697, 566, 4017, 1585, 4577, 674, 4589, 8561, 1244, 4058, 2] */
function _fun115529(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15347:6, offset: 0x02463d6d, size: 423 bytes, params: 8, frame: 24
var object4;
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 StyleSheet = (require(27) /* metro dependency 27 */).StyleSheet;
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
const value2 = require(33) /* metro dependency 33 */;
const env0_6 = value2.jsx;
const env0_7 = value2.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object4 = {};
const object5 = {};
copyDataProperties(object5, StyleSheet.absoluteFillObject, undefined);
object5['top'] = undefined;
const SHADOW_HIGH = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_HIGH;
copyDataProperties(object5, SHADOW_HIGH, undefined);
object4.sendContainer = object5;
const object6 = {};
copyDataProperties(object6, StyleSheet.absoluteFillObject, undefined);
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object6['color'] = BACKGROUND_SURFACE_HIGH;
object4.gradient = object6;
const env0_8 = Reflect.apply(createStyles, createStylesModule, [object4]);
object4 = {code: 'function MediaKeyboardFloatingSendTsx1(){const{animatedIndex,INDEX_HEADER_CHANGE_THRESHOLD,hasUploads}=this.__closure;const isSheetOpen=animatedIndex.get()>INDEX_HEADER_CHANGE_THRESHOLD;return isSheetOpen&&hasUploads;}'};
object4 = {code: 'function MediaKeyboardFloatingSendTsx2(visible){const{isSendVisibleSharedValue}=this.__closure;isSendVisibleSharedValue.set(visible);}'};
object4 = {code: 'function MediaKeyboardFloatingSendTsx3(){const{insetFab,tokens,withSpring,sendVisibleSharedValue}=this.__closure;return{height:insetFab+tokens.space.PX_64+tokens.space.PX_32,opacity:withSpring(sendVisibleSharedValue.get()?1:0)};}'};
object4 = {code: "function MediaKeyboardFloatingSendTsx4(){const{sendVisibleSharedValue}=this.__closure;return{pointerEvents:sendVisibleSharedValue.get()?'box-none':'none'};}"};
value = value.memo(value.forwardRef(MediaKeyboardFloatingSendInner));
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardFloatingSend.tsx');
exports.default = value;
}
function MediaKeyboardFloatingSendInner({animatedIndex, channelId, draftType, onSend}, a1) { // fn#115530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15347:1171, offset: 0x02463f14, size: 667 bytes, params: 3, frame: 25
var object2;
const styles = useStyles();
const value2 = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
let binding = env0_4;
const [property, env0_1] = undefined(binding.useState(null), 2);
const r8 = property ?? value2.bottom;
const value5 = useSendVisibleSharedValue({animatedIndex: animatedIndex, channelId: channelId, draftType: draftType});
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = MediaKeyboardFloatingSendInnerY;
object2 = {insetFab: r8};
object2.tokens = importDefault(697) /* metro dependency 697: native */;
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.sendVisibleSharedValue = value5;
closure.__closure = object2;
closure.__workletHash = 6402761213297;
closure.__initData = env0_11;
const value6 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const moduleValue2 = reanimatedRexportModule;
const useAnimatedProps = moduleValue2.useAnimatedProps;
closure = MediaKeyboardFloatingSendInnerF;
closure.__closure = {sendVisibleSharedValue: value5};
closure.__workletHash = 1097586248797;
closure.__initData = env0_12;
const value7 = Reflect.apply(useAnimatedProps, moduleValue2, [closure]);
binding = env0_4;
const value8 = binding.useMemo(_fun115537, [styles.gradient.color]);
binding.useImperativeHandle(a1, _fun115538);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items2 = [value6];
items2[1] = styles.sendContainer;
let value = importDefault(4589) /* metro dependency 4589 */;
value = ((Component) => <Component style={styles.gradient} {...value8} {...{['pointerEvents']: 'none'}} />)(value);
const FloatingActionButton = (require(8561) /* metro dependency 8561: FloatingActionButtonNative */).FloatingActionButton;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const TXNS7S = (require(1244) /* metro dependency 1244: indexNative */).t.TXNS7S;
const SendMessageIcon = (require(4058) /* metro dependency 4058: SendMessageIcon */).SendMessageIcon;
return (
<View style={items2} animatedProps={value7}>
{value}
<FloatingActionButton
accessibilityLabel={Reflect.apply(string, intl, [TXNS7S])}
icon={<SendMessageIcon />}
onPress={onSend}
positionBottom={r8}
/>
</View>
);
}
function useSendVisibleSharedValue({animatedIndex, channelId, draftType}) { // fn#115531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15347:1356, owner: MediaKeyboardFloatingSendInner.useSendVisibleSharedValue, offset: 0x024641af, size: 276 bytes, params: 2, frame: 22
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UploadAttachmentStore],
_fun115532, [channelId, draftType]);
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
const closure = useSendVisibleSharedValueC;
closure.__closure = {animatedIndex: animatedIndex, INDEX_HEADER_CHANGE_THRESHOLD: 0.7, hasUploads: value2};
closure.__workletHash = 12206635621152;
closure.__initData = env1_9;
const closure2 = useSendVisibleSharedValueL;
closure2.__closure = {isSendVisibleSharedValue: value3};
closure2.__workletHash = 10753585819648;
closure2.__initData = env1_10;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
return value3;
}
function MediaKeyboardFloatingSendInnerY() { // fn#115535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15347:1928, owner: MediaKeyboardFloatingSendInner.y, offset: 0x02464310, size: 130 bytes, params: 1, frame: 17
const object2 = {};
const binding = env0_2;
const PX_64 = (importDefault(697) /* metro dependency 697: native */).space.PX_64;
const value3 = binding + PX_64;
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object2.height = value3 + PX_32;
const springModule = require(4577) /* metro dependency 4577: spring */;
object2.opacity = springModule.withSpring(env0_3.get() ? 1 : 0);
return object2;
}
function MediaKeyboardFloatingSendInnerF() { // fn#115536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15347:2201, owner: MediaKeyboardFloatingSendInner.f, offset: 0x02464392, size: 38 bytes, params: 1, frame: 10
const object2 = {};
object2.pointerEvents = env0_3.get() ? 'box-none' : 'none';
return object2;
}
function _fun115537() { // fn#115537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15347:2348, offset: 0x024643b8, size: 154 bytes, params: 1, frame: 17
let value = environment.__proto__;
value = importDefault(674) /* metro dependency 674 */;
const stylesBinding = styles;
value = value(stylesBinding.gradient.color);
value = value.alpha(0);
value = value.hex();
const items2 = [value];
value = importDefault(674) /* metro dependency 674 */;
value = value(stylesBinding.gradient.color);
items2[1] = value.hex();
return {start: {'x': 0, 'y': 0}, end: {'x': 0, 'y': 1}, colors: items2};
}
function _fun115538() { // fn#115538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15347:2523, offset: 0x02464452, size: 16 bytes, params: 1, frame: 2
return {setInsetFab: env0_1};
}
function _fun115532() { // fn#115532, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15347:1476, offset: 0x024642c3, size: 38 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
const getUploadCount = UploadAttachmentStore.getUploadCount;
return Reflect.apply(getUploadCount, UploadAttachmentStore, [channelId, draftType]) > 0;
}
function useSendVisibleSharedValueC() { // fn#115533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15347:1580, owner: MediaKeyboardFloatingSendInner.useSendVisibleSharedValue.c, offset: 0x024642e9, size: 39 bytes, params: 1, frame: 10
return animatedIndex.get() > 0.7 && env0_3;
}
@@ -0,0 +1,70 @@
/* Metro module 11114; source: modules/media_keyboard/native/components/MediaKeyboardFooter.tsx; dependencies: [31, 27, 33, 4501, 697, 11104, 4573, 1244, 4578, 11115, 2] */
function _fun85108(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11300:6, offset: 0x01f64330, size: 412 bytes, params: 8, frame: 24
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_3 = value2.View;
const env0_4 = value2.Image;
const env0_5 = value2.ActivityIndicator;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.container = {'padding': null, 'height': 280, 'alignItems': 'center', padding: PX_16};
object2.label = {'textAlign': 'center', 'marginBottom': 16};
const object5 = {};
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object5.marginBottom = PX_32;
const PX_48 = (importDefault(697) /* metro dependency 697: native */).space.PX_48;
object5.height = PX_48;
object2.buttonWrapper = object5;
const object6 = {};
const BACKGROUND_SURFACE_HIGHEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGHEST;
object6.color = BACKGROUND_SURFACE_HIGHEST;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.margin = PX_16;
object2.loadingSpinner = object6;
const env0_8 = Reflect.apply(createStyles, createStylesModule, [object2]);
value = value.memo(_fun85109);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardFooter.tsx');
exports.default = value;
exports.FOOTER_HEIGHT = 280;
}
function _fun85109({disabled, onViewAll}) { // fn#85109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11300:502, offset: 0x01f644cc, size: 417 bytes, params: 2, frame: 27
var r0;
var object2;
var loadingSpinner;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var items2;
var Button;
const styles = useStyles();
const defaultImport = importDefault(11104) /* metro dependency 11104: DeviceMedia */;
const useHasReachedEnd = defaultImport.useHasReachedEnd;
if (Reflect.apply(useHasReachedEnd, defaultImport, [])) {
var viewBindingProps = {style: styles.container};
items2 = [((Text) => <Text variant="text-sm/normal" style={styles.label}>{intl.string(t.mKSwAW)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)];
var viewBindingProps2 = {style: styles.buttonWrapper};
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
items2[1] = <View {...viewBindingProps2}><Button variant="primary" size="sm" onPress={onViewAll} text={intl.string(t.ZT24In)} disabled={disabled} /></View>;
items2[2] = <Image source={importDefault(11115) /* metro dependency 11115 */} />;
r0 = <View {...viewBindingProps}>{items2}</View>;
} else {
object2 = {};
loadingSpinner = styles.loadingSpinner;
object2.style = loadingSpinner;
object2.size = 'large';
loadingSpinner = styles.loadingSpinner;
object2.color = loadingSpinner.color;
r0 = <ActivityIndicator {...object2} />;
}
return r0;
}
@@ -0,0 +1,386 @@
/* Metro module 11108; source: modules/media_keyboard/native/components/MediaKeyboardItem.tsx; dependencies: [31, 27, 4644, 11109, 33, 4017, 4501, 697, 4000, 1305, 11059, 4573, 566, 4658, 11110, 1244, 4690, 4660, 8509, 11111, 4504, 1478, 11112, 6697, 9786, 2] */
function _fun85078(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:6, offset: 0x01f62cd3, size: 1124 bytes, params: 8, frame: 32
var object2;
const env0_0 = require;
const closure = function(a0) {
return 'type' in a0 && ['allphotos', 'attach', 'camera'].includes(a0.type);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.View;
const Pressable = value2.Pressable;
const StyleSheet = value2.StyleSheet;
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
const deviceConstantsModule = require(11109) /* metro dependency 11109: DeviceConstants */;
const env0_7 = deviceConstantsModule.ALAssetsType;
const env0_8 = deviceConstantsModule.DeviceMediaType;
const value4 = require(33) /* metro dependency 33 */;
const env0_9 = value4.jsx;
const env0_10 = value4.jsxs;
const env0_11 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).createAnimatedComponent(Pressable);
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {container: {'flexDirection': 'row', 'paddingHorizontal': 12, 'alignItems': 'center'}};
const MOBILE_KEYBOARD_PANEL_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_KEYBOARD_PANEL_BACKGROUND;
object2.image = {backgroundColor: MOBILE_KEYBOARD_PANEL_BACKGROUND};
const object5 = {'borderRadius': null, 'overflow': 'hidden', 'position': 'relative'};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
object2.imageContainer = object5;
const object6 = {'flexDirection': 'row', 'alignItems': 'center', 'backgroundColor': null, 'borderRadius': null,
'paddingHorizontal': 5, 'paddingVertical': 4, 'position': 'absolute', 'left': 8, 'bottom': 8};
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
let hexWithOpacity = colorUtilsModule.hexWithOpacity;
const PRIMARY_700 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_700;
object6.backgroundColor = Reflect.apply(hexWithOpacity, colorUtilsModule, [PRIMARY_700, 0.6]);
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
object2.labelContainer = object6;
object2.mediaKeyboardItemLabelContainer = {right: 10};
let WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object2.icon = {'width': 12, 'height': 12, 'tintColor': null, 'marginEnd': 4, tintColor: WHITE};
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object2.checkIcon = {'width': 14, 'height': 14, color: BACKGROUND_BRAND};
const object7 = {'width': 24, 'height': 24, 'position': 'absolute', 'justifyContent': 'center',
'alignItems': 'center', 'right': 6, 'top': 6, 'borderRadius': null, 'backgroundColor': null, 'borderWidth': 1};
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object7.backgroundColor = WHITE;
const value8 = colorUtilsModule;
hexWithOpacity = value8.hexWithOpacity;
let BLACK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLACK;
object7.borderColor = Reflect.apply(hexWithOpacity, value8, [BLACK, 0.1]);
object2.checkIconContainer = object7;
const object10 = {};
copyDataProperties(object10, StyleSheet.absoluteFillObject, undefined);
object10['borderRadius'] = (importDefault(697) /* metro dependency 697: native */).radii.xs;
const value9 = colorUtilsModule;
hexWithOpacity = value9.hexWithOpacity;
BLACK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLACK;
object10['backgroundColor'] = Reflect.apply(hexWithOpacity, value9, [BLACK, 0.3]);
object2.selectedOverlay = object10;
object2.specialButton = {'flexDirection': 'column', 'justifyContent': 'center', 'alignItems': 'center', 'gap': 8};
object2.disabled = {opacity: 0.4};
object2.imageDisabled = {opacity: 0.2};
const env0_12 = Reflect.apply(createStyles, createStylesModule, [object2]);
const value11 = createStylesModule;
const createStyleProperties = value11.createStyleProperties;
object2 = {};
const CONTROL_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_BACKGROUND_DEFAULT;
object2.backgroundColor = CONTROL_SECONDARY_BACKGROUND_DEFAULT;
const CONTROL_SECONDARY_BACKGROUND_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_BACKGROUND_ACTIVE;
object2.pressedBackgroundColor = CONTROL_SECONDARY_BACKGROUND_ACTIVE;
const env0_16 = Reflect.apply(createStyleProperties, value11, [object2]);
object2 = {code: 'function MediaKeyboardItemTsx1(){const{withTiming,interpolateColor,pressed,backgroundColor,pressedBackgroundColor,Easing}=this.__closure;return{backgroundColor:withTiming(interpolateColor(pressed.get(),[0,1],[backgroundColor,pressedBackgroundColor]),{duration:200,easing:Easing.out(Easing.quad)})};}'};
value = value.memo(_fun85094);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardItem.tsx');
exports.default = value;
exports.PARENT_PADDING = 24;
exports.CHILD_PADDING = 4;
exports.SEPARATOR_SIZE = 4;
exports.isMediaCameraNode = function(a0) {
return 'type' in a0 && a0.type === 'camera';
};
exports.isAttachFilesNode = function(a0) {
return 'type' in a0 && a0.type === 'attach';
};
exports.isViewAllPhotosNode = function(a0) {
return 'type' in a0 && a0.type === 'allphotos';
};
exports.isSpecialMediaGridNode = closure;
}
function useLayoutStyle(a0, a1, a2) { // fn#85080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:1625, offset: 0x01f6315e, size: 66 bytes, params: 4, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return env0_3.useMemo(_fun85081, [a0, a1, a2]);
}
function NewCaption({label, style, textStyle}) { // fn#85082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:1971, offset: 0x01f632d2, size: 201 bytes, params: 2, frame: 23
const styles = useStyles();
const items2 = [styles.labelContainer, style];
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const icon = <Icon source={importDefault(11059) /* metro dependency 11059 */} style={styles.icon} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View style={items2}>
{icon}
<Text
style={textStyle}
color="always-white"
variant="text-xs/bold"
>
{label}
</Text>
</View>
);
}
function MediaKeyboardImage({draftType, item, index, totalNumItems, numItemsPerRow, size, channelId, onPressItem, onLongPressItem, disabled, includedUploadIds, uploadLimit, disableWhenReachedLimit}) { // fn#85083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:2217, offset: 0x01f6339b, size: 1167 bytes, params: 2, frame: 34
var r8;
var r0;
var r16;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var moduleValue2;
var moduleValue3;
const env0_3 = onPressItem;
const styles = useStyles();
const {image, type} = item.node;
const {upload,
uploadCount} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([UploadAttachmentStore],
_fun85084, [channelId, draftType, image, includedUploadIds]);
const value5 = upload != null;
const {onPress, onLongPress} = env0_3.useMemo(function() {
return {onPress: _fun85087, onLongPress: _fun85088};
}, [channelId, item, value5, onPressItem, onLongPressItem]);
const PHOTO = ALAssetsType.PHOTO;
const r17 = PHOTO === type || DeviceMediaType.IMAGE === type ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SkfkEJ) : ALAssetsType.VIDEO === type ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.FlNoSV) : DeviceMediaType.VIDEO !== type ? undefined : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.FlNoSV);
const VIDEO = ALAssetsType.VIDEO;
if (VIDEO === type) {
moduleValue3 = require(4690) /* metro dependency 4690: TimeUtils */;
r8 = <NewCaption label={moduleValue3.getTimeFormat(image.playableDuration)} />;
} else if (DeviceMediaType.VIDEO === type) {
moduleValue3 = require(4690) /* metro dependency 4690: TimeUtils */;
r8 = <NewCaption label={moduleValue3.getTimeFormat(image.playableDuration)} />;
} else if (ALAssetsType.PHOTO === type) {
moduleValue2 = require(4660) /* metro dependency 4660: UploadUtils */;
if (moduleValue2.getType(image.uri) !== 'image/gif') {
r8 = null;
} else {
const Caption = (require(8509) /* metro dependency 8509: Caption */).Caption;
r8 = <Caption style={styles.mediaKeyboardItemLabelContainer} label="GIF" />;
}
} else if (DeviceMediaType.IMAGE !== type) {
r8 = null;
} else {
moduleValue2 = require(4660) /* metro dependency 4660: UploadUtils */;
if (moduleValue2.getType(image.uri) !== 'image/gif') {
r8 = null;
} else {
const Caption2 = (require(8509) /* metro dependency 8509: Caption */).Caption;
r8 = <Caption2 style={styles.mediaKeyboardItemLabelContainer} label="GIF" />;
}
}
if (value5) {
r16 = !value5;
} else {
r0 = uploadCount >= uploadLimit && disableWhenReachedLimit;
r0 = !r0 ? disabled : r0;
r16 = r0;
}
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const view = <View2 style={styles.checkIconContainer}><Icon source={importDefault(11111) /* metro dependency 11111 */} disableColor={false} color={styles.checkIcon.color} style={styles.checkIcon} /></View2>;
const value15 = useLayoutStyle(index, numItemsPerRow, totalNumItems);
const object = {selected: value5};
const items2 = [styles.imageContainer];
items2[1] = r16 ? styles.imageDisabled : undefined;
items2[2] = value15;
const ThumbnailImage = (require(1305) /* metro dependency 1305: native */).ThumbnailImage;
const items4 = [<ThumbnailImage resizeMode="cover" resizeMethod="resize" style={[styles.image, {height: size,
width: size}]} source={{uri: image.uri, width: size, height: size,
cache: 'force-cache'}} localImageSource={{uri: image.uri, width: size, height: size}} />, r8];
items4[2] = value5 ? <View style={[styles.selectedOverlay, {height: size, width: size}]} /> : null;
items4[3] = value5 ? view : null;
return (
<Pressable
accessibilityRole="button"
accessibilityLabel={r17}
accessibilityState={object}
onPress={onPress}
onLongPress={onLongPress}
disabled={r16}
style={items2}
>
{items4}
</Pressable>
);
}
function MediaKeyboardDummy({size, isFirstInRow}) { // fn#85089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:4051, offset: 0x01f639aa, size: 138 bytes, params: 2, frame: 20
const styles = useStyles();
return (
<View style={[styles.imageContainer, !isFirstInRow && ({marginLeft: 4})]}>
<View style={[styles.image, {height: size, width: size}]} />
</View>
);
}
function MediaKeyboardSpecialButton({size, onPress, disabled, accessibilityLabel, children, index, totalNumItems, numItemsPerRow}) { // fn#85090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:4716, offset: 0x01f63a34, size: 401 bytes, params: 2, frame: 33
const styles = useStyles();
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const {backgroundColor, pressedBackgroundColor} = env0_16();
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = MediaKeyboardSpecialButtonH;
let object2 = {};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.interpolateColor = reanimatedRexportModule.interpolateColor;
object2.pressed = value3;
object2.backgroundColor = backgroundColor;
object2.pressedBackgroundColor = pressedBackgroundColor;
const Easing = reanimatedRexportModule.Easing;
object2.Easing = Easing;
closure.__closure = object2;
closure.__workletHash = 15924448581794;
closure.__initData = env0_17;
const value5 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value6 = useLayoutStyle(index, numItemsPerRow, totalNumItems);
const binding = env0_11;
object2 = {disabled: disabled, accessibilityRole: 'button', accessibilityLabel: accessibilityLabel,
onPressIn: onPressIn_85092, onPressOut: onPressOut_85093, onPress: onPress};
disabled = disabled ? styles.disabled : undefined;
object2.style = [value5, styles.imageContainer, styles.specialButton, {width: size, height: size}, value6, disabled];
return ((Component) => <Component {...object2}>{children}</Component>)(binding);
}
function _fun85094({items, channel, draftType, onPressItem, onLongPressItem, rowIndex, totalNumItems, numPerRow, includedUploadIds, uploadLimit, disableWhenReachedLimit, handleCameraPress, handleAttachPress, handleViewAllPhotosPress, disabled}) { // fn#85094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:5586, offset: 0x01f63c75, size: 445 bytes, params: 2, frame: 24
const styles = useStyles();
const env0_11 = ((importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)().width - (24 + 4 * (numPerRow - 1))) / numPerRow;
const object5 = {};
const object6 = {};
object6.text = (require(1244) /* metro dependency 1244: indexNative */).t.uje3P9;
object6.onPress = handleCameraPress;
const CameraIcon = (require(11112) /* metro dependency 11112: CameraIcon */).CameraIcon;
object6.Icon = CameraIcon;
object5.camera = object6;
const object7 = {};
const Zmm6dN = (require(1244) /* metro dependency 1244: indexNative */).t.Zmm6dN;
object7.text = Zmm6dN;
object7.onPress = handleViewAllPhotosPress;
const ImageIcon = (require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon;
object7.Icon = ImageIcon;
object5.allphotos = object7;
const object8 = {};
object8.text = (require(1244) /* metro dependency 1244: indexNative */).t['8Hvr3+'];
object8.onPress = handleAttachPress;
const AttachmentIcon = (require(9786) /* metro dependency 9786: AttachmentIcon */).AttachmentIcon;
object8.Icon = AttachmentIcon;
object5.attach = object8;
return (
<View style={styles.container}>
{items.map(_fun85095)}
</View>
);
}
function _fun85081() { // fn#85081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:1674, offset: 0x01f631a0, size: 306 bytes, params: 1, frame: 18
const value2 = 0;
const r5 = value2 === importDefault ? value2 : global.Math.floor((importDefault - 1) / require);
const Math = global.Math;
const floor = Math.floor;
const binding = env0_0;
const value5 = Reflect.apply(floor, Math, [binding / require]);
const value6 = 4;
return {borderTopLeftRadius: value2 !== binding ? value6 : 16,
borderTopRightRadius: (importDefault >= require ? env0_0 === require - 1 : env0_0 === importDefault - 1) ? 16 : value6,
borderBottomLeftRadius: value5 !== r5 || env0_0 % require != value2 ? value6 : 16,
borderBottomRightRadius: env0_0 === importDefault - 1 ? 16 : importDefault % require == value2 || env0_0 !== (r5 - 1) * require + require - 1 ? value6 : 16,
marginLeft: env0_0 % require != value2 ? value6 : value2};
}
function _fun85084() { // fn#85084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:2486, offset: 0x01f6382a, size: 106 bytes, params: 1, frame: 18
var environment;
const value = environment.__proto__;
return {upload: UploadAttachmentStore.findUpload(channelId, draftType, _fun85085),
uploadCount: includedUploadIds?.length ?? UploadAttachmentStore.getUploadCount(channelId, draftType)};
}
function _fun85086() { // fn#85086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:2732, offset: 0x01f638eb, size: 29 bytes, params: 1, frame: 3
return {onPress: onPress_85087, onLongPress: onLongPress_85088};
}
function MediaKeyboardSpecialButtonH() { // fn#85091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:4947, owner: MediaKeyboardSpecialButton.h, offset: 0x01f63bc5, size: 176 bytes, params: 1, frame: 23
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const value4 = reanimatedRexportModule.interpolateColor(env0_0.get(), [0, 1], [backgroundColor,
pressedBackgroundColor]);
const Easing = reanimatedRexportModule.Easing;
const out = Easing.out;
const Easing2 = reanimatedRexportModule.Easing;
return {backgroundColor: Reflect.apply(withTiming, value, [value4, {duration: 200, easing: Reflect.apply(out,
Easing, [Easing2.quad])}])};
}
function _fun85095(a0, a1) { // fn#85095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:6107, offset: 0x01f63e32, size: 415 bytes, params: 3, frame: 22
var value;
var rowIndexBinding;
var numPerRowBinding;
var property;
var intl;
if (a0 == null) {
value = environment.__proto__;
return (
<MediaKeyboardDummy
size={env0_11}
isFirstInRow={a1 === 0}
key={a1}
/>
);
}
if (isSpecialMediaGridNode(a0)) {
property = env0_12[a0.type];
var mediaKeyboardSpecialButtonBindingProps = {size: env0_11, onPress: property.onPress, disabled: disabled};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
mediaKeyboardSpecialButtonBindingProps.accessibilityLabel = intl.string(property.text);
rowIndexBinding = rowIndex;
numPerRowBinding = numPerRow;
mediaKeyboardSpecialButtonBindingProps.index = rowIndexBinding * numPerRowBinding + a1;
mediaKeyboardSpecialButtonBindingProps.totalNumItems = totalNumItems;
mediaKeyboardSpecialButtonBindingProps.numItemsPerRow = numPerRowBinding;
return (
<MediaKeyboardSpecialButton {...mediaKeyboardSpecialButtonBindingProps} key={a1}>
<property.Icon color={(importDefault(697) /* metro dependency 697: native */).colors.ICON_SUBTLE} size="lg" />
</MediaKeyboardSpecialButton>
);
}
const id = channel.id;
const draftTypeBinding = draftType;
rowIndexBinding = rowIndex;
numPerRowBinding = numPerRow;
return (
<MediaKeyboardImage
channelId={id}
draftType={draftTypeBinding}
index={rowIndexBinding * numPerRowBinding + a1}
totalNumItems={totalNumItems}
numItemsPerRow={numPerRowBinding}
item={a0}
includedUploadIds={includedUploadIds}
uploadLimit={uploadLimit}
disableWhenReachedLimit={disableWhenReachedLimit}
size={env0_11}
onPressItem={onPressItem}
onLongPressItem={onLongPressItem}
disabled={disabled}
key={a1}
/>
);
}
function _fun85085(a0) { // fn#85085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:2529, offset: 0x01f63894, size: 87 bytes, params: 2, frame: 14
let value = environment.__proto__.__proto__;
value = Reflect.apply((require(4658) /* metro dependency 4658: UploadUtils */).doesImageMatchUpload, value, [image,
a0]);
return value && (includedUploadIds == null || includedUploadIds.includes(a0.id));
}
function onPress_85087() { // fn#85087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:2746, offset: 0x01f63908, size: 76 bytes, params: 1, frame: 13
let value = environment.__proto__.__proto__;
(importDefault(11110) /* metro dependency 11110: NativeMenuActionCreators */).hideNativeMenu();
value = environment.__proto__;
onPressItem({channelId: channelId, item: item, isIncluded: result});
}
function onLongPress_85088() { // fn#85088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11294:2828, offset: 0x01f63954, size: 86 bytes, params: 1, frame: 13
let value = environment.__proto__.__proto__;
(importDefault(11110) /* metro dependency 11110: NativeMenuActionCreators */).hideNativeMenu();
value = environment.__proto__;
if (onLongPressItem != null) {
onLongPressItem({channelId: channelId, item: item, isIncluded: result});
}
}
@@ -0,0 +1,49 @@
/* Metro module 11116; source: modules/media_keyboard/native/components/MediaKeyboardLimitedPickerNotice.tsx; dependencies: [31, 27, 33, 4501, 4573, 1244, 4578, 2] */
function _fun85111(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11302:6, offset: 0x01f646b3, size: 251 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const value = require(33) /* metro dependency 33 */;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
const env0_6 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({container: {'flexDirection': 'row',
'paddingHorizontal': 16, 'paddingVertical': 16, 'alignItems': 'center'},
absoluteContainer: {position: 'absolute'}, text: {flex: 1}, button: {marginLeft: 16}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardLimitedPickerNotice.tsx');
exports.default = MediaKeyboardLimitedPickerNotice;
}
function MediaKeyboardLimitedPickerNotice({onPress, onHeightChange}) { // fn#85112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11302:467, offset: 0x01f647ae, size: 362 bytes, params: 2, frame: 25
const styles = useStyles();
const value3 = env0_2.useCallback(function(a0) {
if (onHeightChange != null) {
onHeightChange(a0.nativeEvent.layout.height);
}
}, [onHeightChange]);
const items2 = [styles.container];
items2[1] = onHeightChange != null ? styles.absoluteContainer : undefined;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const text = <Text style={styles.text} variant="text-sm/normal">{Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t['5g7NcN']])}</Text>;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
string = intl.string;
const JuXTi6 = (require(1244) /* metro dependency 1244: indexNative */).t.JuXTi6;
return (
<View style={items2} onLayout={value3}>
{text}
<View style={styles.button}>
<Button
size="sm"
variant="tertiary"
text={Reflect.apply(string, intl, [JuXTi6])}
onPress={onPress}
/>
</View>
</View>
);
}
@@ -0,0 +1,336 @@
/* Metro module 11103; source: modules/media_keyboard/native/components/MediaKeyboardList.tsx; dependencies: [57, 31, 27, 1479, 1580, 6276, 4661, 33, 4501, 697, 4017, 11104, 11107, 1481, 1585, 1478, 5314, 6277, 7739, 4674, 22, 11108, 11114, 11116, 11117, 4670, 8140, 1244, 2] */
function _fun85031(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:6, offset: 0x01f611a5, size: 450 bytes, params: 8, frame: 22
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 {NativeEventEmitter, NativeModules} = require(27) /* metro dependency 27 */;
const dimensionsStoreAndroid = importDefault(1479) /* metro dependency 1479: DimensionsStoreAndroid */;
const env0_7 = (require(1580) /* metro dependency 1580: MediaKeyboardConstants */).InAppCameraUsedCameraPreviewTypes;
const env0_8 = (require(6276) /* metro dependency 6276: ActionSheetConstants */).ACTION_SHEET_START_HEIGHT_RATIO;
const env0_9 = (require(4661) /* metro dependency 4661: NativePermissionConstants */).NativePermissionStatus;
const env0_10 = (require(33) /* metro dependency 33 */).jsx;
const PhotoLibraryHelper = NativeModules.PhotoLibraryHelper;
const nativeEventEmitter = new NativeEventEmitter(PhotoLibraryHelper);
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const MOBILE_KEYBOARD_PANEL_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_KEYBOARD_PANEL_BACKGROUND;
const env0_12 = Reflect.apply(createStyles, createStylesModule, [{listContainer: {'backgroundColor': null,
'marginTop': 8, 'paddingTop': 8, backgroundColor: MOBILE_KEYBOARD_PANEL_BACKGROUND}}]);
object = {code: 'function MediaKeyboardListTsx1(){const{animatedIndex}=this.__closure;return animatedIndex.get();}'};
object = {code: 'function MediaKeyboardListTsx2(currentIndex){const{latch,runOnJS,setIsExpanded}=this.__closure;if(currentIndex>0.1&&!latch.get()){latch.set(true);runOnJS(setIsExpanded)(true);}}'};
object = {code: 'function MediaKeyboardListTsx3(){const{animatedSnapPoints}=this.__closure;return animatedSnapPoints.get();}'};
object = {code: 'function MediaKeyboardListTsx4(snapPoints,previous){const{cheapWorkletArrayShallowEqual,runOnJS,setBottomSheetState,windowHeight,computedStartHeight,maxDynamicContentSize}=this.__closure;var _snapPoints$,_snapPoints;if(cheapWorkletArrayShallowEqual(snapPoints,previous!==null&&previous!==void 0?previous:undefined))return;runOnJS(setBottomSheetState)({minimum:windowHeight-((_snapPoints$=snapPoints[0])!==null&&_snapPoints$!==void 0?_snapPoints$:computedStartHeight),maximum:windowHeight-((_snapPoints=snapPoints[snapPoints.length-1])!==null&&_snapPoints!==void 0?_snapPoints:maxDynamicContentSize)});}'};
value = value.memo(MediaKeyboardList);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/MediaKeyboardList.tsx');
exports.default = value;
}
function MediaKeyboardList({channel, draftType, onPressCamera, onAttachPress, onPressItem, onLongPressItem, onViewAll, onManageLimited, includedUploadIds, extensions, allowCamera, uploadDisabled, uploadLimit, disableWhenReachedLimit}) { // fn#85032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:1526, offset: 0x01f61367, size: 1757 bytes, params: 2, frame: 53
var object2;
var r0;
var FastList;
var intl;
const env0_3 = onAttachPress;
const env0_4 = onPressItem;
let value = undefined;
allowCamera = allowCamera === value || allowCamera;
uploadDisabled = !(uploadDisabled === value) && uploadDisabled;
let binding = env0_4;
const value6 = binding.useCallback(_fun85033, [binding.useRef(true)]);
let useState = binding.useState;
const value7 = Reflect.apply(useState, binding, [null]);
const binding2 = env0_3;
const value8 = binding2(value7, 2);
const property = value8[0];
const env0_15 = value8[1];
const value11 = (importDefault(11104) /* metro dependency 11104: DeviceMedia */).useAssets();
const env0_16 = value11;
const {itemsPerRow,
itemsPageSizeRef} = (require(11107) /* metro dependency 11107: useMediaKeyboardItemsPerRow */).useMediaKeyboardItemsPerRow();
let closure = _fun85034;
binding.useEffect(closure, []);
binding.useEffect(_fun85036, [property, itemsPageSizeRef, extensions]);
const env0_19 = (require(1481) /* metro dependency 1481: AppEntryKeyContext */).useAppEntryKey();
const top = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().top;
const height = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: true}).height;
const value13 = height * ACTION_SHEET_START_HEIGHT_RATIO;
const NAV_BAR_HEIGHT_MULTILINE = (require(5314) /* metro dependency 5314: NavigatorConstantsNative */).NAV_BAR_HEIGHT_MULTILINE;
const value14 = height - NAV_BAR_HEIGHT_MULTILINE - top;
const {animatedSnapPoints, animatedIndex} = (require(6277) /* metro dependency 6277 */).useBottomSheetInternal();
useState = binding.useState;
const value16 = binding2(Reflect.apply(useState, binding, [{minimum: value13, maximum: value14}]), 2);
const {minimum, maximum} = value16[0];
const property3 = value16[1];
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
closure = function() {
return animatedSnapPoints.get();
};
closure.__closure = {animatedSnapPoints: animatedSnapPoints};
closure.__workletHash = 7279123713809;
closure.__initData = env0_15;
const closure2 = MediaKeyboardListG;
closure2.__closure = {cheapWorkletArrayShallowEqual: (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletArrayShallowEqual,
runOnJS: reanimatedRexportModule.runOnJS, setBottomSheetState: property3, windowHeight: height,
computedStartHeight: value13, maxDynamicContentSize: value14};
closure2.__workletHash = 4619753074319;
closure2.__initData = env0_16;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
const value17 = useHasMediaKeyboardBottomSheetExpanded(animatedIndex);
const styles = useStyles();
const r23 = allowCamera && (require(4674) /* metro dependency 4674: ImagePickerUtils */).isImageCaptureIntentSupported();
const value18 = ((value11 == null ? value : value11.edges.length) ?? 0) + (r23 ? 1 : 0);
binding = env0_4;
const value19 = binding.useMemo(_fun85044, [value11, itemsPerRow, r23]);
const value20 = binding.useCallback(function() {
onPressCamera(InAppCameraUsedCameraPreviewTypes.CAMERA_BUTTON);
}, [onPressCamera]);
const value21 = binding.useCallback(_fun85046, [itemsPageSizeRef, extensions]);
const value22 = binding.useCallback(_fun85047, [channel, draftType, value20, onViewAll, onAttachPress, itemsPerRow,
onPressItem, onLongPressItem, value19, includedUploadIds, uploadDisabled, uploadLimit, disableWhenReachedLimit,
value18]);
const value23 = binding.useMemo(_fun85049,
[(importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)().width, itemsPerRow]);
const value24 = binding.useCallback(_fun85050, [onViewAll, uploadDisabled]);
const r5 = value17 ? maximum : minimum;
binding = env0_4;
const value25 = binding.useMemo(_fun85051, [r5]);
const LIMITED = NativePermissionStatus.LIMITED;
const value26 = property === LIMITED;
const [property4, env0_31] = env0_3(binding.useState(_fun85052), 2);
const value29 = binding.useCallback(_fun85053, [onManageLimited]);
const mediaKeyboardEmptyStateModule = require(11117) /* metro dependency 11117: MediaKeyboardEmptyState */;
const getMediaEmptyStateComponentOrNull = mediaKeyboardEmptyStateModule.getMediaEmptyStateComponentOrNull;
object2 = {photoPermissionStatus: property};
object2.photosEmpty = value11 != null && value11.edges.length === 0;
object2.showCameraButton = r23;
object2.onPressCamera = function() {
return onPressCamera(InAppCameraUsedCameraPreviewTypes.TAKE_A_PHOTO_BUTTON);
};
object2.onManageLimited = onManageLimited;
object2.onPressPrivacySettings = importDefault(4670) /* metro dependency 4670: openPrivacySettingsNative */;
const value32 = Reflect.apply(getMediaEmptyStateComponentOrNull, mediaKeyboardEmptyStateModule, [object2]);
if (value32 != null) {
r0 = value32;
} else {
FastList = importDefault(8140) /* metro dependency 8140: FastList */;
var fastListProps = {renderHeader: value26 ? value29 : value, headerSize: value26 ? property4 : 0,
style: [value25,
styles.listContainer], renderItem: value22, sections: [value19.length], itemSize: value23,
inActionSheet: true,
preserveScrollMomentum: true, automaticallyAdjustsScrollIndicatorInsets: false, keyboardDismissMode: 'none',
onEndReached: value21, onScroll: value6, endReachedThreshold: 400, accessibilityRole: 'list'};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
fastListProps.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.XONG6A);
fastListProps.showsVerticalScrollIndicator = false;
fastListProps.footerSize = (require(11114) /* metro dependency 11114: MediaKeyboardFooter */).FOOTER_HEIGHT;
fastListProps.renderFooter = value24;
fastListProps.chunkBase = r5;
fastListProps.batchesToRender = value17 ? value : (require(8140) /* metro dependency 8140: FastList */).MINIMUM_BATCHES_TO_RENDER;
value = <FastList {...fastListProps} />;
r0 = value;
}
return r0;
}
function _fun85033({nativeEvent}) { // fn#85033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:1820, offset: 0x01f61a44, size: 44 bytes, params: 2, frame: 3
env0_13.current = nativeEvent.contentOffset.y < 100;
}
function _fun85034() { // fn#85034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:2032, offset: 0x01f61a70, size: 46 bytes, params: 1, frame: 11
var environment;
const value = environment.__proto__;
const NativePermissionManager = NativeModules.NativePermissionManager;
NativePermissionManager.requestPhotoAuthorization().then(_fun85035);
}
function _fun85036() { // fn#85036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:2128, offset: 0x01f61a9e, size: 161 bytes, params: 1, frame: 17
var value;
let binding = env0_14;
const AUTHORIZED = NativePermissionStatus.AUTHORIZED;
if (binding === AUTHORIZED) {
(importDefault(11104) /* metro dependency 11104: DeviceMedia */).refreshAssets({batchSize: itemsPageSizeRef.current,
extensions: extensions});
if (env1_11 != null) {
value = env1_11.addListener('photoLibraryChanged', _fun85037);
}
return _fun85038;
}
binding = env0_14;
const LIMITED = NativePermissionStatus.LIMITED;
if (binding === LIMITED) {
(importDefault(11104) /* metro dependency 11104: DeviceMedia */).refreshAssets({batchSize: itemsPageSizeRef.current,
extensions: extensions});
if (env1_11 != null) {
value = env1_11.addListener('photoLibraryChanged', _fun85037);
}
return _fun85038;
}
}
function MediaKeyboardListG(a0, a1) { // fn#85040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:2852, owner: MediaKeyboardList.G, offset: 0x01f61ba1, size: 170 bytes, params: 3, frame: 18
var r3;
var object2;
var heightBinding;
var property;
let value = a1;
const value3 = undefined;
const cheapWorkletShallowEqualModule = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
if (!cheapWorkletShallowEqualModule.cheapWorkletArrayShallowEqual(a0, value ?? value3)) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env0_24);
object2 = {};
heightBinding = height;
property = a0[0];
r3 = property ?? env0_21;
object2.minimum = heightBinding - r3;
heightBinding = height;
property = a0[a0.length - 1];
r3 = property ?? env0_22;
object2.maximum = heightBinding - r3;
value(object2);
}
return value3;
}
function useHasMediaKeyboardBottomSheetExpanded(a0) { // fn#85041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:3277, owner: MediaKeyboardList.useHasMediaKeyboardBottomSheetExpanded, offset: 0x01f61c4b, size: 237 bytes, params: 2, frame: 23
var object2;
const env0_0 = a0;
const [property, property2] = env1_3(env1_4.useState(false), 2);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
const closure = useHasMediaKeyboardBottomSheetExpandedS;
closure.__closure = {animatedIndex: a0};
closure.__workletHash = 8982138292467;
closure.__initData = env1_13;
const closure2 = useHasMediaKeyboardBottomSheetExpandedI;
object2 = {latch: value4};
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.setIsExpanded = property2;
closure2.__closure = object2;
closure2.__workletHash = 7990574449734;
closure2.__initData = env1_14;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
return property;
}
function _fun85044() { // fn#85044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:3847, offset: 0x01f61da5, size: 257 bytes, params: 1, frame: 18
var items;
var itemsPerRowBinding;
var value4;
var Array;
var value6;
var value7;
var defaultImport2;
const r1 = env0_25 ? [{type: 'camera'}] : [];
if (env0_16 == null) {
items = [];
value4 = arraySpread(items, r1, 0, undefined);
Array = global.Array;
itemsPerRowBinding = itemsPerRow;
value6 = Array(3 * itemsPerRowBinding - r1.length);
arraySpread(items, value6.fill(null), value4, itemsPerRowBinding);
value7 = environment.__proto__;
defaultImport2 = importDefault(22) /* metro dependency 22 */;
return defaultImport2.chunk(items, itemsPerRow);
}
const r3 = env0_16?.edges ?? [];
items = [];
arraySpread(items, r3, arraySpread(items, r1, 0, undefined), undefined);
const defaultImport = importDefault(22) /* metro dependency 22 */;
return defaultImport.chunk(items, itemsPerRow);
}
function _fun85046() { // fn#85046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:4136, offset: 0x01f61ec3, size: 66 bytes, params: 1, frame: 14
const value = environment.__proto__;
(importDefault(11104) /* metro dependency 11104: DeviceMedia */).getNextAssetPage({batchSize: itemsPageSizeRef.current,
extensions: extensions});
}
function _fun85047(a0, a1) { // fn#85047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:4231, offset: 0x01f61f05, size: 217 bytes, params: 3, frame: 18
var environment;
let value = environment.__proto__;
value = importDefault(11108) /* metro dependency 11108: MediaKeyboardItem */;
const property = env0_27[a1];
return ((Component) => <Component draftType={draftType} rowIndex={a1} totalNumItems={env0_26} channel={channel} numPerRow={itemsPerRow} items={env0_27[a1]} onPressItem={onPressItem} onLongPressItem={onLongPressItem} includedUploadIds={includedUploadIds} uploadLimit={uploadLimit} disableWhenReachedLimit={disableWhenReachedLimit} handleCameraPress={env0_28} handleAttachPress={onAttachPress} handleViewAllPhotosPress={onViewAll} disabled={uploadDisabled} key={property.reduce(_fun85048,
a1.toString())} />)(value);
}
function _fun85049() { // fn#85049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:4804, offset: 0x01f620e5, size: 105 bytes, params: 1, frame: 18
const widthBinding = width;
const PARENT_PADDING = (require(11108) /* metro dependency 11108: MediaKeyboardItem */).PARENT_PADDING;
const CHILD_PADDING = (require(11108) /* metro dependency 11108: MediaKeyboardItem */).CHILD_PADDING;
const value = (widthBinding - (PARENT_PADDING + CHILD_PADDING * (itemsPerRow - 1))) / itemsPerRow;
const SEPARATOR_SIZE = (require(11108) /* metro dependency 11108: MediaKeyboardItem */).SEPARATOR_SIZE;
return value + SEPARATOR_SIZE;
}
function _fun85050() { // fn#85050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:4921, offset: 0x01f6214e, size: 59 bytes, params: 1, frame: 15
const value = environment.__proto__;
return ((Component) => <Component disabled={uploadDisabled} onViewAll={onViewAll} />)(importDefault(11114) /* metro dependency 11114: MediaKeyboardFooter */);
}
function _fun85051() { // fn#85051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:4997, offset: 0x01f62189, size: 15 bytes, params: 1, frame: 2
return {height: env0_30};
}
function _fun85052() { // fn#85052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:5054, offset: 0x01f62198, size: 56 bytes, params: 1, frame: 9
const getState = DimensionsStoreAndroid.getState;
return 32 + 36 * Reflect.apply(getState, DimensionsStoreAndroid, []).byAppEntry[env0_19].fontScale;
}
function _fun85053() { // fn#85053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:5168, offset: 0x01f621d0, size: 59 bytes, params: 1, frame: 15
const value = environment.__proto__;
return ((Component) => <Component onPress={onManageLimited} onHeightChange={env0_31} />)(importDefault(11116) /* metro dependency 11116: MediaKeyboardLimitedPickerNotice */);
}
function _fun85037() { // fn#85037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:2287, offset: 0x01f61b3f, size: 80 bytes, params: 1, frame: 13
var value2;
if (env1_13.current) {
value2 = environment.__proto__.__proto__;
(importDefault(11104) /* metro dependency 11104: DeviceMedia */).refreshAssets({batchSize: itemsPageSizeRef.current,
extensions: extensions});
}
}
function useHasMediaKeyboardBottomSheetExpandedI(a0) { // fn#85043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:3539, owner: MediaKeyboardList.useHasMediaKeyboardBottomSheetExpanded.i, offset: 0x01f61d38, size: 109 bytes, params: 2, frame: 13
var value2;
var moduleValue;
if (a0 > 0.1 && !env0_2.get()) {
env0_2.set(true);
value2 = environment.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS(env0_1)(true);
}
}
function _fun85048(a0, a1) { // fn#85048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11289:4528, offset: 0x01f61fde, size: 263 bytes, params: 3, frame: 18
var r1;
var r0;
var value2;
var moduleValue;
var moduleValue2;
let value = a0;
if (a1 == null) {
r0 = value;
} else {
value2 = environment.__proto__.__proto__;
moduleValue = require(11108) /* metro dependency 11108: MediaKeyboardItem */;
if (moduleValue.isMediaCameraNode(a1)) {
value = '' + value + '-camera';
r1 = value;
} else {
moduleValue2 = require(11108) /* metro dependency 11108: MediaKeyboardItem */;
r1 = moduleValue2.isAttachFilesNode(a1) ? '' + value + '-attach' : (require(11108) /* metro dependency 11108: MediaKeyboardItem */).isViewAllPhotosNode(a1) ? '' + value + '-view-all' : '' + value + '-' + a1.node.image.uri;
}
r0 = r1;
}
return r0;
}
@@ -0,0 +1,70 @@
/* Metro module 15147; source: modules/media_keyboard/native/components/useMediaKeyboardConfig.tsx; dependencies: [31, 1580, 661, 7149, 15148, 6860, 8448, 11095, 2] */
function _fun115517(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15344:6, offset: 0x0246348b, size: 175 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(1580) /* metro dependency 1580: MediaKeyboardConstants */).MediaKeyboardTarget;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_5 = constantsModule.ChannelTypesSets;
const env0_6 = constantsModule.MAX_UPLOAD_COUNT;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/components/useMediaKeyboardConfig.tsx');
exports.default = useMediaKeyboardConfig;
}
function useMediaKeyboardConfig({channel, context}) { // fn#115518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15344:299, offset: 0x0246353a, size: 357 bytes, params: 2, frame: 21
const target = context.target;
const COMMAND = MediaKeyboardTarget.COMMAND;
const value2 = target === COMMAND;
const r8 = (require(7149) /* metro dependency 7149: PollsUtils */).useCanPostPollsInChannel(channel) && !value2;
const value5 = (importDefault(15148) /* metro dependency 15148: useUploadDisabled */)(channel);
const r5 = (require(6860) /* metro dependency 6860: ThreadHooks */).useCanStartThread(channel) && !ChannelTypesSets.GUILD_THREADS_ONLY.has(channel.type) && !channel.isThread() && !value2;
return r5.useMemo(_fun115519, [context, r8, value5,
(require(11095) /* metro dependency 11095: MediaKeyboardUtils */).getMediaKeyboardDraftType(context.target), r5,
(require(8448) /* metro dependency 8448: ActivitiesInTextUtils */).useIsAppLauncherEnabled(channel.id) && !value2]);
}
function _fun115519() { // fn#115519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15344:629, offset: 0x0246369f, size: 308 bytes, params: 1, frame: 15
var object2;
var value3;
var Error;
var value;
const target = context.target;
let CHAT = MediaKeyboardTarget.CHAT;
if (target === CHAT) {
object2 = {};
CHAT = MediaKeyboardTarget.CHAT;
value3 = undefined;
object2.title = target === CHAT ? value3 : context.option.displayName;
CHAT = MediaKeyboardTarget.CHAT;
object2.subtitle = target === CHAT ? value3 : context.option.displayDescription;
CHAT = MediaKeyboardTarget.CHAT;
object2.uploadLimit = target !== CHAT ? 1 : MAX_UPLOAD_COUNT;
} else {
var COMMAND = MediaKeyboardTarget.COMMAND;
if (target !== COMMAND) {
Error = global.Error;
value = 'MediaKeyboard does not support context target ' + target;
throw new Error();
}
object2 = {};
CHAT = MediaKeyboardTarget.CHAT;
value3 = undefined;
object2.title = target === CHAT ? value3 : context.option.displayName;
CHAT = MediaKeyboardTarget.CHAT;
object2.subtitle = target === CHAT ? value3 : context.option.displayDescription;
CHAT = MediaKeyboardTarget.CHAT;
object2.uploadLimit = target !== CHAT ? 1 : MAX_UPLOAD_COUNT;
}
CHAT = MediaKeyboardTarget.CHAT;
object2.disableWhenReachedLimit = target === CHAT;
CHAT = MediaKeyboardTarget.CHAT;
object2.includedUploadIds = target === CHAT ? value3 : [context.option.name];
object2.canPostPolls = env0_1;
object2.canStartThreads = env0_3;
object2.isAppLauncherEnabled = env0_4;
object2.uploadDisabled = env0_2;
object2.draftType = env0_5;
return object2;
}
@@ -0,0 +1,31 @@
/* Metro module 11096; source: modules/media_keyboard/native/showMediaKeyboardActionSheet.tsx; dependencies: [27, 4080, 11097, 1962, 2] */
function _fun85002(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11282:6, offset: 0x01f5fe18, size: 150 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(27) /* metro dependency 27 */).NativeModules;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/showMediaKeyboardActionSheet.tsx');
exports.hideMediaKeyboardActionSheet = hideMediaKeyboardActionSheet;
exports.showMediaKeyboardActionSheet = showMediaKeyboardActionSheet;
exports.presentLimitedLibraryPicker = presentLimitedLibraryPicker;
}
function hideMediaKeyboardActionSheet() { // fn#85003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11282:279, offset: 0x01f5feae, size: 44 bytes, params: 1, frame: 12
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet('MEDIA_KEYBOARD_ACTION_SHEET');
}
function showMediaKeyboardActionSheet(a0) { // fn#85004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11282:378, offset: 0x01f5feda, size: 83 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[1]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[3]);
value = value(dependencyMap[2], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'MEDIA_KEYBOARD_ACTION_SHEET', a0]);
}
function presentLimitedLibraryPicker() { // fn#85005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11282:494, offset: 0x01f5ff2d, size: 72 bytes, params: 1, frame: 12
const NativePermissionManager = NativeModules.NativePermissionManager;
let r0 = NativePermissionManager == null || NativePermissionManager.presentLimitedLibraryPicker == null ? undefined : NativePermissionManager.presentLimitedLibraryPicker();
r0 = r0 ?? global.Promise.resolve();
return r0;
}
@@ -0,0 +1,69 @@
/* Metro module 11107; source: modules/media_keyboard/native/useMediaKeyboardItemsPerRow.tsx; dependencies: [31, 4011, 2] */
function _fun85075(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11293:6, offset: 0x01f62b0d, size: 121 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/useMediaKeyboardItemsPerRow.tsx');
exports.useMediaKeyboardItemsPerRow = useMediaKeyboardItemsPerRow;
}
function useMediaKeyboardItemsPerRow() { // fn#85076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11293:231, offset: 0x01f62b86, size: 305 bytes, params: 1, frame: 17
var r3;
var binding;
var useRef;
var value8;
var value;
const value2 = (importDefault(4011) /* metro dependency 4011: useWindowSizeClassifier */)();
const WindowSizeClassifier = (require(4011) /* metro dependency 4011: useWindowSizeClassifier */).WindowSizeClassifier;
const XLARGE = WindowSizeClassifier.XLARGE;
if (XLARGE === value2) {
r3 = 8;
binding = env0_3;
useRef = binding.useRef;
value = 17 * r3;
value8 = Reflect.apply(useRef, binding, [value]);
binding.useEffect(_fun85077, [r3]);
return {itemsPerRow: r3, itemsPageSize: value, itemsPageSizeRef: value8};
}
const LARGE = WindowSizeClassifier.LARGE;
if (LARGE === value2) {
r3 = 6;
binding = env0_3;
useRef = binding.useRef;
value = 17 * r3;
value8 = Reflect.apply(useRef, binding, [value]);
binding.useEffect(_fun85077, [r3]);
return {itemsPerRow: r3, itemsPageSize: value, itemsPageSizeRef: value8};
}
const NORMAL = WindowSizeClassifier.NORMAL;
if (NORMAL === value2) {
r3 = 4;
binding = env0_3;
useRef = binding.useRef;
value = 17 * r3;
value8 = Reflect.apply(useRef, binding, [value]);
binding.useEffect(_fun85077, [r3]);
return {itemsPerRow: r3, itemsPageSize: value, itemsPageSizeRef: value8};
}
const SMALL = WindowSizeClassifier.SMALL;
if (SMALL === value2) {
r3 = 3;
binding = env0_3;
useRef = binding.useRef;
value = 17 * r3;
value8 = Reflect.apply(useRef, binding, [value]);
binding.useEffect(_fun85077, [r3]);
return {itemsPerRow: r3, itemsPageSize: value, itemsPageSizeRef: value8};
}
const Error = global.Error;
value = 'Unknown window size classifier: ' + value2;
const value7 = Object.create(Error.prototype, {constructor: {value: Error}});
const error = new Error();
throw error instanceof Object ? error : value7;
}
function _fun85077() { // fn#85077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11293:634, offset: 0x01f62cb7, size: 28 bytes, params: 1, frame: 3
env0_1.current = 17 * env0_0;
}
@@ -0,0 +1,34 @@
/* Metro module 15148; source: modules/media_keyboard/native/useUploadDisabled.tsx; dependencies: [4645, 3784, 4644, 661, 566, 5225, 2] */
function _fun115520(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15345:6, offset: 0x024637d3, size: 184 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_5 = constantsModule.MAX_UPLOAD_COUNT;
const env0_6 = constantsModule.Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_keyboard/native/useUploadDisabled.tsx');
exports.default = function(a0) {
var env0_0 = a0;
return require(dependencyMap[4]).useStateFromStores([PermissionStore, UploadAttachmentStore], _fun115522);
};
}
function useUploadDisabled(a0) { // fn#115521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15345:278, offset: 0x0246388b, size: 74 bytes, params: 2, frame: 15
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore, UploadAttachmentStore],
_fun115522);
}
function _fun115522() { // fn#115522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15345:349, offset: 0x024638d5, size: 156 bytes, params: 1, frame: 16
const value = environment.__proto__;
const getUploads = UploadAttachmentStore.getUploads;
const id = env0_0.id;
const ChannelMessage = DraftType.ChannelMessage;
return Reflect.apply(getUploads, UploadAttachmentStore, [id,
ChannelMessage]).length >= MAX_UPLOAD_COUNT || (env0_0.id === (require(5225) /* metro dependency 5225: FakePlaceholderPrivateChannel */).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID || !(env0_0.isPrivate() || PermissionStore.can(Permissions.ATTACH_FILES,
env0_0)));
}