2026-10-12 06:59:38 +00:00
|
|
|
// Module ID: 10494
|
|
|
|
|
// Function ID: 10495
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: actions/GiftCodeActionCreators
|
2026-10-12 06:59:38 +00:00
|
|
|
// Dependencies: [5, 1085, 7137, 10495, 584, 1295, 1265, 5635, 5934, 10500, 2000, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: openGiftCodeRedeemModal, redeemGiftCode
|
|
|
|
|
|
2026-10-12 06:59:38 +00:00
|
|
|
// Module 10494 (actions/GiftCodeActionCreators)
|
2026-10-09 10:00:15 +00:00
|
|
|
import asyncRequire from "asyncRequire" /* 2000 */;
|
2026-10-10 08:08:14 +00:00
|
|
|
import ModalActionCreatorsDefault from "ModalActionCreators" /* 5934 */;
|
2026-10-03 08:58:59 +00:00
|
|
|
import _asyncToGenerator from "_asyncToGenerator" /* 5 */;
|
|
|
|
|
import Constants from "Constants" /* 1085 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-10-03 08:58:59 +00:00
|
|
|
let channel_id, closure_1, closure_2, closure_3, code, entitlement, id;
|
|
|
|
|
|
|
|
|
|
let closure_4;
|
|
|
|
|
let hasOwnProperty;
|
2026-09-10 05:38:07 +00:00
|
|
|
function redeemGiftCode() {
|
2026-10-03 08:58:59 +00:00
|
|
|
return obj(...arguments);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
let value = function _redeemGiftCode() {
|
|
|
|
|
const obj = _asyncToGenerator(async (code) => {
|
|
|
|
|
let c5 = 0;
|
|
|
|
|
let c6 = 0;
|
|
|
|
|
let c4 = 0;
|
|
|
|
|
const iter = (async function(arg0, value) {
|
|
|
|
|
let c0;
|
|
|
|
|
let c2;
|
|
|
|
|
let c3;
|
|
|
|
|
let obj9;
|
|
|
|
|
let options;
|
|
|
|
|
if (c6 === 2) {
|
|
|
|
|
c6 = 3;
|
|
|
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
|
|
|
} else if (tmp3 === 3) {
|
2026-07-29 08:29:29 +00:00
|
|
|
if (arg0 === 1) {
|
2026-09-10 05:38:07 +00:00
|
|
|
throw value;
|
2026-07-29 08:29:29 +00:00
|
|
|
} else if (arg0 === 2) {
|
2026-10-03 08:58:59 +00:00
|
|
|
return { value, done: true };
|
2026-07-29 08:29:29 +00:00
|
|
|
} else {
|
2026-10-12 06:59:38 +00:00
|
|
|
return { value: "IconComponent", done: null };
|
2026-10-03 08:58:59 +00:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
2026-09-10 05:38:07 +00:00
|
|
|
let channelId;
|
|
|
|
|
let paymentSource;
|
2026-10-03 08:58:59 +00:00
|
|
|
let billingError;
|
|
|
|
|
c6 = 2;
|
|
|
|
|
if (0 === c5) {
|
|
|
|
|
if (arg0 === 1) {
|
|
|
|
|
c6 = 3;
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
|
|
|
|
c6 = 3;
|
|
|
|
|
return { value, done: true };
|
|
|
|
|
} else {
|
|
|
|
|
closure_2 = tmp;
|
|
|
|
|
closure_1 = tmp4;
|
|
|
|
|
code = undefined;
|
|
|
|
|
options = undefined;
|
|
|
|
|
c3 = undefined;
|
|
|
|
|
({ code: c0, options } = closure_0);
|
|
|
|
|
const tmp81 = closure_0;
|
|
|
|
|
if (options === undefined) {
|
|
|
|
|
options = closure_2_6;
|
|
|
|
|
}
|
|
|
|
|
({ onRedeemed: c2, onError: c3 } = tmp81);
|
|
|
|
|
channelId = undefined;
|
|
|
|
|
channel_id = undefined;
|
|
|
|
|
paymentSource = undefined;
|
|
|
|
|
id = undefined;
|
|
|
|
|
entitlement = undefined;
|
|
|
|
|
billingError = undefined;
|
|
|
|
|
c5 = 1;
|
|
|
|
|
c6 = 1;
|
2026-10-09 10:00:15 +00:00
|
|
|
return { value: "Set", done: true };
|
2026-10-03 08:58:59 +00:00
|
|
|
}
|
|
|
|
|
} else if (1 === c5) {
|
|
|
|
|
if (arg0 === 1) {
|
|
|
|
|
c6 = 3;
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
|
|
|
|
c6 = 3;
|
|
|
|
|
return { value, done: true };
|
|
|
|
|
} else {
|
|
|
|
|
const obj18 = closure_130_0(closure_130_2[2]);
|
|
|
|
|
if (obj18.getIsPaymentsBlocked()) {
|
|
|
|
|
closure_130_1(closure_130_2[3])();
|
|
|
|
|
c6 = 3;
|
2026-10-12 06:59:38 +00:00
|
|
|
return { value: "IconComponent", done: null };
|
2026-10-03 08:58:59 +00:00
|
|
|
} else {
|
|
|
|
|
channelId = options.channelId;
|
|
|
|
|
let tmp36 = null;
|
|
|
|
|
if (undefined !== channelId) {
|
|
|
|
|
tmp36 = channelId;
|
|
|
|
|
}
|
|
|
|
|
channel_id = tmp36;
|
|
|
|
|
paymentSource = options.paymentSource;
|
|
|
|
|
let tmp41 = null;
|
|
|
|
|
if (undefined !== paymentSource) {
|
|
|
|
|
tmp41 = paymentSource;
|
|
|
|
|
}
|
|
|
|
|
id = tmp41;
|
|
|
|
|
const obj8 = { type: "GIFT_CODE_REDEEM", code };
|
|
|
|
|
const obj7 = closure_130_1(closure_130_2[4]);
|
|
|
|
|
obj7.dispatch(obj8);
|
|
|
|
|
c4 = 1;
|
|
|
|
|
const HTTP = closure_130_0(closure_130_2[5]).HTTP;
|
|
|
|
|
const request = { url: closure_130_4.GIFT_CODE_REDEEM(code), body: obj9, oldFormErrors: true, rejectWithError: false };
|
|
|
|
|
const post = HTTP.post;
|
|
|
|
|
obj9 = { channel_id, payment_source_id: id };
|
|
|
|
|
id = undefined;
|
|
|
|
|
if (id != null) {
|
|
|
|
|
id = id.id;
|
|
|
|
|
}
|
|
|
|
|
c5 = 3;
|
|
|
|
|
c6 = 1;
|
|
|
|
|
const obj10 = { value: post(request), done: false };
|
|
|
|
|
return obj10;
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
} else if (2 === c5) {
|
|
|
|
|
c4 = 0;
|
|
|
|
|
let closure_10 = closure_3;
|
|
|
|
|
const self = this;
|
|
|
|
|
const self2 = this;
|
|
|
|
|
billingError = new closure_130_0(closure_130_2[7]).BillingError(closure_10);
|
|
|
|
|
const obj11 = { type: "GIFT_CODE_REDEEM_FAILURE", code, error: billingError };
|
|
|
|
|
const obj4 = closure_130_1(closure_130_2[4]);
|
|
|
|
|
obj4.dispatch(obj11);
|
|
|
|
|
const obj6 = closure_130_1(closure_130_2[6]);
|
|
|
|
|
obj6.track(closure_130_5.OPEN_MODAL, { type: "gift_accept", location: null });
|
|
|
|
|
if (c3 != null) {
|
|
|
|
|
tmp27(billingError);
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
throw billingError;
|
|
|
|
|
} else if (arg0 === 1) {
|
|
|
|
|
c6 = 3;
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
|
|
|
|
c4 = 0;
|
|
|
|
|
c6 = 3;
|
|
|
|
|
return { value, done: true };
|
|
|
|
|
} else {
|
|
|
|
|
entitlement = value;
|
|
|
|
|
const obj13 = { type: "GIFT_CODE_REDEEM_SUCCESS", code };
|
|
|
|
|
const obj15 = closure_130_1(closure_130_2[4]);
|
|
|
|
|
obj15.dispatch(obj13);
|
|
|
|
|
const obj17 = closure_130_1(closure_130_2[6]);
|
|
|
|
|
obj17.track(closure_130_5.OPEN_MODAL, { type: "gift_accept" });
|
|
|
|
|
if (tmp != null) {
|
|
|
|
|
tmp();
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
value = { code, entitlement };
|
|
|
|
|
c4 = 0;
|
|
|
|
|
c6 = 3;
|
|
|
|
|
return { value, done: true };
|
|
|
|
|
}
|
|
|
|
|
} catch (tmp61) {
|
|
|
|
|
closure_3 = tmp61;
|
|
|
|
|
if (0 === c4) {
|
|
|
|
|
c6 = 3;
|
|
|
|
|
throw tmp61;
|
|
|
|
|
} else {
|
|
|
|
|
c5 = 2;
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
})();
|
|
|
|
|
iter.next();
|
|
|
|
|
return iter;
|
|
|
|
|
});
|
|
|
|
|
return obj(...arguments);
|
2026-09-10 05:38:07 +00:00
|
|
|
};
|
2026-09-25 08:38:05 +00:00
|
|
|
function openGiftCodeRedeemModal(c0, fromServer) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj = ModalActionCreatorsDefault;
|
|
|
|
|
const obj2 = { code: c0, giftCodeDebugOverride: fromServer };
|
2026-10-12 06:59:38 +00:00
|
|
|
obj.pushLazy(asyncRequire(10500, dependencyMap.paths), obj2, "GIFT_CODE_REDEEM_MODAL_KEY");
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
({ Endpoints: closure_4, AnalyticEvents: hasOwnProperty } = Constants);
|
2026-07-20 16:05:17 +00:00
|
|
|
let closure_6 = Object.freeze({});
|
2026-09-10 05:38:07 +00:00
|
|
|
const result = size.fileFinishedImporting("actions/native/GiftCodeActionCreators.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default { redeemGiftCode, openGiftCodeRedeemModal };
|
|
|
|
|
export { redeemGiftCode };
|
|
|
|
|
export { openGiftCodeRedeemModal };
|