Build 589089stable
Module 527549
10,867 characters · in 54efd558003f071c.jsDependencies
Lazily required by (0)none
Requires (62)
37381792818437240017347379545104886112142134528144779157559190107270045274670287809290863291749297264311243313961323889331322352774363195365199375708409626442444461782462887477900503698514547582128590202590524617986630037639214646764651892652215657113661531661644710969792620806931814793821609834730834757838834847641851936859703885574939249945810947204952818971649
Lazily requires (0)none
Source Raw
function(e,t,s){s.d(t,{A:()=>eS});var n=s(477900),l=s(582128),i=s(503698),u=s.n(i),r=s(323889),a=s(17928),o=s(462887),E=s(297264),c=s(939249),d=s(365199),A=s(834730),S=s(331322),T=s(821609),_=s(661531),C=s(157559),m=s(274670),x=s(144779),Q=s(313961),h=s(952818),R=s(409626),L=s(834757),I=s(363195),f=s(461782),g=s(290863),v=s(287809),N=s(352774),U=s(859703),j=s(24001),M=s(104886);let p=(0,s(945810).mj)({name:"2026-06-livestream-entrypoint-v2",kind:"user",defaultConfig:{enabled:!1,redirectToQuestHome:!1},variations:{0:{enabled:!1,redirectToQuestHome:!1},1:{enabled:!0,redirectToQuestHome:!0}}});var b=s(112142),F=s(3738),q=s(514547),y=s(291749),V=s(18437),D=s(590202),O=s(971649),P=s(851936),k=s(651892),w=s(710969),G=s(639214),H=s(792620),W=s(814793),z=s(442444),K=s(73473),$=s(270045),B=s(657113),Y=s(79545);s(134528),s(947204);var X=s(885574),J=s(661644);let Z=l.forwardRef(function(e,t){let{isInventory:s,style:l,children:i}=e;return(0,n.jsxs)("div",{ref:t,className:J.Q,style:{marginTop:8*!!s,...l},children:[(0,n.jsx)(X.m,{size:"custom",className:J.G,height:s?16:12,width:s?16:12,color:s?_.A.colors.TEXT_MUTED.css:_.A.colors.WHITE.css}),(0,n.jsx)(A.E,{color:s?"text-muted":"text-overlay-light",variant:s?"text-xs/normal":"text-xxs/normal",children:i})]})});var ee=s(590524);let et=function(e){let{className:t,color:s=_.A.colors.WHITE,quest:l,isInventory:i}=e,r=(0,q.aC)(e.quest),{percentComplete:a,completedRatioDisplay:o}=(0,q.O9)(l);return!i&&r.length>0?(0,n.jsx)(Z,{children:r.at(0)}):(0,n.jsxs)("div",{className:u()(ee.iE,t),style:{color:s.css},children:[(0,n.jsxs)("div",{className:ee.O,children:[(0,n.jsx)(A.E,{variant:"text-xs/semibold",className:ee.Df,color:"none",children:o}),(0,n.jsx)("div",{className:ee.Cj,style:{width:`${100-a}%`}})]}),(0,n.jsx)("div",{className:ee.hr,role:"progressbar","aria-valuenow":a,children:(0,n.jsx)("div",{className:ee.SX,style:{width:`${a}%`}})}),r.length>0&&(0,n.jsx)(Z,{isInventory:i,children:r.at(0)})]})};var es=s(847641),en=s(646764),el=s(311243),ei=s(617986),eu=s(630037),er=s(190107),ea=s(652215),eo=s(806931),eE=s(375708),ec=s(838834);function ed(e){var t;let{channelId:s,quest:i,previewQuest:f,isParticipatingOverride:K}=e,X=(0,V.Ut)(),J=(0,O.go)(),[Z,ee]=l.useState(!1),ed=l.useCallback(()=>ee(!0),[]),eA=l.useCallback(()=>ee(!1),[]),eS=(0,a.bG)([v.default],()=>v.default.getCurrentUser()),eT=(0,a.bG)([I.A],()=>I.A.getState().theme),e_=(0,o.M)(eT)?ea.NJ8.DARK:ea.NJ8.LIGHT,eC=(0,a.bG)([Q.A],()=>Q.A.getParticipants(e.channelId),[e.channelId]),em=(0,a.bG)([U.A],()=>(0,w.t6)(U.A.quests,U.A.questToDeliverForPlacement,j.p9.DESKTOP_ACCOUNT_PANEL_AREA),[]),{isCurrentUserStreamingQuestApplication:ex,isQuestInQuestBar:eQ}=(0,a.cf)([g.A],()=>{var e;return{isCurrentUserStreamingQuestApplication:null!=i&&null!=eS&&(e=g.A,eC.some(t=>{if(t.type!==eo.lp.STREAM||t.user.id!==eS.id)return!1;let s=(0,L.nr)(t.stream,e);return null!=s&&(0,G.zS)(s,i)})),isQuestInQuestBar:em?.id===i?.id}},[eS,i,eC,em]),eh=(0,H.pU)(i)?.[0],eR=(0,a.bG)([h.Ay,g.A],()=>{let e=h.Ay.getRunningGames().map(e=>e.id);if((0,H.xZ)(i)&&null!==eh&&e.includes(eh))return!0;let t=null!=eS?g.A.findActivity(eS.id,e=>e.type!==ea.$pd.CUSTOM_STATUS):null;return!!(null!=t&&(0,H.g5)(i)&&(0,G.zS)(t,i))},[i,eS,eh]),eL=!0===K||ex||eR,eI=(0,a.bG)([U.A],()=>null!=i&&U.A.isEnrolling(i.id),[i]),ef=(0,a.bG)([Q.A],()=>(eS?.id==null?null:Q.A.getParticipant(s,eS.id))!=null,[s,eS]),{launchInGameActivity:eg}=(0,q.zW)(i),ev=(0,q.S5)(i?.config.expiresAt),eN=(0,q.S5)(i?.config.rewardsConfig.rewardsExpireAt),eU=(t=er.rE.QUEST_CHANNEL_CALL_HEADER,p.useConfig({location:t})),[ej,eM]=l.useState(!1),ep=l.useCallback(async()=>{let{type:e}=await (0,N.Oy)(i.id,{questContent:j.uF.QUEST_LIVE_STREAM,questContentCTA:D.Cy.ACCEPT_QUEST,sourceQuestContent:j.uF.QUEST_LIVE_STREAM});switch(e){case N.WM.SUCCESS:(0,W.vA)(i)&&eg();break;case N.WM.CAPTCHA_FAILED:C.A.show({title:eE.intl.string(eE.t["/CidxO"]),body:eE.intl.string(eE.t.HQdHg6)});break;case N.WM.UNKNOWN_ERROR:C.A.show({title:eE.intl.string(eE.t.R0RpRX),body:eE.intl.string(eE.t.OXD41D)})}},[i,eg]),eb=l.useCallback(async()=>{eM(!0);let{type:e}=await (0,N.Oy)(i.id,{questContent:j.uF.QUEST_LIVE_STREAM,questContentCTA:D.Cy.ACCEPT_QUEST,sourceQuestContent:j.uF.QUEST_LIVE_STREAM});switch(e){case N.WM.SUCCESS:(0,ei.mA)({fromContent:j.uF.QUEST_LIVE_STREAM,questId:i.id});break;case N.WM.PREVIOUS_IN_FLIGHT_REQUEST:break;case N.WM.CAPTCHA_FAILED:eM(!1),C.A.show({title:eE.intl.string(eE.t["/CidxO"]),body:eE.intl.string(eE.t.HQdHg6)});break;case N.WM.UNKNOWN_ERROR:eM(!1),C.A.show({title:eE.intl.string(eE.t.R0RpRX),body:eE.intl.string(eE.t.OXD41D)})}},[i]),eF=l.useCallback(()=>{(0,M.E5)(M.kI.STEP_2_CLICKED_INTERNAL,"quest_channel_call_header")?(0,m.r)({type:x.F.CLICK_INTERNAL,adCreativeType:r.p.QUEST,adCreativeId:i.id,questContentCTA:D.Cy.TRACK_PROGRESS,surfaceId:j.uF.QUEST_LIVE_STREAM,sourceQuestContent:j.uF.QUEST_LIVE_STREAM,impressionId:J}):X({questId:i.id,questContent:j.uF.QUEST_LIVE_STREAM,questContentCTA:D.Cy.TRACK_PROGRESS,sourceQuestContent:j.uF.QUEST_LIVE_STREAM}),(0,ei.mA)({fromContent:j.uF.QUEST_LIVE_STREAM,questId:i.id})},[i,X,J]),eq=l.useCallback(()=>{(0,M.E5)(M.kI.STEP_2_CLICKED_INTERNAL,"quest_channel_call_header")?(0,m.r)({type:x.F.CLICK_INTERNAL,adCreativeType:r.p.QUEST,adCreativeId:i.id,questContentCTA:D.Cy.LEARN_MORE,surfaceId:j.uF.QUEST_LIVE_STREAM,sourceQuestContent:j.uF.QUEST_LIVE_STREAM,impressionId:J}):X({questId:i.id,questContent:j.uF.QUEST_LIVE_STREAM,questContentCTA:D.Cy.LEARN_MORE,sourceQuestContent:j.uF.QUEST_LIVE_STREAM}),(0,ei.mA)({fromContent:j.uF.QUEST_LIVE_STREAM,questId:i.id})},[i,X,J]),ey=(0,eu.D)({quest:i,questContent:j.uF.QUEST_LIVE_STREAM,sourceQuestContent:j.uF.QUEST_LIVE_STREAM}),eV=l.useMemo(()=>(0,P.L)({quest:i,location:er.rE.QUEST_CHANNEL_CALL_HEADER}),[i]),eD=(0,F.NA)({quest:i}),eO=(0,W.vA)(i),eP=(0,q.LS)(i),ek=i.userStatus?.enrolledAt!=null,ew=i.userStatus?.completedAt!=null,eG=null!=f&&i.userStatus?.claimedAt==null,eH=ej&&(ek||eG);l.useEffect(()=>{eM(!1)},[i.id]);let eW=null!=i.userStatus&&(0,w.gO)(i.userStatus,j.uF.QUEST_LIVE_STREAM),ez=null!=i.userStatus&&(0,w.gO)(i.userStatus,j.uF.QUEST_BAR),eK=eQ&&!ez,e$=b.t.useConfig({location:er.rE.QUEST_CHANNEL_CALL_HEADER}),eB=(0,Y.Pd)(i);if(eV.info({isQuestCallHeaderDismissed:eW,isQuestExpired:eP,isQuestBarShowing:eK,isCurrentUserCallParticipant:ef}),!eG&&!eU.enabled&&(eW||eP||eK)||!eG&&eU.enabled&&(eW||eP)||!eG&&!ef)return null;if(eU.enabled)return!eG&&(eH||ek)?null:(0,n.jsx)("div",{className:ec.W2,onFocus:ed,onMouseEnter:ed,onBlur:eA,onMouseLeave:eA,children:(0,n.jsx)(z.A,{quest:i,isFocused:Z,onAcceptQuest:eb,isEnrolling:eI})});let eY=(0,H.Yh)(i),eX=(0,n.jsx)(en.A,{className:ec.Qq,autoplay:Z,quest:i,questContent:j.uF.QUEST_LIVE_STREAM,sourceQuestContent:j.uF.QUEST_LIVE_STREAM});return(0,n.jsxs)("div",{className:u()(ec.iE,{[ec.rH]:ek}),onFocus:ed,onMouseEnter:ed,onBlur:eA,onMouseLeave:eA,children:[!ek&&(0,n.jsxs)("div",{className:ec.D9,children:[(0,n.jsx)(es.A,{bgOpacity:.32,className:ec.Pu}),eX]}),(0,n.jsxs)("div",{className:ec.Qs,children:[(0,n.jsxs)("div",{className:ec.R_,children:[ek&&eL?eX:(0,n.jsx)("img",{className:ec.rC,alt:i.config.messages.gameTitle,src:(0,y.tW)(i,y.fY.GAME_TILE,e_).url}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:ec.Mg,children:[(0,n.jsx)(E.D,{className:ec.bB,variant:"heading-md/semibold",color:"text-strong",children:eL?(0,k.YT)({quest:i,taskDetails:eY}):eE.intl.formatToPlainString(eE.t.EQa7os,{questName:i.config.messages.questName})}),(0,n.jsx)($.C,{questContent:j.uF.QUEST_LIVE_STREAM,sourceQuestContent:j.uF.QUEST_LIVE_STREAM,quest:i,preventIdle:!0,shouldShowDisclosure:i.userStatus?.enrolledAt==null,children:e=>(0,n.jsx)(c.D,{...e,className:ec.rb,"aria-label":eE.intl.string(eE.t.DEoVWZ),children:(0,n.jsx)(d.j,{size:"md",color:"currentColor",className:ec.Bx})})})]}),(0,n.jsx)(A.E,{color:"text-default",variant:"text-xs/medium",children:ew?eE.intl.formatToPlainString(eE.t.APddvF,{expirationDate:eN}):eE.intl.formatToPlainString(eE.t["pX+fmn"],{expirationDate:ev})})]})]}),ek&&!ew&&!eL&&(0,n.jsx)(el.A,{autoplay:Z,quest:i,questContent:j.uF.QUEST_LIVE_STREAM,taskDetails:eY,location:er.rE.QUEST_CHANNEL_CALL_HEADER,sourceQuestContent:j.uF.QUEST_LIVE_STREAM,gameProfileSource:R.GameProfileSources.QuestLiveStream}),(0,n.jsxs)("div",{className:ec.uz,children:[!ek&&(0,n.jsxs)(S.B,{direction:"horizontal",children:[(0,n.jsx)(T.$,{size:"sm",variant:"secondary",text:eE.intl.string(eE.t.LLLLPD),onClick:eq,fullWidth:!eO||i.config.features.includes(er.Li.CLOUD_GAMING_ACTIVITY)}),e$.enabled&&eB===Y.UA.UNENROLLED&&e$.enabledQuestStates.has(Y.UA.UNENROLLED)&&!eP?(0,n.jsx)(B.A,{quest:i,surface:Y.V3.VOICE_CALL_HEADER,size:"sm",analyticsCtxQuestContent:j.uF.QUEST_LIVE_STREAM,analyticsCtxSourceQuestContent:j.uF.QUEST_LIVE_STREAM}):(0,n.jsx)(T.$,{size:"sm",variant:"primary",fullWidth:!0,text:eD,onClick:ep,loading:eI})]}),ek&&!ew&&eL&&(0,n.jsx)(et,{color:_.A.colors.BACKGROUND_BRAND,quest:i}),ek&&!ew&&!eL&&(0,n.jsx)(T.$,{variant:"primary",size:"sm",fullWidth:!0,text:eE.intl.string(eE.t.VN1Ajl),onClick:eF}),ew&&(0,n.jsx)(T.$,{variant:"primary",size:"sm",fullWidth:!0,text:eE.intl.string(eE.t.cfY4PE),onClick:ey})]})]})]})}function eA(e){let t=l.useContext(f.vG),s=(0,a.bG)([U.A],()=>null!=U.A.questEnrollmentBlockedUntil,[]),i=(0,a.bG)([U.A],()=>U.A.quests),u=(0,q.oH)(Array.from(i.values())),r=l.useMemo(()=>(0,W.$e)(i,er.Ls),[i]),o=(0,a.bG)([Q.A],()=>Q.A.getParticipants(e.channelId),[e.channelId]),E=(0,a.bG)([g.A],()=>null!=e.previewQuest?e.previewQuest:function(e,t,s){for(let n of e){if(n.type===eo.lp.STREAM){let e=(0,L.nr)(n.stream,s)??null,l=(0,G.nq)(t,e);if(null!=l&&l.userStatus?.claimedAt==null)return l}for(let n of e)if(!(0,eo.PJ)(n))for(let e of s.getActivities(n.user.id)){let s=(0,G.nq)(t,e);if(null!=s&&s.userStatus?.claimedAt==null)return s}}return null}(o,r,g.A),[o,r,u,e.previewQuest]),c=E?.id??null;l.useEffect(()=>{null==e.previewQuest&&null!=c&&(0,N.yO)([c],j.uF.QUEST_LIVE_STREAM,"QuestChannelCallHeader")},[c,e.previewQuest]);let d=(0,a.bG)([U.A],()=>{let e=U.A.earnedQuestForPlacement.get(j.uF.QUEST_LIVE_STREAM);if(null==e||null==c)return null;let t=e.earnedDecisionByQuestId.get(c);return(0,w.Oh)(t)&&t.shouldDeliver?U.A.getQuest(c):null},[c]),[A,S]=l.useState(null);l.useEffect(()=>{null!=d?S(d):null===c&&S(null)},[d,c]);let T=d??(null!==c?A:null),_=e.previewQuest??T;return null==_||s?null:(0,n.jsx)(K.R,{questOrQuests:_,overrideVisibility:!t,questContent:j.uF.QUEST_LIVE_STREAM,sourceQuestContent:j.uF.QUEST_LIVE_STREAM,children:()=>(0,n.jsx)(ed,{...e,quest:_})})}let eS=function(e){let t=(0,a.bG)([v.default],()=>v.default.getCurrentUser()),s=(0,a.bG)([Q.A],()=>(t?.id==null?null:Q.A.getParticipant(e.channelId,t.id))!=null,[e.channelId,t]),l=(0,a.bG)([U.A],()=>U.A.getQuestPreviewOverride(j.uF.QUEST_LIVE_STREAM),[]),i=e.previewQuest??l;return s||null!=i?(0,n.jsx)(eA,{...e,previewQuest:i}):null}}