This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
// Metro module 12738 (f12739).
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c8776_0;
const reset = function reset() {
c8776_0 = false;
};
c8776_0 = false;
class AdPersonalizationStore extends Module589.Store {
isTogglesDisabled() {
return c8776_0;
}
}
const adPersonalizationStore = new AdPersonalizationStore(Dispatcher, {
AD_PERSONALIZATION_TOGGLES_RESTRICTED: function handleAdPersonalizationTogglesRestricted({ disabled }) {
if (disabled == null) {
disabled = false;
}
c8776_0 = disabled;
},
CONNECTION_OPEN: reset,
LOGOUT: reset
});
export default adPersonalizationStore;
+44
View File
@@ -0,0 +1,44 @@
// Metro module 10886 (f10887).
import { resolveOptionalAdCreativeCdnUrl, resolveAdCreativeCdnUrl } from "../quests/lib/AssetUtils";
export function bountyCtaFromServer(a0) {
return {
url: a0.url,
buttonLabel: a0.button_label,
android: a0.android != null ? {
androidAppId: a0.android.android_app_id
} : void 0,
ios: a0.ios != null ? {
iosAppId: a0.ios.ios_app_id
} : void 0
};
}
export function bountyFromServer(a0) {
const r4 = {
id: a0.id,
advertiserName: a0.advertiser_name,
productName: a0.product_name,
productIcon: resolveOptionalAdCreativeCdnUrl(a0.product_icon),
videoPreview: resolveOptionalAdCreativeCdnUrl(a0.video_preview),
imagePreview: resolveOptionalAdCreativeCdnUrl(a0.image_preview),
videoHls: resolveAdCreativeCdnUrl(a0.video_hls),
cta: null,
rewardTimerSeconds: null
};
const cta = a0.cta;
r4.cta = {
url: cta.url,
buttonLabel: cta.button_label,
android: cta.android != null ? {
androidAppId: cta.android.android_app_id
} : void 0,
ios: cta.ios != null ? {
iosAppId: cta.ios.ios_app_id
} : void 0
};
let reward_timer_seconds = a0.reward_timer_seconds;
if (reward_timer_seconds == null) {
reward_timer_seconds = 15;
}
r4.rewardTimerSeconds = reward_timer_seconds;
return r4;
}
@@ -0,0 +1,291 @@
// Metro module 8446 (f8447).
import QuestStore from "../../quests/QuestStore";
import { AnalyticEvents } from "../../../Constants";
import { AdCreativeType } from "../../../_bundle/Module6013";
import { getCommonClickEventProperties, trackAdContentEvent, trackQuestEvent } from "../../quests/lib/analytics/AnalyticsActions";
import { isBillableQuestContent, getAdMetadataSealed, getAdTrafficMetadataSealed } from "../../quests/utils/QuestDataUtils";
import { getContentProperties, getQuestContentName } from "../../quests/lib/analytics/AnalyticsTypes";
import { getCurrentQuestHomeSearchSession } from "../../quests/lib/analytics/QuestHomeSearchSession";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { v4 } from "../../../_bundle/Module514";
import { isIOS, isAndroid } from "../../../utils/PlatformUtils";
import getDeviceMetadata_native from "../../device/getDeviceMetadata.native";
import { getBrandSafetyContext } from "../../quests/lib/analytics/BrandSafetyContext";
import { getAdUser } from "../utils/AdDataUtils.android";
import { getQuestLogger } from "../../quests/lib/getQuestLogger";
import { AdUserActionType } from "./captureAdUserActionTypes";
let _handleClickInternalAction, _handleClickExternalAdvertiserCtaAction, handleViewImpression, _handleViewInternalSurfaceImpressionAction, reportCaptureAdUserActionError;
const emitClickEventWithCreative = async function emitClickEventWithCreative(c26205_0) {
let uuid, adMetadataSealed, adTrafficMetadataSealed, uuid2, c26205_6;
let c29952_6;
c26205_6 = void 0;
let c29952_0 = c26205_0;
c29952_6 = void 0;
let c29952_1 = c26205_0.adCreativeType;
const { questContentCTA, surfaceId } = c26205_0;
let c29952_2 = surfaceId;
let c29952_3 = c26205_0.sourceQuestContent;
const { impressionId, clickId: clickId2, questContentPosition, questContentRowIndex } = c26205_0;
let c29952_4 = c26205_0.trackGuildAndChannelMetadata;
let c29952_5 = await getCommonClickEventProperties({
questContent: surfaceId,
questContentPosition,
questContentRowIndex,
questContentCTA,
impressionId,
clickId: clickId2
});
if (c29952_1 !== AdCreativeType.QUEST) {
const uuid3 = getCurrentQuestHomeSearchSession()?.uuid;
uuid = uuid3;
if (uuid3 == null) {
uuid = null;
}
trackAdContentEvent({
adContentId: c29952_0.adCreativeId,
relatedQuestId: c29952_0.relatedQuestId,
adCreativeType: c29952_1,
event: AnalyticEvents.QUEST_CONTENT_CLICKED,
properties: {
...c29952_5,
search_session_id: uuid
},
trackGuildAndChannelMetadata: c29952_4,
shouldExtendSession: isBillableQuestContent(c29952_2),
sourceQuestContent: c29952_3
});
} else {
c29952_6 = c29952_0.adCreativeId;
adMetadataSealed = getAdMetadataSealed(c29952_3, c29952_6);
if (adMetadataSealed == null) {
adMetadataSealed = null;
}
adTrafficMetadataSealed = getAdTrafficMetadataSealed(c29952_3, c29952_6);
if (adTrafficMetadataSealed == null) {
adTrafficMetadataSealed = null;
}
const uuid4 = getCurrentQuestHomeSearchSession()?.uuid;
uuid2 = uuid4;
if (uuid4 == null) {
uuid2 = null;
}
trackQuestEvent({
questId: c29952_6,
event: AnalyticEvents.QUEST_CONTENT_CLICKED,
properties: {
...c29952_5,
metadata_sealed: adMetadataSealed,
traffic_metadata_sealed: adTrafficMetadataSealed,
search_session_id: uuid2
},
trackGuildAndChannelMetadata: c29952_4,
shouldExtendSession: isBillableQuestContent(c29952_2),
sourceQuestContent: c29952_3
});
}
};
_handleClickInternalAction = function _handleClickInternalAction() {
const r8 = async (c26206_0) => {
let clickId, isTargeted;
L16: {
if (c26206_0.adCreativeType != null) {
await emitClickEventWithCreative(c26206_0);
break L16;
}
const { surfaceId, questContentCTA, clickId: clickId2 } = c26206_0;
const contentProperties = getContentProperties(surfaceId, c26206_0.questContentPosition, c26206_0.questContentRowIndex);
const QUEST_CONTENT_CLICKED = AnalyticEvents.QUEST_CONTENT_CLICKED;
clickId = clickId2;
if (clickId2 == null) {
clickId = v4();
}
const isTargeted3 = c26206_0.isTargeted;
isTargeted = isTargeted3;
if (isTargeted3 == null) {
isTargeted = false;
}
AnalyticsUtils.track(QUEST_CONTENT_CLICKED, {
cta_name: questContentCTA,
click_id: clickId,
is_targeted: isTargeted,
content_id: contentProperties.content_id,
content_name: contentProperties.content_name,
content_position: contentProperties.content_position,
row_index: contentProperties.row_index,
ad_content_id: c26206_0.adContentId,
quest_id: c26206_0.relatedQuestId
});
return void 0;
}
};
_handleClickInternalAction = r8;
return r8.apply(this, arguments);
};
_handleClickExternalAdvertiserCtaAction = function _handleClickExternalAdvertiserCtaAction() {
const r8 = async (c26207_0) => {
await emitClickEventWithCreative(c26207_0);
};
_handleClickExternalAdvertiserCtaAction = r8;
return r8.apply(this, arguments);
};
handleViewImpression = function handleViewImpression(a0) {
const { surfaceId, sourceQuestContent, impressionId, triggeredByStatusChange, minViewTimeSeconds, minViewportPercentage, isQuestEnrollmentBlocked, shouldExtendSession, adUser, questContentPosition, questContentRowIndex, trackGuildAndChannelMetadata } = a0;
const r7 = {
min_view_time_seconds: minViewTimeSeconds,
min_viewport_percentage: minViewportPercentage,
triggered_by_status_change: triggeredByStatusChange,
apple_advertising_id: adUser != null ? isIOS() ? adUser.advertisingId : null : null,
android_advertising_id: adUser != null ? isAndroid() ? adUser.advertisingId : null : null,
...getDeviceMetadata_native(),
...getBrandSafetyContext(surfaceId),
impression_id: impressionId,
is_quest_enrollment_blocked: isQuestEnrollmentBlocked,
...getContentProperties(surfaceId, questContentPosition, questContentRowIndex)
};
if (a0.adCreativeType !== AdCreativeType.QUEST) {
trackAdContentEvent({
event: AnalyticEvents.QUEST_CONTENT_VIEWED,
adContentId: a0.adCreativeId,
adCreativeType: a0.adCreativeType,
trackGuildAndChannelMetadata,
shouldExtendSession,
sourceQuestContent,
properties: {
...r7
}
});
} else {
const adCreativeId = a0.adCreativeId;
let metadata_sealed = getAdMetadataSealed(sourceQuestContent, adCreativeId);
if (metadata_sealed == null) {
metadata_sealed = null;
}
let search_session_id = getCurrentQuestHomeSearchSession()?.uuid;
if (search_session_id == null) {
search_session_id = null;
}
let traffic_metadata_sealed = getAdTrafficMetadataSealed(sourceQuestContent, adCreativeId);
if (traffic_metadata_sealed == null) {
traffic_metadata_sealed = null;
}
trackQuestEvent({
event: AnalyticEvents.QUEST_CONTENT_VIEWED,
questId: adCreativeId,
trackGuildAndChannelMetadata,
shouldExtendSession,
sourceQuestContent,
properties: {
...r7,
metadata_sealed,
search_session_id,
traffic_metadata_sealed
}
});
}
};
_handleViewInternalSurfaceImpressionAction = function _handleViewInternalSurfaceImpressionAction() {
const r8 = async (c26208_0) => {
let isTargeted2, c26208_3;
let c29953_0, c29953_1;
L22: {
c26208_3 = void 0;
c29953_0 = c26208_0;
c29953_1 = void 0;
if (c26208_0.adCreativeType != null) {
handleViewImpression(c26208_0);
break L22;
}
c29953_1 = await getAdUser(getQuestContentName(c26208_0.surfaceId));
const QUEST_CONTENT_VIEWED = AnalyticEvents.QUEST_CONTENT_VIEWED;
const r63 = {
...getContentProperties(c29953_0.surfaceId),
apple_advertising_id: c29953_1 != null ? isIOS() ? c29953_1.advertisingId : null : null,
android_advertising_id: c29953_1 != null ? isAndroid() ? c29953_1.advertisingId : null : null
};
const isTargeted3 = c29953_0.isTargeted;
isTargeted2 = isTargeted3;
if (isTargeted3 == null) {
isTargeted2 = false;
}
r63.is_targeted = isTargeted2;
AnalyticsUtils.track(QUEST_CONTENT_VIEWED, r63);
return void 0;
}
};
_handleViewInternalSurfaceImpressionAction = r8;
return r8.apply(this, arguments);
};
reportCaptureAdUserActionError = function reportCaptureAdUserActionError(a0) {
getQuestLogger().error("captureAdUserAction failed to report an ad user action", a0);
};
export function captureAdUserAction(a0) {
try {
const type = a0.type;
if (AdUserActionType.END_CONTENT_LOAD === type) {
(function handleEndContentLoadAction(a0) {
const is_quest_enrollment_blocked = QuestStore.questEnrollmentBlockedUntil != null;
if (a0.adCreativeType === AdCreativeType.QUEST) {
const adCreativeId = a0.adCreativeId;
let metadata_sealed = getAdMetadataSealed(a0.sourceQuestContent, adCreativeId);
if (metadata_sealed == null) {
metadata_sealed = null;
}
let traffic_metadata_sealed = getAdTrafficMetadataSealed(a0.sourceQuestContent, adCreativeId);
if (traffic_metadata_sealed == null) {
traffic_metadata_sealed = null;
}
trackQuestEvent({
event: AnalyticEvents.QUEST_CONTENT_LOADED,
questId: adCreativeId,
trackGuildAndChannelMetadata: a0.trackGuildAndChannelMetadata,
sourceQuestContent: a0.sourceQuestContent,
properties: {
triggered_by_status_change: a0.triggeredByStatusChange,
metadata_sealed,
traffic_metadata_sealed,
impression_id: a0.impressionId,
is_quest_enrollment_blocked,
content_id: a0.surfaceId,
content_name: getQuestContentName(a0.surfaceId),
content_position: a0.questContentPosition,
row_index: a0.questContentRowIndex
}
});
} else {
trackAdContentEvent({
event: AnalyticEvents.QUEST_CONTENT_LOADED,
adContentId: a0.adCreativeId,
adCreativeType: a0.adCreativeType,
trackGuildAndChannelMetadata: a0.trackGuildAndChannelMetadata,
sourceQuestContent: a0.sourceQuestContent,
properties: {
triggered_by_status_change: a0.triggeredByStatusChange,
impression_id: a0.impressionId,
is_quest_enrollment_blocked,
content_id: a0.surfaceId,
content_name: getQuestContentName(a0.surfaceId),
content_position: a0.questContentPosition,
row_index: a0.questContentRowIndex
}
});
}
})(a0);
} else if (AdUserActionType.CLICK_INTERNAL === type) {
(function handleClickInternalAction() {
return _handleClickInternalAction.apply(this, arguments);
})(a0).catch(reportCaptureAdUserActionError);
} else if (AdUserActionType.CLICK_EXTERNAL_ADVERTISER_CTA === type) {
(function handleClickExternalAdvertiserCtaAction() {
return _handleClickExternalAdvertiserCtaAction.apply(this, arguments);
})(a0).catch(reportCaptureAdUserActionError);
} else if (AdUserActionType.VIEW_INTERNAL_SURFACE_IMPRESSION === type) {
(function handleViewInternalSurfaceImpressionAction() {
return _handleViewInternalSurfaceImpressionAction.apply(this, arguments);
})(a0).catch(reportCaptureAdUserActionError);
} else if (AdUserActionType.VIEW_EXTERNAL_PAID_AD_PLACEMENT_IMPRESSION === type) {
handleViewImpression(a0);
}
} catch ($e) {
reportCaptureAdUserActionError($e);
}
}
@@ -0,0 +1,9 @@
// Metro module 8450 (f8451).
const r8 = {
END_CONTENT_LOAD: "end_content_load",
CLICK_INTERNAL: "click_internal",
CLICK_EXTERNAL_ADVERTISER_CTA: "click_external_advertiser_cta",
VIEW_INTERNAL_SURFACE_IMPRESSION: "view_internal_surface_impression",
VIEW_EXTERNAL_PAID_AD_PLACEMENT_IMPRESSION: "view_external_paid_ad_placement_impression"
};
export { r8 as AdUserActionType };
@@ -0,0 +1,6 @@
// Metro module 14653 (f14654).
import AdPersonalizationStore from "../AdPersonalizationStore";
import { useStateFromStores } from "../../../_bundle/Module589";
export function useAdPersonalizationTogglesDisabled() {
return useStateFromStores([AdPersonalizationStore], () => AdPersonalizationStore.isTogglesDisabled());
}
@@ -0,0 +1,96 @@
// Metro module 6017 (f6018).
import AdUserStore from "./AdUserStore";
import { AnalyticEvents, Platforms } from "../../../Constants";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import Dispatcher from "../../../Dispatcher";
import Module6018 from "../../../_bundle/Module6018";
export async function fetchAdUser(location2) {
let c25679_3;
let c25679_4 = 0;
let c29650_0, c29650_1, c29650_2, c29650_3, c29650_4, c29650_5;
L17: {
L11: {
try {
c29650_0 = location2;
c29650_1 = void 0;
c29650_2 = void 0;
c29650_3 = void 0;
c29650_4 = void 0;
if (AdUserStore.adUser != null && AdUserStore.adUser.advertisingId != null) {
AnalyticsUtils.track(AnalyticEvents.AD_IDENTIFIER_FETCHED, {
has_advertising_id: true,
android_advertising_id: AdUserStore.adUser.advertisingId,
location: location2,
success: true,
last_fetched_timestamp: AdUserStore.lastFetchedAt
});
break L11;
}
c29650_1 = performance.now();
c25679_4 = 1;
Dispatcher.dispatch({
type: "FETCH_AD_USER_START"
});
c29650_2 = await Module6018.getGoogleAdvertisingId();
c29650_3 = performance.now() - c29650_1;
AnalyticsUtils.track(AnalyticEvents.AD_USER_FETCH_DURATION, {
platform: Platforms.ANDROID,
success: true,
duration_ms: c29650_3,
has_advertising_id: c29650_2.googleAdvertisingId != null,
is_limit_ad_tracking_enabled: c29650_2.isLimitAdTrackingEnabled
});
AnalyticsUtils.track(AnalyticEvents.AD_IDENTIFIER_FETCHED, {
has_advertising_id: c29650_2.googleAdvertisingId != null,
android_advertising_id: c29650_2.googleAdvertisingId != null ? c29650_2.googleAdvertisingId : null,
location: c29650_0,
success: true
});
Dispatcher.dispatch({
type: "FETCH_AD_USER_SUCCESS",
advertisingId: c29650_2.googleAdvertisingId,
isLimitAdTrackingEnabled: c29650_2.isLimitAdTrackingEnabled
});
c25679_4 = 0;
break L17;
} catch ($e) {
const r30 = $e;
let r8 = r30;
c25679_3 = r30;
if (c25679_4 !== 0) {
while (true) {
try {
const r141 = c25679_3;
c25679_4 = 0;
c29650_5 = r141;
c29650_4 = performance.now() - c29650_1;
AnalyticsUtils.track(AnalyticEvents.AD_USER_FETCH_DURATION, {
platform: Platforms.ANDROID,
success: false,
duration_ms: c29650_4,
error_message: c29650_5 instanceof Error ? c29650_5.message : String(c29650_5)
});
AnalyticsUtils.track(AnalyticEvents.AD_IDENTIFIER_FETCHED, {
has_advertising_id: false,
location: c29650_0,
success: false
});
Dispatcher.dispatch({
type: "FETCH_AD_USER_FAILURE"
});
break L17;
} catch (r137) {
r8 = r137;
c25679_3 = r137;
if (c25679_4 === 0) {
break;
}
}
}
}
throw r8;
}
}
return void 0;
}
}
+54
View File
@@ -0,0 +1,54 @@
// Metro module 6015 (f6016).
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
let c3806_0;
let c3806_1 = false;
let c3806_2 = false;
let c3806_3 = null;
let c3806_4 = null;
class AdUserStore extends Module589.Store {
static displayName = "AdUserStore";
get adUser() {
return c3806_0;
}
get isFetching() {
return c3806_1;
}
get hasFetchFailed() {
return c3806_2;
}
get fetchPromise() {
return c3806_3;
}
get lastFetchedAt() {
return c3806_4;
}
get hasFetchedRecently() {
return c3806_4 != null && Date.now() - c3806_4 < 21600000;
}
setFetchPromise(a0) {
c3806_3 = a0;
}
}
const adUserStore = new AdUserStore(Dispatcher, {
POST_CONNECTION_OPEN: function handlePostConnectionOpen() {},
FETCH_AD_USER_START: function handleFetchAdUserStart() {
c3806_1 = true;
c3806_4 = Date.now();
},
FETCH_AD_USER_SUCCESS: function handleFetchAdUserSuccess({ advertisingId, isLimitAdTrackingEnabled }) {
c3806_1 = false;
c3806_3 = null;
c3806_0 = {
advertisingId,
isLimitAdTrackingEnabled
};
c3806_2 = false;
},
FETCH_AD_USER_FAILURE: function handleFetchAdUserFailure() {
c3806_1 = false;
c3806_2 = true;
c3806_3 = null;
}
});
export default adUserStore;
+55
View File
@@ -0,0 +1,55 @@
// Metro module 6014 (f6015).
import { useState, useEffect } from "react";
import AdUserStore from "../native/AdUserStore";
import { DEFAULT_TIMEOUT_MS } from "./AdDataUtilsConstants";
import { fetchAdUser } from "../native/AdUserActionCreators.android";
export function getAdUser(a0) {
let r20;
if (AdUserStore.adUser == null && !AdUserStore.hasFetchFailed) {
if (!AdUserStore.isFetching) {
fetchAdUser(a0);
}
r20 = new Promise((c25677_0) => {
let c25677_1, c25677_2;
const handleUpdate2 = function handleUpdate() {
if (AdUserStore.adUser != null || AdUserStore.hasFetchFailed) {
if (!c25677_1) {
c25677_1 = true;
clearTimeout(c25677_2);
AdUserStore.removeChangeListener(handleUpdate2);
c25677_0(AdUserStore.adUser);
}
}
};
c25677_1 = false;
c25677_2 = setTimeout(() => {
if (!c25677_1) {
c25677_1 = true;
clearTimeout(c25677_2);
AdUserStore.removeChangeListener(handleUpdate2);
c25677_0(null);
}
}, DEFAULT_TIMEOUT_MS);
AdUserStore.addChangeListener(handleUpdate2);
});
} else {
r20 = Promise.resolve(AdUserStore.adUser);
}
return r20;
}
export function useAdUser(a0) {
const [state, setState] = useState(AdUserStore.adUser);
useEffect(() => {
const handleStoreChange2 = function handleStoreChange() {
if (AdUserStore.adUser != null || AdUserStore.hasFetchFailed) {
setState(AdUserStore.adUser);
}
};
if (!(AdUserStore.adUser != null || AdUserStore.isFetching || AdUserStore.hasFetchFailed)) {
fetchAdUser(a0);
}
AdUserStore.addChangeListener(handleStoreChange2);
return () => AdUserStore.removeChangeListener(handleStoreChange2);
}, [a0]);
return state;
}
@@ -0,0 +1,2 @@
// Metro module 6016 (f6017).
export const DEFAULT_TIMEOUT_MS = 5000;
+43
View File
@@ -0,0 +1,43 @@
// Metro module 6001 (f6002).
import Durations from "../../../utils/Durations";
const ttlMillis = 6 * Durations.Millis.HOUR;
export { ttlMillis as MAX_RESPONSE_TTL_MS };
export function resolveResponseTtl(a0) {
if (a0 == null) {
return ttlMillis;
}
const r6 = 1000 * a0;
return r6 < ttlMillis ? 0 < r6 ? r6 : ttlMillis : ttlMillis;
}
export function questAdDecisionFromAdDecision(a0, a1) {
let ttlMillis2;
const { fetchedAt, requestId } = a1;
const response_ttl_seconds = a0.response_ttl_seconds;
if (response_ttl_seconds == null) {
ttlMillis2 = ttlMillis;
} else {
const r14 = 1000 * response_ttl_seconds;
ttlMillis2 = r14 < ttlMillis ? 0 < r14 ? r14 : ttlMillis : ttlMillis;
}
const ad_id = a0.ad_identifiers?.ad_id;
const adset_id = a0.ad_identifiers?.adset_id;
return {
questId: null,
adCreativeId: a1.adCreativeId,
fetchedAt,
ttlMillis: ttlMillis2,
adDecisionData: {
ad_id,
adset_id,
ad_set_id: a0.ad_identifiers?.ad_set_id,
campaign_id: a0.ad_identifiers?.campaign_id,
creative_id: a0.ad_identifiers?.creative_id,
creative_type: a0.ad_identifiers?.creative_type,
decision_id: requestId,
is_targeted: a0.ad_identifiers != null
},
adContext: a0.ad_context,
metadataSealed: a0.metadata_sealed,
trafficMetadataSealed: a0.traffic_metadata_sealed
};
}