2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 8230
|
|
|
|
|
// Function ID: 8231
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useTrackImpression
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [19, 2045, 2099, 4655, 1242, 1249, 1241, 573, 5016, 1331, 5040, 5298, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: default
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 8230 (useTrackImpression)
|
2026-09-26 17:57:22 +00:00
|
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
|
|
|
import AnalyticsUtils2 from "AnalyticsUtils" /* 1241 */;
|
|
|
|
|
import _modDef1331 from "module_1331" /* 1331 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import AppAnalyticsUtils from "AppAnalyticsUtils" /* 5016 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import uniqueIdDefault from "uniqueId" /* 5040 */;
|
|
|
|
|
import react_mod from "react" /* 19 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import ChannelStore from "ChannelStore" /* 2045 */;
|
|
|
|
|
import SelectedChannelStore from "SelectedChannelStore" /* 2099 */;
|
|
|
|
|
import SelectedGuildStore from "SelectedGuildStore" /* 4655 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import ImpressionStore from "ImpressionStore" /* 1242 */;
|
|
|
|
|
import AnalyticsUtils from "discord_common/AnalyticsUtils" /* 1249 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let dependencyMap;
|
|
|
|
|
|
|
|
|
|
let c10;
|
|
|
|
|
let c9;
|
|
|
|
|
let metroImportAll;
|
|
|
|
|
let metroImportDefault;
|
|
|
|
|
let unpackModuleId;
|
2026-09-18 19:45:33 +00:00
|
|
|
function trackImpression(type, disableTrack, arg2) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let name;
|
|
|
|
|
let properties;
|
2026-09-18 19:45:33 +00:00
|
|
|
let flag = disableTrack;
|
|
|
|
|
if (disableTrack === undefined) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
let flag2 = arg2;
|
|
|
|
|
if (arg2 === undefined) {
|
|
|
|
|
flag2 = false;
|
|
|
|
|
}
|
|
|
|
|
({ name, type, properties } = type);
|
2026-10-01 14:13:23 +00:00
|
|
|
if (type.type === AnalyticsUtils.ImpressionTypes.MODAL) {
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null == type.name) {
|
2026-10-01 14:13:23 +00:00
|
|
|
unpackModuleId();
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!flag2) {
|
2026-10-01 14:13:23 +00:00
|
|
|
metroImportDefault(type);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
let guild_id;
|
|
|
|
|
if (properties != null) {
|
|
|
|
|
guild_id = properties.guild_id;
|
|
|
|
|
}
|
|
|
|
|
if (guild_id == null) {
|
|
|
|
|
guild_id = SelectedGuildStore.getGuildId();
|
|
|
|
|
}
|
|
|
|
|
let channel_id;
|
|
|
|
|
if (properties != null) {
|
|
|
|
|
channel_id = properties.channel_id;
|
|
|
|
|
}
|
|
|
|
|
if (channel_id == null) {
|
|
|
|
|
channel_id = SelectedChannelStore.getChannelId(guild_id);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const expandEventProperties = AnalyticsUtils2.expandEventProperties;
|
2026-09-18 19:45:33 +00:00
|
|
|
const tmpResult = AnalyticsUtils2;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj2 = { impression_type: type, location: authStore() };
|
2026-09-18 19:45:33 +00:00
|
|
|
const tmpResult4 = AppAnalyticsUtils;
|
2026-10-01 14:13:23 +00:00
|
|
|
const merged = Object.assign(tmpResult4.collectGuildAnalyticsMetadata(guild_id));
|
|
|
|
|
const tmpResult5 = AppAnalyticsUtils;
|
|
|
|
|
const merged1 = Object.assign(tmpResult5.collectChannelAnalyticsMetadata(ChannelStore.getChannel(channel_id)));
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged2 = Object.assign(properties);
|
2026-10-01 14:13:23 +00:00
|
|
|
const result = expandEventProperties(obj2);
|
2026-09-18 19:45:33 +00:00
|
|
|
if (flag) {
|
2026-10-01 14:13:23 +00:00
|
|
|
React4(null, null);
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp16 = null != name && null != type;
|
|
|
|
|
if (tmp16) {
|
|
|
|
|
const tmpResult6 = AnalyticsUtils2;
|
|
|
|
|
tmpResult6.debugLogEvent(name, result);
|
2026-09-18 19:45:33 +00:00
|
|
|
closure_12(name, result);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
React4(name, result);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let react = react_mod;
|
|
|
|
|
({ setCurrentImpression: metroImportDefault, cleanupImpression: metroImportAll, setDebugTrackedData: c9, getLocation: c10, getImpressionStack: unpackModuleId } = ImpressionStore);
|
|
|
|
|
let obj = { analyticEventConfigs: AnalyticsUtils2.AnalyticEventConfigs, dispatcher: DispatcherDefault, TRACK_ACTION_NAME: "TRACK" };
|
|
|
|
|
let closure_12 = AnalyticsUtils.trackMaker(obj);
|
2026-09-18 19:45:33 +00:00
|
|
|
let result = size.fileFinishedImporting("modules/app_analytics/useTrackImpression.tsx");
|
|
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
export default function useTrackImpression(current) {
|
|
|
|
|
let closure_2;
|
|
|
|
|
let ref;
|
2026-09-18 19:45:33 +00:00
|
|
|
let obj = arg1;
|
|
|
|
|
if (arg1 === undefined) {
|
|
|
|
|
obj = { disableTrack: false, trackOnInitialLoad: false };
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
dependencyMap = arg2;
|
|
|
|
|
react = undefined;
|
|
|
|
|
react = react.useRef(undefined);
|
|
|
|
|
const ref2 = react.useRef(undefined);
|
|
|
|
|
const tmp = obj(5298)(() => {
|
2026-09-18 19:45:33 +00:00
|
|
|
if (obj.trackOnInitialLoad) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let fn;
|
|
|
|
|
const tmp6 = _modDef1331(ref.current, current);
|
|
|
|
|
const tmp4 = ref;
|
|
|
|
|
const tmp7 = !tmp6;
|
|
|
|
|
if (tmp7) {
|
|
|
|
|
tmp4.current = current;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp11 = !_modDef1331(ref2.current, closure_2);
|
|
|
|
|
const tmp8 = ref2;
|
|
|
|
|
const tmp9 = closure_2;
|
|
|
|
|
if (tmp11) {
|
|
|
|
|
tmp8.current = tmp9;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (!tmp6) {
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = { sequenceId: uniqueIdDefault("impression_") };
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged = Object.assign(tmp5);
|
|
|
|
|
trackImpression(obj, tmp.disableTrack);
|
2026-10-01 14:13:23 +00:00
|
|
|
fn = () => {
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != obj) {
|
|
|
|
|
closure_2_8(tmp);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return fn;
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-10-01 14:13:23 +00:00
|
|
|
const effect = react.useEffect(() => {
|
2026-09-18 19:45:33 +00:00
|
|
|
if (!obj.trackOnInitialLoad) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let fn;
|
|
|
|
|
const tmp6 = _modDef1331(ref.current, current);
|
|
|
|
|
const tmp4 = ref;
|
|
|
|
|
const tmp7 = !tmp6;
|
|
|
|
|
if (tmp7) {
|
|
|
|
|
tmp4.current = current;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp11 = !_modDef1331(ref2.current, closure_2);
|
|
|
|
|
const tmp8 = ref2;
|
|
|
|
|
const tmp9 = closure_2;
|
|
|
|
|
if (tmp11) {
|
|
|
|
|
tmp8.current = tmp9;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (!tmp6) {
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = { sequenceId: tmp2(5040)("impression_") };
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged = Object.assign(tmp5);
|
|
|
|
|
trackImpression(obj, tmp.disableTrack);
|
2026-10-01 14:13:23 +00:00
|
|
|
fn = () => {
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != obj) {
|
|
|
|
|
closure_2_8(tmp);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return fn;
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|
2026-09-18 19:45:33 +00:00
|
|
|
export { trackImpression };
|