Loading
function(e,t,n){"use strict";n.d(t,{sB:()=>ew,WM:()=>ea,lx:()=>ep,N1:()=>ei,xB:()=>eL,Yb:()=>eA,IV:()=>eb,Oq:()=>eo,r8:()=>eS,lk:()=>eE,qY:()=>eR,jh:()=>eu,CV:()=>et,UZ:()=>eh,yO:()=>eC,Fr:()=>eN,Oy:()=>es,Gn:()=>em,uI:()=>eO,L4:()=>eI,zh:()=>eM,R2:()=>er,g5:()=>e_,vD:()=>ee,qV:()=>eU,HA:()=>eT,Yf:()=>ev,Ov:()=>en,QG:()=>eg,Zb:()=>eP,dQ:()=>ey,Gt:()=>ef}),n(323874),n(14289),n(35956);var i,r=n(562708),a=n(323889),s=n(517846),l=n(636537),o=n(73153),d=n(181658),c=n(157695),u=n(314329),_=n(291749),E=n(507395),A=n(144779),h=n(107195),f=n(881615),I=n(390595),p=n(69114),T=n(633965),m=n(27620),g=n(463347),S=n(310829),N=n(383394),C=n(544180),O=n(711014),R=n(174459),L=n(927813),y=n(38405),D=n(499785),v=n(789999),b=n(322683),P=n(652215);function M(e){if(Math.random()>.1)return;let t=null==e.apiResponseTimestamp?null:e.apiResponseTimestamp-e.initialSendTimestamp,n=(0,b.O)();R.default.track(P.HAw.EARNED_DECISION_ROUNDTRIP,{...(0,p.A)(),endpoint:e.endpoint,was_successful:e.wasSuccessful,api_latency_ms:t,mobile_network_type:C.A.getType(),...null!=n&&{mobile_signal_strength_level:n},caller_source:e.callerSource,request_id:e.requestId,fetched_at:e.fetchedAt,is_foregrounded:(0,v.R)()})}class U{pendingRequests=new Map;recordEarnedRequestAttempt(e){let t=Symbol(),n={timeoutId:setTimeout(()=>{let e=this.pendingRequests.get(t);null!=e&&(this.pendingRequests.delete(t),M(e))},3e4),initialSendTimestamp:Date.now(),endpoint:"/quests/earned-decision",apiResponseTimestamp:null,wasSuccessful:!1,callerSource:e,requestId:null,fetchedAt:null};return this.pendingRequests.set(t,n),t}recordEarnedRequestApiResponse(e,t){let{wasSuccessful:n,requestId:i=null,fetchedAt:r=null}=t,a=this.pendingRequests.get(e);null!=a&&(clearTimeout(a.timeoutId),this.pendingRequests.delete(e),M({...a,apiResponseTimestamp:Date.now(),wasSuccessful:n,requestId:i,fetchedAt:r}))}}let w=new U;var G=n(260364);function x(e,t,n){if(Math.random()>.1)return;let i=null==e.apiResponseTimestamp?null:e.apiResponseTimestamp-e.initialSendTimestamp,r=(0,b.O)();R.default.track(P.HAw.QUEST_DECISION_ROUNDTRIP,{...(0,p.A)(),endpoint:e.endpoint,was_successful:e.wasSuccessful,api_latency_ms:i,mobile_network_type:C.A.getType(),...null!=r&&{mobile_signal_strength_level:r},caller_source:e.callerSource,ad_request_id:e.adRequestId,fetched_at:n,previous_ad_request_id:e.previousAdDecision?.adDecisionData?.decision_id??null,previous_fetched_at:e.previousAdDecision?.fetchedAt??null,transition_case:t,is_foregrounded:(0,v.R)()})}class k{pendingRequests=new Map;recordQuestRequestAttempt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=Symbol(),r=null!=n?c.A.deliveryAdDecisionByPlacement.get(n)??null:null,a={timeoutId:setTimeout(()=>{let e=this.pendingRequests.get(i);null!=e&&(this.pendingRequests.delete(i),x(e,"timeout",null))},3e4),initialSendTimestamp:Date.now(),endpoint:e,apiResponseTimestamp:null,wasSuccessful:!1,callerSource:t,adRequestId:null,previousAdDecision:r,placement:n};return this.pendingRequests.set(i,a),i}recordQuestRequestApiResponse(e,t){let{wasSuccessful:n,adRequestId:i=null,currentCreative:r=null,currentFetchedAt:s=null}=t,l=this.pendingRequests.get(e);if(null!=l){clearTimeout(l.timeoutId),this.pendingRequests.delete(e);let t=function(e,t){function n(e){if(null==e)return"null";if(null==e.creative)return"no_serve";switch(e.creative.type){case a.p.QUEST:return"quest";case a.p.BOUNTY:return"bounty";case a.p.PLAYABLE:return"playable";case a.p.QUEST_HOME_HERO:return"quest_home_hero"}}let i=n(e),r=n(t);return i===r&&"null"!==i&&"no_serve"!==i?(0,h.K2)(e?.creative)===(0,h.K2)(t?.creative)?`same_${i}`:`different_${i}`:`${i}_to_${r}`}(l.previousAdDecision,null!==s?{creative:r,fetchedAt:s,ttlMillis:0,adDecisionData:null!=i?{decision_id:i}:void 0}:null);x({...l,apiResponseTimestamp:Date.now(),wasSuccessful:n,adRequestId:i},t,s)}}}let F=new k;function B(e){var t,n;let i=e.creative_content;return{id:i.id,labelTitle:i.label_title,labelSubtitle:i.label_subtitle,heroImage:(0,_.dv)(i.hero_image),heroVideo:(0,_.Zf)(i.hero_video),sponsorImage:(0,_.Zf)(i.sponsor_image),cta:{url:(t=i.cta).url,buttonLabel:t.button_label,android:null!=t.android?{androidAppId:t.android.android_app_id}:void 0,ios:null!=t.ios?{iosAppId:t.ios.ios_app_id}:void 0},questIds:i.quest_ids,questHomeEntrypoint:null!=i.quest_home_entrypoint?{linearGradient:(n=i.quest_home_entrypoint).linear_gradient,radialGradient:n.radial_gradient,gradientPreset:n.gradient_preset,image:(0,_.Zf)(n.image),tooltipImage:(0,_.Zf)(n.tooltip_image),tooltipTitle:n.tooltip_title,tooltipSubtitle:n.tooltip_subtitle}:void 0,shelfImage:(0,_.Zf)(i.shelf_image),shelfVideo:(0,_.Zf)(i.shelf_video),features:i.features??[],startsAt:e.starts_at,endsAt:e.ends_at}}var V=n(859703),H=n(738822),j=n(405670),W=n(479442),Y=n(945810);let K="illustration3",$=(0,Y.mj)({name:"2026-08-bounties-mobile-quest-bar",kind:"user",defaultConfig:{enabled:!1,illustration:K,ctrVariant:0,hapticFeedbackOnRewardEarnedEnabled:!1},variations:{1:{enabled:!0,illustration:"illustration1",ctrVariant:0,hapticFeedbackOnRewardEarnedEnabled:!1},2:{enabled:!0,illustration:"illustration2",ctrVariant:0,hapticFeedbackOnRewardEarnedEnabled:!1},3:{enabled:!0,illustration:"illustration3",ctrVariant:0,hapticFeedbackOnRewardEarnedEnabled:!1},4:{enabled:!0,illustration:K,ctrVariant:2,hapticFeedbackOnRewardEarnedEnabled:!1},5:{enabled:!0,illustration:K,ctrVariant:3,hapticFeedbackOnRewardEarnedEnabled:!1},6:{enabled:!0,illustration:K,ctrVariant:1,hapticFeedbackOnRewardEarnedEnabled:!1},7:{enabled:!0,illustration:K,ctrVariant:0,hapticFeedbackOnRewardEarnedEnabled:!0}}}),z=(0,Y.mj)({name:"2026-01-less-personalized-ads",kind:"user",defaultConfig:{enabled:!1},variations:{0:{enabled:!1},1:{enabled:!0}}});var X=n(710969),q=n(319252),Z=n(190107),Q=n(105292);let J=new Set([H.uF.QUEST_BAR,H.uF.QUEST_BAR_V2,H.uF.QUEST_BAR_MOBILE]);async function ee(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{let n=(await l.Bo.post({url:P.Rsh.QUEST_ON_CONSOLE_START(e),query:t?{preview:t}:void 0,failImmediatelyWhenRateLimited:!0,rejectWithError:!1})).body;if(null!=n.quest_user_status)o.h.dispatch({type:"QUESTS_USER_STATUS_UPDATE",user_status:n.quest_user_status});else if(null!=n.error_hints_v2&&n.error_hints_v2.length>0)return{errorHints:n.error_hints_v2.slice(0,5)}}catch(n){let e=new d.A(n);if(429===e.status)return{errorHints:[{type:H.xv.RATE_LIMITED,message:Q.intl.string(Q.t.Whhv4w),connected_account_id:"",connected_account_type:""}]};let t=e.getAnyErrorMessage()??Q.intl.string(Q.t.xSCvBf);return{errorHints:[{type:H.xv.GENERIC,message:t,connected_account_id:"",connected_account_type:""}]}}return{errorHints:[]}}async function et(e){await l.Bo.post({url:P.Rsh.QUEST_ON_CONSOLE_STOP(e),rejectWithError:!1})}async function en(){await l.Bo.del({url:P.Rsh.QUESTS_RESET_RECENT_QUEST_COMPLETIONS,rejectWithError:!1})}async function ei(){if(V.A.isFetchingCurrentQuests)return;let e=[...V.A.quests.keys()];o.h.dispatch({type:"QUESTS_FETCH_CURRENT_QUESTS_BEGIN"});try{let t=await l.Bo.get({url:P.Rsh.QUESTS_CURRENT_QUESTS,rejectWithError:!1}),n=t.body.quests,i=n.filter(e=>(0,q.s2)(e)).map(e=>(0,q.rO)(e)),r=t.body.quest_enrollment_blocked_until,a=t.body.quest_access_suspended_until,s=i.filter(e=>e.userStatus?.claimedAt!=null||e.config.rewardsConfig.platforms.length>0),d=n.map(e=>e.id),c=i.map(e=>e.id),u=d.filter(e=>!c.includes(e)),_=s.map(e=>e.id),E=c.filter(e=>!_.includes(e)),A=e.filter(e=>!_.includes(e));y.A.addBreadcrumb({category:"quests.fetch",message:"fetchCurrentQuests completed",data:{rawCount:d.length,rawIds:d,validCount:_.length,validIds:_,prevQuestIds:e,droppedByConfigVersion:u,droppedByPlatformFilter:E,removedFromStore:A}});let h=t.body.excluded_quests.map(e=>(0,q._g)(e));o.h.dispatch({type:"QUESTS_FETCH_CURRENT_QUESTS_SUCCESS",quests:s,excludedQuests:h,questEnrollmentBlockedUntil:r,questAccessSuspendedUntil:a})}catch(e){o.h.dispatch({type:"QUESTS_FETCH_CURRENT_QUESTS_FAILURE",error:new d.A(e)})}}async function er(e){let{questId:t,streamKey:n,applicationId:i,terminal:a=!1,executablePath:s,executableFingerprint:l}=e;try{let e=await D.A.post({url:P.Rsh.QUESTS_HEARTBEAT(t),body:{stream_key:n,application_id:i,terminal:a,executable_path:s,executable_fingerprint:l},trackedActionData:{event:r.NetworkActionNames.QUEST_HEARTBEAT,properties:{quest_id:t,application_id:i,terminal:a,is_overlay:__OVERLAY__,stack_trace:Error().stack??"",is_playtime_eligible:!0}},rejectWithError:!1});o.h.dispatch({type:"QUESTS_SEND_HEARTBEAT_SUCCESS",userStatus:(0,q.tp)(e.body),questId:t,streamKey:n})}catch(e){o.h.dispatch({type:"QUESTS_SEND_HEARTBEAT_FAILURE",error:new d.A(e),questId:t,streamKey:n})}}var ea=((i={}).SUCCESS="success",i.UNKNOWN_ERROR="unknown_error",i.PREVIOUS_IN_FLIGHT_REQUEST="previous_in_flight_request",i);async function es(e,t){if(null!=t.questContentCTA){let n=t.questContentCTA;(0,E.r)({type:A.F.CLICK_INTERNAL,adCreativeType:a.p.QUEST,adCreativeId:e,questContentCTA:n,surfaceId:t.questContent,sourceQuestContent:t.sourceQuestContent,questContentPosition:t.questContentPosition,questContentRowIndex:t.questContentRowIndex})}if(e===Z.Fw&&(0,S.u)(),V.A.isEnrolling(e))return{type:"previous_in_flight_request"};o.h.dispatch({type:"QUESTS_ENROLL_BEGIN",questId:e});try{let n=(0,X.L4)(t.questContent),i=(0,X.Gp)(t.questContent,e),r=await l.Bo.post({url:P.Rsh.QUESTS_ENROLL(e),body:{location:t.questContent,...(0,X.Kc)(e,t.questContent),metadata_sealed:null!=n?n:null,traffic_metadata_sealed:null!=i?i:null},rejectWithError:!0});return o.h.dispatch({type:"QUESTS_ENROLL_SUCCESS",enrolledQuestUserStatus:(0,q.tp)(r.body)}),{type:"success"}}catch{return o.h.dispatch({type:"QUESTS_ENROLL_FAILURE",questId:e}),{type:"unknown_error"}}}let el=new Map;function eo(e,t,n){let i=el.get(e);if(null!=i)return i;let r=ed(e,t,n);return el.set(e,r),r}async function ed(e,t,n){try{return await ec(e,t,n)}finally{el.delete(e)}}async function ec(e,t,n){o.h.dispatch({type:"QUESTS_CLAIM_REWARD_BEGIN",questId:e});try{let i=(0,X.L4)(n),r=(0,X.Gp)(n,e),a=await l.Bo.post({url:P.Rsh.QUESTS_CLAIM_REWARD(e),body:{platform:t,location:n,...(0,X.Kc)(e,n),metadata_sealed:null!=i?i:null,traffic_metadata_sealed:null!=r?r:null},rejectWithError:!1}),s=(0,q.Dv)(a.body);return 0===s.errors.length?o.h.dispatch({type:"QUESTS_CLAIM_REWARD_SUCCESS",questId:e,entitlements:s}):o.h.dispatch({type:"QUESTS_CLAIM_REWARD_FAILURE",error:s.errors,questId:e}),s}catch(t){throw o.h.dispatch({type:"QUESTS_CLAIM_REWARD_FAILURE",error:new d.A(t),questId:e}),t}}async function eu(e){if(!V.A.isFetchingRewardCode(e)){o.h.dispatch({type:"QUESTS_FETCH_REWARD_CODE_BEGIN",questId:e});try{let t=await l.Bo.get({url:P.Rsh.QUESTS_REWARD_CODE(e),rejectWithError:!1});o.h.dispatch({type:"QUESTS_FETCH_REWARD_CODE_SUCCESS",questId:e,rewardCode:(0,q.Rd)(t.body)})}catch(t){throw o.h.dispatch({type:"QUESTS_FETCH_REWARD_CODE_FAILURE",error:new d.A(t),questId:e}),t}}}async function e_(e,t){let n=V.A.isDismissingContent(e),i=(0,X.vy)(t);if(!n&&i){o.h.dispatch({type:"QUESTS_DISMISS_CONTENT_BEGIN",questId:e,content:t});try{let n=(0,X.Gp)(t,e),i=await l.Bo.post({url:P.Rsh.QUESTS_DISMISS_CONTENT(e,t),body:{...(0,X.Kc)(e,t),traffic_metadata_sealed:null!=n?n:null},rejectWithError:!1});o.h.dispatch({type:"QUESTS_DISMISS_CONTENT_SUCCESS",dismissedQuestUserStatus:(0,q.tp)(i.body)}),J.has(t)&&(0,m.hs)(s.w.QUEST_DISMISSED,{quest_id:e})}catch(t){o.h.dispatch({type:"QUESTS_DISMISS_CONTENT_FAILURE",error:new d.A(t),questId:e})}}}function eE(e){o.h.dispatch({type:"QUESTS_DISMISS_PROGRESS_TRACKING_FAILURE_NOTICE",streamKey:e})}async function eA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;try{let n=await l.Bo.post({url:P.Rsh.QUESTS_PREVIEW_COMPLETE(e),body:{percent:t},rejectWithError:!1});o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_SUCCESS",previewQuestUserStatus:(0,q.tp)(n.body)})}catch(t){o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_FAILURE",error:new d.A(t),questId:e})}}async function eh(e){try{let t=await l.Bo.del({url:P.Rsh.QUESTS_PREVIEW_STATUS(e),body:{},rejectWithError:!1});o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_SUCCESS",previewQuestUserStatus:(0,q.tp)(t.body)})}catch(t){o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_FAILURE",error:new d.A(t),questId:e})}}async function ef(e){try{o.h.dispatch({type:"QUESTS_DOCK_RESET_SOFT_DISMISSAL"});let t=await l.Bo.del({url:P.Rsh.QUESTS_PREVIEW_DISMISSIBILITY(e),body:{},rejectWithError:!1});o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_SUCCESS",previewQuestUserStatus:(0,q.tp)(t.body)})}catch(t){o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_FAILURE",error:new d.A(t),questId:e})}}function eI(e,t){o.h.dispatch({type:"QUESTS_PREVIEW_OVERRIDE",placement:e,questId:t})}function ep(e,t){o.h.dispatch({type:"QUESTS_SELECT_TASK_PLATFORM",questId:e,platform:t})}async function eT(){if(!V.A.isFetchingClaimedQuests){o.h.dispatch({type:"QUESTS_FETCH_CLAIMED_QUESTS_BEGIN"});try{let e=(await l.Bo.get({url:P.Rsh.QUESTS_CLAIMED_QUESTS,rejectWithError:!1})).body.quests.map(e=>(0,q.S)(e));o.h.dispatch({type:"QUESTS_FETCH_CLAIMED_QUESTS_SUCCESS",quests:e})}catch(e){o.h.dispatch({type:"QUESTS_FETCH_CLAIMED_QUESTS_FAILURE",error:new d.A(e)})}}}function em(e,t,n){o.h.dispatch({type:"QUESTS_UPDATE_OPTIMISTIC_PROGRESS",questId:e,taskEventName:t,progress:n})}function eg(e){o.h.dispatch({type:"QUESTS_RESET_OPTIMISTIC_PROGRESS",questId:e})}async function eS(e,t){let n=Date.now(),i=F.recordQuestRequestAttempt("/quests/decision",t,e);o.h.dispatch({type:"QUESTS_FETCH_QUEST_TO_DELIVER_BEGIN",placement:e});try{let d,c=await (0,I.Ht)(),E=await (0,f.sN)(),A=z.getConfig({location:"QuestActionCreators.fetchQuestToDeliver"}),m=(0,T.pc)(),S=null!=m?m():[],L=O.Ay.getGuildsTree(),y=S.filter(e=>{if((0,g.tZ)(e))return!1;let t=L.getNode(e);return t?.parentId==null||N.A.isFolderExpanded(t.parentId)}).slice(0,50),D=A.enabled?y:void 0,v=new URLSearchParams({placement:String(e)});c?.uuid!=null&&v.append("client_heartbeat_session_id",c.uuid),null!=E.uuid&&v.append("client_ad_session_id",E.uuid),null!=D&&D.forEach(e=>v.append("visible_guild_ids",e));let b=(await l.Bo.get({url:`${P.Rsh.QUEST_FETCH_QUEST_TO_DELIVER}?${v.toString()}`,rejectWithError:!1,context:{connection_type:C.A.getType()}})).body,M=!1;e===H.p9.MOBILE_HOME_DOCK_AREA?M=$.getConfig({location:"QuestActionCreators.fetchQuestToDeliver"}).enabled:e===H.p9.DESKTOP_ACCOUNT_PANEL_AREA&&(M=W.w.getConfig({location:"QuestActionCreators.fetchQuestToDeliver"}).enabled);let U=b.creative?.creative_type!==a.p.BOUNTY||M?b.creative:null,w=null,x=null;if(null!=U)switch(U.creative_type){case a.p.QUEST:d=(0,q.Yn)(U.creative_content),w={type:a.p.QUEST,questId:d.id};break;case a.p.BOUNTY:let k=(0,u.t)(U.creative_content);w={type:a.p.BOUNTY,bounty:k};break;case a.p.PLAYABLE:var r,s;let B={id:(r=U.creative_content).id,applicationId:r.application_id,advertiserName:r.advertiser_name,productName:r.product_name,productIcon:(0,_.dv)(r.product_icon),videoPreview:(0,_.Zf)(r.video_preview),imagePreview:(0,_.Zf)(r.image_preview),cta:{url:(s=r.cta).url,buttonLabel:s.button_label,android:null!=s.android?{androidAppId:s.android.android_app_id}:void 0,ios:null!=s.ios?{iosAppId:s.ios.ios_app_id}:void 0},rewardTimerSeconds:r.reward_timer_seconds};w={type:a.p.PLAYABLE,playable:B};break;case a.p.NO_FILL:x=U.creative_content?.ad_content_id??null}else{let e=b.quest;null!=e&&(d=(0,q.Yn)(e),w={type:a.p.QUEST,questId:d.id})}o.h.dispatch({type:"QUESTS_FETCH_QUEST_TO_DELIVER_SUCCESS",quest:d,creative:w,isNoFill:U?.creative_type===a.p.NO_FILL,noFillAdContentId:x,adDecisionData:{ad_id:b.ad_identifiers?.ad_id,adset_id:b.ad_identifiers?.adset_id,ad_set_id:b.ad_identifiers?.ad_set_id,campaign_id:b.ad_identifiers?.campaign_id,creative_id:b.ad_identifiers?.creative_id,creative_type:b.ad_identifiers?.creative_type,decision_id:b.request_id,is_targeted:null!=b.ad_identifiers},metadataSealed:b.metadata_sealed,trafficMetadataSealed:b.traffic_metadata_sealed,provenanceMetadataSealed:b.provenance_metadata_sealed,adContext:b.ad_context,responseTtlSeconds:b.response_ttl_seconds,placement:e,fetchedAt:n}),F.recordQuestRequestApiResponse(i,{wasSuccessful:!0,adRequestId:String(b.request_id),currentCreative:w,currentFetchedAt:n});let V=(0,h.K2)(w);if(null==w||null==V)return;e===H.p9.DESKTOP_ACCOUNT_PANEL_AREA&&G.A.startTracking(V,w.type),R.default.track(P.HAw.QUEST_DECISION_RECEIVED,{...(0,p.A)(),quest_id:w.type===a.p.QUEST?V:null,ad_content_id:V,creative_type:w.type,caller_source:t,ad_request_id:String(b.request_id)})}catch(r){F.recordQuestRequestApiResponse(i,{wasSuccessful:!1,currentFetchedAt:n}),R.default.track(P.HAw.QUEST_DECISION_ROUNDTRIP_ERROR,{...(0,p.A)(),reason:r?.message??null,api_error:new d.A(r).getAnyErrorMessage(),caller_source:t}),o.h.dispatch({type:"QUESTS_FETCH_QUEST_TO_DELIVER_FAILURE",error:new d.A(r),placement:e})}}function eN(e,t){o.h.dispatch({type:"QUESTS_CLEAR_EXPIRED_QUEST_TO_DELIVER",placement:e,fetchedAt:Date.now(),responseTtlSeconds:t/1e3})}async function eC(e,t,n){if(V.A.isFetchingEarnedQuestToDeliverByPlacement(t))return;let i=V.A.earnedQuestForPlacement.get(t)?.earnedDecisionByQuestId,r=e.filter(e=>{let t=i?.get(e);return!(0,X.Oh)(t)});if(0===r.length)return;let a=Date.now(),s=w.recordEarnedRequestAttempt(n);o.h.dispatch({type:"QUESTS_FETCH_EARNED_QUEST_TO_DELIVER_BEGIN",content:t});try{let e=await (0,I.Ht)(),n=r.join(","),i=await l.Bo.get({url:P.Rsh.QUEST_EARNED_DECISION(n,t,e?.uuid),rejectWithError:!1}),d=i.body.quests,c=i.body.response_ttl_seconds,u=new Map(r.map(e=>{let t=d?.[e];return[e,null!=t&&(0,q.s2)(t)?t:null]}));o.h.dispatch({type:"QUESTS_FETCH_EARNED_QUEST_TO_DELIVER_SUCCESS",serverQuests:u,content:t,fetchedAt:a,responseTtlSeconds:c}),w.recordEarnedRequestApiResponse(s,{wasSuccessful:!0,requestId:i.body.request_id??null,fetchedAt:a})}catch(e){w.recordEarnedRequestApiResponse(s,{wasSuccessful:!1,fetchedAt:a}),o.h.dispatch({type:"QUESTS_FETCH_EARNED_QUEST_TO_DELIVER_FAILURE",error:new d.A(e),content:t})}}async function eO(e,t){await D.A.post({url:P.Rsh.QUESTS_VIDEO_PROGRESS(e),body:{timestamp:t},trackedActionData:{event:r.NetworkActionNames.QUEST_VIDEO_PROGRESS,properties:{quest_id:e,timestamp_sec:t.toString(),stack_trace:Error().stack??""}},rejectWithError:!1})}async function eR(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,_.tW)(e,_.fY.VIDEO_PLAYER_TRANSCRIPT,void 0,t);if(null==n)return void j.Ay.getState().setTranscriptAsset({questId:e.id,fetchStatus:j.Lx.FAILURE});j.Ay.getState().setTranscriptAsset({questId:e.id,fetchStatus:j.Lx.FETCHING});try{let t=await l.Bo.get({url:n.url,rejectWithError:!0});j.Ay.getState().setTranscriptAsset({questId:e.id,fetchStatus:j.Lx.SUCCESS,text:t.text,url:n.url})}catch(t){j.Ay.getState().setTranscriptAsset({questId:e.id,fetchStatus:j.Lx.FAILURE})}}async function eL(e){let t=await l.Bo.get({url:P.Rsh.QUEST(e),rejectWithError:!1});return(0,q.Yn)(t.body)}async function ey(e){if(!V.A.isFetchingQuestPreview(e)){o.h.dispatch({type:"QUESTS_FETCH_PREVIEW_BEGIN",questId:e});try{let t=await l.Bo.get({url:P.Rsh.QUEST_PREVIEW(e),rejectWithError:!1});o.h.dispatch({type:"QUESTS_FETCH_PREVIEW_SUCCESS",questId:e,quest:(0,q.rO)(t.body)})}catch(t){throw o.h.dispatch({type:"QUESTS_FETCH_PREVIEW_FAILURE",error:new d.A(t),questId:e}),t}}}let eD=5*L.A.Millis.MINUTE;async function ev(){let e=H.p9.QUEST_HOME_BANNER_DESKTOP;if(c.A.isFetchingAdToDeliverByPlacement(e)||!c.A.canRefreshAd(e))return;let t=c.A.getLastFetchedQuestHomeHero();if(null!=t&&Date.now()-t<=eD)return;let n=Date.now();o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_BEGIN",placement:e});try{let t=await (0,I.Ht)(),i=await (0,f.sN)(),r=new URLSearchParams({placement:String(e),num_decisions_requested:"1"});t?.uuid!=null&&r.append("client_heartbeat_session_id",t.uuid),null!=i.uuid&&r.append("client_ad_session_id",i.uuid);let s=(await l.Bo.get({url:`${P.Rsh.QUESTS_GET_DECISIONS}?${r.toString()}`,rejectWithError:!1,context:{connection_type:C.A.getType()}})).body,d=s.decisions?.[0]??null,c=d?.creative??null,u=null;null!=c&&c.creative_type===a.p.QUEST_HOME_HERO&&(u=B(c)),o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_SUCCESS",questHomeHero:u,adDecisionData:{ad_id:d?.ad_identifiers?.ad_id,ad_set_id:d?.ad_identifiers?.ad_set_id,campaign_id:d?.ad_identifiers?.campaign_id,creative_id:d?.ad_identifiers?.creative_id,creative_type:d?.ad_identifiers?.creative_type,decision_id:s.request_id,is_targeted:d?.ad_identifiers!=null},metadataSealed:d?.metadata_sealed,trafficMetadataSealed:d?.traffic_metadata_sealed,provenanceMetadataSealed:d?.provenance_metadata_sealed,adContext:d?.ad_context,responseTtlSeconds:d?.response_ttl_seconds,placement:e,fetchedAt:n})}catch(t){throw o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_FAILURE",error:new d.A(t),placement:e}),t}}async function eb(e){let t=H.p9.QUEST_HOME_BANNER_DESKTOP,n=Date.now();o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_BEGIN",placement:t});try{let i=new URLSearchParams([["ad_creative_ids",e],["placement",String(t)]]),r=(await l.Bo.get({url:`${P.Rsh.QUESTS_CREATIVE_PREVIEW}?${i.toString()}`,rejectWithError:!1})).body,s=r.decisions?.[0]??null,d=s?.creative??null,c=null;null!=d&&d.creative_type===a.p.QUEST_HOME_HERO&&(c=B(d)),o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_SUCCESS",questHomeHero:c,adDecisionData:{ad_id:s?.ad_identifiers?.ad_id,ad_set_id:s?.ad_identifiers?.ad_set_id,campaign_id:s?.ad_identifiers?.campaign_id,creative_id:s?.ad_identifiers?.creative_id,creative_type:s?.ad_identifiers?.creative_type,decision_id:r.request_id,is_targeted:s?.ad_identifiers!=null},metadataSealed:s?.metadata_sealed,trafficMetadataSealed:s?.traffic_metadata_sealed,provenanceMetadataSealed:s?.provenance_metadata_sealed,adContext:s?.ad_context,responseTtlSeconds:s?.response_ttl_seconds,placement:t,fetchedAt:n})}catch(e){throw o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_FAILURE",error:new d.A(e),placement:t}),e}}function eP(e){o.h.dispatch({type:"UNENROLLED_ACTIVITY_QUEST_DISMISS",questId:e})}function eM(e,t){o.h.dispatch({type:"AD_CONTENT_MARK_SEEN",adCreativeType:e,contentIds:t})}function eU(e,t){o.h.dispatch({type:"AD_CONTENT_MARK_UNSEEN",adCreativeType:e,contentIds:t})}function ew(e){o.h.dispatch({type:"QUESTS_MARK_DISCOVERED",questId:e})}}