364 lines
16 KiB
TypeScript
364 lines
16 KiB
TypeScript
/* Metro module 12566; source: modules/premium/native/NoticeStore.tsx; dependencies: [6, 7, 15, 17, 18, 7064, 1880, 661, 587, 3738, 566, 694, 2] */
|
|
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import UserOfferStore from '../../../stores/billing/UserOfferStore.tsx'; /* Metro dependency 7064 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as StorageModule from '../../../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as PremiumConstantsModule from '../PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
|
|
function _fun96239(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:6, offset: 0x021588d9, size: 532 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_96245 = 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 clearDismissUntil = function(a0) {
|
|
var Storage = require(dependencyMap[8]).Storage;
|
|
Storage.remove(dismissUntilStorageKey(a0));
|
|
};
|
|
const CONNECTION_OPEN_962502 = CONNECTION_OPEN_96250;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const NoticeTypes = (ConstantsModule).NoticeTypes;
|
|
let PREMIUM_TIER_2_TRIAL_ENDING = NoticeTypes.PREMIUM_TIER_2_TRIAL_ENDING;
|
|
object = [PREMIUM_TIER_2_TRIAL_ENDING];
|
|
let PREMIUM_TIER_0_TRIAL_ENDING = NoticeTypes.PREMIUM_TIER_0_TRIAL_ENDING;
|
|
object[1] = PREMIUM_TIER_0_TRIAL_ENDING;
|
|
object = {};
|
|
PREMIUM_TIER_0_TRIAL_ENDING = NoticeTypes.PREMIUM_TIER_0_TRIAL_ENDING;
|
|
object[PREMIUM_TIER_0_TRIAL_ENDING] = 'hidePremiumTier0TrialEndingReminder';
|
|
PREMIUM_TIER_2_TRIAL_ENDING = NoticeTypes.PREMIUM_TIER_2_TRIAL_ENDING;
|
|
object[PREMIUM_TIER_2_TRIAL_ENDING] = 'hidePremiumTier2TrialEndingReminder';
|
|
const Store = (Flux).Store;
|
|
let value = _fun96251(Store);
|
|
value.displayName = 'NoticeStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{CONNECTION_OPEN: CONNECTION_OPEN_962502, CURRENT_USER_UPDATE: CONNECTION_OPEN_962502,
|
|
PREMIUM_PAYMENT_SUBSCRIBE_SUCCESS: CONNECTION_OPEN_962502,
|
|
BILLING_SUBSCRIPTION_UPDATE_SUCCESS: CONNECTION_OPEN_962502,
|
|
BILLING_MOST_RECENT_SUBSCRIPTION_FETCH_SUCCESS: CONNECTION_OPEN_962502,
|
|
BILLING_SUBSCRIPTION_FETCH_SUCCESS: CONNECTION_OPEN_962502, LOGOUT: LOGOUT_96255,
|
|
NOTICE_DISMISS: NOTICE_DISMISS});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/NoticeStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_96240() { // fn#96240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:218, offset: 0x02158aed, 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_96240_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_96243(a0, a1) { // fn#96243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:411, offset: 0x02158b4f, 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 _fun96244;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_96245(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_96245(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_96245(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun96244;
|
|
}
|
|
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 _fun96244() { // fn#96244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:982, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function dismissUntilStorageKey(a0) { // fn#96246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:1540, offset: 0x02158cc3, size: 26 bytes, params: 2, frame: 2
|
|
return env0_13[a0] + '-untilAtLeast';
|
|
}
|
|
|
|
function dismissNotice(a0, a1) { // fn#96248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:1684, offset: 0x02158d15, size: 160 bytes, params: 3, frame: 17
|
|
var property;
|
|
const Storage = (StorageModule).Storage;
|
|
if (a0 != null) {
|
|
property = env0_13[a0];
|
|
if (property != null) {
|
|
Storage.set(property, true);
|
|
}
|
|
if (a1 == null) {
|
|
clearDismissUntil(a0);
|
|
} else if (property != null) {
|
|
Storage.set(dismissUntilStorageKey(a0), a1.format('YYYY-MM-DDTHH:mm:ss.SSSZ'));
|
|
} else {
|
|
clearDismissUntil(a0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function isNoticeDismissed(a0) { // fn#96249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:1931, offset: 0x02158db5, size: 224 bytes, params: 2, frame: 17
|
|
var r2;
|
|
const Storage = (StorageModule).Storage;
|
|
var value7;
|
|
let value = null;
|
|
if (value == a0) {
|
|
return false;
|
|
}
|
|
const property = env0_13[a0];
|
|
if (value != property) {
|
|
var value3 = Storage.get(dismissUntilStorageKey(a0));
|
|
r2 = value != value3 ? (importDefault(3738) /* metro dependency 3738 */)(value3) : value;
|
|
if (value != r2) {
|
|
return r2.isAfter((importDefault(3738) /* metro dependency 3738 */)());
|
|
}
|
|
}
|
|
let r1 = value != property && property !== '';
|
|
if (r1) {
|
|
value7 = Storage.get(property);
|
|
value = value != value7;
|
|
r1 = value && value7;
|
|
}
|
|
return r1;
|
|
}
|
|
|
|
function BILLING_MOST_RECENT_SUBSCRIPTION_FETCH_SUCCESS_96250() { // fn#96250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:2231, offset: 0x02158e95, size: 237 bytes, params: 1, frame: 18
|
|
var r2;
|
|
var value4;
|
|
var PREMIUM_TIER_2_TRIAL_ENDING;
|
|
var PREMIUM_TIER_0_TRIAL_ENDING;
|
|
var userOfferStoreBinding;
|
|
var getAlmostExpiringTrialOffersForReminder;
|
|
var TIER_0;
|
|
var length;
|
|
var isNoticeDismissedBinding;
|
|
var TIER_2;
|
|
var value5;
|
|
const value2 = _createForOfIteratorHelperLoose_96243(env0_12);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r2 = value3;
|
|
reducibleLoop1: while (true) {
|
|
value4 = r2.value;
|
|
PREMIUM_TIER_2_TRIAL_ENDING = NoticeTypes.PREMIUM_TIER_2_TRIAL_ENDING;
|
|
if (value4 === PREMIUM_TIER_2_TRIAL_ENDING) {
|
|
userOfferStoreBinding = UserOfferStore;
|
|
getAlmostExpiringTrialOffersForReminder = userOfferStoreBinding.getAlmostExpiringTrialOffersForReminder;
|
|
TIER_2 = PremiumSubscriptionSKUs.TIER_2;
|
|
length = Reflect.apply(getAlmostExpiringTrialOffersForReminder, userOfferStoreBinding,
|
|
[[TIER_2]]).length;
|
|
reducibleJoin9: while (true) {
|
|
if (length > 0) {
|
|
isNoticeDismissedBinding = isNoticeDismissed;
|
|
PREMIUM_TIER_2_TRIAL_ENDING = NoticeTypes.PREMIUM_TIER_2_TRIAL_ENDING;
|
|
if (isNoticeDismissedBinding(PREMIUM_TIER_2_TRIAL_ENDING)) {
|
|
break reducibleJoin9;
|
|
}
|
|
env0_11 = value4;
|
|
break reducibleLoop1;
|
|
}
|
|
break reducibleJoin9;
|
|
}
|
|
} else {
|
|
PREMIUM_TIER_0_TRIAL_ENDING = NoticeTypes.PREMIUM_TIER_0_TRIAL_ENDING;
|
|
reducibleJoin9: while (true) {
|
|
if (value4 !== PREMIUM_TIER_0_TRIAL_ENDING) {
|
|
break reducibleJoin9;
|
|
}
|
|
userOfferStoreBinding = UserOfferStore;
|
|
getAlmostExpiringTrialOffersForReminder = userOfferStoreBinding.getAlmostExpiringTrialOffersForReminder;
|
|
TIER_0 = PremiumSubscriptionSKUs.TIER_0;
|
|
length = Reflect.apply(getAlmostExpiringTrialOffersForReminder, userOfferStoreBinding,
|
|
[[TIER_0]]).length;
|
|
if (length > 0) {
|
|
isNoticeDismissedBinding = isNoticeDismissed;
|
|
PREMIUM_TIER_0_TRIAL_ENDING = NoticeTypes.PREMIUM_TIER_0_TRIAL_ENDING;
|
|
if (isNoticeDismissedBinding(PREMIUM_TIER_0_TRIAL_ENDING)) {
|
|
break reducibleJoin9;
|
|
}
|
|
env0_11 = value4;
|
|
break reducibleLoop1;
|
|
}
|
|
break reducibleJoin9;
|
|
}
|
|
}
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break reducibleLoop1;
|
|
}
|
|
r2 = value5;
|
|
continue reducibleLoop1;
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun96251(a0) { // fn#96251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:2686, offset: 0x02158f82, size: 97 bytes, params: 2, frame: 16
|
|
const NoticeStore2 = NoticeStore;
|
|
Inherits(NoticeStore2, a0);
|
|
return CreateClass(NoticeStore2, [{key: 'initialize', value: function() {
|
|
this.syncWith([UserOfferStore], CONNECTION_OPEN_96250);
|
|
this.waitFor(UserOfferStore);
|
|
}}, {key: 'getNoticeType', value: value_96254}]);
|
|
function NoticeStore() { // fn#96252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:2698, offset: 0x00e2f839, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_3(this, NoticeStore);
|
|
const value3 = env1_6(NoticeStore);
|
|
return env1_5(this, _isNativeReflectConstruct_96240() ? global.Reflect.construct(value3, arguments,
|
|
env1_6(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_96254() { // fn#96254, offset: 0x00ef8482, size: 9 bytes, params: 1, frame: 1
|
|
return env1_11;
|
|
}
|
|
|
|
}
|
|
|
|
function LOGOUT_96255() { // fn#96255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:3423, offset: 0x02159018, size: 116 bytes, params: 1, frame: 18
|
|
var r4;
|
|
var value4;
|
|
var property;
|
|
var Storage;
|
|
var value5;
|
|
const value2 = _createForOfIteratorHelperLoose_96243(env0_12);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r4 = value3;
|
|
while (true) {
|
|
value4 = r4.value;
|
|
property = env0_13[value4];
|
|
if (property != null) {
|
|
Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.remove(property);
|
|
}
|
|
clearDismissUntil(value4);
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r4 = value5;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
|
|
function NOTICE_DISMISS(a0) { // fn#96256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12756:3640, offset: 0x0215908c, size: 50 bytes, params: 2, frame: 14
|
|
if (env0_11 != null) {
|
|
dismissNotice(env0_11, a0.untilAtLeast);
|
|
CONNECTION_OPEN_96250();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun96239, 12566, [6, 7, 15, 17, 18, 7064, 1880, 661, 587, 3738, 566, 694,
|
|
2]) /* metro module 12566, dependencies: [6, 7, 15, 17, 18, 7064, 1880, 661, 587, 3738, 566, 694, 2] */;
|