230 lines
16 KiB
TypeScript
230 lines
16 KiB
TypeScript
/* Metro module 13629; source: modules/quests/native/VideoQuestModal/VideoQuestModalContentCompleted.tsx; dependencies: [31, 27, 33, 4501, 697, 13597, 9495, 9513, 13627, 13593, 7589, 4017, 4577, 7114, 9212, 9505, 7717, 13573, 6618, 4572, 4573, 1244, 13618, 8141, 13619, 1305, 5278, 10234, 5475, 4578, 9798, 2] */
|
|
function _fun104081(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:6, offset: 0x02283a77, size: 589 bytes, params: 8, frame: 26
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
const env0_4 = value2.ActivityIndicator;
|
|
const env0_5 = value2.View;
|
|
const value3 = require(33) /* metro dependency 33 */;
|
|
const env0_6 = value3.jsx;
|
|
const env0_7 = value3.jsxs;
|
|
const env0_8 = {'mass': 1.9, 'damping': 18, 'stiffness': 80, 'overshootClamping': false};
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object2 = {wrapper: {'flexGrow': 1, 'flexShrink': 1}, headerContentCopy: {'flexGrow': 1, 'flexShrink': 1}};
|
|
object2.closeButton = {opacity: 0.5};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.content = {padding: PX_16};
|
|
object2.contentRewardsAnimatedWrapper = {flex: 1};
|
|
object2.contentRewardsWrapper = {flex: 1};
|
|
object2.contentRewards = {alignItems: 'center'};
|
|
object2.contentRewardsCopy = {textAlign: 'center'};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.contentEndCardHeader = {marginBottom: PX_16};
|
|
object2.contentEndCardHeaderCopy = {'flexGrow': 1, 'flexShrink': 1};
|
|
const object3 = {borderTopWidth: 1};
|
|
const BORDER_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_STRONG;
|
|
object3.borderTopColor = BORDER_STRONG;
|
|
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object3.paddingTop = PX_24;
|
|
object2.contentEndCard = object3;
|
|
const object4 = {height: 210};
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object4.marginBottom = PX_24;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
|
|
object2.image = object4;
|
|
const object5 = {flexGrow: 0};
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
object2.ctaPrimary = object5;
|
|
const env0_9 = Reflect.apply(createStyles, createStylesModule, [object2]);
|
|
object2 = {code: 'function VideoQuestModalContentCompletedTsx1(){const{withDelay,ANIMATION_DELAY,withSpring,isComponentMounted,ANIMATED_CONTENT_SPRING_CONFIG,interpolate,ANIMATED_CONTENT_OFFSET_Y}=this.__closure;return{opacity:withDelay(ANIMATION_DELAY,withSpring(isComponentMounted.get(),ANIMATED_CONTENT_SPRING_CONFIG)),transform:[{translateY:withDelay(ANIMATION_DELAY,withSpring(interpolate(isComponentMounted.get(),[0,1],[ANIMATED_CONTENT_OFFSET_Y,0]),ANIMATED_CONTENT_SPRING_CONFIG))}]};}'};
|
|
value = value.memo(VideoQuestModalContentCompleted);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/VideoQuestModal/VideoQuestModalContentCompleted.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function VideoQuestModalContentCompleted({onClose, onRestartVideo, sourceQuestContent}) { // fn#104082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:1402, offset: 0x02283cc4, size: 2510 bytes, params: 2, frame: 49
|
|
var object2;
|
|
var r14;
|
|
var r10;
|
|
var items5;
|
|
var string;
|
|
var ShinyButton;
|
|
var object19;
|
|
const styles = useStyles();
|
|
const videoQuestModalContextModule = require(13597) /* metro dependency 13597: VideoQuestModalContext */;
|
|
const useVideoQuestModalContext = videoQuestModalContextModule.useVideoQuestModalContext;
|
|
const quest = Reflect.apply(useVideoQuestModalContext, videoQuestModalContextModule, []).quest;
|
|
let binding = env0_3;
|
|
const value3 = binding.useMemo(_fun104083, [quest]);
|
|
const value5 = (require(13627) /* metro dependency 13627: useVideoQuestClickCtaAndMaybeCloseModal */).useVideoQuestClickCtaAndMaybeCloseModal({quest: quest,
|
|
onClose: onClose, sourceQuestContent: sourceQuestContent,
|
|
impressionId: (require(9513) /* metro dependency 9513: ContentImpressionTrackerHooks */).useQuestImpressionId()});
|
|
const questBottomSheetFooterModule = require(13593) /* metro dependency 13593: QuestBottomSheetFooter */;
|
|
const useQuestRewardClaimHandler = questBottomSheetFooterModule.useQuestRewardClaimHandler;
|
|
object2 = {quest: quest};
|
|
object2.onSuccess = (importDefault(7589) /* metro dependency 7589: ProductPurchaseSuccessActionCreators */).close;
|
|
object2.sourceQuestContent = sourceQuestContent;
|
|
const {isLoading, isClaiming, claim} = Reflect.apply(useQuestRewardClaimHandler, questBottomSheetFooterModule,
|
|
[object2]);
|
|
const userStatus = quest.userStatus;
|
|
const value7 = userStatus?.claimedAt != null;
|
|
const value8 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
|
|
const closure = VideoQuestModalContentCompletedT;
|
|
closure.__closure = {withDelay: reanimatedRexportModule.withDelay, ANIMATION_DELAY: 125,
|
|
withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, isComponentMounted: value8,
|
|
ANIMATED_CONTENT_SPRING_CONFIG: env0_8, interpolate: reanimatedRexportModule.interpolate,
|
|
ANIMATED_CONTENT_OFFSET_Y: 75};
|
|
closure.__workletHash = 2704439293952;
|
|
closure.__initData = env0_10;
|
|
const value9 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
|
|
binding = env0_3;
|
|
binding.useEffect(_fun104085, [value8]);
|
|
const questUtilsModule = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
const isShareableQuest2 = questUtilsModule.isShareableQuest(quest.config);
|
|
const value10 = binding.useCallback(_fun104086, [isShareableQuest2, quest.id]);
|
|
binding.useLayoutEffect(_fun104087, []);
|
|
const useContext = binding.useContext;
|
|
const QuestDockGestureContext = (require(13573) /* metro dependency 13573: QuestDockGestureContext */).QuestDockGestureContext;
|
|
const windowDimensions = Reflect.apply(useContext, binding, [QuestDockGestureContext]).windowDimensions;
|
|
let get = windowDimensions.get;
|
|
const value11 = Reflect.apply(get, windowDimensions, []).height < 800;
|
|
get = windowDimensions.get;
|
|
const value12 = Reflect.apply(get, windowDimensions, []).height < 760;
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const EAYZAr = t.EAYZAr;
|
|
const items2 = [<Stack align="center" direction="horizontal" justify="space-between" style={styles.content}><Text variant="heading-sm/semibold" color="text-subtle" style={styles.headerContentCopy}>{Reflect.apply(formatToPlainString,
|
|
intl, [EAYZAr,
|
|
{questName: quest.config.messages.questName}])}</Text>{((Component) => <Component onClose={onClose} style={styles.closeButton} />)(importDefault(13618) /* metro dependency 13618: VideoQuestModalCloseButton */)}</Stack>];
|
|
const ReanimatedNativeView = importDefault(8141) /* metro dependency 8141: ReanimatedNativeView */;
|
|
const items3 = [styles.contentRewardsAnimatedWrapper, value9];
|
|
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
const items4 = [styles.content];
|
|
items4[1] = styles.contentRewardsWrapper;
|
|
if (isLoading) {
|
|
if (isClaiming) {
|
|
var viewBindingProps = {style: styles.contentRewards};
|
|
items5 = [((Component) => <Component withQuestName={false} withRewardAvailableCopy={false} size={value12 ? 'md' : value11 ? 'md-lg' : 'lg'} withRewardTileAnimation />)(importDefault(13619) /* metro dependency 13619: VideoQuestModalReward */)];
|
|
string = intl.string;
|
|
items5[1] = <Text color="text-strong" style={styles.contentRewardsCopy} variant="heading-lg/semibold">{value7 ? Reflect.apply(string,
|
|
|
|
|
|
intl, [t['EMp8/M']]) : Reflect.apply(string, intl, [t.qyKLdg])}</Text>;
|
|
r14 = <View {...viewBindingProps}>{items5}</View>;
|
|
} else {
|
|
r14 = <ActivityIndicator />;
|
|
}
|
|
} else {
|
|
var viewBindingProps = {style: styles.contentRewards};
|
|
items5 = [((Component) => <Component withQuestName={false} withRewardAvailableCopy={false} size={value12 ? 'md' : value11 ? 'md-lg' : 'lg'} withRewardTileAnimation />)(importDefault(13619) /* metro dependency 13619: VideoQuestModalReward */)];
|
|
string = intl.string;
|
|
items5[1] = <Text color="text-strong" style={styles.contentRewardsCopy} variant="heading-lg/semibold">{value7 ? Reflect.apply(string,
|
|
|
|
intl, [t['EMp8/M']]) : Reflect.apply(string, intl, [t.qyKLdg])}</Text>;
|
|
r14 = <View {...viewBindingProps}>{items5}</View>;
|
|
}
|
|
const items6 = [r14];
|
|
if (value7) {
|
|
r14 = !value7;
|
|
} else {
|
|
ShinyButton = (require(1305) /* metro dependency 1305: native */).ShinyButton;
|
|
r14 = <ShinyButton loading={isClaiming} onPress={claim} style={styles.ctaPrimary} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cfY4PE)} color={(require(1305) /* metro dependency 1305: native */).ButtonColors.GREY} />;
|
|
}
|
|
items6[1] = r14;
|
|
items2[1] = <ReanimatedNativeView style={items3}><Stack align="center" justify="center" spacing={PX_24} style={items4}>{items6}</Stack></ReanimatedNativeView>;
|
|
const items7 = [styles.content];
|
|
items7[1] = styles.contentEndCard;
|
|
const Stack2 = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
const stack = <Stack2 spacing={PX_4} style={styles.contentEndCardHeaderCopy}><Text variant="heading-md/semibold" color="mobile-text-heading-primary" accessibilityRole="header">{quest.config.messages.gameTitle}</Text><Text variant="text-sm/medium" color="text-subtle">{quest.config.messages.gamePublisher}</Text></Stack2>;
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
string = intl.string;
|
|
const YsCuyF = (require(1244) /* metro dependency 1244: indexNative */).t.YsCuyF;
|
|
const RetryIcon = (require(10234) /* metro dependency 10234: RetryIcon */).RetryIcon;
|
|
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
|
|
const stack2 = <Stack direction="horizontal" justify="space-between" style={styles.contentEndCardHeader}>{stack}<PressableOpacity accessibilityRole="button" accessibilityLabel={Reflect.apply(string,
|
|
intl,
|
|
[YsCuyF])} onPress={onRestartVideo}><RetryIcon color={INTERACTIVE_TEXT_DEFAULT} /></PressableOpacity></Stack>;
|
|
const value28 = value3 != null;
|
|
if (value28) {
|
|
r10 = <PressableOpacity accessibilityRole="button" accessibilityLabel={intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.r8BzFT,
|
|
|
|
{gameTitle: quest.config.messages.gameTitle})} onPress={value5}>{((Component) => <Component style={styles.image} source={{uri: value3.url}} resizeMode="cover" />)(importDefault(5475) /* metro dependency 5475: FastImage */)}</PressableOpacity>;
|
|
} else {
|
|
r10 = value28;
|
|
}
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
items2[2] = <View style={items7}>{stack2}{r10}<Stack direction="horizontal" spacing={PX_16} align="center"><Button grow onPress={value5} text={(require(9505) /* metro dependency 9505: QuestCopyUtils */).getExternalCtaLabel(quest)} />{isShareableQuest2 && <PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Ej3B3Y)} onPress={value10}>{((ShareIcon) => <ShareIcon color={(importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT} />)((require(9798) /* metro dependency 9798: ShareIcon */).ShareIcon)}</PressableOpacity>}</Stack></View>;
|
|
return (
|
|
<SafeAreaPaddingView bottom style={styles.wrapper}>
|
|
{items2}
|
|
</SafeAreaPaddingView>
|
|
);
|
|
}
|
|
|
|
function _fun104083() { // fn#104083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:1571, offset: 0x02284692, size: 75 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
value = require(9495) /* metro dependency 9495: AssetUtils */;
|
|
const getQuestAsset = value.getQuestAsset;
|
|
const questBinding = quest;
|
|
const QuestAssetType = (require(9495) /* metro dependency 9495: AssetUtils */).QuestAssetType;
|
|
const VIDEO_PLAYER_THUMBNAIL = QuestAssetType.VIDEO_PLAYER_THUMBNAIL;
|
|
return Reflect.apply(getQuestAsset, value, [questBinding, VIDEO_PLAYER_THUMBNAIL, undefined, true]);
|
|
}
|
|
|
|
function VideoQuestModalContentCompletedT() { // fn#104084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:2048, owner: VideoQuestModalContentCompleted.T, offset: 0x022846dd, size: 206 bytes, params: 1, frame: 24
|
|
const object3 = {};
|
|
let value = environment.__proto__;
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
let withDelay = reanimatedRexportModule.withDelay;
|
|
const springModule = require(4577) /* metro dependency 4577: spring */;
|
|
let withSpring = springModule.withSpring;
|
|
let binding = env0_1;
|
|
const value3 = binding.get();
|
|
binding = env1_8;
|
|
object3.opacity = Reflect.apply(withDelay, reanimatedRexportModule, [125, Reflect.apply(withSpring, springModule,
|
|
[value3, binding])]);
|
|
const object4 = {};
|
|
value = reanimatedRexportModule;
|
|
withDelay = value.withDelay;
|
|
const moduleValue3 = springModule;
|
|
withSpring = moduleValue3.withSpring;
|
|
const moduleValue4 = reanimatedRexportModule;
|
|
object4.translateY = Reflect.apply(withDelay, value, [125, Reflect.apply(withSpring, moduleValue3,
|
|
[moduleValue4.interpolate(env0_1.get(), [0, 1], [75, 0]), binding])]);
|
|
object3.transform = [object4];
|
|
return object3;
|
|
}
|
|
|
|
function _fun104086() { // fn#104086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:2597, offset: 0x022847ab, size: 95 bytes, params: 1, frame: 17
|
|
var value2;
|
|
var moduleValue;
|
|
var showShareActionSheet;
|
|
var moduleValue2;
|
|
if (env0_2) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(9212) /* metro dependency 9212: showShareActionSheetAndroid */;
|
|
showShareActionSheet = moduleValue.showShareActionSheet;
|
|
moduleValue2 = require(9505) /* metro dependency 9505: QuestCopyUtils */;
|
|
Reflect.apply(showShareActionSheet, moduleValue, [{message: moduleValue2.getQuestUrl(quest.id)},
|
|
'Video Quest Modal']);
|
|
}
|
|
}
|
|
|
|
function _fun104087() { // fn#104087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:2724, offset: 0x0228480a, size: 45 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
(require(7717) /* metro dependency 7717: DeviceOrientation */).lockOrientation('PORTRAIT', true);
|
|
}
|
|
|