decord/source/modules/app_analytics/useTrackImpression.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

135 lines
4.1 KiB
TypeScript

// Module ID: 8768
// Function ID: 8769
// Name: trackImpression
// Dependencies: [19, 1957, 2011, 4381, 1243, 1250, 1242, 573, 4740, 1332, 4764, 4992, 2]
// Exports: default
// Module 8768 (trackImpression)
import dispatcherDefault from "dispatcher" /* 573 */;
import encodeProperties2 from "encodeProperties" /* 1250 */;
import collectGuildAnalyticsMetadata from "collectGuildAnalyticsMetadata" /* 4740 */;
import closure_3 from "noop" /* 19 */;
import closure_4 from "ensureGuildLoaded" /* 1957 */;
import closure_5 from "handleConnectionOpen" /* 2011 */;
import closure_6 from "handleConnectionOpen" /* 4381 */;
import withEqualityFn from "withEqualityFn" /* 1243 */;
import encodeProperties from "encodeProperties" /* 1250 */;
require = arg1;
function trackImpression(type, arg1, arg2) {
let flag = arg1;
if (arg1 === undefined) {
flag = false;
}
let flag2 = arg2;
if (arg2 === undefined) {
flag2 = false;
}
({ name, type, properties } = type);
if (type.type === encodeProperties2.ImpressionTypes.MODAL) {
if (null == type.name) {
let obj = callback4();
}
}
if (!flag2) {
callback(type);
}
let guild_id;
if (properties != null) {
guild_id = properties.guild_id;
}
if (guild_id == null) {
guild_id = guildId.getGuildId();
}
let channel_id;
if (properties != null) {
channel_id = properties.channel_id;
}
if (channel_id == null) {
channel_id = channelId.getChannelId(guild_id);
}
let tmpResult = tmp(1242);
obj = { impression_type: type, location: callback3() };
tmpResult = tmp(4740);
const merged = Object.assign(tmpResult.collectGuildAnalyticsMetadata(guild_id));
const merged1 = Object.assign(collectGuildAnalyticsMetadata.collectChannelAnalyticsMetadata(channel.getChannel(channel_id)));
const merged2 = Object.assign(properties);
const result = tmpResult.expandEventProperties(obj);
if (flag) {
callback2(null, null);
} else {
if (tmp15) {
tmp(1242).debugLogEvent(name, result);
callback5(name, result);
const tmpResult2 = tmp(1242);
}
callback2(name, result);
tmp15 = null != name && null != type;
}
}
({ setCurrentImpression: error, cleanupImpression: closure_8, setDebugTrackedData: c9, getLocation: c10, getImpressionStack: unpackModuleId } = withEqualityFn);
encodeProperties = { analyticEventConfigs: require("expandEventProperties").AnalyticEventConfigs, dispatcher: dispatcherDefault, TRACK_ACTION_NAME: "TRACK" };
let closure_12 = encodeProperties.trackMaker(encodeProperties);
let result = require("set").fileFinishedImporting("modules/app_analytics/useTrackImpression.tsx");
export default function useTrackImpression(arg0) {
closure_0 = arg0;
let obj = arg1;
if (arg1 === undefined) {
obj = { disableTrack: false, trackOnInitialLoad: false };
}
dependencyMap = arg2;
let React;
closure_4 = undefined;
React = React.useRef(undefined);
closure_4 = React.useRef(undefined);
obj(4992)(() => {
if (obj.trackOnInitialLoad) {
const tmp6 = obj(1332)(ref.current, obj);
if (!tmp6) {
ref.current = tmp5;
}
const tmp10 = obj(1332)(ref2.current, dependencyMap);
if (!tmp10) {
ref2.current = dependencyMap;
}
if (!tmp6) {
obj = {};
const merged = Object.assign(tmp5);
obj.sequenceId = tmp2(4764)("impression_");
closure_1_13(obj, tmp.disableTrack);
const fn = () => {
if (null != obj) {
closure_1_8(tmp);
}
};
}
return fn;
}
});
const effect = React.useEffect(() => {
if (!obj.trackOnInitialLoad) {
const tmp6 = obj(1332)(ref.current, obj);
if (!tmp6) {
ref.current = tmp5;
}
const tmp10 = obj(1332)(ref2.current, dependencyMap);
if (!tmp10) {
ref2.current = dependencyMap;
}
if (!tmp6) {
obj = {};
const merged = Object.assign(tmp5);
obj.sequenceId = tmp2(4764)("impression_");
closure_1_13(obj, tmp.disableTrack);
const fn = () => {
if (null != obj) {
closure_1_8(tmp);
}
};
}
return fn;
}
});
};
export { trackImpression };