/* Metro module 4272; source: records/EntitlementRecord.tsx; dependencies: [6, 7, 15, 17, 18, 1886, 4273, 1885, 661, 3802, 4277, 2] */ 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}); 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 */; let value = importDefault(1886) /* metro dependency 1886: Record */; const skuRecord = importDefault(4273) /* metro dependency 4273: SKURecord */; const userRecord = importDefault(1885) /* metro dependency 1885: UserRecord */; const env0_10 = (require(661) /* metro dependency 661: Constants */).EntitlementTypes; value = _fun36220(value); (require(2) /* metro dependency 2 */).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 closure = EntitlementRecord; env0_7(closure, a0); return env0_4(closure, [{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 userRecord; var date; const object2 = {}; object2.id = a0.id; object2.skuId = a0.sku_id; object2.applicationId = a0.application_id; const user = a0.user; let value = null; if (value != user) { value2 = environment.__proto__; userRecord = new UserRecord(a0.user); } else { r4 = value; } object2.user = r4; const user_id = a0.user_id; object2.userId = user_id; object2.gifterId = a0.gifter_user_id; object2.type = a0.type; const branches = a0.branches; object2.branches = value != branches ? branches : []; if (value != a0.starts_at) { date = new global.Date(a0.starts_at); } else { r4 = value; } object2.startsAt = r4; if (value != a0.ends_at) { date = new global.Date(a0.ends_at); } else { r4 = value; } object2.endsAt = r4; object2.subscriptionId = a0.subscription_id; object2.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; object2.parentId = parent_id; let consumed = a0.consumed; consumed = value != consumed ? a0.consumed : value; object2.consumed = consumed; const gift_code_batch_id = a0.gift_code_batch_id; object2.giftCodeBatchId = value != gift_code_batch_id ? gift_code_batch_id : value; object2.giftStyle = a0.gift_style; object2.guildId = a0.guild_id; object2.deleted = a0.deleted; object2.sku = value != a0.sku ? SKURecord.createFromServer(a0.sku) : value; const source_type = a0.source_type; object2.sourceType = value != source_type ? source_type : value; const fulfillment_status = a0.fulfillment_status; object2.fulfillmentStatus = value != fulfillment_status ? fulfillment_status : value; value = Object.create(EntitlementRecord.prototype, {constructor: {value: EntitlementRecord}}); const entitlementRecord = new EntitlementRecord(object2); return entitlementRecord instanceof Object ? entitlementRecord : value; }