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

@@ -0,0 +1,18 @@
// Metro module 8083 (f8084).
import { useMemo } from "react";
import ProfileFrameRecord from "../../records/ProfileFrameRecord";
import { useFramePreviewOverrideStore } from "../native/tooling/FramePreviewOverrideStore";
import { CollectiblesItemType } from "../../../../_bundle/Module1901";
export default function useFramePreviewOverrideFrame() {
const framePreviewOverrideStore = useFramePreviewOverrideStore((a0) => a0.override);
return useMemo(() => framePreviewOverrideStore != null ? new ProfileFrameRecord({
type: CollectiblesItemType.PROFILE_FRAME,
skuId: "frame-preview-override",
label: framePreviewOverrideStore.frameKey,
layers: framePreviewOverrideStore.layers,
innerWidth: framePreviewOverrideStore.innerWidth,
overflowTop: framePreviewOverrideStore.overflowTop,
overflowBottom: framePreviewOverrideStore.overflowBottom,
overflowHorizontal: framePreviewOverrideStore.overflowHorizontal
}) : null, [framePreviewOverrideStore]);
};
@@ -0,0 +1,22 @@
// Metro module 8082 (f8083).
import { useEffect } from "react";
import useFramePreviewOverrideFrame_native from "./useFramePreviewOverrideFrame.native";
import { useIsProfileFramesEnabled } from "../../experiments/CollectiblesProfileFramesExperiment";
import useProfileFrame from "./useProfileFrame";
import { maybeFetchCollectiblesProduct } from "../../CollectiblesActionCreators";
export default function useMaybeFetchProfileFrame(a0, a1) {
let r13 = useFramePreviewOverrideFrame_native();
const isProfileFramesEnabled = useIsProfileFramesEnabled(a1);
const profileFrame = useProfileFrame(a0);
const r20 = r13 == null && isProfileFramesEnabled && a0 != null && profileFrame == null;
let c16239_1 = r20;
useEffect(() => {
if (c16239_1) {
maybeFetchCollectiblesProduct(a0);
}
}, [r20, a0]);
if (r13 == null) {
r13 = isProfileFramesEnabled ? profileFrame : void 0;
}
return r13;
};
@@ -0,0 +1,44 @@
// Metro module 8366 (f8367).
import { useEffect, useRef } from "react";
import CollectiblesCategoryStore from "../../CollectiblesCategoryStore";
import { useStateFromStores } from "../../../../_bundle/defaultAreStatesEqual";
import { maybeTrackUserProfileUiViewed } from "../../../user_profile/UserProfileAnalyticsUtils";
export default function useMaybeTrackProfileFrameViewed({ skuId, openedAt, context, analyticsLocations }) {
let ref, ref2, ref3, ref4;
ref = void 0;
ref2 = void 0;
ref3 = void 0;
ref4 = void 0;
const stateFromStores = useStateFromStores([CollectiblesCategoryStore], () => CollectiblesCategoryStore.getProductFetch(skuId));
ref = useRef(void 0);
ref2 = useRef(void 0);
ref3 = useRef(void 0);
ref4 = useRef(false);
useEffect(() => {
if (skuId != null && openedAt != null) {
if (!(ref2.current === skuId && ref3.current === openedAt)) {
ref2.current = skuId;
ref3.current = openedAt;
ref4.current = false;
ref.current = void 0;
}
const r9 = Date.now();
if (ref.current == null) {
ref.current = r9 - openedAt;
}
if (!(stateFromStores?.state !== "success" || ref4.current)) {
ref4.current = true;
maybeTrackUserProfileUiViewed({
profileUi: "PROFILE_FRAME",
timeToInteractiveMs: ref.current,
timeToLoadMs: r9 - openedAt,
timeToFetchMs: stateFromStores.startedAt != null ? stateFromStores.endedAt != null ? stateFromStores.endedAt - stateFromStores.startedAt : void 0 : void 0,
viewStartedAt: openedAt,
fetchStartedAt: stateFromStores.startedAt,
analyticsLocations,
...context
});
}
}
}, [skuId, openedAt, stateFromStores]);
};
@@ -0,0 +1,17 @@
// Metro module 8094 (f8095).
import CollectiblesCategoryStore from "../../CollectiblesCategoryStore";
import CollectiblesPurchaseStore from "../../CollectiblesPurchaseStore";
import { isProfileFrameRecord } from "../../records/ProfileFrameRecord";
import { useStateFromStores } from "../../../../_bundle/Module589";
export default function useProfileFrame(c16244_0) {
return useStateFromStores([CollectiblesCategoryStore, CollectiblesPurchaseStore], () => {
if (c16244_0 != null) {
const product = CollectiblesCategoryStore.getProduct(c16244_0);
if (isProfileFrameRecord(product == null ? void 0 : product.items[0])) {
return product.items[0];
}
const purchase = CollectiblesPurchaseStore.getPurchase(c16244_0);
return isProfileFrameRecord(purchase == null ? void 0 : purchase.items[0]) ? purchase.items[0] : void 0;
}
});
};
@@ -0,0 +1,69 @@
// Metro module 13727 (f13728).
import { useMemo } from "react";
import CollectiblesCategoryStore from "../../CollectiblesCategoryStore";
import CollectiblesPurchaseStore from "../../CollectiblesPurchaseStore";
import { useStateFromStores, useStateFromStoresArray } from "../../../../_bundle/defaultAreStatesEqual";
import { useIsProfileFramesEarlyAccessPhase } from "../../hooks/useCanPurchaseFrames";
import { getProfileFrames, isPremiumCollectiblesPurchase, isPremiumCollectiblesProduct } from "../../CollectiblesUtils";
import { intl, t } from "../../../../intl/index.native";
let c9542_6 = {
PURCHASE: "purchase",
PREMIUM_PURCHASE: "premium_purchase",
PREVIEW: "preview"
};
let c9542_7 = {
skuId: "None"
};
let c9542_8 = {
skuId: "Shop"
};
export default function useProfileFrameSections() {
let c20676_1, c20676_2, isProfileFramesEarlyAccessPhase;
const stateFromStores = useStateFromStores([CollectiblesPurchaseStore], () => CollectiblesPurchaseStore.purchases);
const [r22, r23] = useStateFromStoresArray([CollectiblesCategoryStore], () => [CollectiblesCategoryStore.categories, CollectiblesCategoryStore.products]);
c20676_1 = r22;
c20676_2 = r23;
isProfileFramesEarlyAccessPhase = useIsProfileFramesEarlyAccessPhase("useProfileFrameSections");
return useMemo(() => {
const r23 = getProfileFrames(stateFromStores, c20676_1).reduce((acc, item) => {
const r9 = stateFromStores.get(item.skuId);
if (r9 != null ? isPremiumCollectiblesPurchase(r9) : isPremiumCollectiblesProduct(c20676_2.get(item.skuId))) {
acc.premium_purchase.push(item);
} else if (r9 != null) {
acc.purchase.push(item);
} else {
acc.preview.push(item);
}
return acc;
}, {
purchase: [],
premium_purchase: [],
preview: []
});
let header = intl.string(t.TiLCgw);
const r46 = [{
section: c9542_6.PURCHASE,
items: [c9542_7, c9542_8, ...r23.purchase],
height: 12,
header: intl.string(t["9eZ4aO"])
}, {
section: c9542_6.PREMIUM_PURCHASE,
items: r23.premium_purchase,
height: 12,
header
}, ,];
if (!isProfileFramesEarlyAccessPhase) {
header = intl.string(t["1vbbee"]);
}
r46[2] = {
section: c9542_6.PREVIEW,
items: r23.preview,
height: 12,
header
};
return r46.filter((item) => item.items.length > 0);
}, [r22, r23, stateFromStores, isProfileFramesEarlyAccessPhase]);
};
export { c9542_6 as Section };
export { c9542_7 as NONE_ITEM };
export { c9542_8 as SHOP_ITEM };