decord/alpha/source/utils/EmojiUtilsPlatformed.native.tsx
github-actions c6aa9eb120 chore: update source for alpha 349.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
2026-10-01 06:55:13 +00:00

324 lines
11 KiB
TypeScript

// Module ID: 7375
// Function ID: 7376
// Name: EmojiUtilsPlatformed
// Dependencies: [32, 5, 17, 4513, 4821, 1364, 12, 1397, 7376, 1476, 4712, 7415, 7420, 2]
// Module 7375 (EmojiUtilsPlatformed)
import _modDef12 from "module_12" /* 12 */;
import PlatformUtils from "PlatformUtils" /* 1364 */;
import AvatarUtilsDefault from "AvatarUtils" /* 1397 */;
import DeviceUtils from "DeviceUtils" /* 4821 */;
import burst_reactions_BurstReactionEffectUtils from "burst_reactions/BurstReactionEffectUtils" /* 7376 */;
import BurstReactionFirstSendActionSheet from "BurstReactionFirstSendActionSheet" /* 7415 */;
import _slicedToArray from "module_32" /* 32 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import defaultImageSrcGenerator from "defaultImageSrcGenerator" /* 4513 */;
import MemoizerUtils from "MemoizerUtils" /* 7420 */;
require = fn;
function getURL(name) {
if (null == name) {
const convert = defaultImageSrcGenerator.convert;
const _HermesInternal = HermesInternal;
let str = "asset:/emoji-" + convert.toCodePoint(name) + ".png";
} else {
str = "";
}
return str;
}
let closure_9 = async function _getEmojiColors(arg0) {
let id = arg0;
c3 = 0;
c4 = 0;
return (async (arg0, value) => {
if (c4 === 2) {
c4 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c4 = 2;
if (0 === c3) {
if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 3;
const obj3 = { value, done: true };
return obj3;
} else {
closure_2 = tmp5;
closure_1 = tmp2;
closure_129_0 = undefined;
closure_129_1 = undefined;
id = id.id;
if (null != id) {
const obj5 = { id, size: 32, animated: false };
let emojiURL = AvatarUtilsDefault.getEmojiURL(obj5);
} else {
emojiURL = getURL(tmp31);
}
closure_129_0 = emojiURL;
if ("" === emojiURL) {
ImageManager = ImageManager.ImageManager;
c3 = 1;
c4 = 1;
const obj7 = { value: ImageManager.getEmojiBase64(tmp30.name, burst_reactions_BurstReactionEffectUtils.EMOJI_IN_ANIMATION_SIZE), done: false };
return obj7;
} else {
const paletteForAvatar = closure_130_0(closure_130_2[9]).getPaletteForAvatar(closure_129_0);
c3 = 2;
c4 = 1;
const obj6 = closure_130_0(closure_130_2[9]);
}
tmp30 = id;
}
} else if (1 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 !== 2) {
const _HermesInternal = HermesInternal;
closure_129_0 = "data:image/png;base64," + value;
}
} else if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 3;
const obj8 = { value, done: true };
return obj8;
} else {
closure_129_1 = value;
let mapped;
if (closure_129_1 != null) {
mapped = closure_129_1.map((item) => {
[tmp2, tmp3, tmp4] = closure_1_3(item, 3);
const tmp = closure_1_3(item, 3);
return id(closure_1_2[10]).rgbToHex(tmp2, tmp3, tmp4);
});
}
c4 = 3;
const obj = { value: mapped, done: true };
return obj;
}
c4 = 3;
const obj9 = { value, done: true };
return obj9;
} catch (tmp25) {
c4 = tmp;
throw tmp25;
}
}
})();
};
get_ActivityIndicator = fn(17);
({ NativeModules: hasOwnProperty, processColor: metroRequire } = get_ActivityIndicator);
let obj = { getURL: null, filterUnsupportedEmojis: null, applyPlatformToThemedEmojiColorPalette: null, getEmojiColors: null, triggerFullscreenAnimation: null };
obj.getURL = MemoizerUtils.makeMemoizer(getURL);
obj.filterUnsupportedEmojis = function filterUnsupportedEmojis(arg0) {
let found = arg0;
if (!obj.isAndroid()) {
found = _modDef12.filter(arg0, (unicodeVersion) => {
unicodeVersion = unicodeVersion.unicodeVersion;
const systemVersionMajor = DeviceUtils.getSystemVersionMajor();
const systemVersionMinor = DeviceUtils.getSystemVersionMinor();
let flag = true;
if (unicodeVersion > 8) {
if (9 === unicodeVersion) {
let tmp21 = systemVersionMajor > 10;
if (!tmp21) {
let tmp22 = 10 === systemVersionMajor;
if (tmp22) {
tmp22 = systemVersionMinor >= 2;
}
tmp21 = tmp22;
}
flag = tmp21;
} else if (10 === unicodeVersion) {
let tmp19 = systemVersionMajor > 11;
if (!tmp19) {
let tmp20 = 11 === systemVersionMajor;
if (tmp20) {
tmp20 = systemVersionMinor >= 1;
}
tmp19 = tmp20;
}
flag = tmp19;
} else if (11 === unicodeVersion) {
let tmp17 = systemVersionMajor > 12;
if (!tmp17) {
let tmp18 = 12 === systemVersionMajor;
if (tmp18) {
tmp18 = systemVersionMinor >= 1;
}
tmp17 = tmp18;
}
flag = tmp17;
} else {
if (12 !== unicodeVersion) {
if (12.1 !== unicodeVersion) {
if (13 === unicodeVersion) {
let tmp13 = systemVersionMajor > 14;
if (!tmp13) {
let tmp14 = 14 === systemVersionMajor;
if (tmp14) {
tmp14 = systemVersionMinor >= 2;
}
tmp13 = tmp14;
}
flag = tmp13;
} else if (13.1 === unicodeVersion) {
let tmp11 = systemVersionMajor > 14;
if (!tmp11) {
let tmp12 = 14 === systemVersionMajor;
if (tmp12) {
tmp12 = systemVersionMinor >= 5;
}
tmp11 = tmp12;
}
flag = tmp11;
} else if (14 === unicodeVersion) {
let tmp9 = systemVersionMajor > 15;
if (!tmp9) {
let tmp10 = 15 === systemVersionMajor;
if (tmp10) {
tmp10 = systemVersionMinor >= 4;
}
tmp9 = tmp10;
}
flag = tmp9;
} else if (15 === unicodeVersion) {
let tmp7 = systemVersionMajor > 16;
if (!tmp7) {
let tmp8 = 16 === systemVersionMajor;
if (tmp8) {
tmp8 = systemVersionMinor >= 4;
}
tmp7 = tmp8;
}
flag = tmp7;
} else if (15.1 === unicodeVersion) {
let tmp5 = systemVersionMajor > 17;
if (!tmp5) {
let tmp6 = 17 === systemVersionMajor;
if (tmp6) {
tmp6 = systemVersionMinor >= 4;
}
tmp5 = tmp6;
}
flag = tmp5;
} else {
flag = false;
if (16 === unicodeVersion) {
let tmp4 = systemVersionMajor > 18;
if (!tmp4) {
let tmp3 = 18 === systemVersionMajor;
if (tmp3) {
tmp3 = systemVersionMinor >= 4;
}
tmp4 = tmp3;
}
flag = tmp4;
}
}
}
}
let tmp15 = systemVersionMajor > 13;
if (!tmp15) {
let tmp16 = 13 === systemVersionMajor;
if (tmp16) {
tmp16 = systemVersionMinor >= 2;
}
tmp15 = tmp16;
}
flag = tmp15;
}
}
return flag;
});
}
return found;
};
obj.applyPlatformToThemedEmojiColorPalette = function applyPlatformToThemedEmojiColorPalette(arg0) {
({ palette, shouldProcessMobileColors } = arg0);
if (shouldProcessMobileColors === undefined) {
shouldProcessMobileColors = false;
}
if (shouldProcessMobileColors) {
if (null != palette) {
({ LIGHT, DARK } = palette);
let accentColor;
if (LIGHT != null) {
accentColor = LIGHT.accentColor;
}
const obj = { accentColor: timestampProducer(accentColor), backgroundColor: null, highlightColor: null, opacity: null };
let backgroundColor;
if (LIGHT != null) {
backgroundColor = LIGHT.backgroundColor;
}
obj.backgroundColor = timestampProducer(backgroundColor);
let highlightColor;
if (LIGHT != null) {
highlightColor = LIGHT.highlightColor;
}
obj.highlightColor = timestampProducer(highlightColor);
let opacity;
if (LIGHT != null) {
opacity = LIGHT.opacity;
}
const obj2 = { LIGHT: null, DARK: null };
obj.opacity = opacity;
obj2.LIGHT = obj;
let accentColor1;
if (DARK != null) {
accentColor1 = DARK.accentColor;
}
const obj3 = { accentColor: timestampProducer(accentColor1), backgroundColor: null, highlightColor: null, opacity: null };
let backgroundColor1;
if (DARK != null) {
backgroundColor1 = DARK.backgroundColor;
}
obj3.backgroundColor = timestampProducer(backgroundColor1);
let highlightColor1;
if (DARK != null) {
highlightColor1 = DARK.highlightColor;
}
obj3.highlightColor = timestampProducer(highlightColor1);
let opacity1;
if (DARK != null) {
opacity1 = DARK.opacity;
}
obj3.opacity = opacity1;
obj2.DARK = obj3;
return obj2;
}
}
return palette;
};
obj.getEmojiColors = function getEmojiColors() {
const self = this;
const apply = closure_9.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
};
obj.triggerFullscreenAnimation = function triggerFullscreenAnimation(arg0) {
({ channelId, messageId, emoji } = arg0);
const result = BurstReactionFirstSendActionSheet.openBurstReactionFirstSendActionSheet({ channelId, messageId, emoji });
};
const size = fn(2);
let result = size.fileFinishedImporting("utils/EmojiUtilsPlatformed.native.tsx");
export default obj;