decord/source/actions/native/GiftCodeActionCreators.tsx

85 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 7974
2026-07-27 11:26:19 +00:00
// Function ID: 63543
2026-07-20 16:05:17 +00:00
// Name: redeemGiftCode
2026-07-25 08:10:48 +00:00
// Dependencies: [5, 653, 6234, 6299, 686, 507, 675, 4030, 4338, 7975, 1935, 2]
2026-07-20 16:05:17 +00:00
// Exports: openGiftCodeRedeemModal, redeemGiftCode
2026-07-25 08:10:48 +00:00
// Module 7974 (redeemGiftCode)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import ME from "ME";
let closure_4;
let closure_5;
const require = arg1;
2026-07-20 16:05:17 +00:00
function redeemGiftCode(arg0) {
return _redeemGiftCode(...arguments);
}
async function _redeemGiftCode(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let iter = (function*(arg0) {
2026-07-20 16:05:17 +00:00
let code;
let onError;
let onRedeemed;
let options;
({ code, options } = arg0);
if (options === undefined) {
2026-07-23 10:11:24 +00:00
options = outer2_6;
2026-07-20 16:05:17 +00:00
}
({ onRedeemed, onError } = arg0);
yield undefined;
2026-07-23 10:11:24 +00:00
let obj = outer2_0(outer2_2[2]);
2026-07-20 16:05:17 +00:00
if (obj.getIsPaymentsBlocked()) {
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[3])();
2026-07-20 16:05:17 +00:00
} else {
const channelId = options.channelId;
let tmp3 = null;
if (undefined !== channelId) {
tmp3 = channelId;
}
const paymentSource = options.paymentSource;
let tmp5 = null;
if (undefined !== paymentSource) {
tmp5 = paymentSource;
}
2026-07-23 10:11:24 +00:00
let obj1 = outer2_1(outer2_2[4]);
2026-07-20 16:05:17 +00:00
obj = { type: "GIFT_CODE_REDEEM", code };
obj1.dispatch(obj);
2026-07-23 10:11:24 +00:00
const HTTP = outer2_0(outer2_2[5]).HTTP;
obj = { url: outer2_4.GIFT_CODE_REDEEM(code) };
2026-07-20 16:05:17 +00:00
obj1 = { channel_id: tmp3 };
let id;
if (null != tmp5) {
id = tmp5.id;
}
obj1.payment_source_id = id;
obj.body = obj1;
obj.oldFormErrors = true;
obj.rejectWithError = false;
const tmp17 = yield HTTP.post(obj);
const obj2 = { type: "GIFT_CODE_REDEEM_SUCCESS", code };
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[4]).dispatch(obj2);
const obj6 = outer2_1(outer2_2[4]);
2026-07-20 16:05:17 +00:00
const obj3 = { type: "gift_accept" };
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[6]).track(outer2_5.OPEN_MODAL, obj3);
2026-07-20 16:05:17 +00:00
if (null != onRedeemed) {
onRedeemed();
}
const obj4 = { code, entitlement: tmp17 };
return obj4;
}
2026-07-23 10:11:24 +00:00
})();
iter.next();
return iter;
2026-07-20 16:05:17 +00:00
}
function openGiftCodeRedeemModal(code) {
2026-07-25 08:10:48 +00:00
let obj = importDefault(4338);
2026-07-20 16:05:17 +00:00
obj = { code };
2026-07-25 08:10:48 +00:00
obj.pushLazy(require(1935) /* maybeLoadBundle */(7975, dependencyMap.paths), obj, "GIFT_CODE_REDEEM_MODAL_KEY");
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
({ Endpoints: closure_4, AnalyticEvents: closure_5 } = ME);
2026-07-20 16:05:17 +00:00
let closure_6 = Object.freeze({});
2026-07-23 10:11:24 +00:00
const result = require("items").fileFinishedImporting("actions/native/GiftCodeActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default { redeemGiftCode, openGiftCodeRedeemModal };
export { redeemGiftCode };
export { openGiftCodeRedeemModal };