decord/source/modules/contact_sync/native/ContactSyncAnalyticsUtils.tsx

104 lines
3.5 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 11921
// Function ID: 11922
2026-07-20 16:05:17 +00:00
// Name: Steps
2026-08-05 07:35:12 +00:00
// Dependencies: [1874, 11916, 11917, 676, 11919, 698, 11922, 2]
2026-07-20 16:05:17 +00:00
// Exports: trackFlowEnd, trackFlowStart, trackFlowStep
2026-08-05 07:35:12 +00:00
// Module 11921 (Steps)
2026-07-29 08:29:29 +00:00
import mergeGuildAvatar from "mergeGuildAvatar";
import { getIsOnboarding } from "ContactSyncModes";
2026-07-23 10:11:24 +00:00
import { ContactPermissions } from "ContactSyncLandingPage";
import { AnalyticEvents } from "ME";
const require = arg1;
let obj = { INITIALIZED: "Flow Initialized", LANDING: "Landing", PERMISSION_REQUESTED: "Contacts Permission Requested", NAME_INPUT: "Name Input", SUGGESTIONS_RESULTS: "Suggestions Results", CONTACT_INVITES: "Contact Invites", ADD_PHONE_NUMBER: "Add Phone Number", VERIFY_PHONE_NUMBER: "Verify Phone Number", PASSWORD_CONFIRM: "Password Confirmation", COMPLETE: "Complete" };
let c8 = null;
let c9 = 0;
2026-07-29 08:29:29 +00:00
const Onboarding = "Onboarding";
2026-07-23 10:11:24 +00:00
let result = require("ContactSyncLandingPage").fileFinishedImporting("modules/contact_sync/native/ContactSyncAnalyticsUtils.tsx");
2026-07-20 16:05:17 +00:00
export const Steps = obj;
export const CONTACT_SYNC_ONBOARDING_LOCATION = "Onboarding";
export const trackFlowStart = function trackFlowStart(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-20 16:05:17 +00:00
const LANDING = obj.LANDING;
let closure_9 = Date.now();
2026-07-23 10:11:24 +00:00
currentUser = currentUser.getCurrentUser();
2026-07-20 16:05:17 +00:00
let phone;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
phone = currentUser.phone;
}
let closure_1 = null != phone;
2026-08-05 07:35:12 +00:00
obj = _require(11919);
2026-07-20 16:05:17 +00:00
const result = obj.checkContactPermissions();
result.then((arg0) => {
let tmp = null;
2026-07-23 10:11:24 +00:00
if (arg0 !== outer1_5.NOT_DETERMINED) {
2026-07-20 16:05:17 +00:00
let str = "denied";
2026-07-23 10:11:24 +00:00
if (arg0 === outer1_5.AUTHORIZED) {
2026-07-20 16:05:17 +00:00
str = "accepted";
}
tmp = str;
}
2026-07-23 10:11:24 +00:00
let obj = callback(outer1_2[5]);
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(closure_0);
2026-07-29 08:29:29 +00:00
obj.flow_type = "Contact Sync";
({ INITIALIZED: obj2.from_step, LANDING: obj2.to_step } = outer1_7);
obj.skip = false;
obj.back = false;
obj.seconds_on_from_step = 0;
obj.has_phone_number = callback;
obj.mobile_contacts_permission = tmp;
2026-07-23 10:11:24 +00:00
obj.track(outer1_6.CONTACT_SYNC_FLOW_KEY, obj);
2026-07-20 16:05:17 +00:00
});
};
2026-07-29 08:29:29 +00:00
export const trackFlowStep = function trackFlowStep(LANDING, skip, back, location) {
2026-07-20 16:05:17 +00:00
const tmp = getIsOnboarding();
const timestamp = Date.now();
2026-07-23 10:11:24 +00:00
const result = (timestamp - timestamp) / 1000;
2026-07-29 08:29:29 +00:00
let obj = importDefault(698);
2026-07-20 16:05:17 +00:00
obj = {};
const merged = Object.assign(location);
2026-07-29 08:29:29 +00:00
if (tmp) {
let _location = Onboarding;
} else if (location != null) {
_location = location.location;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.location = _location;
obj.flow_type = "Contact Sync";
obj.from_step = closure_8;
obj.to_step = LANDING;
obj.skip = skip;
obj.back = back;
obj.seconds_on_from_step = result;
2026-07-20 16:05:17 +00:00
obj.track(AnalyticEvents.CONTACT_SYNC_FLOW_KEY, obj);
if (tmp) {
2026-07-29 08:29:29 +00:00
obj = { skip: null };
obj[0] = skip;
2026-08-05 07:35:12 +00:00
require(11922) /* trackNUFStep */.trackNUFStep(closure_8, LANDING, obj);
const obj3 = require(11922) /* trackNUFStep */;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_8 = LANDING;
2026-07-20 16:05:17 +00:00
};
export const trackFlowEnd = function trackFlowEnd(flag, location) {
const timestamp = Date.now();
2026-07-29 08:29:29 +00:00
let obj = importDefault(698);
2026-07-20 16:05:17 +00:00
obj = {};
const merged = Object.assign(location);
2026-07-29 08:29:29 +00:00
if (tmp) {
let _location = Onboarding;
} else if (location != null) {
_location = location.location;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.location = _location;
obj.flow_type = "Contact Sync";
obj.from_step = c8;
obj.to_step = obj.COMPLETE;
obj.skip = flag;
obj.back = false;
obj.seconds_on_from_step = (timestamp - c9) / 1000;
2026-07-20 16:05:17 +00:00
obj.track(AnalyticEvents.CONTACT_SYNC_FLOW_KEY, obj);
2026-07-23 10:11:24 +00:00
c8 = null;
2026-07-20 16:05:17 +00:00
};