decord/source/modules/app_analytics/clickstream/Clickstream.tsx

79 lines
2.6 KiB
TypeScript
Raw Normal View History

// Module ID: 7568
// Function ID: 7569
// Name: Clickstream
// Dependencies: [32, 502, 4659, 11, 7569, 1242, 7570, 2]
2026-07-20 16:05:17 +00:00
// Exports: trackClickstream
// Module 7568 (Clickstream)
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */;
import ClickstreamExperiment from "ClickstreamExperiment" /* 7569 */;
import ClickstreamEvents from "ClickstreamEvents" /* 7570 */;
import _slicedToArray from "module_32" /* 32 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4659 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function isClickstreamEnabled(flag) {
if (flag === undefined) {
flag = true;
}
if (flag) {
const extractTimestampResult = SnowflakeUtilsDefault.extractTimestamp(AuthenticationStore.getId());
2026-07-23 10:11:24 +00:00
if (extractTimestampResult !== c7) {
2026-07-20 16:05:17 +00:00
drainClickstream(false);
2026-07-23 10:11:24 +00:00
c7 = extractTimestampResult;
2026-07-20 16:05:17 +00:00
}
result = ClickstreamExperiment.clickstreamExperimentEnabled();
2026-07-20 16:05:17 +00:00
}
return result;
2026-07-20 16:05:17 +00:00
}
function drainClickstream(flag) {
if (flag === undefined) {
flag = true;
}
if (isClickstreamEnabled(flag)) {
2026-07-29 08:29:29 +00:00
const tmp3 = obj[Symbol.iterator]();
while (tmp3 !== undefined) {
let tmp8 = _slicedToArray(tmp5, 2);
2026-07-29 08:29:29 +00:00
let first = tmp8[0];
let obj2 = AnalyticsUtilsDefault;
let obj3 = ClickstreamEvents;
2026-07-29 08:29:29 +00:00
let trackResult = obj2.track(first, obj3.getClickstreamDrainEvent(first, tmp8[1]));
continue;
2026-07-20 16:05:17 +00:00
}
map.clear();
} else {
2026-07-29 08:29:29 +00:00
obj.clear();
2026-07-20 16:05:17 +00:00
}
}
const map = new Map();
2026-07-23 10:11:24 +00:00
let c7 = -1;
const size = fn(2);
let result = size.fileFinishedImporting("modules/app_analytics/clickstream/Clickstream.tsx");
2026-07-20 16:05:17 +00:00
export const trackClickstream = function trackClickstream(CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM, arg1) {
const extractTimestampResult = SnowflakeUtilsDefault.extractTimestamp(AuthenticationStore.getId());
2026-07-29 08:29:29 +00:00
if (extractTimestampResult !== c7) {
drainClickstream(false);
c7 = extractTimestampResult;
}
result = ClickstreamExperiment.clickstreamExperimentEnabled();
2026-07-29 08:29:29 +00:00
if (result) {
if (!map.has(CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM)) {
const result1 = obj3.set(CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM, []);
2026-07-20 16:05:17 +00:00
}
value = obj3.get(CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM);
2026-07-29 08:29:29 +00:00
if (value != null) {
const obj4 = { timestamp: null, rtc_state: null };
2026-07-20 16:05:17 +00:00
const _Date = Date;
const date = new Date();
obj4.timestamp = date;
obj4.rtc_state = RTCConnectionStore.getState();
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg1);
value.push(obj4);
2026-07-20 16:05:17 +00:00
}
}
};
export { drainClickstream };