2026-07-25 08:10:48 +00:00
// Module ID: 16610
// Function ID: 129593
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 15, 17, 18, 57, 1348, 1838, 3759, 3768, 1907, 1850, 653, 16611, 16612, 4321, 11955, 1392, 1327, 3970, 5078, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 16610 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose" ;
import computeDefaultGroupDmNameFromUserIds from "computeDefaultGroupDmNameFromUserIds" ;
import getAvatarURL from "getAvatarURL" ;
import isDiscordFrontendDevelopment from "isDiscordFrontendDevelopment" ;
import _slicedToArray from "_slicedToArray" ;
import closure_9 from "_isNativeReflectConstruct" ;
import closure_10 from "_createForOfIteratorHelperLoose" ;
import closure_11 from "_isNativeReflectConstruct" ;
import closure_12 from "_isNativeReflectConstruct" ;
import closure_13 from "_isNativeReflectConstruct" ;
import closure_14 from "_isNativeReflectConstruct" ;
import ME from "ME" ;
import tmp3 from "AutomaticLifecycleManager" ;
let closure_15 ;
let closure_16 ;
let closure_17 ;
let closure_18 ;
let closure_19 ;
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = ! valueOf . call ( Reflect . construct ( Boolean , [ ] , ( ) = > {
} ) ) ;
function _isNativeReflectConstruct() {
return closure_0 ;
}
const result = _isNativeReflectConstruct ( ) ;
}
2026-07-23 10:11:24 +00:00
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 indexingEnabled() {
2026-07-25 08:10:48 +00:00
let obj = importDefault ( 16611 ) ;
obj = { autoTrackExposure : true , disable : ! importDefault ( 16612 ) . hasSearch ( ) } ;
2026-07-20 16:05:17 +00:00
return obj . getCurrentConfig ( { location : "NativeIntentsManager" } , obj ) . searchEnabled ;
}
function clearEnabled() {
2026-07-25 08:10:48 +00:00
let obj = importDefault ( 16611 ) ;
obj = { autoTrackExposure : true , disable : ! importDefault ( 16612 ) . hasSearch ( ) } ;
2026-07-20 16:05:17 +00:00
return obj . getCurrentConfig ( { location : "NativeIntentsManager" } , obj ) . clearEnabled ;
}
function handleRelativeURL ( channelIconURL ) {
if ( null != channelIconURL ) {
if ( null != channelIconURL . startsWith ) {
if ( channelIconURL . startsWith ( "/" ) ) {
const _location = location ;
let sum = location . origin + channelIconURL ;
}
return sum ;
}
}
if ( null != channelIconURL ) {
sum = channelIconURL ;
}
}
2026-07-23 10:11:24 +00:00
function makeSearchItem ( value , guild , flag ) {
if ( flag === undefined ) {
2026-07-20 16:05:17 +00:00
flag = false ;
}
2026-07-25 08:10:48 +00:00
let obj = require ( 4321 ) /* computeDefaultGroupDmNameFromUserIds */ ;
2026-07-23 10:11:24 +00:00
const channelName = obj . computeChannelName ( value , closure_14 , closure_12 , true ) ;
2026-07-25 08:10:48 +00:00
const channelName1 = require ( 4321 ) /* computeDefaultGroupDmNameFromUserIds */ . computeChannelName ( value , closure_14 , closure_12 , false ) ;
2026-07-20 16:05:17 +00:00
const items = [ ] ;
const items1 = [ channelName , channelName1 ] ;
const items2 = [ ] ;
2026-07-23 10:11:24 +00:00
if ( value . isGuildVocal ( ) ) {
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
items1 . push ( "!" + channelName1 ) ;
}
2026-07-23 10:11:24 +00:00
const channel = authStore . getChannel ( value . parent_id ) ;
2026-07-20 16:05:17 +00:00
if ( null != channel ) {
2026-07-25 08:10:48 +00:00
const obj3 = require ( 4321 ) /* computeDefaultGroupDmNameFromUserIds */ ;
2026-07-20 16:05:17 +00:00
const channelName2 = obj3 . computeChannelName ( channel , closure_14 , closure_12 , true ) ;
2026-07-25 08:10:48 +00:00
const obj4 = require ( 4321 ) /* computeDefaultGroupDmNameFromUserIds */ ;
2026-07-20 16:05:17 +00:00
const channelName3 = obj4 . computeChannelName ( channel , closure_14 , closure_12 , false ) ;
items2 . push ( channelName2 ) ;
items2 . push ( channelName3 ) ;
items . push ( channelName2 ) ;
}
2026-07-23 10:11:24 +00:00
if ( null != guild ) {
items2 . push ( guild . name ) ;
items . push ( guild . name ) ;
2026-07-20 16:05:17 +00:00
}
let str2 = "" ;
if ( items . length > 0 ) {
const _HermesInternal2 = HermesInternal ;
str2 = " (" + items . join ( ", " ) + ")" ;
}
const sum = channelName + str2 ;
let id ;
2026-07-23 10:11:24 +00:00
if ( null != guild ) {
id = guild . id ;
2026-07-20 16:05:17 +00:00
}
if ( null == id ) {
id = closure_15 ;
}
2026-07-23 10:11:24 +00:00
const CHANNELResult = closure_19 . CHANNEL ( id , value . id ) ;
2026-07-20 16:05:17 +00:00
obj = { id : CHANNELResult , relatedUniqueIdentifier : CHANNELResult , type : "url" , title : sum , displayName : sum } ;
2026-07-25 08:10:48 +00:00
const obj2 = require ( 4321 ) /* computeDefaultGroupDmNameFromUserIds */ ;
obj . thumbnailURL = handleRelativeURL ( require ( 11955 ) /* getChannelIconURL */ . getChannelIconURL ( value , 128 , false ) ) ;
2026-07-23 10:11:24 +00:00
if ( value . type === constants . DM ) {
let OTHER_CHANNEL = constants4 . DM ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
OTHER_CHANNEL = constants4 . OTHER_CHANNEL ;
2026-07-20 16:05:17 +00:00
}
obj . rankingHint = OTHER_CHANNEL ;
obj . keywords = items2 ;
obj . alternateNames = items1 ;
obj . isUpdate = flag ;
return obj ;
}
2026-07-23 10:11:24 +00:00
function getGuildThumbnail ( guild ) {
2026-07-20 16:05:17 +00:00
let tmp ;
2026-07-23 10:11:24 +00:00
if ( null != guild ) {
let obj = importDefault ( 1392 ) ;
2026-07-20 16:05:17 +00:00
obj = { } ;
2026-07-23 10:11:24 +00:00
( { id : obj2.id , icon : obj2.icon } = guild ) ;
2026-07-20 16:05:17 +00:00
obj . size = 128 ;
tmp = handleRelativeURL ( obj . getGuildIconURL ( obj ) ) ;
}
return tmp ;
}
2026-07-23 10:11:24 +00:00
function makeGuildDomain ( id , flag ) {
2026-07-20 16:05:17 +00:00
let iter2 ;
2026-07-23 10:11:24 +00:00
if ( flag === undefined ) {
2026-07-20 16:05:17 +00:00
flag = false ;
}
const CHANNELResult = closure_19 . CHANNEL ( id . id ) ;
let obj = { id : CHANNELResult , relatedUniqueIdentifier : CHANNELResult , type : "url" , title : id.name , displayName : id.name } ;
const items = [ "*" + id . name ] ;
obj . alternateNames = items ;
2026-07-23 10:11:24 +00:00
obj . rankingHint = constants4 . GUILD ;
2026-07-20 16:05:17 +00:00
const items1 = [ obj ] ;
const mutableGuildChannelsForGuild = authStore . getMutableGuildChannelsForGuild ( id . id ) ;
for ( const key10029 in mutableGuildChannelsForGuild ) {
let tmp11 = key10029 ;
let tmp12 = mutableGuildChannelsForGuild [ key10029 ] ;
let tmp13 = closure_11 ;
2026-07-23 10:11:24 +00:00
let tmp14 = constants3 ;
if ( ! closure_11 . can ( constants3 . VIEW_CHANNEL , tmp12 ) ) {
2026-07-20 16:05:17 +00:00
continue ;
} else {
2026-07-23 10:11:24 +00:00
let tmp4 = makeSearchItem ;
let arr = items1 . push ( makeSearchItem ( tmp12 , arg0 , flag ) ) ;
continue ;
2026-07-20 16:05:17 +00:00
}
continue ;
}
const tmp6 = _createForOfIteratorHelperLoose ( authStore . getAllThreadsForGuild ( id . id ) ) ;
let iter = tmp6 ( ) ;
if ( ! iter . done ) {
do {
let value = iter . value ;
let tmp7 = closure_11 ;
2026-07-23 10:11:24 +00:00
let tmp8 = constants3 ;
if ( closure_11 . can ( constants3 . VIEW_CHANNEL , value ) ) {
let tmp9 = makeSearchItem ;
arr = items1 . push ( makeSearchItem ( value , id , flag ) ) ;
2026-07-20 16:05:17 +00:00
}
iter2 = tmp6 ( ) ;
iter = iter2 ;
} while ( ! iter2 . done ) ;
}
obj = { id : id.id , items : items1 , defaultThumbnailURL : getGuildThumbnail ( id ) , isUpdate : flag } ;
return obj ;
}
function getChannelKeywords ( channel ) {
const items = [ ] ;
if ( "" !== channel . name ) {
items . push ( channel . name ) ;
}
if ( null != channel . nicks ) {
const push = items . push ;
const _Object = Object ;
const items1 = [ ] ;
HermesBuiltin . arraySpread ( Object . values ( channel . nicks ) , 0 ) ;
HermesBuiltin . apply ( items1 , items ) ;
}
if ( channel . type === constants . DM ) {
const recipients = channel . recipients ;
const mapped = recipients . map ( getUser . getUser ) ;
2026-07-23 10:11:24 +00:00
const first = callback3 ( mapped . filter ( require ( 1327 ) /* isDiscordFrontendDevelopment */ . isNotNullish ) , 1 ) [ 0 ] ;
2026-07-20 16:05:17 +00:00
if ( null != first ) {
2026-07-25 08:10:48 +00:00
const globalName = importDefault ( 3970 ) . getGlobalName ( first ) ;
2026-07-20 16:05:17 +00:00
if ( null != globalName ) {
items . push ( globalName ) ;
}
items . push ( first . username ) ;
items . push ( ` @ ${ tmp23 . username } ` ) ;
2026-07-23 10:11:24 +00:00
nickname = nickname . getNickname ( first . id ) ;
2026-07-20 16:05:17 +00:00
if ( null != nickname ) {
items . push ( nickname ) ;
}
2026-07-25 08:10:48 +00:00
const obj2 = importDefault ( 3970 ) ;
const name = importDefault ( 3970 ) . getName ( first ) ;
2026-07-20 16:05:17 +00:00
if ( null != name ) {
items . push ( name ) ;
}
2026-07-25 08:10:48 +00:00
const obj = importDefault ( 3970 ) ;
2026-07-20 16:05:17 +00:00
}
}
return items ;
}
function setChannelActivity ( channelId ) {
2026-07-25 08:10:48 +00:00
let obj = importDefault ( 16611 ) ;
obj = { autoTrackExposure : true , disable : ! importDefault ( 16612 ) . hasUserActivity ( ) } ;
2026-07-20 16:05:17 +00:00
if ( obj . getCurrentConfig ( { location : "NativeIntentsManager" } , obj ) . activityEnabled ) {
let channel ;
if ( null != channelId ) {
channel = authStore . getChannel ( channelId ) ;
}
if ( null != channel ) {
2026-07-23 10:11:24 +00:00
const guild = store . getGuild ( channel . guild_id ) ;
2026-07-25 08:10:48 +00:00
const obj5 = require ( 4321 ) /* computeDefaultGroupDmNameFromUserIds */ ;
2026-07-20 16:05:17 +00:00
const channelName = obj5 . computeChannelName ( channel , closure_14 , closure_12 , true ) ;
let str2 = "" ;
if ( null != guild ) {
const _HermesInternal = HermesInternal ;
str2 = " (" + guild . name + ")" ;
}
const sum = channelName + str2 ;
const _Set = Set ;
const items = [ channelName ] ;
HermesBuiltin . arraySpread ( getChannelKeywords ( channel ) , 1 ) ;
const set = new Set ( items ) ;
const items1 = [ ] ;
HermesBuiltin . arraySpread ( set , 0 ) ;
const CHANNELResult = closure_19 . CHANNEL ( channel . guild_id , channel . id ) ;
obj = { } ;
const _HermesInternal2 = HermesInternal ;
obj . webpageURL = "" + constants2 . BASE_URL + CHANNELResult ;
obj . relatedUniqueIdentifier = CHANNELResult ;
obj . eligibleForHandoff = true ;
obj . eligibleForSearch = true ;
obj . title = sum ;
obj . keywords = items1 ;
obj . displayName = sum ;
obj . type = "com.discord.view-channel" ;
2026-07-25 08:10:48 +00:00
importDefault ( 16612 ) . setActivity ( obj ) ;
const obj7 = importDefault ( 16612 ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-25 08:10:48 +00:00
importDefault ( 16612 ) . resignActivity ( ) ;
const obj4 = importDefault ( 16612 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
function updateUserId ( arg0 ) {
const dMChannelFromUserId = authStore . getDMChannelFromUserId ( arg0 ) ;
if ( null != dMChannelFromUserId ) {
const items = [ dMChannelFromUserId ] ;
indexChannelUpdates ( items ) ;
}
}
function indexChannelUpdates ( items ) {
let iter3 ;
if ( indexingEnabled ( ) ) {
items = [ ] ;
const items1 = [ ] ;
let obj = { } ;
const tmp3 = _createForOfIteratorHelperLoose ( items ) ;
const iter = tmp3 ( ) ;
let iter2 = iter ;
if ( ! iter . done ) {
do {
let value = iter2 . value ;
let tmp5 = closure_11 ;
2026-07-23 10:11:24 +00:00
let tmp6 = constants3 ;
if ( closure_11 . can ( constants3 . VIEW_CHANNEL , value ) ) {
let tmp8 = store ;
let guild = store . getGuild ( value . guild_id ) ;
2026-07-20 16:05:17 +00:00
let id ;
if ( null != guild ) {
id = guild . id ;
}
let tmp11 = id ;
if ( null == id ) {
tmp11 = closure_15 ;
}
2026-07-23 10:11:24 +00:00
let tmp12 = makeSearchItem ;
let tmp13 = makeSearchItem ( value , guild , true ) ;
2026-07-20 16:05:17 +00:00
let arr3 = obj [ tmp11 ] ;
if ( null != arr3 ) {
let arr = arr3 . push ( tmp13 ) ;
let tmp22 = id ;
let tmp23 = guild ;
let tmp24 = tmp11 ;
let tmp25 = tmp13 ;
let tmp26 = arr3 ;
} else {
2026-07-23 10:11:24 +00:00
let tmp14 = getGuildThumbnail ;
2026-07-20 16:05:17 +00:00
let items2 = [ tmp13 ] ;
2026-07-23 10:11:24 +00:00
obj = { id : tmp11 , items : items2 , defaultThumbnailURL : getGuildThumbnail ( guild ) } ;
2026-07-20 16:05:17 +00:00
arr = items . push ( obj ) ;
obj [ tmp11 ] = items2 ;
let tmp16 = id ;
let tmp17 = guild ;
let tmp18 = tmp11 ;
let tmp19 = tmp13 ;
let tmp20 = arr3 ;
}
} else {
let arr1 = items1 . push ( value . id ) ;
}
iter3 = tmp3 ( ) ;
iter2 = iter3 ;
} while ( ! iter3 . done ) ;
}
if ( items . length > 0 ) {
2026-07-25 08:10:48 +00:00
importDefault ( 16612 ) . indexDomains ( items ) ;
const obj3 = importDefault ( 16612 ) ;
2026-07-20 16:05:17 +00:00
}
if ( items1 . length > 0 ) {
2026-07-25 08:10:48 +00:00
importDefault ( 16612 ) . deleteSearchItems ( items1 ) ;
const obj4 = importDefault ( 16612 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-23 10:11:24 +00:00
( { ME : closure_15 , ChannelTypes : closure_16 , Links : closure_17 , Permissions : closure_18 , Routes : closure_19 } = ME ) ;
2026-07-20 16:05:17 +00:00
let closure_20 = { GUILD : 100 , [ 100 ] : "GUILD" , DM : 75 , [ 75 ] : "DM" , OTHER_CHANNEL : 50 , [ 50 ] : "OTHER_CHANNEL" } ;
tmp3 = new tmp3 ( ) ;
2026-07-23 10:11:24 +00:00
let result = require ( "_possibleConstructorReturn" ) . fileFinishedImporting ( "modules/native_intents/NativeIntentsManager.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default tmp3 ;