2026-07-25 08:10:48 +00:00
// Module ID: 7952
// Function ID: 63248
2026-07-20 16:05:17 +00:00
// Name: isActivityInTextSupportedForChannel
2026-07-25 08:10:48 +00:00
// Dependencies: [1348, 3759, 482, 669, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: isActivitiesInTextEnabled, useIsActivitiesInTextEnabled, useIsAppLauncherEnabled
2026-07-25 08:10:48 +00:00
// Module 7952 (isActivityInTextSupportedForChannel)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_3 from "_isNativeReflectConstruct" ;
import { Permissions } from "sum" ;
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function isActivityInTextSupportedForChannel ( channel ) {
if ( null == channel ) {
return false ;
} else {
channel = channel . getChannel ( channel . parent_id ) ;
let hasItem = null == channel ;
if ( ! hasItem ) {
let type ;
if ( null != channel ) {
type = channel . type ;
}
2026-07-23 10:11:24 +00:00
hasItem = type === require ( 669 ) /* set */ . ChannelTypes . GUILD_CATEGORY ;
2026-07-20 16:05:17 +00:00
}
if ( hasItem ) {
2026-07-23 10:11:24 +00:00
const items = [ require ( 669 ) /* set */ . ChannelTypes . GUILD_TEXT , require ( 669 ) /* set */ . ChannelTypes . GUILD_VOICE , require ( 669 ) /* set */ . ChannelTypes . GROUP_DM , require ( 669 ) /* set */ . ChannelTypes . DM ] ;
2026-07-20 16:05:17 +00:00
hasItem = items . includes ( channel . type ) ;
}
return hasItem ;
}
}
function isActivitiesInTextEnabledForChannelWithPermissions ( guild_id , closure_3 ) {
if ( null != guild_id ) {
if ( undefined !== guild_id ) {
if ( isActivityInTextSupportedForChannel ( guild_id ) ) {
if ( null != guild_id . guild_id ) {
if ( ! closure_3 . can ( Permissions . USE_EMBEDDED_ACTIVITIES , guild_id ) ) {
return false ;
}
}
return true ;
} else {
return false ;
}
}
}
return false ;
}
function getIsAppLauncherEnabled ( channel ) {
let guild_id ;
if ( null != channel ) {
guild_id = channel . guild_id ;
}
let tmp2 = null != guild_id ;
if ( ! tmp2 ) {
tmp2 = isActivityInTextSupportedForChannel ( channel ) ;
}
return tmp2 ;
}
2026-07-23 10:11:24 +00:00
const result = require ( "sum" ) . fileFinishedImporting ( "modules/activities/ActivitiesInTextUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export { isActivityInTextSupportedForChannel } ;
export const isActivitiesInTextEnabled = function isActivitiesInTextEnabled ( channel ) {
return isActivitiesInTextEnabledForChannelWithPermissions ( channel , closure_3 ) ;
} ;
export const useIsActivitiesInTextEnabled = function useIsActivitiesInTextEnabled ( id ) {
2026-07-23 10:11:24 +00:00
const _require = id ;
const items = [ _isNativeReflectConstruct , closure_3 ] ;
return _require ( 566 ) . useStateFromStores ( items , ( ) = > outer1_6 ( outer1_2 . getChannel ( closure_0 ) , outer1_3 ) ) ;
2026-07-20 16:05:17 +00:00
} ;
export { getIsAppLauncherEnabled } ;
export const useIsAppLauncherEnabled = function useIsAppLauncherEnabled ( id ) {
2026-07-23 10:11:24 +00:00
const _require = id ;
const items = [ _isNativeReflectConstruct ] ;
return _require ( 566 ) . useStateFromStores ( items , ( ) = > {
const channel = outer1_2 . getChannel ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
let tmp2 = null != channel ;
if ( tmp2 ) {
2026-07-23 10:11:24 +00:00
tmp2 = outer1_7 ( channel ) ;
2026-07-20 16:05:17 +00:00
}
return tmp2 ;
} ) ;
} ;