decord/source/modules/premium/native/gifting/PremiumGiftAnalytics.tsx

88 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10462
// Function ID: 10463
2026-07-20 16:05:17 +00:00
// Name: PremiumGiftAnalytics
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 676, 9662, 7696, 500, 698, 1236, 7697, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 10462 (PremiumGiftAnalytics)
import closure_3 from "noop" /* 19 */;
import { AnalyticEvents } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/premium/native/gifting/PremiumGiftAnalytics.tsx");
2026-07-20 16:05:17 +00:00
export default function PremiumGiftAnalytics(currentStep) {
currentStep = currentStep.currentStep;
2026-07-29 08:29:29 +00:00
let customGiftMessage;
let productId;
let basePurchaseAnalytics;
let ref;
2026-08-24 06:08:38 +00:00
closure_5 = undefined;
closure_6 = undefined;
2026-07-23 10:11:24 +00:00
const nativeGiftContext = currentStep(productId[2]).useNativeGiftContext();
2026-07-29 08:29:29 +00:00
customGiftMessage = nativeGiftContext.customGiftMessage;
2026-07-23 10:11:24 +00:00
productId = nativeGiftContext.productId;
2026-07-29 08:29:29 +00:00
basePurchaseAnalytics = nativeGiftContext.basePurchaseAnalytics;
ref = basePurchaseAnalytics.useRef(null);
2026-07-23 10:11:24 +00:00
let timestamp = Date.now();
2026-07-29 08:29:29 +00:00
closure_5 = basePurchaseAnalytics.useRef(timestamp);
closure_6 = basePurchaseAnalytics.useRef(timestamp);
2026-07-20 16:05:17 +00:00
const items = [basePurchaseAnalytics, currentStep, ref, customGiftMessage, productId];
2026-07-23 10:11:24 +00:00
const effect = basePurchaseAnalytics.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (currentStep !== ref.current) {
const _Date = Date;
const timestamp = Date.now();
2026-07-29 08:29:29 +00:00
if (null != tmp2.current) {
let isIOSResult = tmp === currentStep(productId[3]).PaymentFlowStep.CONFIRM;
2026-07-20 16:05:17 +00:00
if (isIOSResult) {
let obj = currentStep(productId[4]);
isIOSResult = obj.isIOS();
}
if (isIOSResult) {
2026-08-24 06:08:38 +00:00
obj1 = customGiftMessage(productId[5]);
2026-07-20 16:05:17 +00:00
obj = {};
let obj3 = currentStep(productId[3]);
2026-07-29 08:29:29 +00:00
obj = { subscription_plan_gateway_plan_id: null };
obj[0] = productId;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(obj3.getPaymentFlowStepAnalyticsFields(basePurchaseAnalytics, obj));
const intl = currentStep(productId[6]).intl;
2026-07-29 08:29:29 +00:00
obj.is_custom_message_edited = customGiftMessage !== intl.string(currentStep(productId[6]).t.ZkOo1U);
obj.is_custom_emoji_sound_available = false;
2026-07-20 16:05:17 +00:00
obj1.track(ref.PAYMENT_FLOW_SUCCEEDED, obj);
}
obj1 = {};
const obj6 = customGiftMessage(productId[5]);
2026-07-29 08:29:29 +00:00
const obj2 = { from_step: null, to_step: null, step_duration_ms: null, flow_duration_ms: null, subscription_plan_gateway_plan_id: null };
obj2[0] = tmp2.current;
obj2[1] = tmp;
obj2[2] = timestamp - ref2.current;
obj2[3] = timestamp - ref.current;
obj2[4] = productId;
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(currentStep(productId[3]).getPaymentFlowStepAnalyticsFields(basePurchaseAnalytics, obj2));
obj6.track(ref.PAYMENT_FLOW_STEP, obj1);
const obj8 = currentStep(productId[3]);
} else {
const result = currentStep(productId[7]).trackPaymentFlowStartedAnalyticsAndCTP(basePurchaseAnalytics);
const obj10 = currentStep(productId[7]);
obj3 = {};
const obj11 = customGiftMessage(productId[5]);
2026-07-29 08:29:29 +00:00
const obj4 = { initial_step: null };
obj4[0] = tmp;
2026-07-20 16:05:17 +00:00
const merged2 = Object.assign(currentStep(productId[3]).getPaymentFlowStepAnalyticsFields(basePurchaseAnalytics, obj4));
obj11.track(ref.PAYMENT_FLOW_LOADED, obj3);
const obj13 = currentStep(productId[3]);
}
2026-07-29 08:29:29 +00:00
tmp2.current = tmp;
2026-07-20 16:05:17 +00:00
ref2.current = timestamp;
}
}, items);
const items1 = [basePurchaseAnalytics, ref];
2026-07-23 10:11:24 +00:00
const effect1 = basePurchaseAnalytics.useEffect(() => () => {
2026-08-24 06:08:38 +00:00
if (ref.current !== closure_1_0(closure_1_2[3]).PaymentFlowStep.CONFIRM) {
closure_1_1(closure_1_2[5]).track(closure_1_4.PAYMENT_FLOW_CANCELED, closure_3);
const obj = closure_1_1(closure_1_2[5]);
2026-07-20 16:05:17 +00:00
}
}, items1);
return currentStep.children;
};