9 lines
78 KiB
Plaintext
9 lines
78 KiB
Plaintext
"use strict";(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["74352"],{604467:function(e,l,t){t.r(l),t.d(l,{default:function(){return iS}});var i=t("629686"),o=t("402748"),n=t("811603");t("490629"),t("706056");var a=t("320165"),r=t("101199"),d=t("890710"),s=t("469935"),u=t.n(s),c=t("206698"),v=t("295207"),m=t("813458"),f=t("649310"),p=t("335948"),g=t("499059"),h=t("414061"),_=t("889429"),w=t("509523"),y=t("573031"),I=t("621123"),x=t("489113"),C=t("705171"),P=t("448797");let S=e=>{let{originAwemeInfo:l}=e,[t,i]=(0,r.useState)(""),o=(0,P.W)(e=>e.isSideBarShow),n=(0,P.W)(e=>e.setIsSideBarShow),[a,d]=(0,r.useState)(l);return{slideVideoTab:t,setSlideVideoTab:i,modalAwemeInfo:a,setModalAwemeInfo:d,globalIsSideBarShow:o,setIsSideBarShowFunc:n}};var b=t("908219"),k=t.n(b),L=t("939165"),E=t("687875"),j=t("880327"),T=t("585215"),A=t("205030"),M=t("365169");let N=e=>{let{abtestData:l,closeModal:t,container:i,isClientMiniWin:o=!1,modalEnterFrom:n}=e,{pipWindow:a}=(0,M.Iq)(e=>{let{pipWindow:l}=e;return{pipWindow:l}}),d=(0,r.useRef)(null),s=(0,r.useRef)([]),u=(0,r.useRef)(null),c=(0,r.useRef)(null),v=(0,r.useRef)(0);v.current=(0,_.vU)()?120:0;let m=(0,r.useCallback)((e,l)=>{let t=0,i=e.slice(Math.max(e.length-l,1));for(let e=0;e<i.length;e++)t+=i[e];return Math.ceil(t/l)},[]),f=(0,r.useCallback)(e=>{var l;null==e||null===(l=e.preventDefault)||void 0===l||l.call(e),null==e||e.stopPropagation(),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{s.current=[]},400);let t=new Date().getTime(),i=e.wheelDelta||-e.deltaY||-e.detail,o=Math.max(-1,Math.min(1,i)),a=void 0!==e.wheelDeltaX||void 0!==e.deltaX,r=Math.abs(e.wheelDeltaX)<Math.abs(e.wheelDelta)||Math.abs(e.deltaX)<Math.abs(e.deltaY)||!a;s.current=[...s.current,v.current+Math.abs(i)];let f=t-u.current;u.current=t,f>400&&1===s.current.length&&(s.current=[,,].fill(s.current[0]),c.current=!1);let p=m(s.current,20),_=p>m(s.current,40);_&&!c.current&&r&&((0,g.Vv)(A.CJ.scroll),o<0?(h.emit("changeNext",{from:"scroll",triggerFrom:n}),h.emit(h.EVENT.reportPlayNext,{clickFrom:"scroll"})):(h.emit("changePrev",{from:"scroll",triggerFrom:n}),h.emit(h.EVENT.reportPlayPrev,{clickFrom:"scroll"})),c.current=!0),!_&&c.current&&r&&(c.current=!1)},[]);return(0,r.useEffect)(()=>(null==i||i.addEventListener("wheel",f),()=>{null==i||i.removeEventListener("wheel",f)}),[i]),(0,r.useEffect)(()=>{if(a)return null==a||a.addEventListener("wheel",f),()=>{null==a||a.removeEventListener("wheel",f)}},[a,f]),(0,L.o)(()=>{let e=k()(e=>{var l,t,i,n;if(e.nativeEvent||(null==e?void 0:null===(l=e.target)||void 0===l?void 0:l.contentEditable)==="true")return;let a=e;(null===(t=e.data)||void 0===t?void 0:t.type)==="KEY_DOWN"&&(null===(i=e.data)||void 0===i?void 0:i.data)&&(a=null===(n=e.data)||void 0===n?void 0:n.data);let r=o?[E.bf.ArrowUp.keyCode]:[E.bf.ArrowUp.keyCode,E.bf.W.keyCode],d=o?[E.bf.ArrowDown.keyCode]:[E.bf.ArrowDown.keyCode,E.bf.S.keyCode],s=g.Le.getConfig(g.gI.DisableNextPre);!r.includes(a.keyCode)||a.shiftKey||s&&a.keyCode===E.bf.ArrowUp.keyCode?d.includes(a.keyCode)&&!a.shiftKey&&(!s||a.keyCode!==E.bf.ArrowDown.keyCode)&&((0,g.Vv)(A.CJ.hotkey),h.emit("changeNext",{from:"keyboard"}),h.emit(h.EVENT.reportPlayNext,{clickFrom:"keyboard"})):((0,g.Vv)(A.CJ.hotkey),h.emit("changePrev",{from:"keyboard"}),h.emit(h.EVENT.reportPlayPrev,{clickFrom:"keyboard"}))},500,{leading:!0,trailing:!1});return document.addEventListener("keydown",e),window.addEventListener("message",e),()=>{document.removeEventListener("keydown",e),window.removeEventListener("message",e)}},[l,o]),(0,r.useEffect)(()=>{let e=e=>{if(e.shiftKey||e.metaKey||e.ctrlKey||(0,j.r)())return;let l=g.Le.getConfig(g.gI.DisableExit);"Escape"===e.code&&!o&&!l&&t({click_method:"esc"}),e.preventDefault()};return T.k.bind("Escape",e),()=>{T.k.remove("Escape",e)}},[t,o]),null},D=e=>{let{currentNumber:l}=e,t=(0,r.useRef)(l),i=(0,r.useRef)(!0);return -1===t.current&&-1!==l&&(t.current=l),t.current!==l&&(i.current=!1),i.current};var V=t("913285"),F=t("983218"),W=t("396868"),R=t("63746");let U=e=>window.location.href.includes(e)||window.location.href.includes("user/self"),B=e=>{let{awemeInfoListRef:l,userInfo:t,currentNumber:i}=e,[o,n]=(0,r.useState)(R.Kw.NotShow);return(0,r.useEffect)(()=>{var e,o,a,r;let d=!1,s=l.current,u=async()=>{var e,l;let o=await (0,R.AH)({userId:null==t?void 0:null===(e=t.info)||void 0===e?void 0:e.uid,itemId:null===(l=s[i])||void 0===l?void 0:l.awemeId});!d&&!o.statusCode&&n(o.status)};return U(null==t?void 0:null===(e=t.info)||void 0===e?void 0:e.secUid)&&s[i]&&(null===(a=s[i])||void 0===a?void 0:null===(o=a.authorInfo)||void 0===o?void 0:o.uid)===(null==t?void 0:null===(r=t.info)||void 0===r?void 0:r.uid)&&u(),()=>{d=!0}},[i,t]),{asrState:o}};t("683656"),t("759943");var H=t("855357"),O=t("627932"),G=t("73053");let K=r.forwardRef((e,l)=>{var t,n;let{item:d,isActive:s,customProps:u,playNextFunc:v,playPrevFunc:m,swiper:f,onLivePlay:p,onLivePause:g,isShowGuide:_,useNewUserSoundGuide:w,modalEnterFrom:y}=e,{userContext:I,abtestData:x}=u,{userInfo:C}=I||{},{isLogin:P}=C||{};(0,r.useEffect)(()=>{if(s&&f)try{let e=(0,h.emitterListen)(f,"changeNext",v),l=(0,h.emitterListen)(f,"changePrev",m);return()=>{try{null==e||e(),null==l||l()}catch(e){}}}catch(e){}},[s,v,m,f]);let S=(0,r.useCallback)(()=>{p(d)},[d]),b=(0,r.useCallback)(()=>{g(d)},[d]),k=(0,r.useMemo)(()=>{var e,l,t,i;if(null==d?void 0:d.flvSrc)return d.flvSrc;let o=null==d?void 0:null===(e=d.cellRoom)||void 0===e?void 0:e.rawdata,n=null==o?void 0:null===(i=o.stream_url)||void 0===i?void 0:null===(t=i.flv_pull_url)||void 0===t?void 0:t[null==o?void 0:null===(l=o.stream_url)||void 0===l?void 0:l.default_resolution];return(null==n?void 0:n.includes("https"))?n:null==n?void 0:n.replace("http","https")},[d]);return(0,a.jsx)(O.K6,(0,o._)((0,i._)({ref:l},d),{disableNewPlayer:y===c.a.WaterFall,modalEnterFrom:y,isShow:s,isActive:s,customProps:u,source:{url:d.authorInfo.url,userName:`@ ${d.authorInfo.remarkName||d.authorInfo.nickname}`},gameName:"",scale:3/4,showUserCountInTag:!0,disableLiveCoverBorder:!0,isLogReady:P,userInfo:C,isEnd:2!==d.status,abTestData:x,logParams:(0,i._)({},null!==(n=null==d?void 0:d.logParams)&&void 0!==n?n:{},(null==d?void 0:d.searchLogParams)?{search_params:null==d?void 0:d.searchLogParams}:{},null==u?void 0:null===(t=u.logParams)||void 0===t?void 0:t.live_log_params),onPlay:S,onPause:b,onDestroy:b,enableLiveInfo:!0,isModal:!0,isShowGuide:_,useNewUserSoundGuide:w,flvSrc:k}))}),Z=e=>{let{item:l,videoRef:t}=e;return l.awemeType===H.e.LiveCard?(0,a.jsx)(K,(0,o._)((0,i._)({},e),{ref:t})):(0,a.jsx)(G.Z,(0,o._)((0,i._)({},e),{isMultiInstanceScene:!0,ref:t}))};t("679308");var q=t("855436"),$=t("593124"),z=t("542246"),J=t("295102"),Y=t("331198"),Q=t("793571"),X=t("236121");let ee=(e,l,t,i,o,n)=>{let[a,d]=(0,r.useState)(!0),[s,u]=(0,r.useState)(!1),{handleHiddenLog:c}=(0,X.s)(),[v,m]=(0,r.useState)((0,j.r)()),f=(0,r.useRef)(null),p=(0,r.useRef)(!1),{run:g}=(0,Q.Z)(()=>{d(!0)},500,[],{trailing:!1,leading:!0}),{run:h}=(0,Q.Z)(async()=>{d(p.current||!1)},3e3),_=()=>{p.current=!0},w=()=>{p.current=!1},[y,I]=(0,r.useState)(null);return(0,L.o)(()=>{if(o&&t){var l,i;let t=null==n?void 0:null===(i=n.current)||void 0===i?void 0:null===(l=i.getPlayerRoot)||void 0===l?void 0:l.call(i);!t&&(null==e?void 0:e.awemeType)!==H.e.LiveCard&&(t=document.querySelector(`#${o} [data-e2e="feed-active-video"] .basePlayerContainer`)),I(null!=t?t:null)}else I(null)},[e,l,o,t,n]),(0,L.o)(()=>{var e,l;if(!!y&&!!t)return y.addEventListener("mousemove",g),y.addEventListener("mousemove",h),null===(e=f.current)||void 0===e||e.addEventListener("mouseenter",_),null===(l=f.current)||void 0===l||l.addEventListener("mouseleave",w),()=>{var e,l;y.removeEventListener("mouseenter",_),y.removeEventListener("mouseleave",w),null===(e=f.current)||void 0===e||e.removeEventListener("mousemove",g),null===(l=f.current)||void 0===l||l.removeEventListener("mousemove",h)}},[y,t,e]),(0,L.o)(()=>{if(!y||!t)return;let e=()=>{m((0,j.r)())};return document.addEventListener("fullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("msfullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("msfullscreenchange",e)}},[t,y]),(0,r.useEffect)(()=>{d(!0),p.current=!1,t&&y&&h()},[t,e,i,v,y]),(0,r.useEffect)(()=>{u(a)},[a]),{isShowExtra:!y||s,extraRef:f,searchBarProps:{onHistoryClick:e=>{let{text:l}=e.currentTarget.dataset;return c(l)},onSearchClick:e=>c(e),onInputKeyDown:(e,l)=>{if("Enter"===(0,E.CS)(e))return c(l)}}}};var el=t("36897"),et=t("452154");let ei=(0,q.ZP)(()=>Promise.resolve().then(t.bind(t,661812)),{resolveComponent:e=>{let{SearchBar:l}=e;return l},ssr:!1}),eo=(0,q.ZP)(()=>Promise.resolve().then(t.bind(t,115874)),{resolveComponent:e=>{let{AiSearchBar:l}=e;return l},ssr:!1}),en=(0,q.ZP)(()=>Promise.resolve().then(t.bind(t,115874)),{resolveComponent:e=>{let{AiSearchBarWithAiMiddlePage:l}=e;return l},ssr:!1}),ea=(0,q.ZP)(()=>Promise.resolve().then(t.bind(t,115874)),{resolveComponent:e=>{let{AiSearchBarWithAiInput:l}=e;return l},ssr:!1}),er=e=>{var l,t;let{isInnerFeed:o,modalInnerFeedCard:n,isClientMiniWin:d,refPlayer:s,onBack:c,onBackWithInnerMode:v,abtestData:m,awemeInfoList:f,currentNumber:p,modalEnterFrom:_,isSelf:w,userInfo:I,logParams:x,searchParams:C,slideVideoTab:P,currentAwemeInfo:S,autoOpenPip:b,containerId:k,fullScreenTarget:L}=e,j=(null==S?void 0:S.awemeType)===H.e.LiveCard,{handleHiddenLog:T}=(0,X.s)(),{supportAiTop1:A}=(0,M.Iq)(e=>{let{supportAiTop1:l}=e;return{supportAiTop1:l}}),N=(0,et.V1)(),{awemeFeed:D}=(0,el.j)(),{isWebMiniWin:V}=(0,M.Iq)(e=>{let{isWebMiniWin:l}=e;return{isWebMiniWin:l}}),{isShowExtra:F,extraRef:W}=ee(S,null==s?void 0:null===(l=s.current)||void 0===l?void 0:l.getPlayer(),!V&&!d,o,k,s),R=(0,r.useMemo)(()=>"waterFall"===_,[_]),[U,B]=(0,r.useState)(!1);(0,r.useEffect)(()=>{var e;B(!!(null!==(e=g.Le.getConfig(g.gI.ImmersiveSwitchStatus))&&void 0!==e&&e))},[p]),(0,r.useEffect)(()=>{let e=h.listen(h.EVENT.ImmersiveSwitch,e=>{let{isOn:l}=e;l!==U&&B(!!l)});return()=>e()},[U]);let O=D.useValue("cardType",e=>[$.L.Author,$.L.Related,$.L.Mix,$.L.AwemeRelated,$.L.Series].includes(e)),G=(0,r.useMemo)(()=>b?o||!!n||O:o||!!n,[b,o,n,O]),K=(0,r.useMemo)(()=>{var e;return"general_search"===_?(0,i._)({},x,(null==f?void 0:null===(e=f[p])||void 0===e?void 0:e.logParams)||{}):void 0},[x,_,f,p]),Z="general_search"===_?(0,i._)({},x,(null==f?void 0:null===(t=f[p])||void 0===t?void 0:t.logParams)||{}):void 0,q=(0,r.useCallback)(e=>{let{text:l}=e.currentTarget.dataset;return T(l)},[T]),Q=(0,r.useCallback)((e,l)=>{if("Enter"===(0,E.CS)(e))return T(l)},[T]),er=(0,r.useMemo)(()=>({awemeInfo:f[p],scene:"modal",modalEnterFrom:_}),[f,p,_]),ed=(0,r.useMemo)(()=>y.H.baseOpt(m),[m]),es=(0,r.useMemo)(()=>{var e,l,t;return{getCurrentTab:()=>{var e,l;return(null==s?void 0:null===(l=s.current)||void 0===l?void 0:null===(e=l.getCurTab)||void 0===e?void 0:e.call(l))||P},modalEnterFrom:_,isSelf:w,uidEquals:(null==f?void 0:null===(l=f[p])||void 0===l?void 0:null===(e=l.authorInfo)||void 0===e?void 0:e.uid)===(null==I?void 0:null===(t=I.info)||void 0===t?void 0:t.uid),awemeInfo:null==f?void 0:f[p]}},[s,P,_,w,f,p,I]);return d||V?null:(0,a.jsxs)("div",{ref:W,className:u()({[z.default.extraTL]:R,[z.default.extraShow]:R&&F}),children:[G?(0,a.jsx)(Y.N,{positionFixed:!0,exitTextProps:es,onHandleReturn:v}):(0,a.jsx)(J.P,{onClick:c,isClientMiniWin:d}),j||n&&!f[p]?null:(0,a.jsx)("div",{className:u()(z.default.searchCt,"isDark",{[z.default.hidden]:U}),children:(()=>{if((null==m?void 0:m.aiSearchAiInput)&&(null==m?void 0:m.aiSearchInputMiddleNew)&&A&&!N)return(0,a.jsx)(eo,{customProps:{isModalVideo:!0,isSmoothInnerFeed:o,searchParams:C,logParams:ed?K:Z},userInfo:I,abTestData:m,onSearchClick:ed?T:e=>T(e),onHistoryClick:ed?q:e=>{let{text:l}=e.currentTarget.dataset;return T(l)},onInputKeyDown:ed?Q:(e,l)=>{if("Enter"===(0,E.CS)(e))return T(l)},playerProps:ed?er:{awemeInfo:f[p],scene:"modal",modalEnterFrom:_},fullScreenTarget:L});if(!(null==m?void 0:m.aiSearchAiInput)&&(null==m?void 0:m.aiSearchInputMiddleNew)&&A&&!N)return(0,a.jsx)(en,{customProps:{isModalVideo:!0,isSmoothInnerFeed:o,searchParams:C,logParams:ed?K:Z},userInfo:I,abTestData:m,onSearchClick:ed?T:e=>T(e),onHistoryClick:ed?q:e=>{let{text:l}=e.currentTarget.dataset;return T(l)},onInputKeyDown:ed?Q:(e,l)=>{if("Enter"===(0,E.CS)(e))return T(l)},playerProps:ed?er:{awemeInfo:f[p],scene:"modal",modalEnterFrom:_}});if((null==m?void 0:m.aiSearchAiInput)&&!(null==m?void 0:m.aiSearchInputMiddleNew)&&A&&!N)return(0,a.jsx)(ea,{customProps:{isModalVideo:!0,isSmoothInnerFeed:o,searchParams:C,logParams:ed?K:Z},userInfo:I,abTestData:m,onSearchClick:ed?T:e=>T(e),onHistoryClick:ed?q:e=>{let{text:l}=e.currentTarget.dataset;return T(l)},onInputKeyDown:ed?Q:(e,l)=>{if("Enter"===(0,E.CS)(e))return T(l)},playerProps:ed?er:{awemeInfo:f[p],scene:"modal",modalEnterFrom:_},fullScreenTarget:L});else return(0,a.jsx)(ei,{customProps:{isModalVideo:!0,isSmoothInnerFeed:o,searchParams:C,logParams:ed?K:Z},userInfo:I,abTestData:m,onSearchClick:ed?T:e=>T(e),onHistoryClick:ed?q:e=>{let{text:l}=e.currentTarget.dataset;return T(l)},onInputKeyDown:ed?Q:(e,l)=>{if("Enter"===(0,E.CS)(e))return T(l)},playerProps:ed?er:{awemeInfo:f[p],scene:"modal",modalEnterFrom:_}})})()})]})};t("932651"),t("656562"),t("992871");var ed=t("734123"),es=t("72430"),eu=t("426112"),ec=t("540129"),ev=t("604785"),em=t("426038"),ef=t("379745"),ep=t("594942"),eg=t("375209"),eh=t("405368"),e_=t("728810"),ew=t("547189"),ey=t("618759"),eI=t("249478"),ex=t("633950"),eC=t("513864"),eP=t("554469"),eS=t("489862"),eb=t("678305");let ek=e=>{let{player:l,awemeInfo:t,isActive:n,abtestData:a,modalEnterFrom:d}=e,s=c.a.WaterFall===d;(0,r.useEffect)(()=>{let e;if(!l||!n||!s)return;let r=!!(null==a?void 0:a.themeColorOptimize),d=()=>{(l.cumulateTime?l.cumulateTime:0)>15e3&&((0,ev.VY)({info:{[eP.BW.CompletePlayTime]:!0},awemeId:null==t?void 0:t.awemeId,abData:0}),clearInterval(e))},u=()=>{if(r){let e=g.Le.getConfig(g.gI.JxOuterProgress)||{},l=(null==e?void 0:e[null==t?void 0:t.awemeId])||{},n=(null==l?void 0:l.startTime)||0,a=(null==l?void 0:l.duration)||0;g.Le.setConfig(g.gI.JxOuterProgress,(0,o._)((0,i._)({},e),{[null==t?void 0:t.awemeId]:{duration:a,startTime:n,progress:100,isWatchedEnd:!0}}))}if((null==t?void 0:t.awemeType)!==68)(0,ev.VY)({info:{[eP.BW.Finish]:!0},awemeId:null==t?void 0:t.awemeId,abData:0})},c=()=>{var e,n;let a=null!==(e=null==l?void 0:l.currentTime)&&void 0!==e?e:0,r=null!==(n=null==l?void 0:l.duration)&&void 0!==n?n:0,d=g.Le.getConfig(g.gI.JxOuterProgress)||{},s=(null==d?void 0:d[null==t?void 0:t.awemeId])||{},u=!!(null==s?void 0:s.isWatchedEnd),c=r>0?Math.round(a/r*100):0;g.Le.setConfig(g.gI.JxOuterProgress,(0,o._)((0,i._)({},d),{[null==t?void 0:t.awemeId]:{isWatchedEnd:u,startTime:a,progress:u?100:c,duration:r}}))};return l.once(eb.Ku,u),r&&l.on(eb.MH,c),()=>{d(),l.off(eb.Ku,u),e&&clearInterval(e),r&&l.off(eb.MH,c)}},[l,t,n,a])},eL=e=>{let{awemeInfo:l,isActive:t,modalEnterFrom:i}=e;(0,r.useEffect)(()=>{var e;let{discoverPageCurrentVideoId:o,discoverPageVideoVV:n=0}=g.Le.getConfig(g.gI.LandingPageGuideInfo)||{};t&&(e=[c.a.Hot,c.a.WaterFall],e.includes(i))&&o!==l.awemeId&&g.Le.setConfig(g.gI.LandingPageGuideInfo,{discoverPageVideoVV:n+1,discoverPageCurrentVideoId:l.awemeId},!0)},[t,l.awemeId])};var eE=t("57449"),ej=t("547399"),eT=t("590555"),eA=t("442022"),eM=t("778018"),eN=t("638052"),eD=t("601034"),eV=t("63601");let eF=e=>{let{awemeInfo:l,isActive:t,logParams:o={}}=e||{},n=(0,eT.d)(o),a=(0,eV.n)();(0,r.useEffect)(()=>{if(t&&a&&l){let e=()=>{let e=`${eM.w3.modal.modal_first_video_play}_start`,t=`${eM.w3.modal.modal_first_video_play}_end`,o=(0,eA.bE)(e);if((null==o?void 0:o.length)>0){(0,eA.B1)({tag:t});let o=(0,eA.L8)(eM.w3.modal.modal_first_video_play,e,t);o>0&&eN.logInstance.sendLog("webPerfTiming",(0,i._)({enter_from:(0,eD.yW)(),aweme_id:null==l?void 0:l.awemeId,[eM.w3.modal.modal_first_video_play]:o},(null==n?void 0:n.current)||{})),(0,eA.tl)(e),(0,eA.tl)(t),(0,eA.tl)(eM.w3.modal.modal_first_video_play)}};if(a.isPlaying||a.currentTime>0){e();return}return a.on(ed.Events.AUTOPLAY_STARTED,e),a.on(ed.Events.AUTOPLAY_PREVENTED,e),()=>{a.off(ed.Events.AUTOPLAY_STARTED,e),a.off(ed.Events.AUTOPLAY_PREVENTED,e)}}},[l,a,t])},eW=e=>{let{awemeInfo:l,isActive:t,logParams:i={}}=e;return eF({awemeInfo:l,isActive:t,logParams:i}),null};var eR=t("65229"),eU=t("911750"),eB=t("730430"),eH=t("14105"),eO=t("755890"),eG=t("996473"),eK=t("713507"),eZ=t("388414"),eq=t("191825"),e$=t("121998"),ez=t("8013"),eJ=t("486463"),eY=t("332009");let eQ=e=>{let l=(0,eV.n)(),{awemeInfo:t,modalEnterFrom:i,isActive:o}=e;return(0,r.useEffect)(()=>{eY.s.getAllPlayer().filter(e=>eY.s.getPlayerScene(e.playerId)!==es.lT.Modal).forEach(e=>{var l;null===(l=e.pause)||void 0===l||l.call(e),e.config.autoplay=!1,e.autoplay=!1})},[]),(0,r.useEffect)(()=>{var e,t;if((null==l?void 0:l.setConfig)&&(null===(t=l.plugins)||void 0===t?void 0:null===(e=t.keyboard)||void 0===e?void 0:e.keyCodeMap)){let e=l.plugins.keyboard.keyCodeMap;"rightD"in e&&delete e.rightD,"leftA"in e&&delete e.leftA,l.setConfig({keyboard:{keyCodeMap:e}})}},[l]),(0,r.useEffect)(()=>{l&&o&&(0,eJ.wS)(l.playerId,!0)},[l,o]),(0,r.useEffect)(()=>{var e,l,t;return sessionStorage.setItem("ModalRefresh","1"),null===(t=document)||void 0===t||null===(l=t.activeElement)||void 0===l||null===(e=l.blur)||void 0===e||e.call(l),()=>{let{url:e,query:l}=e$.parseUrl(location.href);delete l.modal_id,window.history.replaceState(null,"",e$.stringifyUrl({url:e,query:l}))}},[]),(0,r.useEffect)(()=>{if(t&&!(0,ey.DT)()&&"recommendUpdateWindow"!==i&&i!==c.a.FollowAuthorModal&&o){let{url:i,query:o}=e$.parseUrl(location.href);if(!o.modal_id){var e,l;(0,ez.t_)(em.SessionStorageKeys.BackURl,null===(l=window)||void 0===l?void 0:null===(e=l.location)||void 0===e?void 0:e.pathname)}o.modal_id=null==t?void 0:t.awemeId,window.history.replaceState(null,"",e$.stringifyUrl({url:i,query:o}))}},[t,o,i]),(0,r.useEffect)(()=>{if(""===document.body.style.overflow)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[]),null};var eX=t("201691"),e0=t("198969"),e1=t("386206"),e3=t("310383");let e9=e=>{let{isActive:l,startTime:t,awemeInfo:i,isLogin:o=!1,isClientMiniWin:n=!1}=e,a=(0,eV.n)(),d=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{if(a&&l&&t>=3&&(0,eI.D)(i)&&o&&!n&&!d.current){let e=()=>{var e,l;null===(l=a.showPrompt)||void 0===l||l.call(a,{text:`上次播放至:${(0,e1.$y)(1e3*t)}`},{mode:"arrow",autoHide:!0,interval:3e3,preventScreenOverflow:!0,style:{left:`${1e3*t/(null==i?void 0:null===(e=i.video)||void 0===e?void 0:e.duration)*100}%`,bottom:"10px",padding:"8px 12px",borderRadius:"12px",backgroundColor:"#33343F",color:"#ffffff",fontSize:"12px",transition:"none",zIndex:"20"}}),d.current=!0};return a.once("play",e),()=>{a.off("play",e)}}if(a&&l&&t>=3&&o&&n){var e;null===(e=a.hidePrompt)||void 0===e||e.call(a)}},[a,l,t,i,o,n]),null},e4=e=>{let l=(0,e3.N)();return(0,a.jsx)(V.k,{componentName:"WaterLaterContinueTip",Slardar:l,children:(0,a.jsx)(e9,(0,i._)({},e))})};var e2=t("783789"),e5=t("771410");let e8=e=>{let{isActive:l,startTime:t,awemeInfo:n,isLogin:a=!1,modalEnterFrom:d}=e,s=(0,eV.n)(),u=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{if(s&&a&&(null==n?void 0:n.awemeId)){let e=e=>{let{currentTime:l}=e,t=Math.floor(l),a=g.Le.getConfig(g.gI.WatchLaterPipContinueProgressRecord)||{};g.Le.setConfig(g.gI.WatchLaterPipContinueProgressRecord,(0,o._)((0,i._)({},a),{[null==n?void 0:n.awemeId]:t}))},l=()=>{let e=g.Le.getConfig(g.gI.WatchLaterPipContinueProgressRecord)||{};g.Le.setConfig(g.gI.WatchLaterPipContinueProgressRecord,(0,o._)((0,i._)({},e),{[null==n?void 0:n.awemeId]:0}))};return s.on("timeupdate",e),s.on("ended",l),()=>{s.off("timeupdate",e),s.off("ended",l)}}},[s,n,a]),(0,r.useEffect)(()=>{if(d===c.a.WatchLaterPip&&s&&l&&t>=3&&(0,eI.D)(n)&&a&&!u.current){let e=e=>{var l,t;null==e||null===(l=e.stopPropagation)||void 0===l||l.call(e),e5.Z.report("watch_later_add_window_play_setting_module_click",(0,o._)((0,i._)({},(0,e2.B)()),{function_name:"move_guide_close"})),null===(t=s.hidePrompt)||void 0===t||t.call(s)},l=()=>{var l,n,a;null==s||null===(l=s.seek)||void 0===l||l.call(s,t),null===(n=s.showPrompt)||void 0===n||n.call(s,{text:`
|
|
<div style="display: flex; align-items: center;">
|
|
<span class="watchLaterPipTipClose" style="margin-right: 2px;cursor: pointer;display: flex; align-items: center;">
|
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M13.0141 11.5997C13.4046 11.9902 13.4046 12.6234 13.0141 13.0139C12.6235 13.4045 11.9904 13.4045 11.5998 13.0139L8.00015 9.41424L4.40047 13.0139C4.00994 13.4045 3.37678 13.4045 2.98625 13.0139C2.59573 12.6234 2.59573 11.9902 2.98625 11.5997L6.58594 8.00003L2.98625 4.40034C2.59573 4.00982 2.59573 3.37665 2.98625 2.98613C3.37678 2.59561 4.00994 2.59561 4.40047 2.98613L8.00015 6.58582L11.5998 2.98613C11.9904 2.59561 12.6235 2.59561 13.0141 2.98613C13.4046 3.37666 13.4046 4.00982 13.0141 4.40034L9.41437 8.00003L13.0141 11.5997Z" fill="white"/>
|
|
</svg>
|
|
</span>已为您定位至${(0,e1.$y)(1e3*t)}
|
|
</div>
|
|
`},{autoHide:!0,interval:3e3,preventScreenOverflow:!0,style:{left:"16px",bottom:"56px",padding:"6px 8px",borderRadius:"8px",backgroundColor:"rgba(0, 0, 0, 0.60)",color:"#ffffff",fontSize:"12px",transition:"none",zIndex:"20",transform:"none"}}),["move_guide","move_guide_progress","move_guide_close"].forEach(e=>{e5.Z.report("watch_later_add_window_play_setting_module_show",(0,o._)((0,i._)({},(0,e2.B)()),{function_name:e}))}),u.current=!0;let r=null==s?void 0:null===(a=s.root)||void 0===a?void 0:a.querySelector(".watchLaterPipTipClose");null==r||r.addEventListener("click",e)};return s.once("play",l),()=>{var t;s.off("play",l);let i=null==s?void 0:null===(t=s.root)||void 0===t?void 0:t.querySelector(".watchLaterPipTipClose");null==i||i.removeEventListener("click",e)}}},[s,l,t,n,a,d]),null},e6=e=>{let l=(0,e3.N)();return(0,a.jsx)(V.k,{componentName:"WaterLaterPipContinueTip",Slardar:l,children:(0,a.jsx)(e8,(0,i._)({},e))})};var e7=t("96296"),le=t("587512"),ll=t("392772"),lt=t("588246"),li=t("721968"),lo=t("900203"),ln=t("761059"),la=t("203404"),lr=t("733900"),ld=t("678817"),ls=t("82430"),lu=t("838468"),lc=t("817567"),lv=t("951115"),lm=t("351105"),lf=t("400188"),lp=t("943660"),lg=t("314946"),lh=t("711838"),l_=t("103978"),lw=t("186738"),ly=t("423830"),lI=t("670642"),lx=t("977240"),lC=t("488977"),lP=t("992189"),lS=t("797618"),lb=t("140268"),lk=t("893392"),lL=t("843452"),lE=t("484571"),lj=t("952300"),lT=t("289097");t("362051"),t("414931");var lA=t("740197"),lM=t("762167"),lN=t("759894"),lD=t("810069"),lV=t("103680"),lF=t("947383"),lW=t("330224"),lR=t("316213"),lU=t("290397"),lB=t("950264"),lH=e=>{let{className:l,text:t,onClick:i}=e;return(0,a.jsx)("div",{className:u()(lB.default.gameVideoWeakAdCard1,l),onClick:e=>null==i?void 0:i(e,{refer:lU.tU.Blank}),children:(0,a.jsxs)("div",{className:lB.default.btnBox,onClick:e=>null==i?void 0:i(e,{refer:lU.tU.Button}),children:[(0,a.jsx)("span",{className:lB.default.text,children:t}),(0,a.jsx)(lR.z,{svg:(0,a.jsx)(lW.Z,{}),className:lB.default.icon})]})})},lO=t("227831"),lG=t("188182"),lK=e=>{let{className:l,logoUrl:t,isBackupImgUrl:i=!1,text:o,onClick:n}=e;return(0,a.jsxs)("div",{className:u()(lG.default.gameVideoWeakAdCard2,l),onClick:e=>null==n?void 0:n(e,{refer:lU.tU.Blank}),children:[(0,a.jsx)("div",{className:lG.default.adInfo,onClick:e=>null==n?void 0:n(e,{refer:lU.tU.Photo,click_type:i?lU.Kw.AdBackupProduct:lU.Kw.AdProduct}),children:(0,a.jsx)(lO.Q,{src:t,iconHeight:24,iconWidth:24,className:lG.default.adIcon})}),(0,a.jsxs)("div",{className:lG.default.btnBox,onClick:e=>null==n?void 0:n(e,{refer:lU.tU.Button}),children:[(0,a.jsx)("span",{className:lG.default.text,children:o}),(0,a.jsx)(lR.z,{svg:(0,a.jsx)(lW.Z,{}),className:lG.default.icon})]})]})},lZ=t("72878"),lq=t("147597"),l$=t("686060"),lz=t("571975"),lJ=e=>{var l;let{className:t,logoUrl:i,isBackupImgUrl:o=!1,title:n,tags:d=[],buttonText:s,buttonBgColor:c=lZ.DEFAULT_BUTTON_COLOR,coverUrl:v,onClose:m,onClick:f}=e,[p,g]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{g(!1)},[v]),(0,a.jsxs)("div",{className:u()(lz.default.gameVideoStrongAdCard1,t),onClick:e=>null==f?void 0:f(e,{refer:lU.tU.Blank}),children:[(0,a.jsxs)("div",{className:lz.default.header,children:[(0,a.jsx)("div",{className:lz.default.adInfo,onClick:e=>null==f?void 0:f(e,{refer:lU.tU.Photo,click_type:o?lU.Kw.AdBackupProduct:lU.Kw.AdProduct}),children:(0,a.jsx)(lO.Q,{src:i,iconHeight:48,iconWidth:48,className:lz.default.adIcon})}),(0,a.jsxs)("div",{className:lz.default.detail,children:[(0,a.jsx)("div",{className:lz.default.title,onClick:e=>null==f?void 0:f(e,{refer:lU.tU.Name}),children:n}),(null==d?void 0:d.length)>0&&(0,a.jsx)("div",{className:lz.default.tagLine,children:null==d?void 0:null===(l=d.slice(0,2))||void 0===l?void 0:l.map((e,l)=>(0,a.jsx)(l$.Z,{className:lz.default.tag,onClick:l=>null==f?void 0:f(l,{refer:lU.tU.Pull,product_tags:e}),children:e},l))})]}),(0,a.jsx)("div",{className:lz.default.downloadBtn,style:{background:c},onClick:e=>null==f?void 0:f(e,{refer:lU.tU.Button}),children:(0,a.jsx)("span",{className:lz.default.downloadBtnText,children:s})})]}),!p&&(0,a.jsxs)("div",{className:lz.default.banner,children:[(0,a.jsx)(lO.Q,{src:v,className:lz.default.coverWrap,imgClass:lz.default.coverImg}),(0,a.jsx)("div",{className:lz.default.closeBtn,onClick:e=>{e.stopPropagation(),g(!0),m(e)},children:(0,a.jsx)(lR.z,{svg:(0,a.jsx)(lq.Z,{}),className:lz.default.closeIcon})})]})]})};t("313036");var lY=t("965347"),lQ=t("258411"),lX=e=>{var l;let{className:t,logoUrl:i,isBackupImgUrl:o=!1,title:n,tags:r=[],buttonText:d,buttonBgColor:s=lZ.DEFAULT_BUTTON_COLOR,descTitle:c="应用简介",descContent:v,onMoreClick:m,onClick:f}=e;return(0,a.jsxs)("div",{className:u()(lQ.default.gameVideoStrongAdCard2,t),onClick:e=>null==f?void 0:f(e,{refer:lU.tU.Blank}),children:[(0,a.jsxs)("div",{className:lQ.default.header,children:[(0,a.jsx)("div",{className:lQ.default.adInfo,onClick:e=>null==f?void 0:f(e,{refer:lU.tU.Photo,click_type:o?lU.Kw.AdBackupProduct:lU.Kw.AdProduct}),children:(0,a.jsx)(lO.Q,{src:i,iconHeight:48,iconWidth:48,className:lQ.default.adIcon})}),(0,a.jsxs)("div",{className:lQ.default.detail,children:[(0,a.jsx)("div",{className:lQ.default.title,onClick:e=>null==f?void 0:f(e,{refer:lU.tU.Name}),children:n}),(null==r?void 0:r.length)>0&&(0,a.jsx)("div",{className:lQ.default.tagLine,children:null==r?void 0:null===(l=r.slice(0,2))||void 0===l?void 0:l.map((e,l)=>(0,a.jsx)(l$.Z,{className:lQ.default.tag,onClick:l=>null==f?void 0:f(l,{refer:lU.tU.Pull,product_tags:e}),children:e},l))})]}),(0,a.jsx)("div",{className:lQ.default.downloadBtn,style:{background:s},onClick:e=>null==f?void 0:f(e,{refer:lU.tU.Button}),children:(0,a.jsx)("span",{className:lQ.default.downloadBtnText,children:d})})]}),v&&(0,a.jsxs)("div",{className:lQ.default.description,children:[(0,a.jsxs)("div",{className:lQ.default.descHeader,children:[(0,a.jsx)("div",{className:lQ.default.descTitle,children:c}),(0,a.jsxs)("div",{className:lQ.default.moreBtn,onClick:e=>{e.stopPropagation(),null==m||m(e)},children:[(0,a.jsx)("span",{className:lQ.default.moreText,children:"更多"}),(0,a.jsx)(lR.z,{svg:(0,a.jsx)(lY.Z,{}),className:lQ.default.moreIcon})]})]}),(0,a.jsx)("div",{className:lQ.default.descContent,children:v})]})]})},l0=t("746517"),l1=t("581999"),l3=t("801567");let l9=e=>(null==e?void 0:e.map(e=>"string"==typeof e?e:null==e?void 0:e.tag).filter(Boolean))||[],l4=e=>{var l,t;let{className:n,awemeInfo:d,isActive:s,isHide:c=!1,onAfterOpenGame:v}=e,[m,f]=(0,r.useState)(!1),p=(0,r.useRef)(!1),g=(0,l1.useUserInfoContext)(),h=null==g?void 0:g.userInfo,_=null==g?void 0:g.dispatch,w=null==h?void 0:h.isLogin,y=(0,r.useMemo)(()=>d?(0,eu.Rx)(d):void 0,[d]),I=(0,r.useMemo)(()=>(0,ew.xi)(y),[y]),x=(0,r.useMemo)(()=>(null==I?void 0:I.data)||{},[I]),C=(0,r.useMemo)(()=>(null==y?void 0:y.log_extra)?"string"==typeof y.log_extra?(0,e1.As)(y.log_extra):y.log_extra:{},[y]),P=(null==C?void 0:C.micro_app_id)||(null==y?void 0:null===(l=y.tt_micro_game_track)||void 0===l?void 0:l.mp_id),S=(null==x?void 0:x.title)||(null==y?void 0:null===(t=y.tt_micro_game_track)||void 0===t?void 0:t.mp_name),b=null==x?void 0:x.sub_title,L=(null==y?void 0:y.avatar_url)||(null==x?void 0:x.image_url),E=null==x?void 0:x.image_url,j=(null==x?void 0:x.button_text)||(null==y?void 0:y.button_text),T=null==x?void 0:x.button_background_color,A=l9((null==x?void 0:x.tags)||(null==x?void 0:x.product_tags)),M=(0,r.useMemo)(()=>{let e=Number(null==x?void 0:x.show_button_seconds);return Number.isFinite(e)&&e>0?e:0},[x]),N=(0,r.useMemo)(()=>{var e,l,t,i,o,n;return{enter_method:"feed_video_game_ad",enter_from:(0,lN.mo)(),_param_for_special:"micro_game",mp_id:P,mp_name:S||"小游戏",scene:"255001",launch_from:"ad",is_ad_channel:"1",is_soft_ad:"0",ad_id:String(null==y?void 0:y.ad_id)||"",cid:(null==y?void 0:y.creative_id)||"",project_id:(null==y?void 0:null===(e=y.tt_micro_game_track)||void 0===e?void 0:e.project_id)||"",promotion_id:(null==y?void 0:null===(l=y.tt_micro_game_track)||void 0===l?void 0:l.promotion_id)||"",if_dou:(null==y?void 0:null===(t=y.tt_micro_game_track)||void 0===t?void 0:t.if_dou)||"",location:(null==y?void 0:null===(i=y.tt_micro_game_track)||void 0===i?void 0:i.location)||"",is_ad:"1",did:(null===(o=(0,lD.Es)())||void 0===o?void 0:o.user_unique_id)||"",uid:(null===(n=h.info)||void 0===n?void 0:n.uid)||"",req_id:(null==C?void 0:C.req_id)||"",rit:(null==C?void 0:C.rit)||""}},[P,S,y,C]),D=(0,r.useMemo)(()=>{var e,l;return{is_ad:"1",is_soft_ad:"0",did:(null===(e=(0,lD.Es)())||void 0===e?void 0:e.user_unique_id)||"",uid:(null===(l=h.info)||void 0===l?void 0:l.uid)||"",req_id:(null==C?void 0:C.req_id)||"",rit:(null==C?void 0:C.rit)||"",creative_id:(null==y?void 0:y.creative_id)||"",mp_id:P}},[P,S,y,C]),V=(0,r.useCallback)(()=>{if(!P)return;let e=S||"小游戏",l=`sslocal://microgame?${new URLSearchParams({app_id:P,bdp_log:JSON.stringify((0,i._)({},N)),scene:"255001",meta:JSON.stringify({icon:L||"",name:e,orientation:0}),is_from_web:String((0,ey.DT)()?0:1),query:JSON.stringify({projectid:N.project_id,promotionid:N.promotion_id,ad_params:{log_extra:{rit:null==C?void 0:C.rit}}})}).toString()}`;if((0,ey.DT)()){lV.invoke("createGameWindow",{urlSchema:l,isHorizontal:0,gameId:P}).then(()=>{null==v||v()}).catch(()=>null);return}lA.p.open({logParams:N,clientSchemaUrl:l,onClose:()=>{lA.p.close()}}),null==v||v()},[L,P,v,S]),F=(0,r.useCallback)(k()((e,l)=>{if(!!s&&!!m&&!c&&!!P)if(e.stopPropagation(),(0,lM.E)("realtime_click",(0,o._)((0,i._)({tag:(0,lF.f)(),value:(null==y?void 0:y.creative_id)||"",log_extra:null==y?void 0:y.log_extra},l),{ad_extra_data:(0,i._)({},D)})),e5.Z.report("mp_click",N),w)V();else{(0,l0.default)({headerText:"登录后即可玩小游戏",enterMethod:"microgame_searchcard",success:()=>{null==_||_({type:"updateUserInfo"}),V()}});return}},1e3,{leading:!0,trailing:!1}),[_,s,c,w,m,P,V,y,N,D]);if((0,r.useEffect)(()=>{f(!1),p.current=!1},[y]),(0,r.useEffect)(()=>{m&&!c&&!p.current&&I&&(p.current=!0,e5.Z.report("mp_show",N),(0,lM.E)("show",{tag:"draw_ad",value:(null==y?void 0:y.creative_id)||"",log_extra:null==y?void 0:y.log_extra,refer:"button",ad_extra_data:(0,i._)({},D)}))},[d,I,c,m,y]),(0,r.useEffect)(()=>{if(!s||!(0,ew.jr)(y)||!I)return()=>{};if(M<=0)return f(!0),()=>{};let e=window.setTimeout(()=>{f(!0)},1e3*M);return()=>window.clearTimeout(e)},[I,s,y,M]),!s||!m||!(0,ew.jr)(y)||!I)return null;let W=u()(l3.default.adCard,n,{[l3.default.hidden]:c});return I.id===ew.HM.VideoWeakAdCard1?(0,a.jsx)(lH,{className:W,text:j,onClick:F}):I.id===ew.HM.VideoWeakAdCard2?(0,a.jsx)(lK,{className:W,logoUrl:L,text:j,onClick:F}):I.id===ew.HM.VideoStrongAdCard1?(0,a.jsx)(lJ,{className:W,logoUrl:L,coverUrl:E,title:S,tags:A,buttonText:j,buttonBgColor:T,onClick:F}):I.id===ew.HM.VideoStrongAdCard2?(0,a.jsx)(lX,{className:W,logoUrl:L,title:S,tags:A,buttonText:j,buttonBgColor:T,descContent:(null==x?void 0:x.app_description)||b,onMoreClick:e=>F(e,{refer:lU.tU.Button}),onClick:F}):null};var l2=t("991530"),l5=t("848403"),l8=t("899429"),l6=t("674918"),l7=t("758137"),te=t("467359"),tl=t("342309"),tt=t("250195"),ti=t("581841"),to=t("433766"),tn=t("286720"),ta=t("307323"),tr=t("869066"),td=t("766353"),ts=t("632887"),tu=t("241891"),tc=t("814129"),tv=t("137375"),tm=t("253149"),tf=t("94109"),tp=t("335989"),tg=t("541053"),th=t("626117"),t_=t("997082"),tw=t("96104"),ty=t("794016"),tI=t("927435"),tx=t("154607"),tC=t("12041"),tP=t("910978"),tS=t("390431"),tb=t("631431"),tk=t("13994"),tL=t("59412");t("340509"),t("225293");var tE=t("723349"),tj=t("721193"),tT=t("316223"),tA=t("46969"),tM=t("992928"),tN=t("536026"),tD=t("988215"),tV=t("912113"),tF=t("190516"),tW=t("37285");let tR=e=>{let{config:l,isInitPlayer:t}=e,i=(0,eV.n)();return(0,r.useEffect)(()=>{if(t&&i){let e=setTimeout(()=>{var e,t;!(null===(e=i.plugins)||void 0===e?void 0:e.srplugin)&&(null===(t=l.plugins)||void 0===t?void 0:t.includes(tF.o))&&(i.config.srplugin=l.srplugin,i.registerPlugin(tF.o),setTimeout(()=>{i.emit(tW.B.RegisterMissingSrPlugin)}))});return()=>{clearTimeout(e)}}},[i,t]),null},tU=e=>{let l=(0,e3.N)();return(0,a.jsx)(V.k,{componentName:"RegisterMissingPlugin",Slardar:l,children:(0,a.jsx)(tR,(0,i._)({},e))})};var tB=t("140726"),tH=t("880323"),tO=t("874688"),tG=t("387382"),tK=t("37749"),tZ=t("800513"),tq=t("55938"),t$=t("605765"),tz=t("815398"),tJ=t("281934"),tY=t("70864");let tQ=(0,r.memo)((0,r.forwardRef)((e,l)=>{var t,n,d,s,m,h,w,I,x,C,P,S,b,k,L,E,j,T,A,N,D,V;let{isActive:F,isNext:W,isPrev:R,isFirst:U,isLast:B,awemeInfo:O,nextAwemeInfo:G,prevAwemeInfo:K,playNextFunc:Z,abtestData:q,deleteCurrentSwiper:$,toggleComment:z,onAvatarClick:J,fullScreenTarget:Y,logParams:Q,videoToast:X,followHandler:ee,playPrevFunc:el,userInfo:et,dispatch:ei,isAuthorCardShow:eo,isShowRelatedCard:en,moreBoxShowList:ea,videoHashtagClassName:er,videoTags:eb,children:eT,disableAutoPlay:eA,shortCutFiltered:eM,positionBoxClassName:eN,customProps:eD,actionFollow:eV,actionUnFollow:eF,modalEnterFrom:e$,showPlaySwitch:ez=!0,isShowPageFullScreen:eJ=!1,isShowCssFullScreenGuide:eY,isInnerFeed:e1,onCooperationAuthorClick:e3,isShowCooperation:e9,sideBarShow:e5,slardarInstance:e8,defaultIsPageFullScreen:lA,avatarTipText:lM,onRelatedClick:lN,onAiCardClick:lD,onDislike:lV,activityCardDirectOpen:lF,onActivityCardClick:lW=()=>{},onShopAnchorClick:lR=()=>{},onGameAnchorClick:lU=()=>{},onShopAnchorMouseEnter:lB=()=>{},onShopAnchorMouseLeave:lH=()=>{},onDouPlusClick:lO,onSodaClick:lG,isShowGuide:lK,notCanMixListen:lZ,openSpecificTab:lq,index:l$,isFullScreen:lz,useNewUserSoundGuide:lJ,isMultiInstanceScene:lY,isUpperFeed:lQ,isRevisitStart:lX,startTime:l0,chapterProps:l1,setContainerPlayer:l3,reuseConfig:l9,recommendTagProps:tF,canShowListenVideo:tW,listenFeedNextAwemeInfo:tR,listenFeedPrevAwemeInfo:tQ,getAwemeInfoList:tX,hideModalWhenPip:t0,setHideModalByPip:t1,modalClose:t3,aiNoteProps:t9,isShowAdCard:t4,isShowShopSideCard:t2,appendPlayerConfig:t5,LiveSliderCard:t8,disableShortCut:t6,isAdShortCut:t7,isShowAiCard:ie,sideCardContext:il}=e,it=(0,r.useRef)(null),{isMainland:ii,isWebMiniWin:io,pipWindow:ia,isListenVideoMiniWin:ir,fullScreenQuestionVars:{isShowingQuestion:id}={isShowingQuestion:!1}}=(0,M.Iq)(e=>{let{isMainland:l,isWebMiniWin:t,pipWindow:i,isListenVideoMiniWin:o,fullScreenQuestionVars:n}=e;return{isMainland:l,isWebMiniWin:t,pipWindow:i,isListenVideoMiniWin:o,fullScreenQuestionVars:n}}),{hasChapterBar:is}=(0,tr.W)(q,O,null===(t=it.current)||void 0===t?void 0:t.player),{infoStyle:iu,renderHighlightBar:ic,setIsHighlightBarShow:iv}=(0,td.t)(q,O),{isClientMiniWin:im}=(0,r.useContext)(f.C),ip=(0,ey.DT)(),[ig,ih]=(0,r.useState)(null);(null===(n=it.current)||void 0===n?void 0:n.player)&&(it.current.player.modalEnterFrom=e$,it.current.player.disableAutoPlay=eA,it.current.player.isShowPageFullScreen=eJ);let i_=(0,r.useMemo)(()=>io||im||ir,[io,im,ir]);(0,r.useEffect)(()=>{if(!tW&&ir){let e=tq.e.getPipWindow({scene:v.d.ListenVideo});e&&e.close()}},[ir]);let{enablePip:iw}=(0,tg.$)({abtestData:q,enterFrom:e$,awemeInfo:O});eL({isActive:F,awemeInfo:O,modalEnterFrom:e$});let{noPaidVideo:iy}=(0,th.B)({awemeInfo:O});(0,t_.u)({awemeInfo:O,player:null===(d=it.current)||void 0===d?void 0:d.player});let iI=(0,eI.D)(O),{isDanmuIcon:ix,isChapterIcon:iC,chapterMaxWidth:iP,isAiNoteIcon:iS,hideList:ib}=(0,tw.l0)({isActive:F,abtestData:q,player:null===(s=it.current)||void 0===s?void 0:s.player,isMiniWin:i_,isInnerFeed:e1,awemeInfo:O});(0,ty.j)({player:null==it?void 0:null===(m=it.current)||void 0===m?void 0:m.player,isActive:F,abValue:q}),(0,tI._)({awemeInfo:O,prevAwemeInfo:K,isInnerFeedModel:e1&&F}),(0,tx.V)({awemeInfo:O}),(0,tC.k)({awemeInfo:O,abtestData:q,isActive:F,shouldRender:!0}),(0,tM.g)({player:null==it?void 0:null===(h=it.current)||void 0===h?void 0:h.player,awemeInfo:O}),(0,tN.G)({player:null==it?void 0:null===(w=it.current)||void 0===w?void 0:w.player,awemeInfo:O,scene:"pc_web_mix_aweme",abtestData:q}),(0,r.useImperativeHandle)(l,()=>{var e;return{getPlayer:()=>it.current.getPlayer(),player:null===(e=it.current)||void 0===e?void 0:e.player,getPlayerRoot:()=>{var e,l;return null===(e=(l=it.current).getPlayerRoot)||void 0===e?void 0:e.call(l)}}}),(0,tP.D)({awemeInfo:O,isActive:F});let ik=(0,r.useMemo)(()=>{var e,l;let t={isModal:!0},i=(0,ts.YO)({abtestData:q,awemeInfo:O,isInnerFeed:e1,modalEnterFrom:e$,isModalVideo:!0,scene:es.lT.Modal,missReasonCb:e=>{t.srMissReason=e}});Object.assign(t,(0,ta.k)({awemeInfo:O,abtestData:q,enableSr:i}),(0,tE.QF)({awemeInfo:O,abtestData:q,enableSr:i})),(null==q?void 0:null===(e=q.bitratePlaylist)||void 0===e?void 0:e.enable)&&(null==t?void 0:t.BitrateSelector)&&Object.assign(t.BitrateSelector,{playlist_info:(0,tu.Um)({awemeInfo:O,awemeInfoList:null==tX?void 0:tX(!0),isInnerFeed:e1,abtestData:q,scene:es.lT.Modal}),playlist_select_bitrate:(null==q?void 0:null===(l=q.bitratePlaylist)||void 0===l?void 0:l.playlistSelectBitrate)||{}}),(0,tc.Zf)({config:t,awemeInfo:O,abtestData:q}),(0,tv.LX)({config:t,awemeInfo:O,abtestData:q,isMultiInstanceScene:lY}),(0,ts.nq)({config:t,abtestData:q,enableSr:i}),t.startTime=(0,eO.v)(O.awemeId),t.pip&&!1===[c.a.Im,c.a.Search,c.a.GeneralSearch].includes(e$)&&(t.pip.showIcon=iw),[c.a.GeneralSearch,c.a.Search].includes(e$)&&!e1&&(t.progressDot=(0,ex.x)(null==O?void 0:O.videoAbstract));try{(null==t?void 0:t.mp4encryptplayer)&&(null==t5?void 0:t5.mp4encryptplayer)&&Object.assign(t.mp4encryptplayer,t5.mp4encryptplayer),(null==t?void 0:t.DASHPlugin)&&(null==t5?void 0:t5.DASHPlugin)&&Object.assign(t.DASHPlugin,t5.DASHPlugin)}catch(e){}return t},[O,q,e$,e1,iw,e$,t5]),iL=(0,r.useMemo)(()=>(0,eu.Jt)(O),[O]),iE=(0,r.useMemo)(()=>(0,eu.gc)(O),[O]),ij=(0,r.useMemo)(()=>{var e;return[...(null==ea?void 0:ea.notInterestingIcon)?[]:[null===(e=ec.getShortcut().dislike)||void 0===e?void 0:e.badgeText],...eM||[]]},[null==ea?void 0:ea.notInterestingIcon,eM]),iT=(0,r.useCallback)(()=>{c.a.WaterFall===e$&&(0,ev.VY)({info:{[eP.BW.Finish]:!0},awemeId:null==O?void 0:O.awemeId,abData:0})},[q,e$]);(0,tS.O)({player:null===(I=it.current)||void 0===I?void 0:I.player,isActive:F,awemeInfo:O,abtestData:q,isWebMiniWin:io}),(0,tb.w)({player:null===(x=it.current)||void 0===x?void 0:x.player,isActive:F,awemeInfo:O,abtestData:q,isInnerFeed:e1}),(0,tk.U)({config:ik,isActive:F,awemeInfo:O,player:null===(C=it.current)||void 0===C?void 0:C.player}),(0,tL.Q)({player:null===(P=it.current)||void 0===P?void 0:P.player,isActive:F,awemeInfo:O,abtestData:q,isSliderVideo:!0,isKeyWorkCancalLike:!0,shortcutExclude:[],isClientMiniWin:im,pipWindow:ia,isLogin:null==et?void 0:et.isLogin}),ek({player:null===(S=it.current)||void 0===S?void 0:S.player,isActive:F,awemeInfo:O,abtestData:q,modalEnterFrom:e$});let iA=(0,r.useRef)(!1),iM=(0,r.useMemo)(()=>F||R||W,[F,R,W]);iA.current=iM;let iN=(0,p.x)(),{anchorList:iD,hasJingxuanActivity:iV}=(0,tH.e)({abtestData:q,awemeInfo:O}),iF=!iV&&(0,tG.$)({abTestData:q,awemeInfo:O});(0,t$.M)({awemeInfo:O,player:null==it?void 0:null===(b=it.current)||void 0===b?void 0:b.player,noPaidVideo:iy,isInnerFeed:e1});let{listenVideoDisablePrev:iW,listenVideoDisableNext:iR}=(0,tD.T)({isAuthorCardShow:eo,isFirst:U,isLast:B,isShowRelatedCard:en,canUseListenFeed:e$===c.a.WaterFall,prevAwemeInfo:K,nextAwemeInfo:G,listenFeedNextAwemeInfo:tR,listenFeedPrevAwemeInfo:tQ,isInnerFeed:e1,isActive:F}),{scene:iU,reuseId:iB}=null!=l9?l9:{},iH=!(tB.YY.checkIsReuseWithId(iU,iB)&&iB===(null==O?void 0:O.awemeId))&&!U&&e$===c.a.WaterFall,iO=(null==q?void 0:q.reuseVideoDiscover)&&iH?ej.Y:eE.f,iG=(0,r.useMemo)(()=>{var e;return(null===(e=window.__QUICK_PLAYER)||void 0===e?void 0:e.playerId)&&window.__QUICK_PLAYER.playerId===(null==ig?void 0:ig.playerId)},[ig]),iK=e$===c.a.WaterFall?null===(k=g.Le.getConfig(g.gI.JxOuterProgress))||void 0===k?void 0:k[null==O?void 0:O.awemeId]:{},iZ=e$===c.a.WaterFall&&!!((null==iK?void 0:iK.isWatchedEnd)||(null==iK?void 0:iK.progress)),[iq,i$]=(0,r.useState)();(0,r.useEffect)(()=>{if(e$===c.a.WatchLaterPip){i$((0,e2.B)());let e=()=>{i$((0,e2.B)())};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}}},[e$]);let iz=(0,r.useMemo)(()=>(0,i._)((0,o._)((0,i._)({},Q),{is_theme_progress_bar:iZ?"1":"0"}),iq),[Q,iZ,iq]),iJ=(0,r.useMemo)(()=>(0,eu.Rx)(O),[O]),iY=(0,r.useMemo)(()=>{var e;return null===(e=(0,ew.xi)(iJ))||void 0===e?void 0:e.id},[iJ]),iQ=(0,r.useMemo)(()=>(0,ew.jr)(iJ),[iJ]),iX=(0,r.useMemo)(()=>iY===ew.HM.VideoStrongAdCard1||iY===ew.HM.VideoStrongAdCard2,[iY]),i0=(0,r.useCallback)(()=>{var e,l,t;null===(t=it.current)||void 0===t||null===(l=t.player)||void 0===l||null===(e=l.pause)||void 0===e||e.call(l)},[]);(0,r.useEffect)(()=>{var e,l,t;let i=null===(e=it.current)||void 0===e?void 0:e.player;if(i&&(iG||tB.YY.checkIsReusePlayer(null==l9?void 0:l9.scene,null==l9?void 0:l9.reuseId,i))){let e=null==i?void 0:null===(t=i.root)||void 0===t?void 0:null===(l=t.closest)||void 0===l?void 0:l.call(t,".basePlayerContainer");e&&ed.Util.addClass(e,"reusePlayer")}},[iG,l9,it.current]),(0,tJ.O)({abtestData:q,player:null==it?void 0:null===(L=it.current)||void 0===L?void 0:L.player,scene:es.lT.Modal,awemeInfo:O,isActive:F,refPlayer:it});let i1=i_&&"small_window_game_widget"===new URL(location.href).searchParams.get("open_from");return(0,a.jsxs)(iO,{xgplayerConfig:ik,isInitPlayer:iM,style:(0,i._)({height:"100%",width:"100%"},ir?{display:"none"}:{}),className:u()(eS.default.container,"chapterPlayerStyle","modalPlayer","lowPopup",[c.a.GeneralSearch,c.a.Search].includes(e$)?"searchModal":"",e$===c.a.WatchLaterPip?"watchLaterPipModal":""),ref:it,scene:es.lT.Modal,onReady:e=>{ih(e)},slardarInstance:e8,reuseConfig:l9,setContainerPlayer:l3,abtestData:q,children:[(0,a.jsx)(tj.V,{awemeInfo:O,isActive:F,timeout:(0,_.b_)()?4e3:2e3,isFirst:!0}),(0,a.jsx)(eW,{awemeInfo:O,isActive:F,logParams:iz}),(0,a.jsx)(eK.p,{scene:es.lT.Modal,isActive:F}),(0,a.jsx)(eO.t,{awemeInfo:O,player:null===(E=it.current)||void 0===E?void 0:E.player,isActive:F}),(0,a.jsxs)(eZ.n,{isActive:F,controlHeight:es.fp.MidHigh,position:"right",awemeInfo:O,className:(0,o._)((0,i._)({},eN),{right:u()(null==eN?void 0:eN.right,{fullscreenModal:lz})}),abtestData:q,children:[ez&&!im&&(0,a.jsx)(eq.I,{playNextFunc:Z,playPrevFunc:el,disablePrev:U&&!(eo||en)||(eo||en)&&!K,disableNext:B&&!(eo||en)||(eo||en)&&!G,className:u()(eS.default.playSwitchContainer,"filter-bg","activity"!==e$||lQ?"":eS.default.playSwitchContainerHidden)}),!im&&(y.H.newInteractionOpt(q)?(0,a.jsx)(eG.InteractionNew,{isInnerFeed:e1,canShowListenVideo:tW,playPrevFunc:el,playNextFunc:Z,listenVideoDisableNext:iR,listenVideoDisablePrev:iW,hideModalWhenPip:t0,setHideModalByPip:t1,modalClose:t3,actionFollow:eV,actionUnFollow:eF,onDouPlusClick:lO,awemeInfo:O,toggleComment:z,loginUserInfo:et,loginDispatch:ei,deleteCurrentSwiper:$,fullScreenTarget:Y,onAvatarClick:J,abtestData:q,videoToast:X,isActive:F,followHandler:ee,reportExtraParams:iz,moreBoxShowList:ea,onRelatedClick:lN,onAiCardClick:lD,canShowAvatarFollowBtn:!iE,canShowAvatarTip:!iE,showMusicDetail:!(0,eu.gc)(O),avatarTipText:lM,onDislike:lV,isShowAiCard:ie,recommendTriggered:null==tF?void 0:tF.recommended,showRecommendToFriend:!!tF,isSearchPlayer:"general_search"===e$,from:[c.a.GeneralSearch,c.a.Search].includes(e$)?"search":void 0}):(0,a.jsx)(eG.Interaction,{isInnerFeed:e1,canShowListenVideo:tW,playPrevFunc:el,playNextFunc:Z,listenVideoDisableNext:iR,listenVideoDisablePrev:iW,hideModalWhenPip:t0,setHideModalByPip:t1,modalClose:t3,actionFollow:eV,actionUnFollow:eF,onDouPlusClick:lO,awemeInfo:O,toggleComment:z,loginUserInfo:et,loginDispatch:ei,deleteCurrentSwiper:$,fullScreenTarget:Y,onAvatarClick:J,abtestData:q,videoToast:X,isActive:F,followHandler:ee,reportExtraParams:iz,moreBoxShowList:ea,onRelatedClick:lN,onAiCardClick:lD,canShowAvatarFollowBtn:!iE,canShowAvatarTip:!iE,showMusicDetail:!(0,eu.gc)(O),avatarTipText:lM,onDislike:lV,isShowAiCard:ie,recommendTriggered:null==tF?void 0:tF.recommended,showRecommendToFriend:!!tF,isSearchPlayer:"general_search"===e$,from:[c.a.GeneralSearch,c.a.Search].includes(e$)?"search":void 0}))]}),(0,a.jsx)(eQ,{awemeInfo:O,isActive:F,modalEnterFrom:e$}),!(0,eC.B)(O)&&(0,a.jsx)(eX._,{awemeInfo:O,isActive:F,controlHeight:es.fp.MidHigh,showImg:!(0,_.G6)(),abtestData:q}),(null==O?void 0:null===(j=O.video)||void 0===j?void 0:j.duration)>18e4&&(0,a.jsx)(e0.S,{awemeInfo:O,isActive:F,isLogin:null==et?void 0:et.isLogin,startTime:lX?l0:0,isClientMiniWin:im}),e$===c.a.UserWatchLater&&(0,a.jsx)(e4,{awemeInfo:O,isActive:F,isLogin:null==et?void 0:et.isLogin,startTime:l0,isClientMiniWin:im}),(null==q?void 0:q.jxWatchLaterPip)&&(0,a.jsx)(e6,{awemeInfo:O,isActive:F,isLogin:null==et?void 0:et.isLogin,startTime:l0,modalEnterFrom:e$}),iw&&(0,a.jsx)(eR._,{isActive:F,awemeInfo:O,abtestData:q,hideModalWhenPip:t0,setHideModalByPip:t1,modalClose:t3,isReusePlayer:(null==q?void 0:q.reuseVideoDiscover)&&iH,logParams:iz,modalEnterFrom:e$}),(0,a.jsx)(e7.V,{awemeInfo:O,isActive:F}),(null==O?void 0:null===(T=O.chargeInfo)||void 0===T?void 0:T.is_charge_content)&&(0,a.jsx)(le.V,{awemeInfo:O,isActive:F,isMiniWin:i_,isShowReplay:!i_}),eA?(0,a.jsx)(ll.r,{}):(0,a.jsxs)(a.Fragment,{children:[e1||iy||i1?null:(0,a.jsx)(lt.kL,{isActive:F,awemeInfo:O,playNextFunc:Z,customLocalStorage:[c.a.Search,c.a.GeneralSearch].includes(e$)?em.LocalStorageKeys.SearchHorizontalAutoPlay:void 0,ablePlayNext:!(B&&!(eo||en)||(eo||en)&&!G),shortcutDisabled:!1,abtestData:q,defaultVal:1}),!e1||iy||i1?null:(0,a.jsx)(li.Ot,{isActive:F,awemeInfo:O,playPrevFunc:el,playNextFunc:Z,ablePlayPrev:!((eo||en)&&!K),ablePlayNext:!((eo||en)&&!G),abtestData:q})]}),!iy&&(0,a.jsx)(lo.SD,{isActive:F,awemeInfo:O,abtestData:q,isInnerFeed:e1,scene:es.lT.Modal}),(0,a.jsx)(ln.SE,{isActive:F,awemeInfo:O,abtestData:q}),(0,a.jsx)(tU,{isInitPlayer:iM,config:ik}),(0,a.jsx)(la.k,{isActive:F,onVolumeShortCutChange:()=>{var e;(0,tm.t)(null===(e=it.current)||void 0===e?void 0:e.player)}}),(0,a.jsx)(lr.g,{isActive:F,abtestData:q,awemeInfo:O,scene:"modal"}),(0,a.jsx)(ld.b,{isActive:F}),!(0,tf.GP)(O)&&(y.H.baseOpt(q)?(0,a.jsx)(ls.Z,{awemeInfo:O,userInfo:et,isActive:F,logParams:iz,isFirst:U,isNext:W,isPrev:R,abtestData:q}):(0,a.jsx)(ls.Z,{awemeInfo:O,userInfo:et,isActive:F,logParams:iz,isFirst:U,isNext:W,isPrev:R,abtestData:q})),(0,a.jsx)(lu.L,{awemeInfo:O,isActive:F,abtestData:q}),(0,a.jsx)(lc.E,{isActive:F,awemeInfo:O,abtestData:q,userInfo:et,deleteCurrentSwiper:$,config:ik,isNext:W,currentIndex:l$,reuseConfig:l9,startTime:lX?l0:0}),(0,a.jsx)(lv.h,{isActive:F}),(0,a.jsx)(lm.P,{isActive:F,awemeInfo:O,abtestData:q,userInfo:et,enablePip:iw}),i_?null:(0,a.jsx)(lf.t,{isInnerFeed:e1,isModalVideo:!0,modalEnterFrom:e$,isActive:F,userInfo:et,dispatch:ei,abtestData:q,awemeInfo:O,player:null==it?void 0:null===(A=it.current)||void 0===A?void 0:A.player,isClientMiniWin:im}),lJ?(0,a.jsx)(tA._q,{isActive:F,awemeInfo:O,isShowGuide:lK,abtestData:q}):(0,a.jsx)(lp.x,{isActive:F,awemeInfo:O,abtestData:q,isShowGuide:lK,scene:"recommend"}),iI&&e$!==c.a.UserWatchLater&&(0,a.jsx)(lg.vq,{isActive:F,awemeInfo:O,isLogin:null==et?void 0:et.isLogin,loginDispatch:ei,userInfo:null==et?void 0:et.info,toast:X,logParams:iz,abtest:q}),iL&&(0,a.jsx)(lh.FeedbackAd,{awemeInfo:O,toast:X,deleteCurrentSwiper:$,abtestData:q}),(0,a.jsx)(l_.o,{isActive:F,awemeInfo:O}),(null==O?void 0:O.awemeType)===H.e.Note?(0,a.jsx)(lw.PictureMode,{isActive:F,awemeInfo:O,logParams:iz,playNextFunc:Z,abTestData:q,ablePlayNext:!(B&&!(eo||en)||(eo||en)&&!G),playPrevFunc:el,ablePlayPrev:!(U&&!(eo||en)||(eo||en)&&!K),isClientMiniWin:im,isShowSideBar:e5,onPlayFinish:iT}):null,(0,a.jsx)(ly.q,{isActive:F,abtestData:q,awemeInfo:O,isInnerFeed:e1,scene:es.lT.Modal,getAwemeInfoList:tX}),iL&&(0,a.jsx)(lI.K,{awemeInfo:O,isActive:F}),(0,a.jsx)(lx.PlayBackSetting,{disable:iL,isActive:F,awemeInfo:O,logParams:iz,loginBlock:!(null==et?void 0:et.isLogin)&&!io,loginDispatch:ei,speedType:(0,_.G6)()?ef.$.Safari:ef.$.Normal}),eT,!im||iN?(0,a.jsx)(lC.I,{isActive:F,fullScreenTarget:Y,loginDispatch:ei,abtestData:q,isLogin:!!(null==et?void 0:et.isLogin)}):null,!i_&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(lP.Danmaku,{isActive:F,awemeInfo:O,userInfo:et,loginDispatch:ei,danmakuInfo:null==eD?void 0:eD.danmakuInfo,abtestData:q,isDanmuIcon:ix}),(0,a.jsx)(lS.e,{isActive:F,awemeInfo:O,abtestData:q,aiNoteProps:t9,isAiNoteIcon:iS}),is?(0,a.jsx)(lb.WC,{isActive:F,awemeInfo:O,userInfo:et,loginDispatch:ei,abtestData:q,isChapterIcon:iC,chapterProps:l1,logParams:iz,chapterMaxWidth:iP}):null,ip&&e$!==c.a.WatchLaterPip&&(0,a.jsx)(tT.zm,{isActive:F,awemeInfo:O,isInnerFeed:e1,abtestData:q}),eJ&&(0,a.jsx)(lk.Vw,{awemeInfo:O,isShowGuide:eY,logParams:iz,isActive:F,defaultIsPageFullScreen:lA,modalEnterFrom:e$,abtestData:q}),(0,a.jsxs)(lL.r,{isActive:F,controlHeight:es.fp.MidHigh,position:"bottom",awemeInfo:O,abtestData:q,style:iu,children:[iF&&!(null==tF?void 0:tF.recommendTagType)&&(0,a.jsx)(tG.n,{scene:"player",awemeInfo:O}),(0,a.jsx)(tY.s,{awemeInfo:O,isActive:F,userInfo:et,loginDispatch:ei}),!(0,tZ.$m)(O)&&(null==tF?void 0:tF.recommendTagType)&&!(null==tF?void 0:tF.isShowVideoInfoSideCard)&&(0,a.jsx)(tK.B,(0,i._)({userInfo:et,awemeInfo:O,player:ig||(null==it?void 0:null===(N=it.current)||void 0===N?void 0:N.player),abTestData:q},tF)),iD.length>0&&(0,a.jsx)(tO.E,{awemeInfo:O,anchorList:iD,openActivityCard:lW,abtestData:q,activityCardDirectOpen:lF}),(0,ep._Q)(O,q)&&(0,a.jsx)(eU.k,{awemeInfo:O,onClick:lU,isActive:F}),ii&&(0,eg.n)(O)&&!(0,eh.o4)(O)&&e$!==c.a.RecommendUpdateWindow&&(0,a.jsx)(lE.n,{awemeInfo:O,onClick:lR,isActive:F,onMouseEnter:lB,onMouseLeave:lH}),(0,e_.A)(O)&&(0,a.jsx)(lj.X,{isActive:F,awemeInfo:O,isHide:t4}),(0,eh.o4)(O)&&(0,eu.Gu)(O)&&(0,a.jsx)(lT.b,{isHide:t2,isActive:F,awemeInfo:O}),(0,eh.o4)(O)&&!(0,eu.Gu)(O)&&(0,a.jsx)(tp.A,{isActive:F,awemeInfo:O}),iQ&&iX&&(0,a.jsx)(l4,{awemeInfo:O,isHide:t4,isActive:F,onAfterOpenGame:i0}),y.H.newVideoInfo(q)?(0,a.jsx)(l2.VideoInfoNew,{isInnerFeed:e1,isActive:F,awemeInfo:O,userInfo:et,scene:es.lT.Modal,isTopicLinkSearchResult:!0,videoHashtagClassName:er,modalEnterFrom:e$,videoTags:e$===c.a.RecommendUpdateWindow?[]:eb,abTestData:q,isShowCreateTime:!0,onCooperationAuthorClick:e3,isShowCooperation:e9,showSideBar:e5,loginUserInfo:et,loginDispatch:ei,fullScreenTarget:Y,reportExtraParams:iz,openSpecificTab:lq,onSodaClick:lG,canMixListen:!lZ&&e$!==c.a.RecommendUpdateWindow&&!e1,chapterProps:l1,sideCardContext:il,showExpandButtonInner:!0}):(0,a.jsx)(l2.VideoInfo,{isInnerFeed:e1,isActive:F,awemeInfo:O,userInfo:et,scene:es.lT.Modal,isTopicLinkSearchResult:!0,videoHashtagClassName:er,modalEnterFrom:e$,videoTags:e$===c.a.RecommendUpdateWindow?[]:eb,abTestData:q,isShowCreateTime:!0,onCooperationAuthorClick:e3,isShowCooperation:e9,showSideBar:e5,loginUserInfo:et,loginDispatch:ei,fullScreenTarget:Y,reportExtraParams:iz,openSpecificTab:lq,onSodaClick:lG,canMixListen:!lZ&&e$!==c.a.RecommendUpdateWindow&&!e1,chapterProps:l1,sideCardContext:il,showExpandButtonInner:!0}),iQ&&!iX?(0,a.jsx)(l4,{awemeInfo:O,className:eS.default.feedVideoGameAdBelowTitle,isHide:t4,isActive:F,onAfterOpenGame:i0}):null,e$===c.a.WaterFall?(0,a.jsx)(l5.H,{isActive:F,isAdAweme:iL,awemeInfo:O,abtestData:q,toast:X,playNextFunc:Z}):null,!!O.videoAbstract&&e$===c.a.GeneralSearch&&!e1&&(0,a.jsx)(l8.y,{awemeInfo:O,isActive:F,showVideoInfo:!0,player:null===(D=it.current)||void 0===D?void 0:D.player,logParams:iz,isModal:!0,openSpecificTab:lq})]}),(0,a.jsx)(l6.h,{awemeInfo:O,isActive:F,userInfo:et,abtestData:q}),(0,a.jsx)(l7.MenuList,{isActive:F,awemeInfo:O,abtestData:q,isSliderVideo:!0,isKeyWorkCancalLike:!0,shortcutExclude:(0,eu.Gu)(O)&&iL&&t7?[]:["showAdDetail"],shortCutFiltered:ij,showEnterDetail:!(iL&&(0,eu.Gu)(O)),showAdMenu:iL&&(0,eu.Gu)(O),disableShortCut:t6||id,disableAllNativeShortCut:t6||id,modalEnterFrom:e$,userInfo:et,showRecommendToFriend:!!tF}),(0,a.jsx)(te.B,{awemeInfo:O,abtestData:q,isActive:F}),(0,a.jsx)(tl.I,{abtestData:q,isActive:F,awemeInfo:O,logParams:iz,isChapterScene:!0}),ic?(0,a.jsx)(eB.I,{awemeInfo:O,isActive:F,abtestData:q,onShowChange:iv}):null,(null==ib?void 0:ib.length)>0&&(0,a.jsx)(tt.SettingList,{isActive:F,awemeInfo:O,hideList:ib,player:null==it?void 0:null===(V=it.current)||void 0===V?void 0:V.player,dispatch:ei,abtestData:q,userInfo:et}),(0,a.jsx)(tV.P,{abtestData:q,isActive:F,controlHeight:es.fp.MidHigh})]}),io&&e$!==c.a.WatchLaterPip&&(0,a.jsx)(eH.U,{awemeInfo:O}),im&&(0,a.jsxs)(a.Fragment,{children:[F&&(0,a.jsx)(ti.MiniWinMask,{isActive:F,awemeInfo:O,abtestData:q,playPrevFunc:el,playNextFunc:Z,disablePrev:U&&!(eo||en)||(eo||en)&&!K,disableNext:B&&!(eo||en)||(eo||en)&&!G,ablePlayNext:!(B&&!(eo||en)||(eo||en)&&!G),loginUserInfo:et,loginDispatch:ei,fullScreenTarget:Y,reportExtraParams:iz,recordPreferVideoSwitch:!0}),F&&!iN&&(0,a.jsx)(to.N,{awemeInfo:O})]}),"general_search"===e$&&(0,a.jsx)(tn.l,{awemeInfo:O,from:"modal_player",isActive:F,isUpperFeed:lQ}),e$===c.a.Activity&&(0,a.jsx)(tz.I,{awemeInfo:O,from:"modal_player",isActive:F,isUpperFeed:lQ})]})}));var tX=t("289137");let t0=()=>{let e=(0,r.useRef)({});return{recordLatestAwemeId:(0,r.useCallback)((l,t)=>{l&&t&&!e.current[t]&&(e.current[t]=!0,g.Le.setConfig(g.gI.FeedLatestViewedAweme,{awemeId:t}))},[])}};var t1=t("160843"),t3=t("359141"),t9=t("538220"),t4=t("624508");let t2=new t4.h({closePlayer:{eventName:"close_player",params:{enter_from:"",tab_name:"",click_method:""}},clickPreviousVideo:{eventName:"click_previous_video",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:"",click_from:"click_button",play_material:"video"}},clickNextVideo:{eventName:"click_next_video",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:"",click_from:"click_button",play_material:"video"}},modalNextVideoUnready:{eventName:"modal_next_video_unready",params:{error:"",enter_from:"",group_id:"",log_pb:""}},modalNextVideoView:{eventName:"modal_next_video_view",params:{index:0,success:!0,error:"",enter_from:"",group_id:"",log_pb:""}},clickSmallWindowEntrance:{eventName:"click_small_window_entrance",params:{enter_from:"",click_method:"",is_manual:"0",group_id:"",player_display_mode:""}}}),t5=e=>{let{awemeInfo:l,refPlayer:t,hideModalByPipInitial:o=!1,setHideModalByPipInitial:n,modalEnterFrom:a,logParams:d}=e,s=(0,M.Iq)(e=>{let{pipWindow:l}=e;return{pipWindow:l}}),[u,m]=(0,r.useState)(o),f=function(){var e,l,o,n,r,u;let{scene:v="auto",awemeId:m}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{scene:"auto"};if(a===c.a.WaterFall){if(t2.sendLog("clickSmallWindowEntrance",(0,i._)({enter_from:(0,lN.vM)(),click_method:v,is_manual:"auto"===v?"0":"1",player_display_mode:(0,lN.Ok)(),group_id:m},d)),"auto"===v){let i=null==t?void 0:null===(e=t.current)||void 0===e?void 0:e.getPlayer(),{pipWindow:n}=s;null==i||null===(o=i.plugins)||void 0===o||null===(l=o.pip)||void 0===l||l.requestPIP(n)}}else if(a===c.a.WatchLaterPip&&"keyboard_u"===v){let e=null==t?void 0:null===(n=t.current)||void 0===n?void 0:n.getPlayer(),{pipWindow:l}=s;null==e||null===(u=e.plugins)||void 0===u||null===(r=u.pip)||void 0===r||r.requestPIP(l)}};return(0,r.useEffect)(()=>{o&&u&&(f({scene:"click_preview_icon",awemeId:null==l?void 0:l.awemeId}),null==n||n(!1))},[o,n]),(0,r.useEffect)(()=>h.listen(h.EVENT.openWebMinWinInPlayer,e=>{let{scene:l}=e;f({scene:l}),null==n||n(!1)}),[]),(0,r.useEffect)(()=>()=>{s.pipWindow&&u&&s.pipWindow.close();let e=tq.e.getPipWindow({scene:v.d.ListenVideo});e&&u&&e.close()},[]),{hideModalByPip:u,setHideModalByPip:m}};var t8=t("59850");let t6=e=>{let{logParams:l,awemeInfoList:t,currentNumber:n,modalInnerFeedCard:a,awemeInfoListRef:d,onLivePause:s,modalEnterFrom:u,close:c,isInnerFeed:v}=e,{awemeFeed:m}=(0,el.j)(),f=(0,r.useMemo)(()=>null==t?void 0:t[n],[t,n]),p=(0,r.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];v&&!a?(m.dispatch({modalAwemeInfo:null,nextAwemeInfo:null,prevAwemeInfo:null}),t2.sendLog("closePlayer",(0,o._)((0,i._)({},l,e,(null==f?void 0:f.logParams)||{}),{enter_from:m.getValue("feedType")})),t&&c(n)):(c(n),t2.sendLog("closePlayer",(0,i._)({},l,e,(null==f?void 0:f.logParams)||{})))},[c,f,n,l,v]),g=(0,t8.Z)(()=>{m.dispatch("cardType",null),t2.sendLog("closePlayer",(0,o._)((0,i._)({},l,(null==f?void 0:f.logParams)||{}),{enter_from:m.getValue("feedType"),click_method:"button"})),m.dispatch("modalAwemeInfo",null),a&&(null==c||c())}),_=(0,t8.Z)(e=>{var l,t,i;if(null==e||null===(l=e.preventDefault)||void 0===l||l.call(e),null==e||null===(t=e.stopPropagation)||void 0===t||t.call(e),null==s||s(null===(i=d.current)||void 0===i?void 0:i[n]),(null==e?void 0:e.triggerFrom)!=="ai_search"&&(null==e?void 0:e.triggerFrom)!=="ai_extension"&&(null==e?void 0:e.triggerFrom)!=="activity"||u===(null==e?void 0:e.triggerFrom))p({click_method:"button"},!0)});return(0,r.useEffect)(()=>{let e=h.listen(h.EVENT.triggerModalPlayerClose,_),l=h.listen(h.EVENT.triggerModalPlayerCloseForCachePages,_);return()=>{e(),l()}},[_]),{closeModal:p,onBack:_,onBackWithInnerMode:g}},t7=e=>{let{disableSwitch:l,modalEnterFrom:t,recommendGuideVisible:o,handleCloseGuide:n,setCurrentNumber:a,awemeInfoListRef:d,abtestData:s,logParams:u,modalSlideOptimize:v,swiper:m,setIsFirstEnterVideo:f,closeWhenUp:p}=e,h=(0,r.useRef)(()=>{}),_=(0,r.useRef)(()=>{t!==c.a.WatchLaterPip&&(t2.sendLog("modalNextVideoUnready",(0,i._)({error:"正在加载下一个视频"},u)),W.F.info("正在加载下一个视频"))}),w=(0,r.useCallback)(e=>{if(l)return;let{from:r="click_button",triggerFrom:c}=e||{};if("ai_search"!==c&&"ai_extension"!==c&&"activity"!==c||t===c)o&&n({scroll:"mouse",keyboard:"keyboard",click_button:"next_video_button"}[r]),"auto"===r&&(0,g.Vv)(A.CJ.auto),a(e=>{let l=!0,t=e;if(e<d.current.length-1)l=!0,t=e+1;else if("aiNote"===c)l=!1,W.F.info("已经是最后一个视频了"),t=e;else{var o,n;l=!1,(null==s?void 0:s.discoverOptimize)?!!document.querySelector("#toastContainer")||null===(o=_.current)||void 0===o||o.call(_):null===(n=_.current)||void 0===n||n.call(_),t=e}return t2.sendLog("modalNextVideoView",(0,i._)({error:l?"":"正在加载下一个视频",index:e+1,success:l},u)),v&&(null==m||m.slideTo(t)),t}),f(!1)},[l,o,m,v]),y=(0,r.useCallback)(e=>{if(l)return;let{from:i="click_button",triggerFrom:r}=e||{};if("ai_search"!==r&&"ai_extension"!==r&&"activity"!==r||t===r)o&&p&&n({scroll:"mouse",keyboard:"keyboard",click_button:"last_video_button"}[i]),a(e=>{var l;if(e>0)return v&&(null==m||m.slideTo(e-1)),e-1;return null===(l=h.current)||void 0===l||l.call(h),v&&(null==m||m.slideTo(e)),e}),f(!1)},[l,o,p,m,v]);return{refPrevVideoCallBack:h,refNextVideoCallBack:_,playNextFunc:w,playPrevFunc:y}};t("527553"),t("240148");let ie="modal-video-0",il=()=>{let e=parseInt(ie.match(/\d+$/)[0]);e++,ie=ie.replace(/\d+$/,e)},it=()=>{let e=parseInt(ie.match(/\d+$/)[0]);e--,ie=ie.replace(/\d+$/,e)},ii=()=>({refDepth:(0,r.useRef)(ie)});var io=t("661444"),ia=t("265886"),ir=t("138899");let id=e=>{let{abtestData:l,swiper:t,currentNumber:i,awemeInfoList:o}=e,n=(0,r.useMemo)(()=>{if((0,io.En)()){var e;return null===(e=(0,ia.P)(l))||void 0===e?void 0:e.preloadCount}let t={};return((null==l?void 0:l.preloadCountApplySideServer)==="both"||isInClient()&&(null==l?void 0:l.preloadCountApplySideServer)==="client"||!isInClient()&&(null==l?void 0:l.preloadCountApplySideServer)==="web")&&(t=null==l?void 0:l.preloadCountServer),Object.assign({},null==l?void 0:l.preloadCount,t)},[l,t]);(0,r.useLayoutEffect)(()=>{(()=>{if(null==n?void 0:n.open){var e;let t=(null==n?void 0:n.count)||3;if(null==l?void 0:null===(e=l.preloadStartBuffer)||void 0===e?void 0:e.notifyV2){let e=o.slice(i+2),l=(0,ir.$8)(e).slice(0,t);g.Le.setConfig(g.gI.PreloadList,l),h.emit(h.EVENT.promotePreload)}else{let e=o.slice(i+1).filter(e=>(null==e?void 0:e.awemeType)===H.e.Normal&&!(0,tf.Ni)(e)).slice(0,t);g.Le.setConfig(g.gI.PreloadList,e)}}else{let e=o.slice(i+1,i+4).filter(e=>!(0,tf.Ni)(e));g.Le.setConfig(g.gI.PreloadList,e)}})()},[l,i,o])};var is=t("295613"),iu=t("265018");let ic=e=>{let{refPlayer:l,swiper:t,setAwemeInfoList:i,awemeInfoList:o,scrollRef:n,isInnerFeed:a}=e,d=(0,r.useRef)(""),[s,u]=(0,r.useState)(!1);return(0,is.g)({swiper:t,setAwemeInfoList:i,awemeInfoList:o,refMixPlayer:l,scrollRef:n,isInnerFeed:a}),(0,iu.Z)({refMixPlayer:l,changeMinWinCb:e=>{e&&(d.current=document.body.style.minWidth),document.body.style.minWidth=e?"auto":d.current,document.body.style.overflow=e?"hidden":"",u(e)}}),{isClientMiniWin:s}},iv=e=>{let{swiper:l,modalSlideOptimize:t,currentNumber:i,setCurrentNumber:o}=e;(0,r.useEffect)(()=>{l&&(t||l.slideTo(i))},[l,i,t]),(0,r.useEffect)(()=>{if(l){let e=null==l?void 0:l.activeIndex,t=t=>{o(null==l?void 0:l.activeIndex),(null==t?void 0:t.from)==="drag"&&h.emit((null==l?void 0:l.activeIndex)-e>0?h.EVENT.reportPlayNext:h.EVENT.reportPlayPrev,{clickFrom:"drag"}),e=null==l?void 0:l.activeIndex};return l.on("slideChange",t),()=>{l.off("slideChange",t)}}},[l])};t("14275");var im=t("391302");let ip=["search_multi_modal","waterFall","hot",/^channel/,/^music/,"favorite_collection","like","post","record","watch_later"],ig=e=>{var l,t,i,o,n,a,r,d,s,u,v,m;let{scene:f,awemeInfoList:p,currentNumber:h,originAwemeInfo:_,modalAwemeInfo:w,isSelf:y}=e,x=null!==(l=p[h])&&void 0!==l?l:_,C=null==x?void 0:x.awemeId,P=g.Le.getConfig(g.gI.ModalStartTime)||{};if(f===c.a.WatchLaterPip){let e=(g.Le.getConfig(g.gI.WatchLaterPipContinueProgressRecord)||{})[C],l=Math.floor((null==x?void 0:null===(t=x.playProgress)||void 0===t?void 0:t.play_progress)/1e3),o=Math.floor((null==x?void 0:null===(i=x.video)||void 0===i?void 0:i.duration)/1e3);return{time:o-l<=1?0:null!=e?e:l,isRevisitStart:!1}}if(P[C]){let e=P[C];return!(0,I.N)()&&(delete P[C],g.Le.setConfig(g.gI.ModalStartTime,P)),{time:e,isRevisitStart:!1}}if(!(ip.findIndex(e=>{var l;return e===f||(null==e?void 0:null===(l=e.test)||void 0===l?void 0:l.call(e,f))})>=0))return{time:void 0,isRevisitStart:!1};let S="watch_later"===f,b=g.Le.getConfig(g.gI.PreviewPlayInfoRecord);if((0,im.sF)()){let e=new URL(location.href).searchParams;e&&e.get("modal_id")&&(b={awemeId:e.get("modal_id"),recordPlayTime:Number(e.get("start_time"))/1e3})}let k=(null==b?void 0:b.awemeId)===(null==x?void 0:x.awemeId)?null==b?void 0:b.recordPlayTime:void 0,L=(null==x?void 0:x.awemeId)===(null==_?void 0:_.awemeId);if(S&&L&&!k){let{store:e}=null!==(d=g.Le.getConfig(g.gI.WatchLater))&&void 0!==d?d:{},l=(null==e?void 0:null===(o=e[null==x?void 0:x.awemeId])||void 0===o?void 0:o.loop)>0||(null==x?void 0:null===(n=x.playProgress)||void 0===n?void 0:n.watch_times)>0,t=null!==(u=null!==(s=null==e?void 0:null===(a=e[null==x?void 0:x.awemeId])||void 0===a?void 0:a.progress)&&void 0!==s?s:null==x?void 0:null===(r=x.playProgress)||void 0===r?void 0:r.play_progress)&&void 0!==u?u:0;return l||!t?{time:0,isRevisitStart:!1}:{time:Math.floor(t/1e3),isRevisitStart:!1}}if(["favorite_collection","like","record"].includes(f)&&L&&y){if((null==w?void 0:null===(v=w.playProgress)||void 0===v?void 0:v.play_progress)<=0)return{time:0,isRevisitStart:!1};let e=Math.max(Math.floor((null==w?void 0:null===(m=w.playProgress)||void 0===m?void 0:m.play_progress)/1e3)-2,1);return{time:k>=e?k:e,isRevisitStart:!0}}return{time:k,isRevisitStart:!1}};var ih=t("537694"),i_=t("709705"),iw=t("356336");let iy=e=>{let{modalEnterFrom:l,abtestData:t}=e,n=l===c.a.WaterFall||l===c.a.ShareModal&&"discover"===(0,eD.yW)(),a=n&&(t.jxAskAiDefaultOpen===iw.JxAskAiDefaultOpen.V1||t.jxAskAiDefaultOpen===iw.JxAskAiDefaultOpen.V2),d=n&&t.jxAskAiDefaultOpen===iw.JxAskAiDefaultOpen.V1,[s,u]=(0,r.useState)(!1),[v,m]=(0,r.useState)(!1),[f,p]=(0,r.useState)(!1),g=(0,r.useRef)(!1),h=(0,r.useCallback)(e=>{g.current=e},[]),_=(0,r.useCallback)(e=>{u(e),(0,i_.qQ)(em.LocalStorageKeys.AiCardIsPined,e?"1":"0")},[]);return(0,r.useEffect)(()=>{if(a){let e="1"===(0,i_.$o)(em.LocalStorageKeys.AiCardIsPined);u(e),m(e)}},[a]),(0,r.useEffect)(()=>{d&&(window.innerWidth>=1200&&p(!0),window.addEventListener("resize",()=>{window.innerWidth<1200&&p(!1)}))},[d]),(0,r.useMemo)(()=>(0,o._)((0,i._)({},a?{globalIsShowAiCard:v,setGlobalIsShowAiCard:m,aiCardIsPined:s,togglePinAiCard:_}:{}),{useJxSlideInheritAndPin:a,useJxDefaultOpen:d,aiCardIsDefaultOpen:f,hasDefaultShowAiCardRef:g,setHasDefaultShowAiCard:h}),[v,m,s,_,a,d,f,h])};var iI=t("666266"),ix=t("575559");let{useRecommendGuide:iC}=tX.Z,iP=e=>{var l,t,n,d,s,v;let{appendPlayerConfig:m,preloadReady:P,preloadAwemeList:b=[],userContext:k,abtestData:L,close:E,anyHooks:j,moreBoxShowList:T={notInterestingIcon:!0,unfollow:!0,report:!0,shortcutList:!1,dataAnalysis:!1,deleteSelfPost:!1},logParams:A,defaultCommentShow:R=!1,className:U,insertCommentId:H,disableSwitch:O=!1,disableAutoPlay:G=!1,originAwemeInfo:K,modalId:q,uid:$,useOldModal:z,danmakuInfo:J,defaultShowSideBar:Y,shortCutFilteredList:Q,modalEnterFrom:X="",collectFolderId:ee,collectionFolderInfo:et,isDefaultShowRelatedCard:ei,modalInnerFeedCard:eo,defaultOpenedCardType:en,defaultOpenedCardExtraProps:ea,defaultForceOpenTab:ed,activityCardDirectOpen:es,bingeInfo:eu,container:ec,isSelf:ev,scene:em,notCanMixListen:ef,searchParams:ep,mouseScrollContainer:eg,searchFrom:eh,wrapperClassName:e_,reuseConfig:ew,hideModalWhenPip:ey=!1,hideModalByPipInitial:eI=!1,setHideModalByPipInitial:ex,autoOpenPip:eC=!1,initIndex:eP=-1,scrollRef:eS}=e,{userInfo:eb}=k,{refDepth:ek}=ii(),eL=(0,r.useRef)(null),eE=(0,r.useRef)(null),ej=(0,r.useRef)(),[eT,eA]=(0,r.useState)(eP),eM=(0,r.useRef)(eT);eM.current=eT;let[eN,eD]=(0,r.useState)(!0),[eV,eF]=(0,r.useState)([]),[eW,eR]=(0,r.useState)(null),eU=(0,r.useRef)([]);eU.current=eV;let eB=(0,r.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return eU.current.slice(e?eM.current:0)},[]),{awemeFeed:eH}=(0,el.j)(),eO=eH.useValue("modalAwemeInfo",Boolean),eG=eH.useValue("innerFeedAwemeInfo"),eK=X.includes("search"),{isWebMiniWin:eZ,isListenVideoMiniWin:eq}=(0,M.Iq)(e=>{let{isWebMiniWin:l,isListenVideoMiniWin:t}=e;return{isWebMiniWin:l,isListenVideoMiniWin:t}}),[e$,ez]=(0,r.useState)(),[eY,eQ]=(0,r.useState)(!1),eX=(0,p.x)(),[e0,e1]=(0,r.useState)(K),e3=(null==L?void 0:L.discoverSlideOptimize)&&(null==A?void 0:A.enter_from)==="discover"||(null==L?void 0:L.searchSlideOptimize)&&eK,e9=iy({modalEnterFrom:X,abtestData:L}),{setAllInactiveOnModal:e4}=iI.c.getState();(0,r.useEffect)(()=>(g.Le.setConfig(g.gI.IsInModalVideo,{isInModal:!0,modalEnterFrom:X,awemeId:(null==K?void 0:K.awemeId)||""}),X===c.a.WaterFall&&(window.isInJingxuanModal=!0),g.Le.setConfig(g.gI.VideoPlayMethod,"auto"),h.emit(h.EVENT.videoPause,"ModalVideoContent_enter"),h.emit(h.EVENT.musicPause),h.emit(h.EVENT.searchMusicPause),h.emit(h.EVENT.livePause),g.Le.setConfig(g.gI.isVideoPlayed,null),h.emit(h.EVENT.enterModalVideo,ek.current),e4(X===c.a.WaterFall?null==K?void 0:K.awemeId:void 0),il(),()=>{var e;((null===(e=g.Le.getConfig(g.gI.IsInModalVideo))||void 0===e?void 0:e.modalEnterFrom)||"")===X&&(g.Le.setConfig(g.gI.IsInModalVideo,{isInModal:!1}),X===c.a.WaterFall&&(window.isInJingxuanModal=!1)),h.emit(h.EVENT.exitModalVideo,ek.current),it()}),[]),(0,r.useEffect)(()=>{(0,g.Vv)(void 0)},[q]);let e8="general_search"===X,{recommendGuideChild:e6,useNewUserSoundGuide:e7,recommendGuideVisible:le,handleCloseGuide:ll}=iC({isCanShow:X!==c.a.Im,enterFrom:"modal_video",modalEnterFrom:X,awemeInfoList:eV,className:C.default.guideCard,disableLottie:(0,_.b_)()||(0,_.Sb)(),isFullscreen:!0,closeWhenUp:e8,isCloseInGuide:!0,swiper:eW}),{playNextFunc:lt,playPrevFunc:li,refNextVideoCallBack:lo,refPrevVideoCallBack:ln}=t7({disableSwitch:O,modalEnterFrom:X,recommendGuideVisible:le,handleCloseGuide:ll,setCurrentNumber:eA,awemeInfoListRef:eU,abtestData:L,logParams:A,modalSlideOptimize:e3,swiper:eW,setIsFirstEnterVideo:eD,closeWhenUp:e8}),la=(0,r.useCallback)(()=>{var e,l,t,i;eV.length-1===eT&&(eA(eT-1),e3&&(null==eW||eW.slideTo(eT-1))),eF(e=>{var l;let t=[...e];return t.splice(eT,1),null===(l=ej.current)||void 0===l||l.call(ej,{currentNumber:eT,awemeList:t}),t}),null===(l=eL.current)||void 0===l||null===(e=l.setIsAuthorCardShow)||void 0===e||e.call(l,!1),null===(i=eL.current)||void 0===i||null===(t=i.setIsShowRelatedCard)||void 0===t||t.call(i,!1)},[eT,eV,eW,e3]);id({abtestData:L,swiper:eW,currentNumber:eT,awemeInfoList:eV});let{slideVideoTab:lr,setSlideVideoTab:ld,modalAwemeInfo:ls,setModalAwemeInfo:lu,globalIsSideBarShow:lc,setIsSideBarShowFunc:lv}=S({originAwemeInfo:null!=K?K:eV[0]}),{defaultTab:lm="",isTabFeed:lf,onLivePause:lp=()=>null,onLivePlay:lg=()=>null}=(null==j?void 0:j((0,o._)((0,i._)({},e),{delVideoCallBackRef:ej,currentNumber:eT,awemeInfoList:eV,refPrevVideoCallBack:ln,refNextVideoCallBack:lo,curTab:lr,awemeInfo:ls,setCurrentNumber:eA,setAwemeInfoList:eF,setModalAwemeInfo:lu,swiper:eW,preloadReady:P,preloadAwemeList:b,currentAwemeInfo:e0})))||{},{hideModalByPip:lh,setHideModalByPip:l_}=t5({awemeInfo:ls,refPlayer:eL,hideModalByPipInitial:eI,setHideModalByPipInitial:ex,modalEnterFrom:X,logParams:A}),{isClientMiniWin:lw}=ic({swiper:eW,setAwemeInfoList:eF,awemeInfoList:eV,refPlayer:eL,scrollRef:eS,isInnerFeed:eO}),{closeModal:ly,onBack:lI,onBackWithInnerMode:lx}=t6({logParams:A,awemeInfoList:eV,currentNumber:eT,modalInnerFeedCard:eo,awemeInfoListRef:eU,onLivePause:lp,modalEnterFrom:X,close:E,isInnerFeed:eO});N({abtestData:L,container:eg||ec,closeModal:ly,isClientMiniWin:lw,modalEnterFrom:X}),(0,r.useEffect)(()=>{let e=location.pathname,l=(0,eJ.OB)();return l&&(0,eJ.wS)(l,!1),()=>{l&&e===location.pathname&&(0,eJ.wS)(l,!0),w.p.postTask({priority:"background",task:()=>h.emit(h.EVENT.syncInteraction)})}},[]);let{asrState:lC}=B({awemeInfoListRef:eU,userInfo:eb,currentNumber:eT});iv({swiper:eW,modalSlideOptimize:e3,currentNumber:eT,setCurrentNumber:eA});let lP=D({currentNumber:eT}),{recordLatestAwemeId:lS}=t0(),{isRevisitStart:lb,time:lk}=(0,r.useMemo)(()=>ig({scene:em,awemeInfoList:eV,currentNumber:eT,originAwemeInfo:K,modalAwemeInfo:ls,isSelf:ev}),[em,eV,eT,K,ls,ev]),lL=(0,r.useMemo)(()=>{var e,l,t,n,a;return{insertCommentId:eN?H:void 0,userContext:k,abtestData:L,logParams:(0,o._)((0,i._)({},A),{is_modal_first_enter:lP?"1":"0",is_auto_show_ask_ai:(null==e9?void 0:e9.aiCardIsPined)||(null==e9?void 0:e9.aiCardIsDefaultOpen)?"1":"0"}),showTopicAndMusicCard:!1,showMixCard:!1,showMixCardEntry:!1,showHotCard:!!((null===(e=eV[eT])||void 0===e?void 0:e.hotList)&&(null===(t=eV[eT])||void 0===t?void 0:null===(l=t.hotList)||void 0===l?void 0:l.rank)!==51&&(null===(a=eV[eT])||void 0===a?void 0:null===(n=a.hotList)||void 0===n?void 0:n.type)!==2),tab:"modal",useOldModal:z,danmakuInfo:J}},[eN,H,k,L,A,eT,z,J,e9,lP]),lE=(0,r.useMemo)(()=>{var e;return(0,o._)((0,i._)({},T),{shortcutList:!0,notInterestingIcon:!!lf||T.notInterestingIcon,dataAnalysis:(null==T?void 0:T.dataAnalysis)&&(null==K?void 0:K.authorUserId)===(null===(e=eV[eT])||void 0===e?void 0:e.authorUserId),deleteSelfPost:null==T?void 0:T.deleteSelfPost,asrState:lC})},[T,lf,K,eV,eT,lC]),lj=(0,r.useMemo)(()=>e=>W.F.info(e,void 0,1e3),[]),lT=(0,a.jsx)(Z,{appendPlayerConfig:m,activityCardDirectOpen:es,close:lI,fullScreenTarget:ec,deleteCurrentSwiper:la,moreBoxShowList:y.H.baseOpt(L)?lE:(0,o._)((0,i._)({},T),{shortcutList:!0,notInterestingIcon:!!lf||T.notInterestingIcon,dataAnalysis:(null==T?void 0:T.dataAnalysis)&&(null==K?void 0:K.authorUserId)===(null===(l=eV[eT])||void 0===l?void 0:l.authorUserId),deleteSelfPost:null==T?void 0:T.deleteSelfPost,asrState:lC}),modalEnterFrom:X,modalInnerFeedCard:eo,defaultOpenedCardType:en,defaultOpenedCardExtraProps:ea,swiper:h.commonEvent,videoToast:y.H.baseOpt(L)?lj:e=>W.F.info(e,void 0,1e3),item:eV[eT],playNextFunc:lt,playPrevFunc:li,getAwemeInfoList:eB,defaultCommentShow:R,InnerPlayer:tQ,disableAutoPlay:G,relatedDefaultTab:lm,originAwemeInfo:null!=K?K:eV[0],modalId:q,defaultShowSideBar:Y,setModalAwemeInfo:lu,customProps:y.H.baseOpt(L)?lL:{insertCommentId:eN?H:void 0,userContext:k,abtestData:L,logParams:(0,o._)((0,i._)({},A),{is_modal_first_enter:lP?"1":"0",is_auto_show_ask_ai:(null==e9?void 0:e9.aiCardIsPined)||(null==e9?void 0:e9.aiCardIsDefaultOpen)?"1":"0"}),showTopicAndMusicCard:!1,showMixCard:!1,showMixCardEntry:!1,showHotCard:!!((null===(t=eV[eT])||void 0===t?void 0:t.hotList)&&(null===(d=eV[eT])||void 0===d?void 0:null===(n=d.hotList)||void 0===n?void 0:n.rank)!==51&&(null===(v=eV[eT])||void 0===v?void 0:null===(s=v.hotList)||void 0===s?void 0:s.type)!==2),tab:"modal",useOldModal:z,danmakuInfo:J},ref:eL,shortCutFilteredList:Q,collectFolderId:ee,collectionFolderInfo:et,isDefaultShowRelatedCard:ei,defaultForceOpenTab:ed,bingeInfo:eu,isClientMiniWin:lw,notCanMixListen:ef,startTime:lk,onLivePause:lp,onLivePlay:lg,searchFrom:eh,isShowGuide:le,useNewUserSoundGuide:e7,isRevisitStart:lb,onAwemeInfoChange:e3?null:e1,reuseConfig:ew,scrollRef:eS,hideModalWhenPip:ey,setHideModalByPip:l_,modalClose:E}),lA=em?`dy-modal-video-container-${em}`:void 0;(0,r.useEffect)(()=>{if(X===c.a.WatchLaterPip&&eZ){ix.J.closeWindow();let e=Date.now(),l=(0,e2.B)();return e5.Z.report("watch_later_add_window_enter",l),()=>{e5.Z.report("watch_later_add_window_exit",(0,o._)((0,i._)({},l),{duration:Date.now()-e}))}}},[eZ,X]);let lM=(0,I.N)();return(0,a.jsxs)(f.C.Provider,{value:(0,i._)({userId:$,slideVideoTab:lr,setSlideVideoTab:ld,setModalAwemeInfo:lu,awemeInfoList:eV,globalIsSideBarShow:lc,setIsSideBarShowFunc:lv,isCssFullScreen:!0,isSelf:ev,collectionFolderInfo:et,isClientMiniWin:lw,globalIsCommentTrayPushGuideShow:e$,setIsCommentTrayPushGuideShowFunc:ez,globalCommentTrayPushGuideType:eY,setCommentTrayPushGuideTypeFunc:eQ},e9),children:[(0,a.jsxs)("div",{className:u()(e_,{[C.default.pipHide]:lh}),children:[(0,a.jsx)(er,{containerId:lA,close:E,autoOpenPip:eC,isInnerFeed:eO,modalInnerFeedCard:eo,isClientMiniWin:lw,refPlayer:eL,onBack:lI,onBackWithInnerMode:lx,abtestData:L,awemeInfoList:eV,currentNumber:eT,modalEnterFrom:X,isSelf:ev,userInfo:eb,logParams:A,searchParams:ep,slideVideoTab:lr,currentAwemeInfo:eO?eG:null==eV?void 0:eV[eT],fullScreenTarget:ec}),!lw&&e6,(0,a.jsx)("div",{id:"upperFeedContainer",className:u()(C.default.moreIndex,{[C.default.isClientMiniWin]:lw,searchUpperFeedContainer:eK})}),(0,a.jsx)(V.k,{componentName:"ModalVideoContent",children:(0,a.jsxs)("div",{id:lA,className:u()(C.default.modalVideo,U,"modal-video-container",{[C.default.isLoading]:!eV[eT],[C.default.modalSlider]:"search"===X,[C.default.isWebMiniWin]:eZ||eq,isMiniWindow:lw,isMiniWindowOptimize:lw&&eX,miniWindowFromGameWidget:lw&&lM}),"data-e2e":"modal-video-container",children:[eV[eT]?(0,a.jsx)(t3.ZP,{onSwiper:eR,abTestData:L,cardBetween:0,nextSwiperHeaderHeight:0,upperSpace:0,data:eV,scene:t9.R5.Modal,defaultCssFullScreen:!0,initIndex:eT,useWheelListener:!1,collectionFolderInfo:et,globalAiCardValue:e9,children:(0,a.jsx)(t1.o,{"data-e2e":"feed-item",className:u()(C.default.swiperItem),slot:t9.t6.INSIDE,children:e=>{let{slideData:l,activeIndex:t,currentIndex:i}=e;if(!(1>=Math.abs(t-i)))return null;{let e=t===i;return lS(e,null==l?void 0:l.awemeId),(0,r.cloneElement)(lT,{isActive:e,isFirst:0===i,isNext:t+1===i,isPrev:t-1===i,isLast:i===eV.length-1,index:i,isClientMiniWin:lw,item:l,videoRef:e?eL:eE})}}})}):(0,a.jsx)(F.gb,{}),(0,a.jsx)("div",{id:"modal_fullscreen_capture_feedback",children:(0,a.jsx)("div",{id:"modal_fullscreen_capture"})})]})})]}),(0,a.jsx)(x.IsLivingPlugin,{activeIndex:eT,dataList:eV,setDataList:eF,scene:"jingxuan_feed"})]})};var iS=(0,r.memo)(e=>{var l;let{root:t,onSetAttribute:s,metaCtxId:u,isSelfMetaProvider:c=!1,modalEnterFrom:f}=e,{pipWindow:p,isListenVideoMiniWin:g,changeIsListenVideoMiniWin:h}=(0,M.Iq)(e=>{let{pipWindow:l,isListenVideoMiniWin:t,changeIsListenVideoMiniWin:i}=e;return{pipWindow:l,isListenVideoMiniWin:t,changeIsListenVideoMiniWin:i}}),_=(0,r.useRef)(document.createElement("div"));(0,r.useEffect)(()=>{let e=t||document.getElementById("douyin-right-container")||document.body;return null==s||s(_),e.appendChild(_.current),()=>{var e,l;(null===(e=_.current)||void 0===e?void 0:e.parentNode)&&(null===(l=_.current)||void 0===l||l.remove()),_.current=null}},[]),(0,r.useEffect)(()=>{if(g){h(!1);let e=tq.e.getPipWindow({scene:v.d.ListenVideo});e?e.close():ih.T.exit()}},[]),(0,m.w)(()=>{let e=_.current;if(e)return e.classList.add(C.default.routeHide),()=>{e.classList.remove(C.default.routeHide)}},[]);let w=(0,el.j)(),{awemeFeed:y}=w,I=(0,n._)(w,["awemeFeed"]);return c?d.createPortal((0,a.jsx)(iP,(0,o._)((0,i._)({},e),{close:l=>{var t,i,o;let n=tq.e.getPipWindow({scene:v.d.ListenVideo});n&&n.close(),null==p||null===(t=p.close)||void 0===t||t.call(p),_.current.parentNode&&(null===(o=_.current)||void 0===o||o.remove()),null==e||null===(i=e.close)||void 0===i||i.call(e,l)},container:t||_.current,mouseScrollContainer:_.current})),_.current):d.createPortal((0,a.jsx)(el.b,{context:(0,o._)((0,i._)({},I),{metaCtxId:null!==(l=null!=u?u:f)&&void 0!==l?l:"modal"}),children:(0,a.jsx)(iP,(0,o._)((0,i._)({},e),{close:l=>{var t,i,o;null==p||null===(t=p.close)||void 0===t||t.call(p),_.current.parentNode&&(null===(o=_.current)||void 0===o||o.remove()),null==e||null===(i=e.close)||void 0===i||i.call(e,l)},container:t||_.current,mouseScrollContainer:_.current}))}),_.current)})},815398:function(e,l,t){t.d(l,{I:function(){return s}});var i=t(101199),o=t(502615),n=t(855357),a=t(499059),r=t(414061),d=t(63601);let s=e=>{let{awemeInfo:l,from:t,isActive:s,hackFullScreenDom:u=!1,videoAreaClickActive:c=!1,logParams:v,enableInteractionPlugin:m=!0,searchListType:f,isUpperFeed:p=!1,syncInMulti:g=!1}=e,h=(0,d.n)(),_=a.Le.getConfig(a.gI.ActivityModalCurrentActiveProgress);return(0,i.useEffect)(()=>{if(h&&s&&l){a.Le.getConfig(a.gI.ActivityModalEnterFullScreenAfterCreate)&&"modal_player"===t&&(a.Le.setConfig(a.gI.ActivityModalEnterFullScreenAfterCreate,!1),h.getFullscreen());let{awemeId:e}=l,i=()=>{_[0]=e,_[1]=h.currentTime};return h.on("timeupdate",i),()=>{h.off("timeupdate",i),"activity_player"===t&&_[0]===(null==l?void 0:l.awemeId)&&(_[0]="",_[1]=0)}}},[h,l,s]),(0,i.useEffect)(()=>{if(h&&l&&(null==l?void 0:l.awemeType)!==n.e.Note&&(null==l?void 0:l.awemeId)===_[0]){let e=_[1];h.once(o.FP.CANPLAY,()=>{h.seek(e)})}},[h]),(0,i.useEffect)(()=>{if(h&&"activity_player"===t&&s)return r.listen(r.EVENT.activitySyncVideoPlay,()=>{(null==l?void 0:l.awemeType)!==n.e.Note&&((null==l?void 0:l.awemeId)===_[0]&&h.seek(_[1]),a.Le.setConfig(a.gI.IsSearchOuterAsync,!0)),h.play()})},[h,s,l]),null}}}]); |