/* Metro module 4272; source: records/EntitlementRecord.tsx; dependencies: [6, 7, 15, 17, 18, 1886, 4273, 1885, 661, 3802, 4277, 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 UserRecord from './UserRecord.tsx'; /* Metro dependency 1885 */ import Record from '../lib/Record.tsx'; /* Metro dependency 1886 */ import SKURecord from '../modules/skus/SKURecord.tsx'; /* Metro dependency 4273 */ import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */ function _fun36216(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4444:6, offset: 0x010854fa, size: 260 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = Record; value = _fun36220(value); (FileImportTrackerModule).fileFinishedImporting('records/EntitlementRecord.tsx'); exports.default = value; function _isNativeReflectConstruct_36217() { // fn#36217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4444:205, offset: 0x010855fe, size: 94 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_36217_isNativeReflectConstruct = function() { return !!result; })(); } function _fun36220(a0) { // fn#36220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4444:404, offset: 0x0108565c, size: 144 bytes, params: 2, frame: 17 const EntitlementRecord2 = EntitlementRecord; Inherits(EntitlementRecord2, a0); return CreateClass(EntitlementRecord2, [{key: 'isGiftable', get: get_36222}, {key: 'isValid', value: value_36223}, {key: 'isFulfilled', value: function() { return this.fulfillmentStatus === require(dependencyMap[10]).EntitlementTenantFulfillmentStatus.FULFILLED; }}], [{key: 'createFromServer', value: value_36225}]); function EntitlementRecord({id, skuId, applicationId, user, userId, gifterId, type, branches, startsAt, endsAt, subscriptionId, subscriptionPlanId, parentId, consumed, giftCodeBatchId, giftStyle, guildId, deleted, sourceType, fulfillmentStatus}) { // fn#36221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4444:416, offset: 0x010856ec, size: 344 bytes, params: 2, frame: 20 let value = environment.__proto__; env1_3(this, EntitlementRecord); const value3 = env1_6(EntitlementRecord); value = env1_5(this, _isNativeReflectConstruct_36217() ? global.Reflect.construct(value3, [], env1_6(this).constructor) : value3.apply(this, undefined)); value.id = id; value.skuId = skuId; value.applicationId = applicationId; value.user = user; value.userId = userId; value.gifterId = gifterId; value.type = type; value.branches = branches; value.startsAt = startsAt; value.endsAt = endsAt; value.subscriptionId = subscriptionId; value.subscriptionPlanId = subscriptionPlanId; value.parentId = parentId; value.consumed = consumed; value.giftCodeBatchId = giftCodeBatchId; value.giftStyle = giftStyle; value.guildId = guildId; value.deleted = deleted; value.sourceType = sourceType; value.fulfillmentStatus = fulfillmentStatus; return value; } function get_36222() { // fn#36222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4444:1192, offset: 0x01085844, size: 42 bytes, params: 1, frame: 3 const type = this.type; const value = environment.__proto__; const USER_GIFT = EntitlementTypes.USER_GIFT; return type === USER_GIFT && this.gifterId == null; } function value_36223(a0, a1) { // fn#36223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4444:1278, offset: 0x0108586e, size: 283 bytes, params: 3, frame: 15 var date; var startsAt; var endsAt; var branches; let value = a2; const r1 = value !== undefined ? value : null; if (!this.isGiftable) { if (this.deleted) { return false; } var type = this.type; value = environment.__proto__; var PREMIUM_SUBSCRIPTION = EntitlementTypes.PREMIUM_SUBSCRIPTION; if (type !== PREMIUM_SUBSCRIPTION) { date = new global.Date(); startsAt = this.startsAt; if (startsAt == null) { endsAt = this.endsAt; if (endsAt == null) { if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } endsAt = this.endsAt; if (date >= endsAt) { return false; } if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } startsAt = this.startsAt; if (date < startsAt) { return false; } endsAt = this.endsAt; if (endsAt == null) { if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } endsAt = this.endsAt; if (date >= endsAt) { return false; } if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } var value2 = a1.get(this.skuId); if (value2 == null) { value = importDefault(3802) /* metro dependency 3802: PremiumUtils */; if (value.canInstallPremiumApplications(a0)) { date = new global.Date(); startsAt = this.startsAt; if (startsAt == null) { endsAt = this.endsAt; if (endsAt == null) { if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } endsAt = this.endsAt; if (date >= endsAt) { return false; } if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } startsAt = this.startsAt; if (date < startsAt) { return false; } endsAt = this.endsAt; if (endsAt == null) { if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } endsAt = this.endsAt; if (date >= endsAt) { return false; } if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } return false; } if (value2.premium) { value = importDefault(3802) /* metro dependency 3802: PremiumUtils */; if (value.canInstallPremiumApplications(a0)) { date = new global.Date(); startsAt = this.startsAt; if (startsAt == null) { endsAt = this.endsAt; if (endsAt == null) { if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } endsAt = this.endsAt; if (date >= endsAt) { return false; } if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } startsAt = this.startsAt; if (date < startsAt) { return false; } endsAt = this.endsAt; if (endsAt == null) { if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } endsAt = this.endsAt; if (date >= endsAt) { return false; } if (r1 == null) { return true; } branches = this.branches; if (branches.length === 0) { if (this.applicationId !== r1) { return false; } return true; } branches = this.branches; if (branches.includes(r1)) { return true; } return false; } return false; } } return false; } function value_36225(a0) { // fn#36225, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4444:1886, offset: 0x010859bd, size: 519 bytes, params: 2, frame: 16 var r4; var value2; var userRecord2; var date; const object = {}; object.id = a0.id; object.skuId = a0.sku_id; object.applicationId = a0.application_id; const user = a0.user; let value = null; if (value != user) { value2 = environment.__proto__; userRecord2 = new UserRecord(a0.user); } else { r4 = value; } object.user = r4; const user_id = a0.user_id; object.userId = user_id; object.gifterId = a0.gifter_user_id; object.type = a0.type; const branches = a0.branches; object.branches = value != branches ? branches : []; if (value != a0.starts_at) { date = new global.Date(a0.starts_at); } else { r4 = value; } object.startsAt = r4; if (value != a0.ends_at) { date = new global.Date(a0.ends_at); } else { r4 = value; } object.endsAt = r4; object.subscriptionId = a0.subscription_id; object.subscriptionPlanId = value != a0.subscription_plan ? a0.subscription_plan.id : value; let parent_id = a0.parent_id; parent_id = value != parent_id ? a0.parent_id : value; object.parentId = parent_id; let consumed = a0.consumed; consumed = value != consumed ? a0.consumed : value; object.consumed = consumed; const gift_code_batch_id = a0.gift_code_batch_id; object.giftCodeBatchId = value != gift_code_batch_id ? gift_code_batch_id : value; object.giftStyle = a0.gift_style; object.guildId = a0.guild_id; object.deleted = a0.deleted; object.sku = value != a0.sku ? SKURecord.createFromServer(a0.sku) : value; const source_type = a0.source_type; object.sourceType = value != source_type ? source_type : value; const fulfillment_status = a0.fulfillment_status; object.fulfillmentStatus = value != fulfillment_status ? fulfillment_status : value; value = Object.create(EntitlementRecord.prototype, {constructor: {value: EntitlementRecord}}); const entitlementRecord = new EntitlementRecord(object); return entitlementRecord instanceof Object ? entitlementRecord : value; } } } global.__d(_fun36216, 4272, [6, 7, 15, 17, 18, 1886, 4273, 1885, 661, 3802, 4277, 2]) /* metro module 4272, dependencies: [6, 7, 15, 17, 18, 1886, 4273, 1885, 661, 3802, 4277, 2] */;