Files
discord-decomp/sources/modules/guild_onboarding/usePromptHelpText.tsx
T
2026-07-28 01:06:53 +03:00

409 lines
19 KiB
TypeScript

/* Metro module 6734; source: modules/guild_onboarding/usePromptHelpText.tsx; dependencies: [1379, 1938, 3784, 3793, 1878, 661, 1244, 566, 4805, 2] */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import GuildRoleStore from '../../stores/GuildRoleStore.tsx'; /* Metro dependency 1938 */
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
function _fun53137(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:6, offset: 0x0133e95d, size: 220 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/guild_onboarding/usePromptHelpText.tsx');
exports.default = usePromptHelpText;
exports.useCustomizeCommunityPromptHelpText = useCustomizeCommunityPromptHelpText;
function formatRoleString(a0, a1, a2) { // fn#53138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:168, offset: 0x0133ea39, size: 186 bytes, params: 4, frame: 20
var r2;
var r0;
var intl;
var format;
var t;
var object;
var Math;
var max;
let length = a0.length;
if (length === 0) {
r0 = '';
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
format = intl.format;
t = (require(1244) /* metro dependency 1244: indexNative */).t;
r2 = a2 ? t.cJZxWf : t.Kj5GIT;
object = {};
length = a0.length;
object.count = length;
Math = global.Math;
max = Math.max;
length = a0.length;
object.extraCount = Reflect.apply(max, Math, [length - 2, 0]);
object.role1 = a0[0];
object.role2 = a0[1];
object.itemHook = a1;
r0 = Reflect.apply(format, intl, [r2, object]);
}
return r0;
}
function usePromptHelpText({guild, prompt, selectedRoleIds, selectedChannelIds, itemHook}) { // fn#53139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:455, offset: 0x0133eaf3, size: 534 bytes, params: 2, frame: 28
var r2;
var r7;
var r1;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var value8;
var format;
var Rj841R;
var Math;
var max;
let value = undefined;
const id = guild == null ? value : guild.id;
let useStateFromStoresArray = FluxModule.useStateFromStoresArray;
const value3 = Reflect.apply(useStateFromStoresArray, FluxModule, [[GuildRoleStore], _fun53140, [id,
selectedRoleIds]]);
useStateFromStoresArray = FluxModule.useStateFromStoresArray;
object = [ChannelStore];
object[1] = UserStore;
object[2] = RelationshipStore;
object[3] = PermissionStore;
const value4 = Reflect.apply(useStateFromStoresArray, FluxModule, [object, _fun53141]);
const value5 = value3.map(function({name}) {
return '@' + name;
});
if (prompt == null) {
r2 = intl.string(t.JshhEl);
} else if (prompt.singleSelect) {
r2 = '';
} else {
r2 = intl.string(t.JshhEl);
}
let length = value4.length;
if (length !== 0) {
length = value4.length;
value8 = '';
if (length > 0) {
length = value4.length;
if (length === 0) {
r7 = value8;
} else {
format = intl.format;
Rj841R = t.Rj841R;
object = {};
length = value4.length;
object.count = length;
Math = global.Math;
max = Math.max;
length = value4.length;
object.extraCount = Reflect.apply(max, Math, [length - 2, 0]);
object.channel1 = value4[0];
object.channel2 = value4[1];
object.itemHook = itemHook;
r7 = Reflect.apply(format, intl, [Rj841R, object]);
}
length = value5.length;
r1 = length > 0 ? formatRoleString(value5, itemHook, true) : value8;
r2 = r7;
} else {
r1 = value8;
}
} else {
length = value5.length;
if (length > 0) {
value = formatRoleString(value5, itemHook);
r1 = '';
r2 = value;
} else {
length = value4.length;
value8 = '';
if (length > 0) {
length = value4.length;
if (length === 0) {
r7 = value8;
} else {
format = intl.format;
Rj841R = t.Rj841R;
object = {};
length = value4.length;
object.count = length;
Math = global.Math;
max = Math.max;
length = value4.length;
object.extraCount = Reflect.apply(max, Math, [length - 2, 0]);
object.channel1 = value4[0];
object.channel2 = value4[1];
object.itemHook = itemHook;
r7 = Reflect.apply(format, intl, [Rj841R, object]);
}
length = value5.length;
r1 = length > 0 ? formatRoleString(value5, itemHook, true) : value8;
r2 = r7;
} else {
r1 = value8;
}
}
}
return {helpText: r2, helpTextAdditional: r1};
function _fun53140() { // fn#53140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:617, offset: 0x0133ed09, size: 48 bytes, params: 1, frame: 14
return id != null ? GuildRoleStore.getManyRoles(id, selectedRoleIds) : [];
}
function _fun53141() { // fn#53141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:705, offset: 0x0133ed39, size: 74 bytes, params: 1, frame: 12
const Array = global.Array;
let value = Array.from(selectedChannelIds);
value = value.map(function(a0) {
return ChannelStore.getChannel(a0);
});
value = value.filter(_fun53143);
return value.map(function(a0) {
return require(dependencyMap[8]).computeChannelName(a0, UserStore, RelationshipStore, true);
});
function _fun53143(a0) { // fn#53143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:757, offset: 0x0133ed99, size: 43 bytes, params: 2, frame: 14
var r0;
var permissionStoreBinding;
let value = a0 != null;
if (value) {
value = environment.__proto__.__proto__;
permissionStoreBinding = PermissionStore;
value = permissionStoreBinding.can(Permissions.VIEW_CHANNEL, a0);
r0 = value;
} else {
r0 = value;
}
return r0;
}
}
}
function useCustomizeCommunityPromptHelpText({guild, prompt, selectedRoleIds, selectedChannelIds, itemHook}) { // fn#53146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:1320, offset: 0x0133ee19, size: 840 bytes, params: 2, frame: 26
var r1;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var format;
var WewRHM;
var Math;
var max;
var ZKywGU;
var vdtNYa;
const id = guild?.id;
let useStateFromStoresArray = FluxModule.useStateFromStoresArray;
const value3 = Reflect.apply(useStateFromStoresArray, FluxModule, [[GuildRoleStore], _fun53147, [id,
selectedRoleIds]]);
useStateFromStoresArray = FluxModule.useStateFromStoresArray;
object = [ChannelStore];
object[1] = UserStore;
object[2] = RelationshipStore;
object[3] = PermissionStore;
const value4 = Reflect.apply(useStateFromStoresArray, FluxModule, [object, _fun53148]);
const value5 = value3.map(function({name}) {
return '@' + name;
});
if (prompt == null) {
r1 = intl.string(t.JshhEl);
} else if (prompt.singleSelect) {
r1 = '';
} else {
r1 = intl.string(t.JshhEl);
}
let length = value4.length;
if (length !== 0) {
length = value4.length;
if (length > 0) {
length = value5.length;
if (length === 0) {
format = intl.format;
ZKywGU = t.ZKywGU;
object = {};
length = value4.length;
object.count = length;
Math = global.Math;
max = Math.max;
length = value4.length;
object.extraCount = Reflect.apply(max, Math, [length - 2, 0]);
object.channel1 = value4[0];
object.channel2 = value4[1];
object.itemHook = itemHook;
r1 = Reflect.apply(format, intl, [ZKywGU, object]);
} else {
length = value4.length;
if (length > 0 && value5.length > 0) {
format = intl.format;
WewRHM = t.WewRHM;
object = {};
length = value4.length;
object.channelCount = length;
Math = global.Math;
max = Math.max;
length = value4.length;
object.extraChannelCount = Reflect.apply(max, Math, [length - 2, 0]);
object.channel1 = value4[0];
object.channel2 = value4[1];
object.itemHook = itemHook;
length = value5.length;
object.roleCount = length;
Math = global.Math;
max = Math.max;
length = value5.length;
object.extraRoleCount = Reflect.apply(max, Math, [length - 2, 0]);
object.role1 = value5[0];
object.role2 = value5[1];
r1 = Reflect.apply(format, intl, [WewRHM, object]);
}
}
} else {
length = value4.length;
if (length > 0 && value5.length > 0) {
format = intl.format;
WewRHM = t.WewRHM;
object = {};
length = value4.length;
object.channelCount = length;
Math = global.Math;
max = Math.max;
length = value4.length;
object.extraChannelCount = Reflect.apply(max, Math, [length - 2, 0]);
object.channel1 = value4[0];
object.channel2 = value4[1];
object.itemHook = itemHook;
length = value5.length;
object.roleCount = length;
Math = global.Math;
max = Math.max;
length = value5.length;
object.extraRoleCount = Reflect.apply(max, Math, [length - 2, 0]);
object.role1 = value5[0];
object.role2 = value5[1];
r1 = Reflect.apply(format, intl, [WewRHM, object]);
}
}
} else {
length = value5.length;
if (length > 0) {
format = intl.format;
vdtNYa = t.vdtNYa;
object = {};
length = value5.length;
object.count = length;
Math = global.Math;
max = Math.max;
length = value5.length;
object.extraCount = Reflect.apply(max, Math, [length - 2, 0]);
object.role1 = value5[0];
object.role2 = value5[1];
object.itemHook = itemHook;
r1 = Reflect.apply(format, intl, [vdtNYa, object]);
} else {
length = value4.length;
if (length > 0) {
length = value5.length;
if (length === 0) {
format = intl.format;
ZKywGU = t.ZKywGU;
object = {};
length = value4.length;
object.count = length;
Math = global.Math;
max = Math.max;
length = value4.length;
object.extraCount = Reflect.apply(max, Math, [length - 2, 0]);
object.channel1 = value4[0];
object.channel2 = value4[1];
object.itemHook = itemHook;
r1 = Reflect.apply(format, intl, [ZKywGU, object]);
} else {
length = value4.length;
if (length > 0 && value5.length > 0) {
format = intl.format;
WewRHM = t.WewRHM;
object = {};
length = value4.length;
object.channelCount = length;
Math = global.Math;
max = Math.max;
length = value4.length;
object.extraChannelCount = Reflect.apply(max, Math, [length - 2, 0]);
object.channel1 = value4[0];
object.channel2 = value4[1];
object.itemHook = itemHook;
length = value5.length;
object.roleCount = length;
Math = global.Math;
max = Math.max;
length = value5.length;
object.extraRoleCount = Reflect.apply(max, Math, [length - 2, 0]);
object.role1 = value5[0];
object.role2 = value5[1];
r1 = Reflect.apply(format, intl, [WewRHM, object]);
}
}
} else {
length = value4.length;
if (length > 0 && value5.length > 0) {
format = intl.format;
WewRHM = t.WewRHM;
object = {};
length = value4.length;
object.channelCount = length;
Math = global.Math;
max = Math.max;
length = value4.length;
object.extraChannelCount = Reflect.apply(max, Math, [length - 2, 0]);
object.channel1 = value4[0];
object.channel2 = value4[1];
object.itemHook = itemHook;
length = value5.length;
object.roleCount = length;
Math = global.Math;
max = Math.max;
length = value5.length;
object.extraRoleCount = Reflect.apply(max, Math, [length - 2, 0]);
object.role1 = value5[0];
object.role2 = value5[1];
r1 = Reflect.apply(format, intl, [WewRHM, object]);
}
}
}
}
return {helpText: r1, helpTextAdditional: ''};
function _fun53147() { // fn#53147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:1500, offset: 0x0133ed09, size: 48 bytes, params: 1, frame: 14
return id != null ? GuildRoleStore.getManyRoles(id, selectedRoleIds) : [];
}
function _fun53148() { // fn#53148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:1588, offset: 0x0133f161, size: 74 bytes, params: 1, frame: 12
const Array = global.Array;
let value = Array.from(selectedChannelIds);
value = value.map(function(a0) {
return ChannelStore.getChannel(a0);
});
value = value.filter(_fun53150);
return value.map(function(a0) {
return require(dependencyMap[8]).computeChannelName(a0, UserStore, RelationshipStore, true);
});
function _fun53150(a0) { // fn#53150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:1640, offset: 0x0133ed99, size: 43 bytes, params: 2, frame: 14
var r0;
var permissionStoreBinding;
let value = a0 != null;
if (value) {
value = environment.__proto__.__proto__;
permissionStoreBinding = PermissionStore;
value = permissionStoreBinding.can(Permissions.VIEW_CHANNEL, a0);
r0 = value;
} else {
r0 = value;
}
return r0;
}
}
}
}
global.__d(_fun53137, 6734, [1379, 1938, 3784, 3793, 1878, 661, 1244, 566, 4805,
2]) /* metro module 6734, dependencies: [1379, 1938, 3784, 3793, 1878, 661, 1244, 566, 4805, 2] */;