113 lines
5.8 KiB
TypeScript
113 lines
5.8 KiB
TypeScript
/* Metro module 6948; source: modules/soundboard/searchSounds.tsx; dependencies: [6540, 661, 6949, 683, 3797, 6590, 6951, 2] */
|
|
function _fun55262(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:6, offset: 0x0137a1f9, size: 217 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const closure = function(a0, a1) {
|
|
var defaultImport = importDefault(dependencyMap[3]);
|
|
var SEARCH_STARTED = AnalyticEvents.SEARCH_STARTED;
|
|
defaultImport.track(SEARCH_STARTED, {channel_id: a1, search_type: SearchTypes.SOUNDBOARD, location_stack: a0});
|
|
};
|
|
const closure2 = function(a0, a1, a2, a3) {
|
|
var defaultImport = importDefault(dependencyMap[3]);
|
|
var SEARCH_RESULT_VIEWED = AnalyticEvents.SEARCH_RESULT_VIEWED;
|
|
defaultImport.track(SEARCH_RESULT_VIEWED, {search_type: SearchTypes.SOUNDBOARD, channel_id: a2, query: a3,
|
|
total_results: a0.length, location_stack: a1});
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_4 = constantsModule.AnalyticEvents;
|
|
const env0_5 = constantsModule.SearchTypes;
|
|
const env0_6 = (importDefault(6949) /* metro dependency 6949 */)(closure, 350);
|
|
const env0_7 = (importDefault(6949) /* metro dependency 6949 */)(closure2, 350);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/searchSounds.tsx');
|
|
exports.trackSearchStart = closure;
|
|
exports.trackSearchResultViewed = closure2;
|
|
exports.searchSounds = searchSounds;
|
|
}
|
|
|
|
function searchSounds(a0, a1, a2, a3, a4) { // fn#55265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:681, offset: 0x0137a387, size: 130 bytes, params: 6, frame: 19
|
|
const env0_0 = a0;
|
|
const env0_1 = a2;
|
|
const env0_2 = a3;
|
|
const env0_3 = a4;
|
|
const env0_4 = a1.reduce(_fun55266, {});
|
|
let value = a1.filter(_fun55271);
|
|
value = value.sort(_fun55272);
|
|
env0_7(value, a4, a3?.id, a0);
|
|
return value;
|
|
}
|
|
|
|
function _fun55266(a0, a1) { // fn#55266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:730, offset: 0x0137a409, size: 102 bytes, params: 3, frame: 19
|
|
env1_6(env0_3, importAll?.id);
|
|
a0[a1.soundId] = getScore(env0_0.toLocaleLowerCase(), a1, importDefault, importAll);
|
|
return a0;
|
|
}
|
|
|
|
function _fun55271({soundId}) { // fn#55271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1407, offset: 0x0137a6c2, size: 28 bytes, params: 2, frame: 2
|
|
return env0_4[soundId] > 0;
|
|
}
|
|
|
|
function _fun55272({soundId}, {soundId}) { // fn#55272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1433, offset: 0x0137a6de, size: 39 bytes, params: 3, frame: 3
|
|
const binding = env0_4;
|
|
return binding[soundId] - binding[soundId];
|
|
}
|
|
|
|
function getScore(a0, a1, a2, a3) { // fn#55267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:776, offset: 0x0137a46f, size: 506 bytes, params: 5, frame: 21
|
|
var environment;
|
|
var r8;
|
|
var r1;
|
|
var value5;
|
|
var defaultImport;
|
|
const env0_0 = a0;
|
|
let name = a1.name;
|
|
let value = name.toLocaleLowerCase();
|
|
const emojiId = a1.emojiId;
|
|
const value2 = null;
|
|
const r0 = value2 != emojiId ? EmojiStore.getCustomEmojiById(a1.emojiId) : value2;
|
|
if (value2 != a1.emojiName) {
|
|
value5 = environment.__proto__.__proto__;
|
|
defaultImport = importDefault(3797) /* metro dependency 3797: UnicodeEmojis */;
|
|
r8 = defaultImport.convertSurrogateToName(a1.emojiName, false);
|
|
} else {
|
|
r8 = value2;
|
|
}
|
|
let r4 = value2 != r8 ? (importDefault(3797) /* metro dependency 3797: UnicodeEmojis */).getByName(r8) : value2;
|
|
const r7 = value2 != r0 ? [r0.name] : value2 != (value2 == r4 ? undefined : r4.names) ? value2 == r4 ? undefined : r4.names : [];
|
|
const value10 = 0;
|
|
let r5 = a0 !== value ? value10 : 8;
|
|
r4 = r7.includes(a0) ? r5 + 7 : r5;
|
|
r5 = value.startsWith(a0) ? r4 + 6 : r4;
|
|
r4 = r7.some(_fun55268) ? r5 + 5 : r5;
|
|
const r3 = value.endsWith(a0) ? r4 + 4 : r4;
|
|
r8 = r7.some(_fun55269) ? r3 + 3 : r3;
|
|
value = environment.__proto__.__proto__;
|
|
const defaultImport3 = importDefault(6590) /* metro dependency 6590 */;
|
|
name = a1.name;
|
|
r5 = defaultImport3(a0, name.toLocaleLowerCase()) ? r8 + 2 : r8;
|
|
const r2 = r7.some(_fun55270) ? r5 + 1 : r5;
|
|
const value17 = r2 > value10;
|
|
if (value17) {
|
|
value = require(6951) /* metro dependency 6951: SoundboardUtils */;
|
|
value = value.canUseSoundboardSound(a2, a1, a3);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value17;
|
|
}
|
|
return r1 ? r2 + 100 : r2;
|
|
}
|
|
|
|
function _fun55268(a0) { // fn#55268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1137, offset: 0x0137a669, size: 23 bytes, params: 2, frame: 11
|
|
return a0.startsWith(env0_0);
|
|
}
|
|
|
|
function _fun55269(a0) { // fn#55269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1196, offset: 0x0137a680, size: 23 bytes, params: 2, frame: 11
|
|
return a0.endsWith(env0_0);
|
|
}
|
|
|
|
function _fun55270(a0) { // fn#55270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1277, offset: 0x0137a697, size: 43 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
return (importDefault(6590) /* metro dependency 6590 */)(env0_0, a0);
|
|
}
|
|
|