693 lines
33 KiB
TypeScript
693 lines
33 KiB
TypeScript
/* Metro module 8326; source: modules/premium/gifting/PremiumGiftingIntentStore.tsx; dependencies: [6, 7, 15, 17, 18, 4107, 5221, 1348, 5078, 3793, 661, 8327, 8328, 3829, 22, 566, 694, 2] */
|
|
function _fun66272(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:6, offset: 0x01bf5eb9, size: 904 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_66278 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const experimentStore = importDefault(4107) /* metro dependency 4107: ExperimentStore */;
|
|
const userAffinitiesV2Store = importDefault(5221) /* metro dependency 5221: UserAffinitiesV2Store */;
|
|
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
|
|
const consentStore = importDefault(5078) /* metro dependency 5078: ConsentStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const env0_13 = (require(661) /* metro dependency 661: Constants */).Consents;
|
|
object = {messageGiftIntentLastShownMap: {}, lastShownFriendsListGiftIntents: [],
|
|
friendsTabBadgeLastDismissedTime: null, giftUnreadNotificationLastDismissedTimes: [],
|
|
profilePopoutGiftIntentsDismissMap: {}, lastKnownGiftIntentDismissedAtMs: 0};
|
|
const env0_15 = [];
|
|
let Set = global.Set;
|
|
let set = new Set();
|
|
Set = global.Set;
|
|
set = new Set();
|
|
const env0_18 = {};
|
|
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
|
|
set = _fun66293(PersistedStore);
|
|
set.displayName = 'PremiumGiftingIntentStore';
|
|
set.persistKey = 'PremiumGiftingIntentStore';
|
|
set.migrations = [function(a0) {
|
|
var r0;
|
|
var object;
|
|
var property;
|
|
var value = a0;
|
|
var value2 = null;
|
|
if (value2 == value) {
|
|
r0 = value;
|
|
} else {
|
|
object = {};
|
|
property = value.friendsTabBadgeLastDismissedTime;
|
|
object.friendsTabBadgeLastDismissedTime = value2 != property ? property : value2;
|
|
property = value.lastShownFriendsListGiftIntents;
|
|
object.lastShownFriendsListGiftIntents = value2 != property ? property : [];
|
|
object.messageGiftIntentLastShownMap = {};
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
}, function(a0) {
|
|
var r4;
|
|
var r0;
|
|
var property;
|
|
var value = a0;
|
|
if (value == null) {
|
|
r0 = value;
|
|
} else {
|
|
property = value.lastShownFriendsListGiftIntents;
|
|
r4 = property ?? [];
|
|
property = value.messageGiftIntentLastShownMap;
|
|
r0 = {friendsTabBadgeLastDismissedTime: null, lastShownFriendsListGiftIntents: r4,
|
|
messageGiftIntentLastShownMap: property ?? ({}), giftUnreadNotificationLastDismissedTimes: []};
|
|
}
|
|
return r0;
|
|
}, function(a0) {
|
|
var r4;
|
|
var r0;
|
|
var object;
|
|
var property;
|
|
var value = a0;
|
|
if (value == null) {
|
|
r0 = value;
|
|
} else {
|
|
object = {friendsTabBadgeLastDismissedTime: null};
|
|
property = value.lastShownFriendsListGiftIntents;
|
|
r4 = property ?? [];
|
|
object.lastShownFriendsListGiftIntents = r4;
|
|
property = value.messageGiftIntentLastShownMap;
|
|
r4 = property ?? ({});
|
|
object.messageGiftIntentLastShownMap = r4;
|
|
property = value.giftUnreadNotificationLastDismissedTimes;
|
|
object.giftUnreadNotificationLastDismissedTimes = property ?? [];
|
|
object.profilePopoutGiftIntentsDismissMap = {};
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
}, function(a0) {
|
|
var r4;
|
|
var r0;
|
|
var object;
|
|
var lastKnownGiftIntentDismissedAtMs;
|
|
var value = a0;
|
|
if (value == null) {
|
|
r0 = value;
|
|
} else {
|
|
object = {};
|
|
copyDataProperties(object, value, r4);
|
|
lastKnownGiftIntentDismissedAtMs = value.lastKnownGiftIntentDismissedAtMs;
|
|
value = 0;
|
|
object['lastKnownGiftIntentDismissedAtMs'] = lastKnownGiftIntentDismissedAtMs ?? value;
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
}];
|
|
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
|
|
resetFriendAnniversaries();
|
|
}, LOGOUT: function() {
|
|
env0_14 = {messageGiftIntentLastShownMap: {}, lastShownFriendsListGiftIntents: [],
|
|
friendsTabBadgeLastDismissedTime: null, giftUnreadNotificationLastDismissedTimes: [],
|
|
profilePopoutGiftIntentsDismissMap: {}, lastKnownGiftIntentDismissedAtMs: 0};
|
|
resetFriendAnniversaries();
|
|
}, MESSAGE_GIFT_INTENT_SHOWN: function({recipientUserId}) {
|
|
maybeUpdateMessageGiftIntentLastShownMap(recipientUserId);
|
|
}, FRIENDS_LIST_GIFT_INTENTS_SHOWN: FRIENDS_LIST_GIFT_INTENTS_SHOWN,
|
|
GIFT_UNREAD_NOTIFICATION_DISMISS: GIFT_UNREAD_NOTIFICATION_DISMISS,
|
|
GIFT_INTENT_FLOW_PURCHASED_GIFT: function({recipientUserId}) {
|
|
maybeUpdateMessageGiftIntentLastShownMap(recipientUserId);
|
|
}, GIFT_INTENT_DISMISSALS_FETCH_SUCCESS: GIFT_INTENT_DISMISSALS_FETCH_SUCCESS,
|
|
PROFILE_POPOUT_GIFT_INTENTS_DISMISS: PROFILE_POPOUT_GIFT_INTENTS_DISMISS,
|
|
DEV_TOOLS_FRIENDS_LIST_GIFT_INTENTS_SHOWN_RESET: DEV_TOOLS_FRIENDS_LIST_GIFT_INTENTS_SHOWN_RESET,
|
|
DEV_TOOLS_GIFT_MESSAGE_COOLDOWN_RESET: DEV_TOOLS_GIFT_MESSAGE_COOLDOWN_RESET,
|
|
DEV_TOOLS_GIFT_UNREAD_NOTIFICATION_COOLDOWN_RESET: DEV_TOOLS_GIFT_UNREAD_NOTIFICATION_COOLDOWN_RESET,
|
|
DEV_TOOLS_SET_FRIEND_ANNIVERSARY_COUNT: DEV_TOOLS_SET_FRIEND_ANNIVERSARY_COUNT,
|
|
DEV_TOOLS_RESAMPLE_FRIEND_ANNIVERSARIES: DEV_TOOLS_RESAMPLE_FRIEND_ANNIVERSARIES,
|
|
DEV_TOOLS_SET_CURRENT_DATE: function(a0) {
|
|
env0_21 = a0.date;
|
|
}, DEV_TOOLS_RESET_CURRENT_DATE: function() {
|
|
env0_21 = null;
|
|
}, DEV_TOOLS_PROFILE_POPOUT_GIFT_INTENTS_DISMISS_RESET: DEV_TOOLS_PROFILE_POPOUT_GIFT_INTENTS_DISMISS_RESET});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/gifting/PremiumGiftingIntentStore.tsx');
|
|
exports.default = set;
|
|
exports.FRIENDS_LIST_ANNIVERSARY_DISPLAY_LIMIT = 5;
|
|
exports.FRIENDS_TAB_BADGE_COOLDOWN_MS = 604800000;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_66273() { // fn#66273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:221, offset: 0x01bf6241, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_66273_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_66276(a0, a1) { // fn#66276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:414, offset: 0x01bf62a3, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun66277;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_66278(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_66278(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_66278(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun66277;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function getCurrentTime_66279() { // fn#66279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:1618, offset: 0x01bf6417, size: 38 bytes, params: 1, frame: 10
|
|
return env0_21 ?? global.Date.now();
|
|
}
|
|
|
|
function categorizeTopAffinityFriendAnniversaries() { // fn#66280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:1672, offset: 0x01bf643d, size: 82 bytes, params: 1, frame: 17
|
|
const value = a0;
|
|
const r6 = value !== undefined ? value : false;
|
|
const friendAnniversaryUtilsModule = require(8327) /* metro dependency 8327: FriendAnniversaryUtils */;
|
|
const {highestAffinity,
|
|
highAffinity} = friendAnniversaryUtilsModule.categorizeFriendAnniversariesByAffinity(env0_15, _fun66281, r6);
|
|
}
|
|
|
|
function updateFriendAnniversaries() { // fn#66282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:1908, offset: 0x01bf64b7, size: 464 bytes, params: 1, frame: 23
|
|
var r4;
|
|
var FriendAnniversariesExperiment;
|
|
var EnableFriendAnniversaryNotifications;
|
|
var value2;
|
|
var value3;
|
|
var done;
|
|
var value4;
|
|
var since;
|
|
var userAffinity;
|
|
var isFriend;
|
|
var dmProbability;
|
|
var Date;
|
|
var prototype;
|
|
var value7;
|
|
var date;
|
|
var value8;
|
|
var moduleValue;
|
|
var isFriendAnniversary;
|
|
var binding;
|
|
var value9;
|
|
if (env0_19 == null) {
|
|
resetFriendAnniversaries();
|
|
if (ConsentStore.hasConsented(Consents.PERSONALIZATION)) {
|
|
FriendAnniversariesExperiment = (require(8328) /* metro dependency 8328: FriendAnniversariesExperiment */).FriendAnniversariesExperiment;
|
|
if (FriendAnniversariesExperiment.getConfig({location: 'PremiumGiftingIntentStore updateFriendAnniversaries'}).enabled) {
|
|
EnableFriendAnniversaryNotifications = (require(3829) /* metro dependency 3829: UserSettings */).EnableFriendAnniversaryNotifications;
|
|
if (EnableFriendAnniversaryNotifications.getSetting()) {
|
|
value2 = _createForOfIteratorHelperLoose_66276(RelationshipStore.getFriendIDs());
|
|
value3 = value2();
|
|
done = value3.done;
|
|
if (!done) {
|
|
r4 = value3;
|
|
while (true) {
|
|
value4 = r4.value;
|
|
since = RelationshipStore.getSince(value4);
|
|
userAffinity = UserAffinitiesV2Store.getUserAffinity(value4);
|
|
isFriend = RelationshipStore.isFriend;
|
|
if (Reflect.apply(isFriend, RelationshipStore, [value4])) {
|
|
if (userAffinity == null) {
|
|
break;
|
|
}
|
|
dmProbability = userAffinity.dmProbability;
|
|
if (dmProbability > 0) {
|
|
if (since == null) {
|
|
break;
|
|
}
|
|
Date = global.Date;
|
|
prototype = Date.prototype;
|
|
value7 = Object.create(prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
value8 = date instanceof Object ? date : value7;
|
|
moduleValue = require(8327) /* metro dependency 8327: FriendAnniversaryUtils */;
|
|
isFriendAnniversary = moduleValue.isFriendAnniversary;
|
|
if (Reflect.apply(isFriendAnniversary, moduleValue, [value8])) {
|
|
binding = env0_15;
|
|
binding.push(value4);
|
|
binding = env0_18;
|
|
binding[value4] = {friendsSince: value8};
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
value9 = value2();
|
|
done = value9.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r4 = value9;
|
|
continue;
|
|
}
|
|
}
|
|
binding = env0_15;
|
|
binding.sort(function(a0, a1) {
|
|
return UserAffinitiesV2Store.compareByDmProbability(a0, a1);
|
|
});
|
|
categorizeTopAffinityFriendAnniversaries();
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
generateFriendAnniversaries(env0_19);
|
|
}
|
|
}
|
|
|
|
function resetFriendAnniversaries() { // fn#66284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:2608, offset: 0x01bf66a2, size: 87 bytes, params: 1, frame: 11
|
|
env0_15.length = 0;
|
|
let Set = global.Set;
|
|
let set = new Set();
|
|
Set = global.Set;
|
|
set = new Set();
|
|
env0_18 = {};
|
|
}
|
|
|
|
function cleanGiftUnreadNotificationLastDismissedTimes() { // fn#66285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:2680, offset: 0x01bf66f9, size: 54 bytes, params: 1, frame: 13
|
|
const env0_0 = getCurrentTime_66279();
|
|
const binding = env0_14;
|
|
binding.giftUnreadNotificationLastDismissedTimes = binding.giftUnreadNotificationLastDismissedTimes.filter(_fun66286);
|
|
}
|
|
|
|
function maybeUpdateMessageGiftIntentLastShownMap(a0) { // fn#66287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:2871, offset: 0x01bf6749, size: 54 bytes, params: 2, frame: 11
|
|
if (env0_14.messageGiftIntentLastShownMap[a0] == null) {
|
|
env0_14.messageGiftIntentLastShownMap[a0] = getCurrentTime_66279();
|
|
}
|
|
}
|
|
|
|
function generateFriendAnniversaries(a0) { // fn#66288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:3020, offset: 0x01bf677f, size: 332 bytes, params: 2, frame: 17
|
|
var EnableFriendAnniversaryNotifications;
|
|
var value3;
|
|
var set;
|
|
resetFriendAnniversaries();
|
|
const FriendAnniversariesExperiment = (require(8328) /* metro dependency 8328: FriendAnniversariesExperiment */).FriendAnniversariesExperiment;
|
|
const getConfig = FriendAnniversariesExperiment.getConfig;
|
|
if (Reflect.apply(getConfig, FriendAnniversariesExperiment,
|
|
[{location: 'PremiumGiftingIntentStore generateFriendAnniversaries'}]).enabled) {
|
|
EnableFriendAnniversaryNotifications = (require(3829) /* metro dependency 3829: UserSettings */).EnableFriendAnniversaryNotifications;
|
|
if (EnableFriendAnniversaryNotifications.getSetting()) {
|
|
env0_19 = a0;
|
|
value3 = RelationshipStore.getFriendIDs().filter(function(a0) {
|
|
return !RelationshipStore.isIgnored(a0);
|
|
});
|
|
set = new global.Set();
|
|
(env0_20 == null || env0_20.length !== a0 ? (importDefault(22) /* metro dependency 22 */).sampleSize(value3,
|
|
a0) : env0_20.every(_fun66290) ? env0_20 : (importDefault(22) /* metro dependency 22 */).sampleSize(value3,
|
|
|
|
a0)).forEach(_fun66291);
|
|
env0_15.sort(_fun66292);
|
|
categorizeTopAffinityFriendAnniversaries(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun66293(a0) { // fn#66293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:3626, offset: 0x01bf6940, size: 500 bytes, params: 2, frame: 16
|
|
const closure = PremiumGiftingIntentStore;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'initialize', value: value_66295}, {key: 'getState', value: value_66296},
|
|
{key: 'getFriendAnniversaries', value: value_66297}, {key: 'getNextRecipientUserIDForNotification',
|
|
value: value_66298}, {key: 'isNotificationCooldownActive', value: value_66300}, {key: 'canShowFriendsTabBadge',
|
|
value: function() {
|
|
return _fun66303();
|
|
}}, {key: 'getFriendAnniversaryYears', value: value_66305}, {key: 'canShowProfilePopoutGiftIntents',
|
|
value: value_66306}, {key: 'isGiftIntentMessageInCooldown', value: value_66307},
|
|
{key: 'getDevToolTotalFriendAnniversaries', value: value_66308}, {key: 'getDevToolCurrentDate',
|
|
value: value_66309}, {key: 'getHighestAffinityFriendAnniversaries', value: value_66310},
|
|
{key: 'getHighAffinityFriendAnniversaries', value: value_66311},
|
|
{key: 'getGiftUnreadNotificationLastDismissedTimes', value: value_66312},
|
|
{key: 'getMessageGiftIntentLastShownMap', value: value_66313}, {key: 'getLastKnownGiftIntentDismissedAtMs',
|
|
value: value_66314}, {key: 'getProfilePopoutGiftIntentsDismissMap', value: value_66315}]);
|
|
}
|
|
|
|
function FRIENDS_LIST_GIFT_INTENTS_SHOWN() { // fn#66323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:8696, offset: 0x01bf70b3, size: 39 bytes, params: 1, frame: 12
|
|
const binding = env0_14;
|
|
const Array = global.Array;
|
|
binding.lastShownFriendsListGiftIntents = Array.from(env0_15);
|
|
}
|
|
|
|
function GIFT_UNREAD_NOTIFICATION_DISMISS() { // fn#66324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:8823, offset: 0x01bf70da, size: 35 bytes, params: 1, frame: 12
|
|
const giftUnreadNotificationLastDismissedTimes = env0_14.giftUnreadNotificationLastDismissedTimes;
|
|
giftUnreadNotificationLastDismissedTimes.push(getCurrentTime_66279());
|
|
}
|
|
|
|
function GIFT_INTENT_DISMISSALS_FETCH_SUCCESS({dismissals, settingsTimestampMs}) { // fn#66326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:9115, offset: 0x01bf70fd, size: 197 bytes, params: 2, frame: 24
|
|
var r4;
|
|
var r3;
|
|
var value4;
|
|
var targetId;
|
|
var dismissedAtMs;
|
|
var property;
|
|
var Math;
|
|
var value5;
|
|
var value6;
|
|
const object2 = {};
|
|
copyDataProperties(object2, env0_14.messageGiftIntentLastShownMap, undefined);
|
|
const value2 = _createForOfIteratorHelperLoose_66276(dismissals);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r4 = value3;
|
|
while (true) {
|
|
value4 = r4.value;
|
|
targetId = value4.targetId;
|
|
dismissedAtMs = value4.dismissedAtMs;
|
|
property = object2[targetId];
|
|
if (property == null) {
|
|
r3 = dismissedAtMs;
|
|
} else {
|
|
Math = global.Math;
|
|
value5 = Math.max(property, dismissedAtMs);
|
|
r3 = value5;
|
|
}
|
|
object2[targetId] = r3;
|
|
value6 = value2();
|
|
done = value6.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r4 = value6;
|
|
continue;
|
|
}
|
|
}
|
|
const binding = env0_14;
|
|
const friendAnniversaryUtilsModule = require(8327) /* metro dependency 8327: FriendAnniversaryUtils */;
|
|
binding.messageGiftIntentLastShownMap = friendAnniversaryUtilsModule.pruneTimestampMap(object2,
|
|
getCurrentTime_66279(), 1296000000);
|
|
env0_14.lastKnownGiftIntentDismissedAtMs = settingsTimestampMs;
|
|
}
|
|
|
|
function PROFILE_POPOUT_GIFT_INTENTS_DISMISS({recipientUserId}) { // fn#66327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:9545, offset: 0x01bf71c2, size: 38 bytes, params: 2, frame: 11
|
|
env0_14.profilePopoutGiftIntentsDismissMap[recipientUserId] = getCurrentTime_66279();
|
|
}
|
|
|
|
function DEV_TOOLS_FRIENDS_LIST_GIFT_INTENTS_SHOWN_RESET() { // fn#66328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:9719, offset: 0x01bf71e8, size: 21 bytes, params: 1, frame: 2
|
|
env0_14.lastShownFriendsListGiftIntents = [];
|
|
}
|
|
|
|
function DEV_TOOLS_GIFT_MESSAGE_COOLDOWN_RESET() { // fn#66329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:9852, offset: 0x01bf71fd, size: 19 bytes, params: 1, frame: 2
|
|
env0_14.messageGiftIntentLastShownMap = {};
|
|
}
|
|
|
|
function DEV_TOOLS_GIFT_UNREAD_NOTIFICATION_COOLDOWN_RESET() { // fn#66330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:9987, offset: 0x01bf7210, size: 21 bytes, params: 1, frame: 2
|
|
env0_14.giftUnreadNotificationLastDismissedTimes = [];
|
|
}
|
|
|
|
function DEV_TOOLS_SET_FRIEND_ANNIVERSARY_COUNT({total}) { // fn#66331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:10133, offset: 0x01bf7225, size: 54 bytes, params: 2, frame: 12
|
|
if (total == null) {
|
|
updateFriendAnniversaries();
|
|
} else {
|
|
generateFriendAnniversaries(total);
|
|
}
|
|
}
|
|
|
|
function DEV_TOOLS_RESAMPLE_FRIEND_ANNIVERSARIES() { // fn#66332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:10329, offset: 0x01bf725b, size: 39 bytes, params: 1, frame: 12
|
|
var r0;
|
|
const value2 = env0_19 != null;
|
|
if (value2) {
|
|
generateFriendAnniversaries(env0_19);
|
|
r0 = true;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function DEV_TOOLS_PROFILE_POPOUT_GIFT_INTENTS_DISMISS_RESET() { // fn#66335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:10650, offset: 0x01bf7296, size: 19 bytes, params: 1, frame: 2
|
|
env0_14.profilePopoutGiftIntentsDismissMap = {};
|
|
}
|
|
|
|
function _fun66281(a0) { // fn#66281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:1787, offset: 0x01bf648f, size: 40 bytes, params: 2, frame: 11
|
|
const value = environment.__proto__;
|
|
return UserAffinitiesV2Store.getUserAffinity(a0)?.dmProbability;
|
|
}
|
|
|
|
function _fun66286(a0) { // fn#66286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:2854, offset: 0x01bf672f, size: 26 bytes, params: 2, frame: 2
|
|
return env0_0 - a0 <= 604800000;
|
|
}
|
|
|
|
function _fun66291(a0) { // fn#66291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:3437, offset: 0x01bf68e5, size: 91 bytes, params: 2, frame: 13
|
|
var date;
|
|
var binding;
|
|
const since = RelationshipStore.getSince(a0);
|
|
if (since != null) {
|
|
date = new global.Date(since);
|
|
binding = env1_15;
|
|
binding.push(a0);
|
|
binding = env1_18;
|
|
binding[a0] = {friendsSince: date};
|
|
}
|
|
}
|
|
|
|
function value_66295(a0) { // fn#66295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:3981, offset: 0x01bf6b34, size: 453 bytes, params: 2, frame: 22
|
|
var binding;
|
|
var Array;
|
|
let object2 = {messageGiftIntentLastShownMap: {}, lastShownFriendsListGiftIntents: [],
|
|
friendsTabBadgeLastDismissedTime: null, giftUnreadNotificationLastDismissedTimes: [],
|
|
profilePopoutGiftIntentsDismissMap: {}};
|
|
let value = 0;
|
|
object2.lastKnownGiftIntentDismissedAtMs = value;
|
|
env1_14 = object2;
|
|
if (a0 != null) {
|
|
binding = env1_14;
|
|
binding.friendsTabBadgeLastDismissedTime = a0.friendsTabBadgeLastDismissedTime;
|
|
binding = env1_14;
|
|
Array = global.Array;
|
|
binding.lastShownFriendsListGiftIntents = Array.from(a0.lastShownFriendsListGiftIntents);
|
|
binding = env1_14;
|
|
object2 = {};
|
|
copyDataProperties(object2, a0.messageGiftIntentLastShownMap, undefined);
|
|
binding.messageGiftIntentLastShownMap = object2;
|
|
binding = env1_14;
|
|
Array = global.Array;
|
|
binding.giftUnreadNotificationLastDismissedTimes = Array.from(a0.giftUnreadNotificationLastDismissedTimes ?? []);
|
|
binding = env1_14;
|
|
object2 = {};
|
|
copyDataProperties(object2, a0.profilePopoutGiftIntentsDismissMap, undefined);
|
|
binding.profilePopoutGiftIntentsDismissMap = object2;
|
|
binding = env1_14;
|
|
binding.lastKnownGiftIntentDismissedAtMs = a0.lastKnownGiftIntentDismissedAtMs ?? value;
|
|
}
|
|
this.syncWith([RelationshipStore, UserAffinitiesV2Store, ConsentStore, ExperimentStore, UserSettingsProtoStore],
|
|
updateFriendAnniversaries);
|
|
binding = env1_14;
|
|
value = require(8327) /* metro dependency 8327: FriendAnniversaryUtils */;
|
|
let pruneTimestampMap = value.pruneTimestampMap;
|
|
const messageGiftIntentLastShownMap = env1_14.messageGiftIntentLastShownMap;
|
|
const getCurrentTime_66279Binding = getCurrentTime_66279;
|
|
binding.messageGiftIntentLastShownMap = Reflect.apply(pruneTimestampMap, value, [messageGiftIntentLastShownMap,
|
|
getCurrentTime_66279Binding(), 1209600000]);
|
|
cleanGiftUnreadNotificationLastDismissedTimes();
|
|
binding = env1_14;
|
|
value = require(8327) /* metro dependency 8327: FriendAnniversaryUtils */;
|
|
pruneTimestampMap = value.pruneTimestampMap;
|
|
const profilePopoutGiftIntentsDismissMap = env1_14.profilePopoutGiftIntentsDismissMap;
|
|
const currentTime_66279Binding = getCurrentTime_66279Binding();
|
|
const FRIEND_ANNIVERSARY_ELIGIBILITY_WINDOW_DAYS = (require(8327) /* metro dependency 8327: FriendAnniversaryUtils */).FRIEND_ANNIVERSARY_ELIGIBILITY_WINDOW_DAYS;
|
|
binding.profilePopoutGiftIntentsDismissMap = Reflect.apply(pruneTimestampMap, value,
|
|
[profilePopoutGiftIntentsDismissMap, currentTime_66279Binding,
|
|
86400000 * FRIEND_ANNIVERSARY_ELIGIBILITY_WINDOW_DAYS * 2]);
|
|
}
|
|
|
|
function value_66298() { // fn#66298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:5390, offset: 0x01bf6cf9, size: 69 bytes, params: 1, frame: 11
|
|
var environment;
|
|
if (this.isNotificationCooldownActive()) {
|
|
return undefined;
|
|
}
|
|
const Array = global.Array;
|
|
const from = Array.from;
|
|
const value = environment.__proto__;
|
|
return Reflect.apply(from, Array, [env1_16]).find(_fun66299);
|
|
}
|
|
|
|
function value_66300() { // fn#66300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:5558, offset: 0x01bf6d5a, size: 99 bytes, params: 1, frame: 14
|
|
cleanGiftUnreadNotificationLastDismissedTimes();
|
|
const giftUnreadNotificationLastDismissedTimes = env1_14.giftUnreadNotificationLastDismissedTimes;
|
|
if (giftUnreadNotificationLastDismissedTimes.length === 0) {
|
|
return false;
|
|
}
|
|
if (giftUnreadNotificationLastDismissedTimes.length >= 5) {
|
|
return true;
|
|
}
|
|
const env0_0 = getCurrentTime_66279();
|
|
return giftUnreadNotificationLastDismissedTimes.filter(_fun66301).length >= 1;
|
|
}
|
|
|
|
function value_66302() { // fn#66302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:5815, offset: 0x01bf6dd7, size: 17 bytes, params: 1, frame: 9
|
|
return hasNewHighAffinityFriendAnniversaries();
|
|
}
|
|
|
|
function value_66305(a0) { // fn#66305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:6005, offset: 0x01bf6e36, size: 66 bytes, params: 2, frame: 13
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
const property = env1_18[a0];
|
|
if (property == null) {
|
|
r0 = 0;
|
|
} else {
|
|
value = require(8327) /* metro dependency 8327: FriendAnniversaryUtils */;
|
|
value = value.yearsSince(property.friendsSince);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_66306(a0) { // fn#66306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:6129, offset: 0x01bf6e78, size: 43 bytes, params: 2, frame: 5
|
|
const value = environment.__proto__;
|
|
return env1_14.profilePopoutGiftIntentsDismissMap[a0] == null && env1_18[a0] != null;
|
|
}
|
|
|
|
function value_66307(a0) { // fn#66307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:6251, offset: 0x01bf6ea3, size: 28 bytes, params: 2, frame: 2
|
|
return env1_14.messageGiftIntentLastShownMap[a0] != null;
|
|
}
|
|
|
|
function value_66311() { // fn#66311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:6573, offset: 0x01bf6eda, size: 27 bytes, params: 1, frame: 11
|
|
const Array = global.Array;
|
|
return Array.from(env1_17);
|
|
}
|
|
|
|
function value_66312() { // fn#66312, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:6664, offset: 0x01bf6ef5, size: 15 bytes, params: 1, frame: 1
|
|
return env1_14.giftUnreadNotificationLastDismissedTimes;
|
|
}
|
|
|
|
function value_66313() { // fn#66313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:6773, offset: 0x01bf6f04, size: 15 bytes, params: 1, frame: 1
|
|
return env1_14.messageGiftIntentLastShownMap;
|
|
}
|
|
|
|
function value_66314() { // fn#66314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:6874, offset: 0x01bf6f13, size: 15 bytes, params: 1, frame: 1
|
|
return env1_14.lastKnownGiftIntentDismissedAtMs;
|
|
}
|
|
|
|
function value_66315() { // fn#66315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:6980, offset: 0x01bf6f22, size: 15 bytes, params: 1, frame: 1
|
|
return env1_14.profilePopoutGiftIntentsDismissMap;
|
|
}
|
|
|
|
function _fun66299(a0) { // fn#66299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:5468, offset: 0x01bf6d3e, size: 28 bytes, params: 2, frame: 2
|
|
return env2_14.messageGiftIntentLastShownMap[a0] == null;
|
|
}
|
|
|
|
function _fun66301(a0) { // fn#66301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:5755, offset: 0x01bf6dbd, size: 26 bytes, params: 2, frame: 2
|
|
return env0_0 - a0 <= 86400000;
|
|
}
|
|
|
|
function hasNewHighAffinityFriendAnniversaries() { // fn#66303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:5833, owner: value_66302.hasNewHighAffinityFriendAnniversaries, offset: 0x01bf6de8, size: 47 bytes, params: 1, frame: 11
|
|
var environment;
|
|
const Array = global.Array;
|
|
const from = Array.from;
|
|
const value = environment.__proto__.__proto__;
|
|
return Reflect.apply(from, Array, [env2_17]).some(_fun66304);
|
|
}
|
|
|
|
function _fun66304(a0) { // fn#66304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8511:5909, offset: 0x01bf6e17, size: 31 bytes, params: 2, frame: 11
|
|
const lastShownFriendsListGiftIntents = env3_14.lastShownFriendsListGiftIntents;
|
|
return !lastShownFriendsListGiftIntents.includes(a0);
|
|
}
|
|
|