2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 11777
|
|
|
|
|
// Function ID: 11778
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useShowConnectedUserLimit
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [1074, 9103, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: default, useConnectedUserLimit, useConnectedUserLimitFormatted
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 11777 (useShowConnectedUserLimit)
|
2026-09-26 17:57:22 +00:00
|
|
|
import Constants from "Constants" /* 1074 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import useChannelVideoLimitDefault from "useChannelVideoLimit" /* 9103 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
|
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
let closure_2 = Constants.MAX_STAGE_VOICE_USER_LIMIT;
|
|
|
|
|
const result = size.fileFinishedImporting("modules/guild_sidebar/useShowConnectedUserLimit.tsx");
|
|
|
|
|
|
|
|
|
|
export default function useShowConnectedUserLimit(channel) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let considerMaxStageVoiceUserLimit;
|
|
|
|
|
let locked;
|
|
|
|
|
let num2;
|
|
|
|
|
let selected;
|
|
|
|
|
let video;
|
2026-09-26 17:57:22 +00:00
|
|
|
({ channel, video, considerMaxStageVoiceUserLimit } = { channel: channel.channel, video: channel.video });
|
|
|
|
|
({ locked, selected } = channel);
|
|
|
|
|
if (considerMaxStageVoiceUserLimit === undefined) {
|
|
|
|
|
considerMaxStageVoiceUserLimit = true;
|
|
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
const limit = useChannelVideoLimitDefault(channel).limit;
|
|
|
|
|
let num = -1;
|
|
|
|
|
if (channel.userLimit > 0) {
|
|
|
|
|
num = channel.userLimit;
|
|
|
|
|
}
|
|
|
|
|
if (video) {
|
|
|
|
|
video = limit > 0;
|
|
|
|
|
}
|
2026-09-26 17:57:22 +00:00
|
|
|
let tmp = num;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (video) {
|
|
|
|
|
let bound = limit;
|
|
|
|
|
if (num > 0) {
|
|
|
|
|
const _Math = Math;
|
|
|
|
|
bound = Math.min(num, limit);
|
|
|
|
|
}
|
2026-09-26 17:57:22 +00:00
|
|
|
tmp = bound;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-09-26 17:57:22 +00:00
|
|
|
if (!considerMaxStageVoiceUserLimit) {
|
2026-10-01 14:13:23 +00:00
|
|
|
num2 = tmp;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
num2 = 0;
|
|
|
|
|
}
|
2026-09-26 17:57:22 +00:00
|
|
|
return num2 > 0 && !locked && !selected;
|
|
|
|
|
};
|
|
|
|
|
export const useConnectedUserLimit = function useConnectedUserLimit(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channel;
|
|
|
|
|
let considerMaxStageVoiceUserLimit;
|
|
|
|
|
let num2;
|
|
|
|
|
let video;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ channel, video, considerMaxStageVoiceUserLimit } = arg0);
|
|
|
|
|
if (considerMaxStageVoiceUserLimit === undefined) {
|
|
|
|
|
considerMaxStageVoiceUserLimit = true;
|
|
|
|
|
}
|
|
|
|
|
const limit = useChannelVideoLimitDefault(channel).limit;
|
|
|
|
|
let num = -1;
|
|
|
|
|
if (channel.userLimit > 0) {
|
|
|
|
|
num = channel.userLimit;
|
|
|
|
|
}
|
|
|
|
|
if (video) {
|
|
|
|
|
video = limit > 0;
|
|
|
|
|
}
|
|
|
|
|
let tmp = num;
|
|
|
|
|
if (video) {
|
|
|
|
|
let bound = limit;
|
|
|
|
|
if (num > 0) {
|
|
|
|
|
const _Math = Math;
|
|
|
|
|
bound = Math.min(num, limit);
|
|
|
|
|
}
|
|
|
|
|
tmp = bound;
|
|
|
|
|
}
|
|
|
|
|
if (!considerMaxStageVoiceUserLimit) {
|
2026-10-01 14:13:23 +00:00
|
|
|
num2 = tmp;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
num2 = 0;
|
|
|
|
|
}
|
|
|
|
|
return num2;
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|
|
|
|
|
export const useConnectedUserLimitFormatted = function useConnectedUserLimitFormatted(channel) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let considerMaxStageVoiceUserLimit;
|
|
|
|
|
let num2;
|
|
|
|
|
let video;
|
2026-09-26 17:57:22 +00:00
|
|
|
const userCount = channel.userCount;
|
|
|
|
|
({ channel, video, considerMaxStageVoiceUserLimit } = { channel: channel.channel, video: channel.video });
|
|
|
|
|
if (considerMaxStageVoiceUserLimit === undefined) {
|
|
|
|
|
considerMaxStageVoiceUserLimit = true;
|
|
|
|
|
}
|
|
|
|
|
const limit = useChannelVideoLimitDefault(channel).limit;
|
|
|
|
|
let num = -1;
|
|
|
|
|
if (channel.userLimit > 0) {
|
|
|
|
|
num = channel.userLimit;
|
|
|
|
|
}
|
|
|
|
|
if (video) {
|
|
|
|
|
video = limit > 0;
|
|
|
|
|
}
|
|
|
|
|
let tmp = num;
|
|
|
|
|
if (video) {
|
|
|
|
|
let bound = limit;
|
|
|
|
|
if (num > 0) {
|
|
|
|
|
const _Math = Math;
|
|
|
|
|
bound = Math.min(num, limit);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-09-26 17:57:22 +00:00
|
|
|
tmp = bound;
|
|
|
|
|
}
|
|
|
|
|
if (!considerMaxStageVoiceUserLimit) {
|
2026-10-01 14:13:23 +00:00
|
|
|
num2 = tmp;
|
2026-09-26 17:57:22 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
num2 = 0;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp5 = null;
|
|
|
|
|
if (num2 > 0) {
|
|
|
|
|
let combined2;
|
|
|
|
|
if (null != userCount) {
|
|
|
|
|
let combined;
|
|
|
|
|
let combined1;
|
|
|
|
|
if (userCount >= 1000) {
|
|
|
|
|
const _Math3 = Math;
|
|
|
|
|
let str7 = "";
|
|
|
|
|
const rounded = Math.floor(userCount / 1000);
|
|
|
|
|
if (userCount % 1000 !== 0) {
|
|
|
|
|
str7 = "+";
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const _HermesInternal2 = HermesInternal;
|
|
|
|
|
combined = "" + rounded + "k" + str7;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
const toFixedResult = userCount.toFixed(0);
|
|
|
|
|
combined = toFixedResult.padStart(2, "0");
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (num2 >= 1000) {
|
|
|
|
|
const _Math4 = Math;
|
|
|
|
|
let str11 = "";
|
|
|
|
|
const rounded1 = Math.floor(num2 / 1000);
|
|
|
|
|
if (num2 % 1000 !== 0) {
|
|
|
|
|
str11 = "+";
|
|
|
|
|
}
|
|
|
|
|
const _HermesInternal3 = HermesInternal;
|
|
|
|
|
combined1 = "" + rounded1 + "k" + str11;
|
|
|
|
|
} else {
|
|
|
|
|
const toFixedResult1 = num2.toFixed(0);
|
|
|
|
|
combined1 = toFixedResult1.padStart(2, "0");
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const _HermesInternal4 = HermesInternal;
|
|
|
|
|
combined2 = "" + combined + "/" + combined1;
|
|
|
|
|
} else if (num2 >= 1000) {
|
|
|
|
|
const _Math2 = Math;
|
|
|
|
|
let str3 = "";
|
|
|
|
|
const rounded2 = Math.floor(num2 / 1000);
|
|
|
|
|
if (num2 % 1000 !== 0) {
|
|
|
|
|
str3 = "+";
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
combined2 = "" + rounded2 + "k" + str3;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
const toFixedResult2 = num2.toFixed(0);
|
|
|
|
|
combined2 = toFixedResult2.padStart(2, "0");
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp5 = combined2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return tmp5;
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|