decord/beta/source/modules/quests/native/QuestDockRewardTile.tsx
2026-10-12 16:32:48 +00:00

218 lines
6.9 KiB
TypeScript

// Module ID: 12976
// Function ID: 12977
// Name: QuestDockRewardTile
// Dependencies: [32, 19, 17, 5081, 21, 5092, 587, 558, 576, 1382, 504, 9185, 8426, 6157, 2]
// Module 12976 (QuestDockRewardTile)
import Fragment from "Fragment" /* 21 */;
import nativeDefault from "native" /* 587 */;
import AssetUtils from "AssetUtils" /* 9185 */;
import _slicedToArray from "_slicedToArray" /* 32 */;
import react_mod from "react" /* 19 */;
import react_native from "react-native" /* 17 */;
import AccessibilityStore from "AccessibilityStore" /* 5081 */;
import createStyles from "createStyles" /* 5092 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size_mod from "module_2" /* 2 */;
let str, tmp2;
let hasOwnProperty;
let metroRequire;
let react = react_mod;
({ AppState: hasOwnProperty, View: metroRequire } = react_native);
const jsx = Fragment.jsx;
let closure_9 = createStyles.createStyles(() => {
const obj = { container: { borderRadius: nativeDefault.radii.sm, display: "flex", justifyContent: "center", alignItems: "center", overflow: "hidden" }, video: { overflow: "hidden", height: "100%", width: "100%" }, image: { height: "100%", width: "100%" } };
({ borderRadius: nativeDefault.radii.sm, display: "flex", justifyContent: "center", alignItems: "center", overflow: "hidden" });
return obj;
});
const memoResult = react.memo(ReactCompilerGating.isReactCompilerEnabled() ? (function QuestDockRewardTile(arg0) {
let accessibilityLabel;
let assetUrl;
let height;
let isAnimatedAsset;
let paused;
let style;
let tmp12;
let tmp13;
let tmp6;
let tmp7;
let useReducedMotion;
let width;
let withAnimation;
let tmp = isAnimatedAsset;
const obj = isAnimatedAsset(576);
const cResult = obj.c(32);
({ assetUrl, isAnimatedAsset } = arg0);
({ accessibilityLabel, height, width, style, paused, withAnimation } = arg0);
if (cResult[0] !== withAnimation) {
let isIOSResult = withAnimation;
if (undefined === withAnimation) {
const tmpResult = tmp(1382);
isIOSResult = tmpResult.isIOS();
}
cResult[0] = withAnimation;
cResult[1] = isIOSResult;
}
if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) {
const items = [AccessibilityStore];
class L {
constructor() {
return closure_1_7.useReducedMotion;
}
}
cResult[2] = items;
cResult[3] = L;
tmp7 = L;
tmp6 = items;
} else {
tmp6 = cResult[2];
tmp7 = cResult[3];
}
const tmpResult3 = tmp(504);
const stateFromStores = tmpResult3.useStateFromStores(tmp6, tmp7);
closure_9();
[r10055, importDefault] = react.useState("active" === closure_5.currentState);
_slicedToArray(react.useState("active" === closure_5.currentState), 2);
const obj4 = react;
if (cResult[4] !== isAnimatedAsset) {
class U {
constructor() {
tmp = closure_0;
if (tmp) {
tmp2 = closure_1_5;
str = "change";
closure_0 = closure_1_5.addEventListener("change", () => { /* body not rendered: F145367 */ });
return () => { /* body not rendered: F145368 */ };
} else {
return;
}
}
}
const items1 = [isAnimatedAsset];
class L {
constructor() {
return closure_1_7.useReducedMotion;
}
}
cResult[4] = isAnimatedAsset;
cResult[5] = U;
cResult[6] = items1;
tmp13 = items1;
tmp12 = U;
} else {
class U {
constructor() {
tmp = closure_0;
if (tmp) {
tmp2 = closure_1_5;
str = "change";
closure_0 = closure_1_5.addEventListener("change", () => { /* body not rendered: F145367 */ });
return () => { /* body not rendered: F145368 */ };
} else {
return;
}
}
}
tmp13 = cResult[6];
}
const effect = obj4.useEffect(tmp12, tmp13);
if (cResult[7] === assetUrl) {
class U {
constructor() {
tmp = closure_0;
if (tmp) {
tmp2 = closure_1_5;
str = "change";
closure_0 = closure_1_5.addEventListener("change", () => { /* body not rendered: F145367 */ });
return () => { /* body not rendered: F145368 */ };
} else {
return;
}
}
}
}
const tmpResult4 = tmp(9185);
const scaledImageUrl = tmpResult4.getScaledImageUrl({ assetUrl, width, height });
cResult[7] = assetUrl;
cResult[8] = height;
cResult[9] = width;
cResult[10] = scaledImageUrl;
}) : (function QuestDockRewardTile(assetUrl) {
let accessibilityLabel;
let c4;
let items3;
let obj5;
let style;
let tmp14;
let tmp8;
let useReducedMotion;
assetUrl = assetUrl.assetUrl;
const isAnimatedAsset = assetUrl.isAnimatedAsset;
const height = assetUrl.height;
const width = assetUrl.width;
let flag = assetUrl.paused;
({ accessibilityLabel, style } = assetUrl);
if (flag === undefined) {
flag = false;
}
let withAnimation = assetUrl.withAnimation;
if (withAnimation === undefined) {
let tmp = assetUrl;
let obj = assetUrl(height[9]);
withAnimation = obj.isIOS();
}
react = undefined;
const items = [AccessibilityStore];
const obj2 = assetUrl(height[10]);
const stateFromStores = obj2.useStateFromStores(items, () => useReducedMotion.useReducedMotion);
const tmp6 = closure_9();
[tmp8, c4] = width(react.useState("active" === closure_5.currentState), 2);
const items1 = [isAnimatedAsset];
width(react.useState("active" === closure_5.currentState), 2);
const effect = react.useEffect(() => {
const tmp = isAnimatedAsset;
if (tmp) {
let closure_0 = closure_1_5.addEventListener("change", (event) => {
closure_1_4("active" === event);
});
return () => {
closure_0.remove();
};
}
}, items1);
const items2 = [assetUrl, width, height];
const memo = react.useMemo(() => {
size = { assetUrl, width, height };
const obj = AssetUtils;
return obj.getScaledImageUrl(size);
}, items2);
const obj3 = { accessibilityLabel, style: items3, children: null };
items3 = [tmp6.container, { height, width }, style];
const tmp3 = assetUrl;
if (isAnimatedAsset) {
let tmp11Result;
if (withAnimation) {
const obj4 = { style: tmp6.video, source: obj5, disableFocus: true, preventsDisplaySleepDuringVideoPlayback: false, importantForAccessibility: "no-hide-descendants", poster: memo, resizeMode: "cover", paused: tmp14, muted: true };
tmp14 = !tmp8;
obj5 = { uri: assetUrl };
const VideoComponent = tmp3(tmp4[12]).VideoComponent;
if (tmp8) {
tmp14 = flag;
}
if (!tmp14) {
tmp14 = stateFromStores;
}
tmp11Result = tmp11(VideoComponent, obj4);
}
obj3.children = tmp11Result;
return <tmp12 {...obj3} />;
}
const obj6 = { source: { uri: memo }, style: tmp6.image };
tmp11Result = tmp11(isAnimatedAsset(tmp4[13]), obj6);
}));
let size = size_mod;
const result = size.fileFinishedImporting("modules/quests/native/QuestDockRewardTile.tsx");
export default memoResult;