Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4907.js (118.4 MB)
195 lines
7.1 KiB
TypeScript
195 lines
7.1 KiB
TypeScript
// Module ID: 7545
|
|
// Function ID: 7546
|
|
// Name: VoiceChannelEffectsUtils
|
|
// Dependencies: [1372, 7544, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 7565, 7566, 7567, 12, 1431, 1397, 4375, 4379, 1115, 2]
|
|
// Exports: getEffectAnnouncement, getEffectUrl, sampleAnimationId
|
|
|
|
// Module 7545 (VoiceChannelEffectsUtils)
|
|
import util from "util" /* 1115 */;
|
|
import AvatarUtilsDefault from "AvatarUtils" /* 1397 */;
|
|
import ImageLoaderUtils from "ImageLoaderUtils" /* 1431 */;
|
|
import UnicodeEmojisDefault from "UnicodeEmojis" /* 4375 */;
|
|
import _modDef7546 from "module_7546" /* 7546 */;
|
|
import _modDef7547 from "module_7547" /* 7547 */;
|
|
import _modDef7548 from "module_7548" /* 7548 */;
|
|
import _modDef7549 from "module_7549" /* 7549 */;
|
|
import _modDef7550 from "module_7550" /* 7550 */;
|
|
import _modDef7551 from "module_7551" /* 7551 */;
|
|
import _modDef7552 from "module_7552" /* 7552 */;
|
|
import _modDef7553 from "module_7553" /* 7553 */;
|
|
import _modDef7554 from "module_7554" /* 7554 */;
|
|
import _modDef7555 from "module_7555" /* 7555 */;
|
|
import _modDef7556 from "module_7556" /* 7556 */;
|
|
import _modDef7557 from "module_7557" /* 7557 */;
|
|
import _modDef7558 from "module_7558" /* 7558 */;
|
|
import _modDef7559 from "module_7559" /* 7559 */;
|
|
import _modDef7560 from "module_7560" /* 7560 */;
|
|
import _modDef7561 from "module_7561" /* 7561 */;
|
|
import _modDef7562 from "module_7562" /* 7562 */;
|
|
import _modDef7563 from "module_7563" /* 7563 */;
|
|
import _modDef7564 from "module_7564" /* 7564 */;
|
|
import _modDef7565 from "module_7565" /* 7565 */;
|
|
import _modDef7566 from "module_7566" /* 7566 */;
|
|
import _modDef7567 from "module_7567" /* 7567 */;
|
|
import UserStore from "UserStore" /* 1372 */;
|
|
import apply from "module_12" /* 12 */;
|
|
|
|
require = fn;
|
|
const VoiceChannelEffectsConstants = fn(7544);
|
|
({ EMOJI_SIZE: closure_4, VoiceChannelEffectAnimationType } = VoiceChannelEffectsConstants);
|
|
const items = [_modDef7546];
|
|
const items1 = [_modDef7547, _modDef7548, _modDef7549, _modDef7550, _modDef7551, _modDef7552, _modDef7553, _modDef7554, _modDef7555, _modDef7556, _modDef7557, _modDef7558, _modDef7559, _modDef7560, _modDef7561, _modDef7562, _modDef7563, _modDef7564, _modDef7565, _modDef7566, _modDef7567];
|
|
const AnimationTypeToAnimations = { [VoiceChannelEffectAnimationType.BASIC]: items, [VoiceChannelEffectAnimationType.PREMIUM]: items1 };
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/voice_channel_effects/VoiceChannelEffectsUtils.tsx");
|
|
|
|
export const CUSTOM_CALL_SOUND_ANIMATION_RANGE = { start: 10, end: 15 };
|
|
export { AnimationTypeToAnimations };
|
|
export const getResizedEmojiData = apply.memoize((src) => new Promise((arg0) => {
|
|
src = arg0;
|
|
const image = new globalThis.Image();
|
|
image.src = src;
|
|
image.crossOrigin = "Anonymous";
|
|
image.onload = () => {
|
|
const result = React4 * ImageLoaderUtils.getDevicePixelRatio();
|
|
if (image.width === result) {
|
|
if (tmp2.height === result) {
|
|
closure_0(closure_0);
|
|
}
|
|
}
|
|
const element = <canvas />;
|
|
element.width = result;
|
|
element.height = result;
|
|
const context = element.getContext("2d");
|
|
if (context != null) {
|
|
context.drawImage(tmp2, 0, 0);
|
|
}
|
|
closure_0(element.toDataURL("image/png"));
|
|
};
|
|
}));
|
|
export const sampleAnimationId = function sampleAnimationId(BASIC, CUSTOM_CALL_SOUND_ANIMATION_RANGE) {
|
|
if (null != CUSTOM_CALL_SOUND_ANIMATION_RANGE) {
|
|
if (BASIC === VoiceChannelEffectAnimationType.PREMIUM) {
|
|
const sum = CUSTOM_CALL_SOUND_ANIMATION_RANGE.end + 1;
|
|
const _Math = Math;
|
|
const _Math2 = Math;
|
|
return Math.floor(Math.random() * (CUSTOM_CALL_SOUND_ANIMATION_RANGE.start - sum) + sum);
|
|
}
|
|
}
|
|
return Math.floor(Math.random() * obj[BASIC].length);
|
|
};
|
|
export const getEffectUrl = function getEffectUrl(emoji) {
|
|
let tmp = arg1;
|
|
if (arg1 === undefined) {
|
|
tmp = React4;
|
|
}
|
|
if (null != emoji.id) {
|
|
const obj3 = { id: null, animated: null, size: null };
|
|
({ id: obj5.id, animated } = emoji);
|
|
if (animated == null) {
|
|
animated = false;
|
|
}
|
|
obj3.animated = animated;
|
|
obj3.size = tmp;
|
|
return AvatarUtilsDefault.getEmojiURL(obj3);
|
|
} else {
|
|
const result = UnicodeEmojisDefault.convertSurrogateToName(emoji.name, false);
|
|
const tmp2 = importDefault;
|
|
const byName = UnicodeEmojisDefault.getByName(result);
|
|
let str = "";
|
|
if (null != byName) {
|
|
str = tmp2(4379).getURL(byName.surrogates);
|
|
const tmp2Result = tmp2(4379);
|
|
}
|
|
return str;
|
|
}
|
|
};
|
|
export const getEffectAnnouncement = function getEffectAnnouncement(items) {
|
|
if (items.length < 1) {
|
|
return "";
|
|
} else {
|
|
let emojiName = "userId";
|
|
let yZYxzF = dependencyMap;
|
|
const mapped = apply(items).map((item) => {
|
|
let tmp = item[emojiName];
|
|
if (tmp == null) {
|
|
tmp = null;
|
|
}
|
|
return tmp;
|
|
});
|
|
const found = mapped.filter((item) => null != item);
|
|
const arr = apply(items);
|
|
let obj3 = found.uniq().value();
|
|
emojiName = "emojiName";
|
|
const iter = found.uniq();
|
|
const mapped1 = apply(items).map((item) => {
|
|
let tmp = item[emojiName];
|
|
if (tmp == null) {
|
|
tmp = null;
|
|
}
|
|
return tmp;
|
|
});
|
|
const found1 = mapped1.filter((item) => null != item);
|
|
const arr3 = apply(items);
|
|
const valueResult2 = found1.uniq().value();
|
|
if (valueResult2.length < 2) {
|
|
let str2;
|
|
if (valueResult2 != null) {
|
|
str2 = valueResult2[0];
|
|
}
|
|
if (str2 == null) {
|
|
str2 = "";
|
|
}
|
|
let joined = str2;
|
|
} else {
|
|
joined = valueResult2.join(", ");
|
|
}
|
|
if (obj3.length < 1) {
|
|
return "";
|
|
} else if (1 === obj3.length) {
|
|
const intl2 = util.intl;
|
|
yZYxzF = util.t.yZYxzF;
|
|
const user = UserStore.getUser(obj3[0]);
|
|
let username;
|
|
if (user != null) {
|
|
username = user.username;
|
|
}
|
|
obj3 = { firstUsername: username, emojiNames: joined };
|
|
let formatToPlainStringResult = intl2.formatToPlainString(yZYxzF, obj3);
|
|
} else if (2 === obj3.length) {
|
|
const intl = util.intl;
|
|
const user1 = UserStore.getUser(obj3[0]);
|
|
let username1;
|
|
if (user1 != null) {
|
|
username1 = user1.username;
|
|
}
|
|
const obj4 = { firstUsername: username1, secondUsername: null, emojiNames: null };
|
|
const user2 = UserStore.getUser(obj3[1]);
|
|
let username2;
|
|
if (user2 != null) {
|
|
username2 = user2.username;
|
|
}
|
|
obj4.secondUsername = username2;
|
|
obj4.emojiNames = joined;
|
|
formatToPlainStringResult = intl.formatToPlainString(util.t["8rmtbd"], obj4);
|
|
} else {
|
|
const intl3 = util.intl;
|
|
const user3 = UserStore.getUser(obj3[0]);
|
|
let username3;
|
|
if (user3 != null) {
|
|
username3 = user3.username;
|
|
}
|
|
const obj = { firstUsername: username3, secondUsername: null, count: null, emojiNames: null };
|
|
const user4 = UserStore.getUser(obj3[1]);
|
|
let username4;
|
|
if (user4 != null) {
|
|
username4 = user4.username;
|
|
}
|
|
obj.secondUsername = username4;
|
|
obj.count = obj3.length - 2;
|
|
obj.emojiNames = joined;
|
|
formatToPlainStringResult = intl3.formatToPlainString(util.t["/okjv0"], obj);
|
|
}
|
|
const iter2 = found1.uniq();
|
|
}
|
|
};
|