2026-07-23 10:11:24 +00:00
// Module ID: 9652
// Function ID: 75161
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-23 10:11:24 +00:00
// Dependencies: [5, 1280, 1348, 4468, 1906, 4467, 1552, 653, 4344, 4665, 7938, 4672, 4674, 4675, 675, 4686, 477, 4110, 9653, 1207, 9679, 4539, 9811, 9812, 22, 2]
2026-07-20 16:05:17 +00:00
// Exports: addAttachmentForCommand, cropResultToUploadItem, handleSelectGift, handleSelectThread
2026-07-23 10:11:24 +00:00
// Module 9652 (_createForOfIteratorHelperLoose)
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_4 from "_isNativeReflectConstruct" ;
import closure_5 from "_isNativeReflectConstruct" ;
import { DraftType } from "_isNativeReflectConstruct" ;
import closure_7 from "_isNativeReflectConstruct" ;
import closure_8 from "_isNativeReflectConstruct" ;
import DRAG_HANDLE from "DRAG_HANDLE" ;
import ME from "ME" ;
import { NativePermissionTypes } from "NativePermissionStatus" ;
let closure_10 ;
let closure_11 ;
let closure_12 ;
let closure_13 ;
let closure_14 ;
let closure_15 ;
let closure_16 ;
let closure_17 ;
let closure_18 ;
let closure_9 ;
const require = arg1 ;
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
function addImagesFromPicker ( id , items , IMAGE_PICKER ) {
2026-07-23 10:11:24 +00:00
const _require = id ;
2026-07-20 16:05:17 +00:00
const importDefault = IMAGE_PICKER ;
2026-07-23 10:11:24 +00:00
if ( IMAGE_PICKER !== _require ( 4665 ) . UploadOrigin . FILE_ATTACHMENT ) {
2026-07-20 16:05:17 +00:00
const found = items . filter ( ( uri ) = > {
2026-07-23 10:11:24 +00:00
let closure_0 = uri ;
let tmp = null != closure_0 && null != uri . uri ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
tmp = "" !== uri . uri ;
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = null == outer1_8 . findUpload ( closure_0 , outer1_6 . ChannelMessage , ( closure_0 ) = > uri ( outer2_2 [ 11 ] ) . doesImageMatchUpload ( uri , closure_0 ) ) ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ) ;
const mapped = found . map ( ( arg0 ) = > {
const obj = { } ;
const merged = Object . assign ( arg0 ) ;
2026-07-23 10:11:24 +00:00
obj [ "origin" ] = closure_1 ;
2026-07-20 16:05:17 +00:00
return obj ;
} ) ;
let obj = { files : mapped , channelId : id , draftType : DraftType.ChannelMessage } ;
2026-07-23 10:11:24 +00:00
importDefault ( 7938 ) . addFiles ( obj ) ;
const obj3 = importDefault ( 7938 ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
obj = importDefault ( 7938 ) ;
2026-07-20 16:05:17 +00:00
obj = { files : items , channelId : id , draftType : DraftType.ChannelMessage } ;
obj . addFiles ( obj ) ;
}
}
function handleCameraDialog ( arg0 ) {
2026-07-23 10:11:24 +00:00
let _isNativeReflectConstruct ;
let closure_4 ;
let dependencyMap ;
let importDefault ;
let require ;
( { channel : require , previewType : importDefault , onDismissKeyboard : dependencyMap , onRestoreKeyboard : _isNativeReflectConstruct , onSelectFiles : closure_4 } = arg0 ) ;
const permission = importDefault ( 4675 ) . requestPermission ( NativePermissionTypes . CAMERA ) ;
2026-07-20 16:05:17 +00:00
permission . then ( ( arg0 ) = > {
if ( arg0 ) {
2026-07-23 10:11:24 +00:00
let obj = outer1_1 ( outer1_2 [ 14 ] ) ;
obj = { type : outer1_16 . CAMERA } ;
( { id : obj2.channel_id , guild_id : obj2.guild_id } = closure_0 ) ;
obj . track ( outer1_11 . CHAT_INPUT_COMPONENT_VIEWED , obj ) ;
callback ( ) ;
obj = { mediaType : "mixed" , includeBase64 : false , quality : null , videoQuality : "high" , saveToPhotos : null , skipProcessing : true } ;
const obj3 = outer1_1 ( outer1_2 [ 15 ] ) ;
obj . quality = outer1_0 ( outer1_2 [ 12 ] ) . getImageCompressionQuality ( ) ;
obj . saveToPhotos = outer1_4 . saveCameraUploadsToDevice ;
2026-07-20 16:05:17 +00:00
obj3 . launchCamera ( obj , ( didCancel ) = > {
if ( didCancel . didCancel ) {
2026-07-23 10:11:24 +00:00
outer1_3 ( ) ;
2026-07-20 16:05:17 +00:00
} else if ( null == didCancel . errorCode ) {
if ( null != didCancel . assets ) {
if ( didCancel . assets . length > 0 ) {
const size = didCancel . assets [ 0 ] ;
if ( null != size ) {
if ( null != size . uri ) {
if ( null != size . height ) {
if ( null != size . width ) {
let str8 = size . type ;
if ( null == str8 ) {
let arr ;
if ( null != size . fileName ) {
const parts = str . split ( "." ) ;
arr = parts . pop ( ) ;
}
let str4 = "image/jpeg" ;
if ( null != arr ) {
str4 = "image/jpeg" ;
if ( null != size . fileType ) {
const _HermesInternal = HermesInternal ;
str4 = "" + size . fileType + "/" + arr . toLowerCase ( ) ;
const str7 = "" + size . fileType + "/" + arr ;
}
}
str8 = str4 ;
}
let obj = { } ;
( { id : obj.id , uri : obj.uri , uri : obj.originalUri , width : obj.width , height : obj.height } = size ) ;
if ( null != size . fileName ) {
if ( "" !== size . fileName ) {
let fileName = size . fileName ;
}
obj . filename = fileName ;
obj . playableDuration = size . duration ;
2026-07-23 10:11:24 +00:00
obj . platform = outer2_0 ( outer2_2 [ 9 ] ) . UploadPlatform . REACT_NATIVE ;
2026-07-20 16:05:17 +00:00
obj . createdUsingInAppCamera = true ;
obj . mimeType = str8 ;
const items = [ obj ] ;
2026-07-23 10:11:24 +00:00
outer1_4 ( items ) ;
obj = { camera_view : outer2_10.FULLY_EXPANDED , camera_preview_type : outer1_1 } ;
outer2_1 ( outer2_2 [ 14 ] ) . track ( outer2_11 . IN_APP_CAMERA_USED , obj ) ;
outer1_3 ( ) ;
const obj2 = outer2_1 ( outer2_2 [ 14 ] ) ;
2026-07-20 16:05:17 +00:00
}
const tmp4 = str8 . split ( "/" ) [ 1 ] ;
let str11 = "jpeg" ;
if ( null != tmp4 ) {
str11 = tmp4 ;
}
const _HermesInternal2 = HermesInternal ;
fileName = "camera_upload." + str11 ;
}
}
}
}
}
}
}
} ) ;
2026-07-23 10:11:24 +00:00
const obj5 = outer1_0 ( outer1_2 [ 12 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
}
function handleViewAllDialog ( arg0 ) {
2026-07-23 10:11:24 +00:00
let DraftType ;
let _isNativeReflectConstruct ;
let closure_4 ;
let closure_5 ;
let dependencyMap ;
let importDefault ;
let require ;
( { channel : require , draftType : importDefault , uploadLimit : dependencyMap , includedUploadIds : _isNativeReflectConstruct , onDismissKeyboard : closure_4 , onRestoreKeyboard : closure_5 , onSelectFiles : DraftType } = arg0 ) ;
2026-07-20 16:05:17 +00:00
if ( obj . isIOS ( ) ) {
if ( obj2 . getSystemVersionMajor ( ) >= 14 ) {
let resolved = Promise . resolve ( true ) ;
}
resolved . then ( ( arg0 ) = > {
if ( arg0 ) {
2026-07-23 10:11:24 +00:00
let obj = outer1_1 ( outer1_2 [ 14 ] ) ;
obj = { type : outer1_16 . NATIVE_MEDIA_PICKER } ;
2026-07-20 16:05:17 +00:00
( { id : obj2.channel_id , guild_id : obj2.guild_id } = found ) ;
2026-07-23 10:11:24 +00:00
obj . track ( outer1_11 . CHAT_INPUT_COMPONENT_VIEWED , obj ) ;
callback ( ) ;
const uploads = outer1_8 . getUploads ( found . id , closure_1 ) ;
found = uploads ;
2026-07-20 16:05:17 +00:00
let arr2 = uploads ;
2026-07-23 10:11:24 +00:00
if ( null != _isNativeReflectConstruct ) {
found = uploads . filter ( ( id ) = > outer1_3 . includes ( id . id ) ) ;
2026-07-20 16:05:17 +00:00
arr2 = found ;
}
2026-07-23 10:11:24 +00:00
obj = { mediaType : "any" , includeBase64 : false } ;
2026-07-20 16:05:17 +00:00
if ( closure_2 <= 1 ) {
obj . selectionLimit = 1 ;
obj . selections = arr2 . map ( ( id ) = > id . id ) ;
2026-07-23 10:11:24 +00:00
obj . includeExtra = ! outer1_0 ( outer1_2 [ 16 ] ) . isIOS ( ) ;
2026-07-20 16:05:17 +00:00
obj . skipProcessing = true ;
2026-07-23 10:11:24 +00:00
const obj5 = outer1_0 ( outer1_2 [ 16 ] ) ;
outer1_1 ( outer1_2 [ 15 ] ) . launchImageLibrary ( obj , ( didCancel ) = > {
2026-07-20 16:05:17 +00:00
let iter2 ;
2026-07-23 10:11:24 +00:00
let closure_0 = didCancel ;
outer1_5 ( ) ;
2026-07-20 16:05:17 +00:00
if ( ! didCancel . didCancel ) {
if ( null == didCancel . errorCode ) {
2026-07-23 10:11:24 +00:00
if ( 0 !== closure_0 . length ) {
2026-07-20 16:05:17 +00:00
if ( didCancel . replaceSelection ) {
2026-07-23 10:11:24 +00:00
const item = closure_0 . forEach ( ( origin ) = > {
const didCancel = origin ;
let tmp = origin . origin !== outer3_0 ( outer3_2 [ 9 ] ) . UploadOrigin . IMAGE_PICKER ;
2026-07-20 16:05:17 +00:00
if ( ! tmp ) {
2026-07-23 10:11:24 +00:00
const assets = didCancel . assets ;
tmp = null != assets && assets . some ( ( image ) = > outer4_0 ( outer4_2 [ 11 ] ) . doesImageMatchUpload ( image , closure_0 ) ) ;
const tmp4 = null != assets && assets . some ( ( image ) = > outer4_0 ( outer4_2 [ 11 ] ) . doesImageMatchUpload ( image , closure_0 ) ) ;
2026-07-20 16:05:17 +00:00
}
if ( ! tmp ) {
2026-07-23 10:11:24 +00:00
outer3_1 ( outer3_2 [ 10 ] ) . remove ( found . id , origin . id , outer3_6 . ChannelMessage ) ;
const obj = outer3_1 ( outer3_2 [ 10 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
}
const items = [ ] ;
2026-07-23 10:11:24 +00:00
const tmp6 = outer2_21 ( didCancel . assets ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp6 ( ) ;
if ( ! iter . done ) {
do {
let value = iter . value ;
if ( null != value . uri ) {
let obj = { } ;
( { id : obj.id , uri : obj.uri , uri : obj.originalUri , mimeType : obj.mimeType , width : obj.width , height : obj.height , fileName : obj.filename , duration : obj.playableDuration } = value ) ;
2026-07-23 10:11:24 +00:00
let tmp10 = outer2_0 ;
let tmp11 = outer2_2 ;
obj . platform = outer2_0 ( outer2_2 [ 9 ] ) . UploadPlatform . REACT_NATIVE ;
2026-07-20 16:05:17 +00:00
let arr = items . push ( obj ) ;
}
iter2 = tmp6 ( ) ;
iter = iter2 ;
} while ( ! iter2 . done ) ;
}
if ( items . length > 0 ) {
2026-07-23 10:11:24 +00:00
outer1_6 ( items ) ;
2026-07-20 16:05:17 +00:00
}
}
}
}
} ) ;
2026-07-23 10:11:24 +00:00
const obj6 = outer1_1 ( outer1_2 [ 15 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
if ( obj4 . isIOS ( ) ) {
2026-07-23 10:11:24 +00:00
let length = arr2 . filter ( ( origin ) = > origin . origin !== outer2_0 ( outer2_2 [ 9 ] ) . UploadOrigin . IMAGE_PICKER ) . length ;
2026-07-20 16:05:17 +00:00
} else {
length = arr2 . length ;
}
const diff = closure_2 - length ;
2026-07-23 10:11:24 +00:00
obj4 = outer1_0 ( outer1_2 [ 16 ] ) ;
2026-07-20 16:05:17 +00:00
const tmp15 = closure_2 ;
}
}
} ) ;
}
2026-07-23 10:11:24 +00:00
obj = require ( 477 ) /* set */ ;
resolved = importDefault ( 4675 ) . requestPermission ( NativePermissionTypes . PHOTOS ) ;
2026-07-20 16:05:17 +00:00
}
function handleLimitedPickerDialog ( arg0 ) {
return _handleLimitedPickerDialog ( . . . arguments ) ;
}
function _handleLimitedPickerDialog() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function handleAttachFile ( arg0 ) {
return _handleAttachFile ( . . . arguments ) ;
}
function _handleAttachFile() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function mediaNodeToUploadItem ( item , createdUsingInAppCamera ) {
const image = item . node . image ;
let obj = { } ;
let uri = item . node . id ;
if ( null == uri ) {
uri = image . uri ;
}
obj . id = uri ;
2026-07-23 10:11:24 +00:00
obj . origin = require ( 4665 ) /* _isNativeReflectConstruct */ . UploadOrigin . IMAGE_PICKER ;
2026-07-20 16:05:17 +00:00
( { uri : obj.uri , uri : obj.originalUri , mimeType : obj.mimeType , width : obj.width , height : obj.height , filename : obj.filename , playableDuration : obj.playableDuration } = image ) ;
2026-07-23 10:11:24 +00:00
obj . platform = require ( 4665 ) /* _isNativeReflectConstruct */ . UploadPlatform . REACT_NATIVE ;
2026-07-20 16:05:17 +00:00
let tmp = null != createdUsingInAppCamera ;
if ( tmp ) {
obj = { createdUsingInAppCamera } ;
tmp = obj ;
}
const merged = Object . assign ( tmp ) ;
return obj ;
}
function handleSelectKeyboardItem ( channelId , item , isIncluded , createdUsingInAppCamera ) {
2026-07-23 10:11:24 +00:00
const image = item . node . image ;
2026-07-20 16:05:17 +00:00
if ( isIncluded ) {
2026-07-23 10:11:24 +00:00
const findUploadResult = closure_8 . findUpload ( channelId , DraftType . ChannelMessage , ( closure_0 ) = > image ( outer1_2 [ 11 ] ) . doesImageMatchUpload ( image , closure_0 ) ) ;
2026-07-20 16:05:17 +00:00
if ( null != findUploadResult ) {
2026-07-23 10:11:24 +00:00
importDefault ( 7938 ) . remove ( channelId , findUploadResult . id , DraftType . ChannelMessage ) ;
const obj3 = importDefault ( 7938 ) ;
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 7938 ) ;
2026-07-20 16:05:17 +00:00
obj = { channelId , file : mediaNodeToUploadItem ( item , createdUsingInAppCamera ) , draftType : DraftType.ChannelMessage } ;
obj . addFile ( obj ) ;
}
}
function getMediaKeyboardDraftType ( target ) {
if ( constants . CHAT === target ) {
return DraftType . ChannelMessage ;
} else if ( constants . COMMAND === target ) {
return DraftType . SlashCommand ;
} else if ( constants . APP_LAUNCHER === target ) {
return DraftType . ApplicationLauncherCommand ;
} else if ( constants . INTERACTION_MODAL === target ) {
return DraftType . InteractionModal ;
}
}
2026-07-23 10:11:24 +00:00
( { MediaKeyboardTarget : closure_9 , InAppCameraUsedViews : closure_10 } = DRAG_HANDLE ) ;
( { AnalyticEvents : closure_11 , AnalyticsObjects : closure_12 , AnalyticsObjectTypes : closure_13 , AnalyticsPages : closure_14 , AnalyticsSections : closure_15 , ChatInputComponentViewedTypes : closure_16 , ComponentActions : closure_17 , MAX_UPLOAD_COUNT : closure_18 } = ME ) ;
2026-07-20 16:05:17 +00:00
let closure_20 = { code : "function animatedIndexThreshold_MediaKeyboardUtilsTsx1(animatedSnapPoints,thresholdPercent){return animatedSnapPoints.get().length===1?thresholdPercent-1:thresholdPercent*(animatedSnapPoints.get().length-1);}" } ;
2026-07-23 10:11:24 +00:00
let tmp4 = ( ( ) = > {
export function animatedIndexThreshold ( get ) {
2026-07-20 16:05:17 +00:00
if ( 1 === get . get ( ) . length ) {
let diff = arg1 - 1 ;
} else {
diff = arg1 * ( get . get ( ) . length - 1 ) ;
}
return diff ;
}
animatedIndexThreshold . __closure = { } ;
animatedIndexThreshold . __workletHash = 97398083076 ;
animatedIndexThreshold . __initData = closure_20 ;
return animatedIndexThreshold ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
let result = require ( "_isNativeReflectConstruct" ) . fileFinishedImporting ( "modules/media_keyboard/native/MediaKeyboardUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
function showSimpleMediaKeyboard ( channel ) {
2026-07-23 10:11:24 +00:00
const _require = channel ;
2026-07-20 16:05:17 +00:00
function onAttachFileParams ( arg0 ) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0 ;
2026-07-20 16:05:17 +00:00
return {
2026-07-23 10:11:24 +00:00
channel : closure_0 ,
uploadLimit : outer1_18 ,
2026-07-20 16:05:17 +00:00
onDismissKeyboard() {
2026-07-23 10:11:24 +00:00
return lib ( onAttachFileParams [ 18 ] ) . hideMediaKeyboardActionSheet ( ) ;
2026-07-20 16:05:17 +00:00
} ,
onRestoreKeyboard() {
2026-07-23 10:11:24 +00:00
outer2_33 ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
} ,
onSelectFiles ( arg0 ) {
2026-07-23 10:11:24 +00:00
outer2_23 ( lib . id , arg0 , lib ) ;
2026-07-20 16:05:17 +00:00
}
} ;
}
let obj = { target : constants.CHAT } ;
const tmp = getMediaKeyboardDraftType ( obj . target ) ;
const importDefault = tmp ;
obj = {
channel ,
draftType : tmp ,
uploadLimit : closure_18 ,
disableWhenReachedLimit : true ,
onAttachPress() {
2026-07-23 10:11:24 +00:00
const merged = Object . assign ( onAttachFileParams ( channel ( onAttachFileParams [ 9 ] ) . UploadOrigin . FILE_ATTACHMENT ) ) ;
outer1_28 ( { } ) ;
2026-07-20 16:05:17 +00:00
} ,
onPressCamera ( arg0 ) {
const obj = { } ;
2026-07-23 10:11:24 +00:00
const merged = Object . assign ( onAttachFileParams ( channel ( onAttachFileParams [ 9 ] ) . UploadOrigin . IMAGE_PICKER ) ) ;
2026-07-20 16:05:17 +00:00
obj [ "previewType" ] = arg0 ;
2026-07-23 10:11:24 +00:00
outer1_24 ( obj ) ;
2026-07-20 16:05:17 +00:00
} ,
onPressItem ( arg0 ) {
let channelId ;
let isIncluded ;
let item ;
( { channelId , item , isIncluded } = arg0 ) ;
2026-07-23 10:11:24 +00:00
const result = channel ( onAttachFileParams [ 18 ] ) . hideMediaKeyboardActionSheet ( ) ;
outer1_31 ( channelId , item , isIncluded ) ;
2026-07-20 16:05:17 +00:00
} ,
onViewAll() {
const obj = { } ;
2026-07-23 10:11:24 +00:00
const merged = Object . assign ( onAttachFileParams ( channel ( onAttachFileParams [ 9 ] ) . UploadOrigin . IMAGE_PICKER ) ) ;
obj [ "draftType" ] = closure_1 ;
outer1_25 ( obj ) ;
2026-07-20 16:05:17 +00:00
} ,
onManageLimited() {
2026-07-23 10:11:24 +00:00
outer1_26 ( {
onDismissKeyboard : channel ( onAttachFileParams [ 18 ] ) . hideMediaKeyboardActionSheet ,
2026-07-20 16:05:17 +00:00
onRestoreKeyboard() {
2026-07-23 10:11:24 +00:00
outer2_33 ( outer1_0 ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
} ,
2026-07-23 10:11:24 +00:00
onClose : _require ( onAttachFileParams [ 18 ] ) . hideMediaKeyboardActionSheet ,
onBack : _require ( onAttachFileParams [ 18 ] ) . hideMediaKeyboardActionSheet
2026-07-20 16:05:17 +00:00
} ;
2026-07-23 10:11:24 +00:00
let result = _require ( onAttachFileParams [ 18 ] ) . showMediaKeyboardActionSheet ( obj ) ;
2026-07-20 16:05:17 +00:00
}
export { addImagesFromPicker } ;
2026-07-23 10:11:24 +00:00
export const addAttachmentForCommand = function addAttachmentForCommand ( channelId , onSelectFiles , result1 , outer1_5 , IMAGE_PICKER ) {
const option = outer1_5 . option ;
let obj = require ( 4674 ) /* openImagePickerUnhandled */ ;
2026-07-20 16:05:17 +00:00
const filename = obj . getFileFromUploadItem ( result1 ) . filename ;
2026-07-23 10:11:24 +00:00
if ( outer1_5 . target === constants . COMMAND ) {
const current = onSelectFiles . current ;
2026-07-20 16:05:17 +00:00
const applicationCommandManager = current . getApplicationCommandManager ( ) ;
if ( null != applicationCommandManager ) {
obj = { displayText : filename , preferred : true } ;
const result = applicationCommandManager . insertOrJumpCommandOption ( option , undefined , false , obj ) ;
}
}
2026-07-23 10:11:24 +00:00
const tmp7 = getMediaKeyboardDraftType ( outer1_5 . target ) ;
importDefault ( 7938 ) . remove ( channelId , outer1_5 . option . name , tmp7 ) ;
const obj4 = importDefault ( 7938 ) ;
2026-07-20 16:05:17 +00:00
obj = { channelId } ;
const obj1 = { } ;
const merged = Object . assign ( result1 ) ;
obj1 [ "origin" ] = IMAGE_PICKER ;
obj1 [ "id" ] = option . name ;
obj1 [ "filename" ] = filename ;
obj . file = obj1 ;
obj . draftType = tmp7 ;
obj . allowOptimization = false ;
2026-07-23 10:11:24 +00:00
importDefault ( 7938 ) . addFile ( obj ) ;
2026-07-20 16:05:17 +00:00
} ;
export { handleCameraDialog } ;
export { handleViewAllDialog } ;
export { handleLimitedPickerDialog } ;
export const handleSelectGift = function handleSelectGift ( analyticsLocations , chatInput , current2 ) {
2026-07-23 10:11:24 +00:00
const _require = current2 ;
2026-07-20 16:05:17 +00:00
let current = chatInput . current ;
2026-07-23 10:11:24 +00:00
channelId = channelId . getChannelId ( ) ;
2026-07-20 16:05:17 +00:00
current . closeCustomKeyboard ( ) ;
2026-07-23 10:11:24 +00:00
channel = channel . getChannel ( channelId ) ;
const ComponentDispatch = _require ( 1207 ) . ComponentDispatch ;
2026-07-20 16:05:17 +00:00
ComponentDispatch . dispatch ( constants8 . MEDIA_KEYBOARD_GIFT_SELECTED ) ;
let obj = { section : constants6.CHANNEL_TEXT_AREA , object : constants3 . BUTTON_ICON , objectType : constants4.GIFT } ;
let guild_id ;
if ( null != channel ) {
guild_id = channel . guild_id ;
}
if ( null != guild_id ) {
let DM_CHANNEL = constants5 . GUILD_CHANNEL ;
} else {
DM_CHANNEL = constants5 . DM_CHANNEL ;
}
obj . page = DM_CHANNEL ;
obj = { type : constants7 . NITRO_GIFTING } ;
let id ;
if ( null != channel ) {
id = channel . id ;
}
obj . channel_id = id ;
let guild_id1 ;
if ( null != channel ) {
guild_id1 = channel . guild_id ;
}
obj . guild_id = guild_id1 ;
2026-07-23 10:11:24 +00:00
importDefault ( 675 ) . track ( constants2 . CHAT_INPUT_COMPONENT_VIEWED , obj ) ;
const obj3 = importDefault ( 675 ) ;
2026-07-20 16:05:17 +00:00
const obj1 = { } ;
let recipientId ;
if ( null != channel ) {
if ( channel . isDM ( ) ) {
recipientId = channel . getRecipientId ( ) ;
}
}
obj1 . recipientUserId = recipientId ;
obj1 . analyticsLocation = obj ;
obj1 . analyticsLocations = analyticsLocations ;
obj1 . navigationParams = { presentation : "card" } ;
current = undefined ;
if ( null != current2 ) {
current = current2 . current ;
}
let fn ;
if ( null != current ) {
fn = ( ) = > {
2026-07-23 10:11:24 +00:00
let obj = current2 ( outer1_2 [ 21 ] ) ;
obj = { ref : current2 } ;
2026-07-20 16:05:17 +00:00
return obj . setAccessibilityFocus ( obj ) ;
} ;
}
obj1 . onDismiss = fn ;
2026-07-23 10:11:24 +00:00
_require ( 9679 ) . openGiftModal ( obj1 ) ;
2026-07-20 16:05:17 +00:00
} ;
export const handleSelectThread = function handleSelectThread ( channel , chatInput ) {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 675 ) ;
2026-07-20 16:05:17 +00:00
obj = { type : constants7 . START_THREAD , channel_id : channel.id } ;
let guild_id ;
if ( null != channel ) {
guild_id = channel . guild_id ;
}
obj . guild_id = guild_id ;
obj . track ( constants2 . CHAT_INPUT_COMPONENT_VIEWED , obj ) ;
if ( null != channel ) {
const current = chatInput . current ;
current . openSystemKeyboard ( ) ;
if ( obj3 . isIOS ( ) ) {
const current2 = chatInput . current ;
current2 . blur ( ) ;
}
2026-07-23 10:11:24 +00:00
obj3 = require ( 477 ) /* set */ ;
const result = require ( 9811 ) /* navigateToThreadCreation */ . navigateToThreadCreation ( channel , "Plus Button" ) ;
const obj4 = require ( 9811 ) /* navigateToThreadCreation */ ;
2026-07-20 16:05:17 +00:00
}
} ;
export { handleAttachFile } ;
export { mediaNodeToUploadItem } ;
export const cropResultToUploadItem = function cropResultToUploadItem ( path ) {
path = path . path ;
const path2 = path . path ;
if ( path . startsWith ( "file://" ) ) {
let combined = path2 ;
} else {
const _HermesInternal = HermesInternal ;
combined = "file://" + path2 ;
}
const parts = path . path . split ( "/" ) ;
const obj = { } ;
const arr = parts . pop ( ) ;
const str = path . path ;
2026-07-23 10:11:24 +00:00
obj . id = importDefault ( 22 ) . uniqueId ( path . path ) ;
2026-07-20 16:05:17 +00:00
obj . uri = combined ;
obj . originalUri = combined ;
( { mime : obj.mimeType , width : obj.width , height : obj.height } = path ) ;
obj . filename = arr ;
2026-07-23 10:11:24 +00:00
obj . platform = require ( 4665 ) /* _isNativeReflectConstruct */ . UploadPlatform . REACT_NATIVE ;
2026-07-20 16:05:17 +00:00
return obj ;
} ;
export { handleSelectKeyboardItem } ;
export { showSimpleMediaKeyboard } ;
export { getMediaKeyboardDraftType } ;