/* Metro module 13522; source: modules/quests/native/BountiesModal/BountiesScrollVideoItem.tsx; dependencies: [5, 57, 31, 27, 10071, 7092, 6528, 33, 13523, 566, 9530, 13533, 9532, 13534, 13536, 13537, 13538, 10183, 7121, 6533, 13543, 2] */ import Module00005 from '../../../../by-id/module-00005.js'; /* Metro dependency 5 */ import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */ import BountyStore from '../../BountyStore.tsx'; /* Metro dependency 7092 */ import VirtualCurrencyStore from '../../../virtual_currency/stores/VirtualCurrencyStore.tsx'; /* Metro dependency 10071 */ import BountiesScrollEndCard from './BountiesScrollEndCard.tsx'; /* Metro dependency 13543 */ import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as QuestConstantsModule from '../../QuestConstants.tsx'; /* Metro dependency 6528 */ import * as QuestContentModule from '../../../../external/discord_common/js/shared/shared-constants/QuestContent.tsx'; /* Metro dependency 6533 */ import * as AdCreativeTypeModule from '../../../../external/discord_common/js/shared/shared-constants/AdCreativeType.tsx'; /* Metro dependency 7121 */ import * as BountiesStage1ExperimentModule from '../../experiments/BountiesStage1Experiment.tsx'; /* Metro dependency 9530 */ import * as QuestContentImpressionTrackerNativeModule from '../QuestContentImpressionTracker.native.tsx'; /* Metro dependency 10183 */ import * as UseBountiesModalTimingModule from './useBountiesModalTiming.tsx'; /* Metro dependency 13533 */ import * as UseBountiesModalVideoAnalyticsModule from './useBountiesModalVideoAnalytics.tsx'; /* Metro dependency 13536 */ import * as UseBountyVideoProgressPersistenceModule from './useBountyVideoProgressPersistence.tsx'; /* Metro dependency 13537 */ import * as BountyVideoModule from './BountyVideo.tsx'; /* Metro dependency 13538 */ function _fun102777(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:6, offset: 0x0224825f, size: 260 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/quests/native/BountiesModal/BountiesScrollVideoItem.tsx'); exports.BountiesScrollVideoItem = BountiesScrollVideoItem; function BountiesScrollVideoItemInner({bounty, sourceQuestContent, width, height, isActive, isRecapPageRevealed, isRecapPageOnTop, isScrollingInBoundsSharedValue}) { // fn#102778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:211, offset: 0x02248363, size: 1184 bytes, params: 2, frame: 44 var currentBalance; const height2 = height; const isActive2 = isActive; const isScrollingInBoundsSharedValue2 = isScrollingInBoundsSharedValue; const value2 = isScrollingInBoundsSharedValue2.useMemo(function() { return {width: width, height: height}; }, [width, height]); const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([BountyStore], function() { return BountyStore.isBountyCompleted(bounty.id); }); const BountiesStage1Experiment = (BountiesStage1ExperimentModule).BountiesStage1Experiment; const useConfig = BountiesStage1Experiment.useConfig; const VIDEO_MODAL_MOBILE = QuestsExperimentLocations.VIDEO_MODAL_MOBILE; const {enabled, loopingEnabled, orbAmount, rewardTimerSeconds} = Reflect.apply(useConfig, BountiesStage1Experiment, [{location: VIDEO_MODAL_MOBILE}]); const BountyVideoEndMode = (UseBountiesModalTimingModule).BountyVideoEndMode; const r26 = loopingEnabled ? BountyVideoEndMode.LOOP : BountyVideoEndMode.END_CARD_WITH_CTA; const r25 = enabled ? 1000 * rewardTimerSeconds : 1000 * bounty.rewardTimerSeconds; const value8 = isScrollingInBoundsSharedValue2.useRef(null); const handlePlayerStateChange = useResumeOnActive({isActive: isActive, playerRef: value8}).handlePlayerStateChange; const [property, property2] = isActive2(isScrollingInBoundsSharedValue2.useState(isActive), 2); const [property3, property4] = isActive2(isScrollingInBoundsSharedValue2.useState(_fun102784), 2); const isActive22 = isActive2(isScrollingInBoundsSharedValue2.useState(0), 2); const property5 = isActive22[0]; if (property !== isActive) { property2(isActive); if (isActive) { currentBalance = VirtualCurrencyStore.getCurrentBalance(); property4(currentBalance); if (currentBalance !== property3) { isActive22[1](function(a0) { return a0 + 1; }); } } } const value17 = isScrollingInBoundsSharedValue2.useCallback(height2(_fun102787), [bounty.id, isActive, orbAmount, sourceQuestContent]); const {handleVideoProgressAnalytics, handleVideoEndAnalytics, handleVideoLoopedAnalytics, handleVideoPausedAnalytics, handleVideoResumedAnalytics} = (UseBountiesModalVideoAnalyticsModule).useBountiesModalVideoAnalytics({bountyId: bounty.id, sourceQuestContent: sourceQuestContent, rewardDurationMs: r25}); const value19 = (UseBountyVideoProgressPersistenceModule).useBountyVideoProgressPersistence({bountyId: bounty.id, endMode: r26}); const initialProgress = value19.initialProgress; const handleProgress = value19.handleProgress; isScrollingInBoundsSharedValue2.useEffect(function() { return _fun102790; }, [value19.flushProgress]); const value20 = isScrollingInBoundsSharedValue2.useCallback(function(a0, a1, a2) { handleVideoProgressAnalytics(a0, a1); handleProgress(a0, a1, a2); }, [handleVideoProgressAnalytics, handleProgress]); const useBountiesModalTiming = UseBountiesModalTimingModule.useBountiesModalTiming; let duration = initialProgress.duration; duration = duration > 0 ? initialProgress.duration : null; const value21 = Reflect.apply(useBountiesModalTiming, UseBountiesModalTimingModule, [{endMode: r26, rewardDurationMs: r25, isCompleted: value3, onRewardEarned: value17, onVideoProgress: value20, onVideoEnd: handleVideoEndAnalytics, onVideoLooped: handleVideoLoopedAnalytics, onVideoPaused: handleVideoPausedAnalytics, onVideoResumed: handleVideoResumedAnalytics, playerRef: value8, initialProgressSec: initialProgress.timestampSec, initialMaxVideoProgressSec: initialProgress.maxTimestampSec, initialVideoDurationSec: duration}]); const isCtaVisible = value21.isCtaVisible; const isEndCardVisible = value21.isEndCardVisible; const handleVideoEnd = value21.handleVideoEnd; const handleVideoProgress = value21.handleVideoProgress; const handleVideoPaused = value21.handleVideoPaused; const handleVideoResumed = value21.handleVideoResumed; const env0_12 = value21.handleReplay; const rewardRemainingSeconds = value21.rewardRemainingSeconds; const rewardTotalSeconds = value21.rewardTotalSeconds; const normalizedProgress = value21.normalizedProgress; const BountyVideo = (BountyVideoModule).BountyVideo; return ( ); function useResumeOnActive({isActive, playerRef}) { // fn#102781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:784, owner: BountiesScrollVideoItemInner.useResumeOnActive, offset: 0x0224883a, size: 137 bytes, params: 2, frame: 17 const env0_2 = env1_5.useRef(true); const env0_3 = env1_5.useRef(null); const value2 = env1_5.useCallback(_fun102782, []); env1_5.useEffect(_fun102783, [isActive, playerRef]); return {handlePlayerStateChange: value2}; function _fun102782(a0) { // fn#102782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:890, offset: 0x0218936d, size: 20 bytes, params: 2, frame: 2 env0_3.current = a0; } function _fun102783() { // fn#102783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:932, offset: 0x022488c3, size: 118 bytes, params: 1, frame: 14 var r1; var isActiveBinding; var value2; let current = env0_2.current; if (current) { env0_2.current = false; } else { isActiveBinding = isActive; if (isActiveBinding) { current = env0_3.current; value2 = environment.__proto__.__proto__; r1 = current === (require(13523) /* metro dependency 13523: AdVideoPlayer */).PlayerState.PAUSED; } else { r1 = isActiveBinding; } if (r1) { current = playerRef.current; if (current != null) { current.play(); } } } } } function _fun102784() { // fn#102784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:1186, offset: 0x02248939, size: 31 bytes, params: 1, frame: 10 var r0; const isActiveBinding = isActive; let value = null; if (isActiveBinding) { value = environment.__proto__; value = VirtualCurrencyStore.getCurrentBalance(); r0 = value; } else { r0 = value; } return r0; } function* _fun102787() { // fn#102787, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:1378, offset: 0x02248963, size: 167 bytes, params: 1, frame: 15 var environment; var r2; var r1; var binding; var binding2; var property; var value4; var claimBountyReward; var id; var value6; var value7; var value8; var error; var value9; if (true) { value = false; try { binding = env2_0; } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } try { binding2 = env2_2; } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } try { property = binding2[12]; } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } try { value4 = binding(property); } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } try { claimBountyReward = value4.claimBountyReward; } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } try { } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } try { id = require.id; } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } try { } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } try { value6 = Reflect.apply(claimBountyReward, value4, [id, importDefault]); } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } yield value6; try { value7 = undefined; value8 = false; } catch (error) { binding = env2_0; value9 = binding(env2_2[13]); value9.openBountyRewardClaimErrorToast(error); r2 = value; if (r2) { value = environment.__proto__; binding = env1_4; r1 = binding; } else { r1 = r2; } if (r1) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } return undefined; } if (value8) { return value7; } r2 = true; if (r2 && env1_4) { value = environment.__proto__; VirtualCurrencyStore(_fun102788); } } function _fun102788(a0) { // fn#102788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:1511, offset: 0x02248a0a, size: 25 bytes, params: 2, frame: 3 var r0; let value = null; if (value == a0) { r0 = value; } else { value = environment.__proto__.__proto__; value = a0 + View; r0 = value; } return r0; } } function _fun102789() { // fn#102789, offset: 0x02248a23, size: 11 bytes, params: 1, frame: 1 return function() { return flushProgress(); }; function _fun102790() { // fn#102790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:1958, offset: 0x01e42539, size: 15 bytes, params: 1, frame: 9 return flushProgress(); } } function renderEndCard() { // fn#102792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:3092, owner: BountiesScrollVideoItemInner.renderEndCard, offset: 0x02248a53, size: 151 bytes, params: 1, frame: 17 const QuestContentImpressionTrackerNative = (QuestContentImpressionTrackerNativeModule).QuestContentImpressionTrackerNative; const id = bounty.id; const AdCreativeType = (AdCreativeTypeModule).AdCreativeType; const BOUNTY = AdCreativeType.BOUNTY; const QuestContent = (QuestContentModule).QuestContent; const VIDEO_MODAL_END_CARD = QuestContent.VIDEO_MODAL_END_CARD; return ( {children_102793} ); function renderEndCardChildren() { // fn#102793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:3315, owner: BountiesScrollVideoItemInner.renderEndCard.children, offset: 0x02248aea, size: 87 bytes, params: 1, frame: 15 const value = environment.__proto__.__proto__; return ((Component) => )(BountiesScrollEndCard); } } } function BountiesScrollVideoItem({bounty, sourceQuestContent, width, height, isActive, isRecapPageRevealed, isRecapPageOnTop, isScrollingInBoundsSharedValue}) { // fn#102794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:3539, offset: 0x02248b41, size: 235 bytes, params: 2, frame: 19 isActive = !(isActive === undefined) && isActive; if (isRecapPageRevealed !== undefined) { } if (isRecapPageOnTop !== undefined) { } const QuestContentImpressionTrackerNative = (QuestContentImpressionTrackerNativeModule).QuestContentImpressionTrackerNative; const id = bounty.id; const AdCreativeType = (AdCreativeTypeModule).AdCreativeType; const BOUNTY = AdCreativeType.BOUNTY; const QuestContent = (QuestContentModule).QuestContent; const VIDEO_MODAL_MOBILE = QuestContent.VIDEO_MODAL_MOBILE; return ( {children_102795} ); function BountiesScrollVideoItemChildren() { // fn#102795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13712:3939, owner: BountiesScrollVideoItem.children, offset: 0x02248c2c, size: 96 bytes, params: 1, frame: 14 return ( ); } } } global.__d(_fun102777, 13522, [5, 57, 31, 27, 10071, 7092, 6528, 33, 13523, 566, 9530, 13533, 9532, 13534, 13536, 13537, 13538, 10183, 7121, 6533, 13543, 2]) /* metro module 13522, dependencies: [5, 57, 31, 27, 10071, 7092, 6528, 33, 13523, 566, 9530, 13533, 9532, 13534, 13536, 13537, 13538, 10183, 7121, 6533, 13543, 2] */;