"use strict";(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["52170"],{249782:function(e,t,i){let n,o,r;i.d(t,{t:function(){return J}});var l=i("629686"),a=i("402748"),s=i("811603");i("490629"),i("559352"),i("374954");var u=i("320165"),d=i("101199"),c=i("469935"),h=i.n(c),g="MbojDve2",m="s6C69J_V",v="YmPlbavY";i("932651");var p=i("283791"),f=i.n(p),_=i("59850");i("706056");var y={horizontal:0,0:"horizontal",vertical:1,1:"vertical",unknow:2,2:"unknow"};let w=e=>"string"==typeof e?e:`${e}px`,I=(e,t,i,n)=>{e.style.transform=`translate3d(${[t,i,n].map(e=>w(e)).join(",")})`};function x(){let e=this.el.offsetWidth||this.elWidth,t=this.el.offsetHeight||this.elHeight;this.elWidth=e,this.elHeight=t,this.touchData.containerWidth=e+(this.direction===y.horizontal?this.spaceBetween:0),this.touchData.containerHeight=t+(this.direction===y.vertical?this.spaceBetween:0),this.el.childNodes.forEach(i=>{Array.from(i.classList).includes("dySwiperSlide")&&(i.style[this.direction===y.vertical?"height":"width"]=`${this.direction===y.vertical?t:e}px`,i.style[this.direction===y.vertical?"marginBottom":"marginRight"]=`${this.spaceBetween}px`)});let i=this.activeIndex,n=this.loop?i+1:i,o=-(this.touchData.containerWidth*n),r=-(this.touchData.containerHeight*n);this.touchData.x=this.direction===y.horizontal?o:0,this.touchData.y=this.direction===y.vertical?r:0,this.transitionCallback&&(this.transitionCallback(),this.transitionCallback=null),I(this.el,this.touchData.x,this.touchData.y,0)}var C=i("908219"),b=i.n(C),P=i("273372");if("object"==typeof performance&&"function"==typeof performance.now)n=()=>performance.now();else{let e=Date,t=e.now();n=()=>e.now()-t}let E=["INPUT","SELECT","OPTION","TEXTAREA","BUTTON","VIDEO","LABEL"];function k(e){var t,i;if(!this.isDisabled())this.eventEmitter.emit("touchStart"),this.touchData.isTouchDown=!0,this.touchData.touchStartX="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,this.touchData.touchStartY="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY,this.touchData.startX=this.touchData.x,this.touchData.startY=this.touchData.y,this.touchData.lastDetectTime=n(),!(E.includes(null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.nodeName)||(null==e?void 0:null===(i=e.target)||void 0===i?void 0:i.isContentEditable))&&e.preventDefault()}function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y";return this.touchData[this.direction===y.horizontal?e:t]}i("591964");let L=[],T=(e,t)=>(L.push([e,t]),L.splice(0,L.findIndex(t=>e-t[0]<=300)),L.reduce((e,t)=>e+t[1],0)/L.length),D=(e,t)=>Math.min(e,Math.abs(t))===e?(t>=0?1:-1)*e:t;function N(){return(null===this||void 0===this?void 0:this.data)&&(null===this||void 0===this?void 0:this.activeIndex)&&!this.data[this.activeIndex-1]?-this.touchData.containerHeight*this.activeIndex:0}function M(){return-(this.data.length-1)*this.touchData[this.direction===y.horizontal?"containerWidth":"containerHeight"]}function A(e,t){var i,n;this.touchData.x=this.direction===y.horizontal?this.touchData.startX+D(this.touchData.containerWidth,e):0,this.touchData.y=this.direction===y.vertical?this.touchData.startY+D(this.touchData.containerHeight,t):0;let o=N.call(this);S.call(this)>o?this.touchData[this.direction===y.horizontal?"x":"y"]=o-1+(-o+S.call(this,"startX","startY")+(this.direction===y.horizontal?e:t))**(null!==(i=this.resistanceRatio)&&void 0!==i?i:.7):S.call(this)=30&&this.touchData.userIntendDirection===y.unknow&&(this.touchData.userIntendDirection=Math.max(Math.abs(r),Math.abs(l))===Math.abs(r)?y.horizontal:y.vertical),this.touchData.userIntendDirection===this.direction){let e=n(),t=this.direction===y.horizontal?this.touchData.x:this.touchData.y;A.call(this,r,l),this.touchData.gestureSwipeSpeed=T(e,Math.floor((this.touchData[this.direction===y.horizontal?"x":"y"]-t)/((e-this.touchData.lastDetectTime)/1e3))),this.touchData.lastDetectTime=e,I(this.el,this.touchData.x,this.touchData.y,"0"),this.eventEmitter.emit("touchMove"),this.touchData.isTouchMove=!0,this.transitionCallback&&(this.transitionCallback(),this.transitionCallback=null)}}}}let F=(e,t)=>{e.style.transitionDuration="string"!=typeof t?`${t}ms`:t};function Z(e,t,i,n,o){this.touchData.isTouchDown=!1,this.touchData.isTouchMove=!1,this.touchData.userIntendDirection=y.unknow,0<=e&&this.data.length;let r=this.loop?e+1:e,l=-(this.touchData.containerWidth*r),a=-(this.touchData.containerHeight*r);if(this.direction===y.horizontal?this.touchData.x===l:this.touchData.y===a)return!n&&(this.activeIndex=e,this.updateCallback(e,{from:i})),!1;let s=null!=t?t:this.speed;if(F(this.el,s),this.touchData.x=this.direction===y.horizontal?l:0,this.touchData.y=this.direction===y.vertical?a:0,I(this.el,this.touchData.x,this.touchData.y,0),!n&&(this.activeIndex=e,this.updateCallback(e,{from:i})),0!==s)return this.touchData.animating=!0,this.eventEmitter.emit("transitionStart"),this.transitionCallback=()=>{this.touchData.animating=!1,this.eventEmitter.emit("transitionEnd"),F(this.el,0),null==o||o(),this.el.removeEventListener("transitionend",this.transitionCallback),this.el.removeEventListener("webkitTransitionEnd",this.transitionCallback)},this.el.addEventListener("transitionend",this.transitionCallback),this.el.addEventListener("webkitTransitionEnd",this.transitionCallback),!0;this.touchData.animating=!1}function U(){Z.call(this,this.activeIndex,250)}function j(){return Math.abs(S.call(this)-S.call(this,"startX","startY"))>=S.call(this,"containerWidth","containerHeight")/2}function H(e){return e-this.touchData.lastDetectTime>=100}function B(e){let t=j.call(this),i=Math.abs(this.touchData.gestureSwipeSpeed)>=50,n=H.call(this,e),o=0===this.activeIndex&&S.call(this)>0||this.activeIndex===this.data.length-1&&S.call(this)=0,observer:"MutationObserver"in window||"WebkitMutationObserver"in window,smoothScroll:document.documentElement&&"scrollBehavior"in document.documentElement.style,touch:!!("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||e),passiveListener:function(){let e=!1;try{let t=Object.defineProperty({},"passive",{get(){e=!0}});window.addEventListener("testPassiveListener",null,t)}catch(e){}return e}(),gestures:"ongesturestart"in window}}()),o}i("240148"),i("759943");let Y={start:"touchstart",move:"touchmove",end:"touchend",cancel:"touchcancel"},V={start:"pointerdown",move:"pointermove",end:"pointerup"};function K(e){this.touchData.animating&&(e.stopPropagation(),e.stopImmediatePropagation())}let X=(e,t)=>{let i=$(),n=(!r&&(r=function(){let e=$(),{platform:t}=window.navigator,i=window.navigator.userAgent,n={ios:!1,android:!1},o=window.screen.width,r=window.screen.height,l=i.match(/(Android);?[\s\/]+([\d.]+)?/),a=i.match(/(iPad).*OS\s([\d_]+)/),s=i.match(/(iPod)(.*OS\s([\d_]+))?/),u=!a&&i.match(/(iPhone\sOS|iOS)\s([\d_]+)/),d="MacIntel"===t;return!a&&d&&e.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${o}x${r}`)>=0&&(!(a=i.match(/(Version)\/([\d.]+)/))&&(a=[0,1,"13_0_0"]),d=!1),l&&"Win32"!==t&&(n.os="android",n.android=!0),(a||u||s)&&(n.os="ios",n.ios=!0),n}()),r),o=[k,R,O,b()(x,50,{leading:!0,trailing:!0})].map(e=>e.bind(t)),l=K.bind(t);if(!i.touch&&i.pointerEvents){e.addEventListener(V.start,o[0],!1),document.addEventListener(V.move,o[1],!1),document.addEventListener(V.end,o[2],!1),e.addEventListener("click",l,!0);let t=P.Z.bind(e,o[3]);return()=>{e.removeEventListener(V.start,o[0],!1),document.removeEventListener(V.move,o[1],!1),document.removeEventListener(V.end,o[2],!1),e.removeEventListener("click",l,!0),t&&t()}}{let t="touchstart"===Y.start&&!!i.passiveListener&&{passive:!0,capture:!1};i.touch&&(e.addEventListener(Y.start,o[0],t),e.addEventListener(Y.move,o[1],!!i.passiveListener&&{passive:!1,capture:!1}),e.addEventListener(Y.end,o[2],t),e.addEventListener(Y.cancel,o[2],t)),(!n.ios&&!n.android||!i.touch&&n.ios)&&(e.addEventListener("mousedown",o[0],!1),document.addEventListener("mousemove",o[1],!1),document.addEventListener("mouseup",o[2],!1));let r=P.Z.bind(e,o[3]);return e.addEventListener("click",l,!0),()=>{i.touch&&(e.removeEventListener(Y.start,o[0],t),e.removeEventListener(Y.move,o[1],!1),e.removeEventListener(Y.end,o[2],t),e.removeEventListener(Y.cancel,o[2],t)),(!n.ios&&!n.android||!i.touch&&n.ios)&&(e.removeEventListener("mousedown",o[0],!1),document.removeEventListener("mousemove",o[1],!1),document.removeEventListener("mouseup",o[2],!1)),r&&r(),e.removeEventListener("click",l,!0)}}},G=e=>{let{spaceBetween:t,speed:i,resistanceRatio:n,direction:o,touchRatio:r,onActiveIndexChange:l,onSwiper:a,initIndex:s,data:u,loop:c,isDisabled:h}=e,g=(0,d.useMemo)(()=>new(f()),[]),m=(0,d.useRef)(null),v=(0,d.useRef)({}),p=(0,d.useRef)(-1),[w,I]=(0,d.useState)(s),C=(0,_.Z)((e,t)=>{let{from:i=""}=t;w!==e&&(null==l||l(e),I(e),g.emit("slideChange",{from:i}),g.emit("activeIndexChange",{index:e}))});return v.current=Object.assign(v.current,{data:u,activeIndex:w,speed:i,resistanceRatio:n,spaceBetween:t,slides:u,loop:c,direction:o,touchRatio:r}),(0,d.useEffect)(()=>{var e;let i=o===y.horizontal,n=o===y.vertical,r={isTouchDown:!1,isTouchMove:!1,animating:!1,x:0,y:0,startX:0,startY:0,touchStartX:0,touchStartY:0,gestureSwipeSpeed:0,userIntendDirection:y.unknow,containerWidth:m.current.offsetWidth+(i?t:0),containerHeight:m.current.offsetHeight+(n?t:0)};v.current=Object.assign(v.current,{el:m.current,updateCallback:C,eventEmitter:g,touchData:r,on:g.on.bind(g),once:g.once.bind(g),emit:g.emit.bind(g),off:g.off.bind(g),slideTo:Z.bind(v.current),slideToSync:e=>{p.current=e,C(e,{from:""})},update:()=>null,isDisabled:h,slideNext:()=>{var e;if(h())return;let t=v.current;if(t.touchData.animating&&document&&!document.hidden)return;let i=t.activeIndex+1;i<(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.length)?t.slideTo(i):t.loop&&t.slideTo(i,t.speed,void 0,!0,()=>{t.slideTo(0,0)})},slidePrev:()=>{var e;if(h())return;let t=v.current;if(t.touchData.animating&&document&&!document.hidden)return;let i=t.activeIndex-1;if(i>=0&&(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e[i])){t.slideTo(i);return}-1===i&&t.loop&&t.slideTo(i,t.speed,void 0,!0,()=>{t.slideTo(t.data.length-1,0)})}});let l=h()?()=>{}:X(m.current,v.current);return null==a||a(v.current),null===(e=v.current)||void 0===e||e.slideTo(w,0),()=>{l()}},[]),(0,d.useEffect)(()=>{-1!==p.current&&v.current.slideTo(p.current,0)},[u]),(0,d.useEffect)(()=>{let e=setTimeout(()=>{x.call(v.current)});return()=>{clearTimeout(e)}},[t,u]),{activeIndex:w,swiperContainerRef:m,dySwiperStatusRef:v}},Q=e=>{let{dySwiperStatusRef:t,data:i}=e;(0,d.useEffect)(()=>{var e;(null===(e=t.current)||void 0===e?void 0:e.activeIndex)>(null==i?void 0:i.length)-1&&(null==i?void 0:i.length)>0&&Z.call(t.current,(null==i?void 0:i.length)-1,0)},[i])};i("679308");var q=i("915825");let J=(0,d.forwardRef)((e,t)=>{let{direction:i,children:n,className:o,data:r,spaceBetween:c=0,style:p,speed:f,isDisabled:_,resistanceRatio:w,onSwiper:I,slideKey:x,onActiveIndexChange:C,touchRatio:b=1,initIndex:P=0,loop:E=!1,isVideoSupportMP4:k=!0}=e,S=(0,s._)(e,["direction","children","className","data","spaceBetween","style","speed","isDisabled","resistanceRatio","onSwiper","slideKey","onActiveIndexChange","touchRatio","initIndex","loop","isVideoSupportMP4"]),[L,T]=function(e){let t=[],i={"wrapper-start":[],"wrapper-end":[],"wrapper-right":[]};return d.Children.toArray(e).forEach(e=>{if(e.type&&e.type.displayName===q.o.displayName)t.push(e);else if(e.props&&e.props.slot&&i[e.props.slot])i[e.props.slot].push(e);else if(e.props&&e.props.children){let n=function e(t){let i=[];return d.Children.toArray(t).forEach(t=>{t.type&&t.type.displayName===q.o.displayName?i.push(t):t.props&&t.props.children&&e(t.props.children).forEach(e=>i.push(e))}),i}(e.props.children);n.length>0?n.forEach(e=>t.push(e)):i["wrapper-end"].push(e)}else i["wrapper-end"].push(e)}),[t,i]}(n),D=L[0],{activeIndex:N,dySwiperStatusRef:M,swiperContainerRef:A}=G({data:r,initIndex:P,spaceBetween:c,speed:f,resistanceRatio:w,touchRatio:b,direction:i,onActiveIndexChange:C,onSwiper:I,loop:E,isDisabled:()=>(null==_?void 0:_())||!k}),R=(0,d.useMemo)(()=>{if(!D)return null;let e=r.map((e,t)=>d.cloneElement(D,{activeIndex:N,currentIndex:t,slideData:e,key:null==x?void 0:x(e,t)}));if(E&&r.length>1){let t=r[0],i=r[r.length-1],n=r.length,o=d.cloneElement(D,{activeIndex:N,currentIndex:-1,slideData:i,key:null==x?void 0:x(i,-1)}),l=d.cloneElement(D,{activeIndex:N,currentIndex:n,slideData:t,key:null==x?void 0:x(i,n)});e.unshift(o),e.push(l)}return e},[D,E,r,N]);return(0,d.useImperativeHandle)(t,()=>M.current,[]),Q({dySwiperStatusRef:M,data:r}),(0,u.jsxs)("div",(0,a._)((0,l._)({className:h()(g,o),style:p},S),{children:[(0,u.jsxs)("div",{ref:A,className:h()(m,{[v]:i===y.vertical}),children:[T["wrapper-start"],R,T["wrapper-end"]]}),T["wrapper-right"]]}))})},915825:function(e,t,i){i.d(t,{o:function(){return c}});var n=i("629686"),o=i("402748"),r=i("811603");i("490629");var l=i("320165"),a=i("101199"),s=i("469935"),u=i.n(s),d="TQdQSVhG";let c=(0,a.memo)(e=>{let{activeIndex:t,currentIndex:i,children:a,slideData:s,style:c,className:h}=e,g=(0,r._)(e,["activeIndex","currentIndex","children","slideData","style","className"]);return(0,l.jsx)("div",(0,o._)((0,n._)({style:c,className:u()(d,"dySwiperSlide",h)},g),{children:"function"==typeof a?a({activeIndex:t,currentIndex:i,slideData:s}):a}))});c.displayName="SwiperSlide"},448214:function(e,t,i){i.d(t,{B:function(){return n}});var n={Ended:"ended",MiniWinChange:"miniWinChange",PlayRatioChange:"playRatioChange",UpdateCommentCount:"updateCommentCount",Blur:"blur",VolumeUp:"upVolume",VolumeDown:"downVolume",NextAutoplayChange:"nextAutoplayChange",BeforePlaySwitchPrev:"playSwitchPrevBefore",AfterPlaySwitchNext:"playSwitchNextBefore",KeyPlaySwitchPrev:"keyPlaySwitchPrev",KeyPlaySwitchNext:"keyPlaySwitchNext",Waiting:"waiting",ManualChangeMiniState:"manual_change_min_state",Star:"onStar",ShowComment:"showComment",Collect:"onCollect",ShowShareCode:"showShareCode",Dislike:"onDislike",Avatar:"onAvatar",Follow:"onFollow",FakeScreen:"onFakeScreen",SwitchFullScreen:"switch_fullscreen",FakeScreenChange:"fakeScreenChange",PlayRatioPanelShow:"playRatioPanelShow",LightBottomControls:"lightBottomControls",ResolutionChange:"resolutionChange",PlayResolutionClick:"playResolutionClick",PlayResolutionEnter:"playResolutionEnter",VolumeChange:"volumechange",UpdateImmersiveSwitch:"updateImmersiveSwitch",ImmersiveSwitchChange:"immersiveSwitchChange",UpdateAutoPlaySwitch:"updateAutoPlay",AutoPlaySwitchChange:"autoPlaySwitchChange",CustomShortCut:"customShortCut",ChangePlayRate:"changePlayRate",TimeUpdate:"timeupdate",ShowAdDetail:"showAdDetail",AdLike:"adverLike",AdDislike:"adverDislike",AdReport:"adverReport",AdThrow:"adverThrow",AdIntroduce:"adverIntroduce",Play:"play",Replay:"replay",Error:"error",ChangeDanmaku:"changeDanmaku",UpdateRadio:"UpdateRadio",UpdateClarity:"UpdateClarity",UpdateAutoPlay:"UpdateAutoPlay",BeforeDestroy:"beforeDestroy",DyUserSeek:"dyUserSeek",UpdateDebugInfo:"updateDebugInfo",RegisterMissingSrPlugin:"registerMissingSrPlugin"}},486856:function(e,t,i){i.d(t,{E:function(){return r}});var n=i(283791),o=i.n(n);let r=i(101199).createContext({player:{},slardarInstance:null,contextEvent:new(o())})},537158:function(e,t,i){i.d(t,{n:function(){return r}});var n=i(101199),o=i(486856);let r=()=>{let{player:e}=(0,n.useContext)(o.E);return e}},111482:function(e,t,i){i.d(t,{N:function(){return r}});var n=i(101199),o=i(486856);let r=()=>{let{slardarInstance:e}=(0,n.useContext)(o.E);return e}},812468:function(e,t,i){i.r(t),i.d(t,{PictureMode:function(){return eS},PictureModeInner:function(){return ek}});var n=i("629686");i("490629");var o=i("320165"),r=i("101199"),l=i("832602");i("635303");var a=i("469935"),s=i.n(a),u=i("734123"),d=i("855357"),c=i("426038"),h=i("273372"),g=i("709705"),m={arrow:"RTP0owpT",hide:"cTt02Iqv",disabled:"uICK4H8L",leftArrow:"osirrNiy",inSideBar:"p2MzSPu4",inSearch:"OFCH0bFC",rightArrow:"FWrv9gCm",swiperContainer:"WurxE75K",mask:"EIciH9OY",inactive:"xzEZGk1j",pictureFeed:"I0coqyEG"},v=i("402748"),p=i("390923"),f=i("913485"),_=i("908219"),y=i.n(_),w=i("880327"),I=i("499059"),x=i("759894"),C=i("335924"),b=i("237869"),P=i("31992"),E=i("515330"),k=i("623607"),S=i("697233"),L=i("730084");i("527553");let T=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played transition",styleKey:"playedColor"}];class D{updateDuration(e){this.duration=parseInt(1e3*e);let t=0,{fragments:i}=this;this.fragments=i.map(e=>(e.start=t,e.end=t+e.percent*this.duration,e.duration=e.percent*this.duration,t+=e.percent*this.duration,e))}updateProgress(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},{progressList:i,fragments:n}=this,{newIndex:o,curIndex:r,millisecond:l}=t;o!==r&&i.map((t,i)=>{io&&(t[e].style.width=0)});let a=n[o],s=0===l?0:(l-a.start)/a.duration;i[o]&&(i[o][e].style.width=s<0?0:`${100*s}%`)}reset(){let{progressList:e,fragments:t}=this;e.map((e,t)=>{L.ZP.removeClass(e.played,"transition"),setTimeout(()=>L.ZP.addClass(e.played,"transition"),100)}),this.update({played:0},this.duration)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(t)}let{playedIndex:i,cachedIndex:n}=this;if("Undefined"!==L.ZP.typeOf(e.played)){let t=this.findIndex(1e3*e.played,i);this.updateProgress("played",{newIndex:t,curIndex:i,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=t}if("Undefined"!==L.ZP.typeOf(e.cached)){let t=this.findIndex(1e3*e.cached,n);this.updateProgress("cached",{newIndex:t,curIndex:n,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=t}}findIndex(e,t){let{fragments:i}=this;if(1===i.length||0===e)return 0;let n=t;for(let t=0;ti.start&&e<=i.end)break}return n}findHightLight(){let{children:e}=this.root;for(let t=0;t=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}unHightLight(){let{children:e}=this.root;for(let t=0;t{let n=L.ZP.createDom("xg-inner","",{style:e?`background:${e}; flex: ${t.percent}`:`flex: ${t.percent}`},`${t.isFocus?"inner-focus":""} xgplayer-progress-inner picture-inner`);return n.addEventListener("click",()=>this.onInnerClick(i)),this.root.appendChild(n),T.map(e=>{n.appendChild(L.ZP.createDom(e.tag,"",{style:e.styleKey?`background: ${this.style[e.styleKey]}; width:0;`:"width:0;"},e.className))}),{cached:n.children[0],played:n.children[1]}})),this.root}constructor(e){this.fragments=e.fragments||[],this.onInnerClick=e.onInnerClick,this.focusClass="inner-focus",this.style=e.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0}}class N extends S.ZP{static get pluginName(){return"pictureProgress"}static get defaultConfig(){return{position:S.kd.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],miniMoveStep:5,miniStartStep:2,onMoveStart:()=>{},onMoveEnd:()=>{}}}get duration(){return this.playerConfig&&this.playerConfig.customDuration||this.player.duration}get timeOffset(){return this.playerConfig.timeOffset||0}beforeCreate(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}createInner(){try{this.innerList=new D({fragments:this.config.fragments,style:this.playerConfig.commonStyle||{},onInnerClick:this.config.onInnerClick}),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map(e=>{this[e]=this.innerList[e].bind(this.innerList)})}catch(e){}}afterCreate(){if(!this.config.disable&&!this.playerConfig.isLive)this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer"),this.createInner(),this.bind("pointerdown",this.onStopPropagation),this.bind("touchstart",this.onStopPropagation)}focus(){this.player.controls.pauseAutoHide(),L.ZP.addClass(this.root,"active")}blur(){this.player.controls.recoverAutoHide(),L.ZP.removeClass(this.root,"active")}onStopPropagation(e){e.stopPropagation()}onMouseDown(e){let{player:t,pos:i,config:n,playerConfig:o}=this,r=L.ZP.getEventPos(e,t.zoom),{width:l,height:a,top:s,left:u}=this.root.getBoundingClientRect(),d=(r.clientX-u)/l;this.updatePercent(d)}updateTime(e){let{player:t,duration:i}=this;e>i?e=i:e<0&&(e=0);let n=t.plugins.time;n&&n.updateTime(e)}updatePercent(e){e=e>1?1:e<0?0:e,this.percent=e,this.innerList.update({played:e*this.duration},this.duration)}getPercent(){return this.percent}destroy(){this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null,this.unbind("mousedown",this.onMouseDown),this.unbind("pointerdown",this.onStopPropagation),this.unbind("touchstart",this.onStopPropagation)}render(){if(this.config.disable||this.playerConfig.isLive)return;let e=this.player.controls?this.player.controls.config.mode:"";return` `}constructor(e){super(e),this.percent=0,this._state={now:-1,direc:0,time:0}}}var M=i("198412"),A=i.n(M),R=i("5784"),F=i.n(R),Z=i("687875"),U=i("537158");function j(e){var t,i;if(null==e?void 0:null===(i=e.plugins)||void 0===i?void 0:null===(t=i.keyboard)||void 0===t?void 0:t.keyCodeMap){let t=e.plugins.keyboard.keyCodeMap||{},i={};return Object.keys(t).forEach(e=>{t[e]&&(i[e]=t[e].disable,t[e].disable=!0)}),()=>{var t,n;let o=(null==e?void 0:null===(n=e.plugins)||void 0===n?void 0:null===(t=n.keyboard)||void 0===t?void 0:t.keyCodeMap)||{};o&&Object.keys(o).forEach(e=>{o[e]&&(o[e].disable=i[e])})}}}let H=e=>{let{currentCodeMap:t,additionalCodeMap:i}=e;Object.keys(i).map(e=>{delete t[e]})},{ArrowLeft:B,ArrowRight:W,A:O,D:z}=Z.bf,$=e=>{let t=(0,U.n)(),{preClick:i,nextClick:o,disableShortCut:l=!1,active:a=!0}=e;return(0,r.useEffect)(()=>{if(!!a){if(t){if(l)return j(t);let e={left:{keyCode:B.keyCode,action:i,disable:!1,noBodyTarget:!1},right:{keyCode:W.keyCode,action:o,disable:!1,noBodyTarget:!1},leftA:{keyCode:O.keyCode,action:i,disable:!1,noBodyTarget:!1},rightD:{keyCode:z.keyCode,action:o,disable:!1,noBodyTarget:!1}},r={left:A()(t,"plugins.keyboard.keyCodeMap.left"),right:A()(t,"plugins.keyboard.keyCodeMap.right"),leftA:A()(t,"plugins.keyboard.keyCodeMap.leftA"),rightD:A()(t,"plugins.keyboard.keyCodeMap.rightD")};return F()(t,"plugins.keyboard.keyCodeMap",(0,n._)({},A()(t,"plugins.keyboard.keyCodeMap")||{},e)),()=>{t.plugins.keyboard&&(H({currentCodeMap:t.plugins.keyboard.keyCodeMap,additionalCodeMap:e}),F()(t,"plugins.keyboard.keyCodeMap",(0,n._)({},A()(t,"plugins.keyboard.keyCodeMap")||{},r)))}}}},[t,i,o,l,a]),null},Y=e=>{let{player:t,timeDuration:i=3e3}=e,[n,o]=(0,r.useState)(!1),l=(0,r.useRef)(),a=(0,r.useCallback)(()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{o(!0),l.current=null},i)},[i]);return(0,r.useEffect)(()=>{if(null==t?void 0:t.root){var e,i,n;let r=()=>{l.current&&clearTimeout(l.current),o(!1)},s=()=>{o(!1),a()},u=()=>{o(!1),a()};return null==t||null===(e=t.root)||void 0===e||e.addEventListener("mouseenter",s),null==t||null===(i=t.root)||void 0===i||i.addEventListener("mousemove",u),null==t||null===(n=t.root)||void 0===n||n.addEventListener("mouseleave",r),()=>{var e,i,n;null==t||null===(e=t.root)||void 0===e||e.removeEventListener("mouseenter",s),null==t||null===(i=t.root)||void 0===i||i.removeEventListener("mousemove",u),null==t||null===(n=t.root)||void 0===n||n.removeEventListener("mouseleave",r)}}},[null==t?void 0:t.root,a,o]),(0,r.useEffect)(()=>()=>{l.current&&clearTimeout(l.current),l.current=null},[]),n};var V=i("268632"),K=i("624508");let X={multiPhotoSlide:{eventName:"multi_photo_slide",params:{aweme_type:d.e.Note,enter_from:"",enter_method:"",author_id:"",group_id:"",pic_cnt:0,is_zoom:!1}},enterGraphicDetail:{eventName:"enter_graphic_detail",params:{enter_from:"",author_id:"",group_id:"",pic_cnt:0}},videoPlayFinish:{eventName:"video_play_finish",params:{author_id:"",group_id:"",log_pb:"",is_visible:"1",enter_from:"",compilation_id:"",playlet_id:"",previous_page:"",tab_name:"",from_follow_list:"0",is_mute:"0",is_force:"0",trending_topic:"",open_from_page:"",multi_window_order:""}},finishTuji:{eventName:"finish_tuji",params:{author_id:"",group_id:"",log_pb:"",is_visible:"1",enter_from:"",compilation_id:"",playlet_id:"",previous_page:"",tab_name:"",from_follow_list:"0",is_mute:"0",is_force:"0",trending_topic:""}}};var G=new K.h(X);i("480333"),i("890710"),i("358986"),i("995270"),i("601034"),i("202206");var Q=i("889429"),q=i("414061"),J=i("875784"),ee=i("423780"),et=i("792076");new K.h({autoPlayModePanelShow:{eventName:"auto_play_mode_panel_show",params:{group_id:"",enter_from_merge:"",enter_from:""}},autoPlayModePanelClick:{eventName:"auto_play_mode_panel_click",params:{group_id:"",enter_from_merge:"",enter_from:"",auto_play_mode:""}}}),i("448214"),i("966473");new K.h({like:{eventName:"like",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:"",is_full_screen:"0",is_full_webscreen:"0",tab_name:"",click_method:"icon",from_follow_list:"0",relation:"",clarity:"",trending_topic:"",first_tag_name:"",top:0,aweme_type:"",is_auto:1,item_duration_ms:0}},clickLike:{eventName:"click_like",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:"",is_full_screen:"0",tab_name:"",click_method:"",from_follow_list:"0",relation:""}},cancelLike:{eventName:"cancel_like",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:"",is_full_screen:"0",tab_name:"",relation:"",aweme_type:"",item_duration_ms:0}},clickCommentButton:{eventName:"click_comment_button",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:"",from_follow_list:"0",trending_topic:"",first_tag_name:"",top:0,aweme_type:"",item_duration_ms:0}},shareMenuShow:{eventName:"share_menu_show",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:""}},shareVideo:{eventName:"share_video",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:"",from_follow_list:"0",trending_topic:"",first_tag_name:"",top:0,aweme_type:""}},follow:{eventName:"follow",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:"",relation:"",trending_topic:"",first_tag_name:"",top:0,aweme_type:""}},followCancel:{eventName:"follow_cancel",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:"",relation:""}},enterPersonalDetail:{eventName:"enter_personal_detail",params:{author_id:"",group_id:"",log_pb:"",enter_from:"",previous_page:""}},clickRemoveFans:{eventName:"click_remove_fans",params:{to_user_id:"",enter_from:"personal_homepage",click_method:"fans_list"}},removeFans:{eventName:"remove_fans",params:{to_user_id:"",enter_from:"personal_homepage",click_method:"fans_list"}},favoriteVideo:{eventName:"favorite_video",params:{click_from:"icon",previous_page:"",author_id:"",group_id:"",log_pb:"",enter_from:"",is_full_screen:"0",is_full_webscreen:"0",click_method:"",from_xigua:0,clarity:"",trending_topic:"",first_tag_name:"",top:0,aweme_type:"",item_duration_ms:0,is_from_aweme_search_engine:0}},favoriteVideoFailed:{eventName:"favorite_video_failed",params:{click_from:"icon",err_code:0,previous_page:"",author_id:"",group_id:"",log_pb:"",enter_from:"",is_full_screen:"0"}},cancelFavoriteVideo:{eventName:"cancel_favorite_video",params:{click_from:"icon",previous_page:"",author_id:"",group_id:"",log_pb:"",enter_from:"",is_full_screen:"0",item_duration_ms:0}},playSettingIconShow:{eventName:"play_setting_icon_show",params:{enter_from_merge:"",enter_from:"",icon:""}},installNativePanelClick:{eventName:"install_native_panel_click",params:{action:"cancel"}},smallWindowShow:{eventName:"small_window_show",params:{source:""}}});var ei={Nomal:0,0:"Nomal",Reverse:1,1:"Reverse",Cycle:2,2:"Cycle"};J.Z,ee.Z,et.Z;let en=e=>{var t;let{isActive:i,awemeInfo:l,swiper:a,onPlayFinish:c,playNextFunc:h,ablePlayNext:g,playPrevFunc:_,ablePlayPrev:S,logParams:L,arrowButtonSize:T=56,isClientMiniWin:D,disableShortCut:M=!1,isShowSideBar:A=!1,inSearch:R,leftStyle:F,rightStyle:Z}=e,j=(0,U.n)(),[H,B]=(0,r.useState)(!0),[W,O]=(0,r.useState)([!0,!0]),z=(0,r.useRef)(Date.now()),K=(0,r.useRef)(0),X=(0,r.useRef)(L),Q=(0,r.useRef)(!0),q=(0,r.useRef)(null),J=e=>{B(e),Q.current=e},ee=Y({player:j});X.current=L;let et=(0,r.useCallback)(e=>{var t;let i=null==j?void 0:j.getPlugin("pictureProgress");null==i||null===(t=i.updatePercent)||void 0===t||t.call(i,e),K.current=e},[j]),en=(0,r.useCallback)(e=>{var t,i;G.sendLog("multiPhotoSlide",(0,n._)({enter_from:null===(t=X.current)||void 0===t?void 0:t.enter_from,enter_method:"click_pic",author_id:null==l?void 0:null===(i=l.authorInfo)||void 0===i?void 0:i.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length,is_zoom:(0,w.r)()},X.current)),O([0===a.activeIndex,a.activeIndex===(null==l?void 0:l.images.length)-1]),J(!1),et((e+1)/l.images.length),null==a||a.slideTo(e,0)},[a,et,l]),eo=(0,r.useCallback)(e=>{if(a.activeIndex>0){var t,i;G.sendLog("multiPhotoSlide",(0,n._)({enter_from:null===(t=X.current)||void 0===t?void 0:t.enter_from,enter_method:(null==e?void 0:e.type)==="click"?"click_button":"keyboard",author_id:null==l?void 0:null===(i=l.authorInfo)||void 0===i?void 0:i.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length,is_zoom:(0,w.r)()},X.current)),J(!1),et(a.activeIndex/l.images.length),a.slidePrev(),O([0===a.activeIndex,a.activeIndex===(null==l?void 0:l.images.length)-1])}},[a,et,l]),er=(0,r.useCallback)(e=>{if(a.activeIndex{if(j&&(null==l?void 0:l.awemeType)===d.e.Note){let e=e=>{if(e){var t;G.sendLog("enterGraphicDetail",{enter_from:null==L?void 0:L.enter_from,author_id:null==l?void 0:null===(t=l.authorInfo)||void 0===t?void 0:t.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length})}};return j.on(u.Events.FULLSCREEN_CHANGE,e),()=>{j.off(u.Events.FULLSCREEN_CHANGE,e)}}},[l,j]),(0,r.useEffect)(()=>{if(j&&(null==l?void 0:l.awemeType)===d.e.Note){let e=j.getPlugin("AutoPlaySettingPlugin")||j.getPlugin("SearchAutoPlaySettingPlugin");if(e)return e.playeNextWeightNum+=1,()=>{e.playeNextWeightNum-=1}}},[l,j]),(0,r.useEffect)(()=>{if(j&&(null==l?void 0:l.awemeType)===d.e.Note){let e=j.getPlugin("InnerAutoPlayPlugin");if(e)return e.config.innerAutoPlayWeight+=1,()=>{e.config.innerAutoPlayWeight-=1}}},[l,j]),(0,r.useEffect)(()=>{if(j)return K.current=0,j.registerPlugin(N,{fragments:l.images.map(e=>({percent:1/l.images.length})),onInnerClick:en}),j.getPlugin(p.Z.pluginName)&&j.unRegisterPlugin(p.Z.pluginName,!0),j.getPlugin(f.Z.pluginName)&&j.unRegisterPlugin(f.Z.pluginName,!0),()=>{j.getPlugin(N.pluginName)&&j.unRegisterPlugin(N.pluginName,!0),j.registerPlugin(p.Z,{}),j.registerPlugin(f.Z,{})}},[j,en]),(0,r.useEffect)(()=>{if(a){let e=!1,t=()=>{e=!1,setTimeout(()=>en(a.activeIndex))},i=()=>{J(!1),et((a.activeIndex+1)/l.images.length),e||a.once("touchEnd",t),e=!0};try{a.on("touchMove",i)}catch(e){}return()=>{try{null==a||a.off("touchMove",i)}catch(e){}}}},[a,et,en]),(0,r.useEffect)(()=>{if(i&&j){var e,t,o,r,s;if(H){z.current=Date.now()-3e3*K.current*l.images.length;let i=j.getPlugin("pictureProgress");0===K.current?null==i||null===(e=i.innerList)||void 0===e||e.reset():null==i||null===(o=i.innerList)||void 0===o||null===(t=o.progressList)||void 0===t||t.map((e,t)=>{u.Util.addClass(null==e?void 0:e.played,"transition")});let r=y()(()=>{j.cumulateTime>=5e3&&(q.current(),j.off(u.Events.TIME_UPDATE,r))},500,{leading:!0,trailing:!0}),s=()=>{var e,t,o,s,d;if((Date.now()-z.current)/(3e3*l.images.length)>=1){j.off(u.Events.TIME_UPDATE,r),j.on(u.Events.TIME_UPDATE,r),et(1),K.current=0,z.current=Date.now(),null==i||null===(e=i.innerList)||void 0===e||e.reset();let n=j.getPlugin("AutoPlaySettingPlugin")||j.getPlugin("SearchAutoPlaySettingPlugin"),l=j.getPlugin("InnerAutoPlayPlugin");n&&(null==n?void 0:null===(t=n.config)||void 0===t?void 0:t.nextAutoPlay)&&(null==n?void 0:n.playeNextWeightNum)<=1&&g&&(null==n?void 0:n.stopFlag)===0?null==h||h():l&&(null===(o=I.Le.getConfig(I.gI.InnerAutoPlay))||void 0===o?void 0:o.modeIndex)===ei.Nomal&&l.config.innerAutoPlayWeight>=0&&g&&(null==l?void 0:l.stopFlag)===0?null==h||h({from:"auto"}):l&&(null===(s=I.Le.getConfig(I.gI.InnerAutoPlay))||void 0===s?void 0:s.modeIndex)===ei.Reverse&&l.config.innerAutoPlayWeight>=0&&S&&(null==l?void 0:l.stopFlag)===0&&(null==_||_({from:"auto"}))}else et((Date.now()-z.current)/(3e3*l.images.length));let c=Math.floor((Date.now()-z.current)/3e3);if((null==a?void 0:a.activeIndex)!==c){if(null==a?void 0:a.destroyed)return;G.sendLog("multiPhotoSlide",(0,n._)({enter_from:null==L?void 0:L.enter_from,enter_method:"auto",author_id:null==l?void 0:null===(d=l.authorInfo)||void 0===d?void 0:d.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length,is_zoom:(0,w.r)()},X.current)),null==a||a.slideTo(c,a.activeIndex===l.images.length-1?0:250),O([(null==a?void 0:a.activeIndex)===0,(null==a?void 0:a.activeIndex)===(null==l?void 0:l.images.length)-1])}},d=()=>{z.current=Date.now()-3e3*K.current*l.images.length};return j.on(u.Events.TIME_UPDATE,s),j.on(u.Events.PLAY,d),()=>{j.off(u.Events.TIME_UPDATE,s),j.off(u.Events.PLAY,d),j.off(u.Events.TIME_UPDATE,r)}}{let e=j.getPlugin("pictureProgress");null==e||null===(s=e.innerList)||void 0===s||null===(r=s.progressList)||void 0===r||r.map((e,t)=>{u.Util.removeClass(null==e?void 0:e.played,"transition")});let t=()=>{J(!0)};(null==j?void 0:j.paused)&&j.once(u.Events.PLAY,t);let i=()=>{j.once(u.Events.PLAY,t)},n=()=>{j.off(u.Events.PLAY,t)};return j.on(u.Events.PAUSE,i),j.on(u.Events.ENDED,n),()=>{var o,r;j.off(u.Events.PAUSE,i),j.off(u.Events.ENDED,n),j.off(u.Events.PLAY,t),null==e||null===(r=e.innerList)||void 0===r||null===(o=r.progressList)||void 0===o||o.map((e,t)=>{u.Util.addClass(null==e?void 0:e.played,"transition")})}}}K.current=0},[i,j,H,et,a,h,g]),(0,r.useEffect)(()=>{if(a){let e=()=>{if(a.activeIndex===(null==l?void 0:l.images.length)-1){var t,i,o,r,s,u,d,h;G.sendLog("videoPlayFinish",(0,v._)((0,n._)({urlParamList:["enter_method","trending_topic","previous_page"],enter_from:(0,x.mo)(),author_id:null==l?void 0:null===(t=l.authorInfo)||void 0===t?void 0:t.uid,group_id:null==l?void 0:l.awemeId,log_pb:null==l?void 0:l.logPb,compilation_id:null==l?void 0:null===(i=l.mixInfo)||void 0===i?void 0:i.mixId,playlet_id:null==l?void 0:null===(o=l.seriesInfo)||void 0===o?void 0:o.seriesId,tab_name:(0,P.zD)()||(0,C.Rs)("tab_name")||"",is_visible:String("visible"===document.visibilityState?1:0),is_author_card_expand:(null===(r=I.Le.getConfig("isCollapseAuthorCard"))||void 0===r?void 0:r.isCollapseAuthorCard)?0:1,from_follow_list:(null===(s=I.Le.getConfig("fromFollowList"))||void 0===s?void 0:s.tag)?"1":"0",is_mute:(null==j?void 0:j.muted)?"1":"0",is_force:(null===(u=I.Le.getConfig(I.gI.ForceMuted))||void 0===u?void 0:u.currentMuteType)==="browser"?"1":"0",trending_topic:"",aweme_type:null==l?void 0:l.awemeType,pic_cnt:null==l?void 0:null===(d=l.images)||void 0===d?void 0:d.length,is_small_window:"0",column_type:(null==L?void 0:L.column_type)||(null==L?void 0:null===(h=L.search_params)||void 0===h?void 0:h.column_type)},L,(0,b.Wc)()),{is_selected_label:(null==l?void 0:l.weeklyRecommend)?1:0}));try{a.off("slideChange",e)}catch(e){}null==c||c()}};try{a.slideTo(0,0),O([0===a.activeIndex,a.activeIndex===(null==l?void 0:l.images.length)-1]),a.on("slideChange",e)}catch(e){}return()=>{try{a.off("slideChange",e)}catch(e){}}}},[a,l]),(0,r.useEffect)(()=>{if(a){q.current=()=>{var e,t,i,o,r,a,s;G.sendLog("finishTuji",(0,n._)({urlParamList:["enter_method","trending_topic","previous_page"],enter_from:(0,x.mo)(),author_id:null==l?void 0:null===(e=l.authorInfo)||void 0===e?void 0:e.uid,group_id:null==l?void 0:l.awemeId,log_pb:null==l?void 0:l.logPb,compilation_id:null==l?void 0:null===(t=l.mixInfo)||void 0===t?void 0:t.mixId,playlet_id:null==l?void 0:null===(i=l.seriesInfo)||void 0===i?void 0:i.seriesId,tab_name:(0,P.zD)()||(0,C.Rs)("tab_name")||"",is_visible:String("visible"===document.visibilityState?1:0),is_author_card_expand:(null===(o=I.Le.getConfig("isCollapseAuthorCard"))||void 0===o?void 0:o.isCollapseAuthorCard)?0:1,from_follow_list:(null===(r=I.Le.getConfig("fromFollowList"))||void 0===r?void 0:r.tag)?"1":"0",is_mute:(null==j?void 0:j.muted)?"1":"0",is_force:(null===(a=I.Le.getConfig(I.gI.ForceMuted))||void 0===a?void 0:a.currentMuteType)==="browser"?"1":"0",trending_topic:"",aweme_type:null==l?void 0:l.awemeType,pic_cnt:null==l?void 0:null===(s=l.images)||void 0===s?void 0:s.length,is_small_window:"0"},L)),q.current=()=>{}};let e=()=>{a.activeIndex===(null==l?void 0:l.images.length)-1&&q.current&&!Q.current&&q.current()};return a.on("slideChange",e),()=>{a.off("slideChange",e)}}},[a,l]),!D&&(null==l?void 0:null===(t=l.images)||void 0===t?void 0:t.length)>1?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:s()(m.leftArrow,m.arrow,{[m.disabled]:W[0],[m.inSideBar]:A,[m.inSearch]:R,[m.hide]:ee,[F]:F}),style:{width:`${T}px`,height:`${T}px`},children:(0,o.jsx)(V.Z,{src:E.Z,width:T,height:T,viewBox:"0 0 56 56",onClick:eo})}),(0,o.jsx)("div",{className:s()(m.rightArrow,m.arrow,{[m.disabled]:W[1],[m.inSideBar]:A,[m.inSearch]:R,[m.hide]:ee,[Z]:Z}),style:{width:`${T}px`,height:`${T}px`},children:(0,o.jsx)(V.Z,{src:k.Z,width:T,height:T,viewBox:"0 0 56 56",onClick:er})})]}):null};i("591964");let eo=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played transition",styleKey:"playedColor"}];class er{updateProgress(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},{progressList:i,fragments:n}=this,{newIndex:o,curIndex:r,millisecond:l}=t;o!==r&&i.map((t,i)=>{io&&(t[e].style.width=0)});let a=n[o],s=0===l?0:(l-a.start)/a.duration;i[o]&&(i[o][e].style.width=s<0?0:`${100*s}%`)}reset(){let{progressList:e,fragments:t}=this;this.update({played:0})}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},{playedIndex:t,cachedIndex:i}=this;if("Undefined"!==L.ZP.typeOf(e.played)){let i=this.findIndex(e.played,t);if(i!==t){var n,o;L.ZP.removeClass(null===(n=this.progressList[t])||void 0===n?void 0:n.played,"transition"),L.ZP.addClass(null===(o=this.progressList[i])||void 0===o?void 0:o.played,"transition")}this.updateProgress("played",{newIndex:i,curIndex:t,millisecond:e.played}),this.playedIndex=i}if("Undefined"!==L.ZP.typeOf(e.cached)){let t=this.findIndex(e.cached,i);this.updateProgress("cached",{newIndex:t,curIndex:i,millisecond:parseInt(e.cached,10)}),this.cachedIndex=t}}findIndex(e,t){let{fragments:i}=this;if(1===i.length||0===e)return 0;let n=t;for(let t=0;t=i.start&&e<=i.end)break}return n}findHightLight(){let{children:e}=this.root;for(let t=0;t=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}unHightLight(){let{children:e}=this.root;for(let t=0;t{let n=L.ZP.createDom("xg-inner","",{style:e?`background:${e}; flex: ${t.percent}`:`flex: ${t.percent}`},`${t.isFocus?"inner-focus":""} xgplayer-progress-inner picture-inner`);return n.addEventListener("click",()=>this.onInnerClick(i)),this.root.appendChild(n),eo.map(e=>{n.appendChild(L.ZP.createDom(e.tag,"",{style:e.styleKey?`background: ${this.style[e.styleKey]}; width:0;`:"width:0;"},e.className))}),{cached:n.children[0],played:n.children[1]}})),this.root}constructor(e){this.fragments=e.fragments||[],this.onInnerClick=e.onInnerClick,this.focusClass="inner-focus",this.style=e.style||{playedColor:"",cachedColor:"",progressColor:""},this.cachedIndex=0,this.playedIndex=0}}class el extends S.ZP{static get pluginName(){return"pictureProgress"}static get defaultConfig(){return{position:S.kd.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[],miniMoveStep:5,miniStartStep:2,onMoveStart:()=>{},onMoveEnd:()=>{}}}beforeCreate(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}createInner(){try{this.innerList=new er({duration:this.config.duration,fragments:this.config.fragments,style:this.playerConfig.commonStyle||{},onInnerClick:this.config.onInnerClick}),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map(e=>{this[e]=this.innerList[e].bind(this.innerList)})}catch(e){}}afterCreate(){if(!this.config.disable&&!this.playerConfig.isLive)this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer"),this.createInner(),this.bind("pointerdown",this.onStopPropagation),this.bind("touchstart",this.onStopPropagation)}focus(){this.player.controls.pauseAutoHide(),L.ZP.addClass(this.root,"active")}blur(){this.player.controls.recoverAutoHide(),L.ZP.removeClass(this.root,"active")}onStopPropagation(e){e.stopPropagation()}updateIndex(e,t){let i="video"===this.config.fragments[e].type||t?this.config.fragments[e].start:this.config.fragments[e].end;this.innerList.update({played:i})}updateTime(e){this.innerList.update({played:e})}destroy(){this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null,this.unbind("pointerdown",this.onStopPropagation),this.unbind("touchstart",this.onStopPropagation)}render(){if(this.config.disable||this.playerConfig.isLive)return;let e=this.player.controls?this.player.controls.config.mode:"";return` `}constructor(e){super(e),this._state={now:-1,direc:0,time:0}}}let{ArrowLeft:ea,ArrowRight:es,A:eu,D:ed}=Z.bf,ec=e=>{let t=(0,U.n)(),{preClick:i,nextClick:o,disableShortCut:l=!1,active:a=!0}=e;return(0,r.useEffect)(()=>{if(!!a){if(t){if(l)return j(t);let e={left:{keyCode:ea.keyCode,action:i,disable:!1,noBodyTarget:!1},right:{keyCode:es.keyCode,action:o,disable:!1,noBodyTarget:!1},leftA:{keyCode:eu.keyCode,action:i,disable:!1,noBodyTarget:!1},rightD:{keyCode:ed.keyCode,action:o,disable:!1,noBodyTarget:!1}},r={left:A()(t,"plugins.keyboard.keyCodeMap.left"),right:A()(t,"plugins.keyboard.keyCodeMap.right"),leftA:A()(t,"plugins.keyboard.keyCodeMap.leftA"),rightD:A()(t,"plugins.keyboard.keyCodeMap.rightD")};return F()(t,"plugins.keyboard.keyCodeMap",(0,n._)({},A()(t,"plugins.keyboard.keyCodeMap")||{},e)),()=>{t.plugins.keyboard&&(H({currentCodeMap:t.plugins.keyboard.keyCodeMap,additionalCodeMap:e}),F()(t,"plugins.keyboard.keyCodeMap",(0,n._)({},A()(t,"plugins.keyboard.keyCodeMap")||{},r)))}}}},[t,i,o,l,a]),null},eh=e=>{let{player:t,timeDuration:i=3e3}=e,[n,o]=(0,r.useState)(!1),l=(0,r.useRef)(),a=(0,r.useCallback)(()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{o(!0),l.current=null},i)},[i]);return(0,r.useEffect)(()=>{if(null==t?void 0:t.root){var e,i,n;let r=()=>{l.current&&clearTimeout(l.current),o(!1)},s=()=>{o(!1),a()},u=()=>{o(!1),a()};return null==t||null===(e=t.root)||void 0===e||e.addEventListener("mouseenter",s),null==t||null===(i=t.root)||void 0===i||i.addEventListener("mousemove",u),null==t||null===(n=t.root)||void 0===n||n.addEventListener("mouseleave",r),()=>{var e,i,n;null==t||null===(e=t.root)||void 0===e||e.removeEventListener("mouseenter",s),null==t||null===(i=t.root)||void 0===i||i.removeEventListener("mousemove",u),null==t||null===(n=t.root)||void 0===n||n.removeEventListener("mouseleave",r)}}},[null==t?void 0:t.root,a,o]),(0,r.useEffect)(()=>()=>{l.current&&clearTimeout(l.current),l.current=null},[]),n},eg={singleTime:2e3,speed:250},em=e=>{var t;let{isActive:i,awemeInfo:l,swiper:a,onPlayFinish:c,playNextFunc:h,ablePlayNext:g,playPrevFunc:_,ablePlayPrev:y,logParams:S,arrowButtonSize:L=56,isClientMiniWin:T,disableShortCut:D=!1,isShowSideBar:N=!1,inSearch:M,leftStyle:A,rightStyle:R}=e,F=(0,U.n)(),[Z,j]=(0,r.useState)(!0),[H,B]=(0,r.useState)([!0,!0]),W=(0,r.useRef)(S),O=(0,r.useRef)(!0),z=(0,r.useRef)(null),$=e=>{j(e),O.current=e},Y=eh({player:F}),K=(0,r.useMemo)(()=>l.images.reduce((e,t)=>e+(t.video?t.video.duration:eg.singleTime),0),[l]),X=(0,r.useMemo)(()=>{if(l&&0===l.images.length)return[];let e=-1;return l.images.map(t=>{if(t.video){let i={type:"video",start:e+1,end:e+t.video.duration,duration:t.video.duration,percent:1/l.images.length};return e=i.end,i}{let t={type:"image",start:e+1,end:e+eg.singleTime,duration:eg.singleTime,percent:1/l.images.length};return e=t.end,t}})},[l]);W.current=S;let Q=(0,r.useCallback)(e=>{var t;let i=null==F?void 0:F.getPlugin("pictureProgress");null==i||null===(t=i.updateIndex)||void 0===t||t.call(i,e,O.current)},[F]),J=(0,r.useCallback)(e=>{var t;let i=null==F?void 0:F.getPlugin("pictureProgress");null==i||null===(t=i.updateTime)||void 0===t||t.call(i,e)},[F]),ee=(0,r.useCallback)(e=>{var t,i;G.sendLog("multiPhotoSlide",(0,v._)((0,n._)({enter_from:null===(t=W.current)||void 0===t?void 0:t.enter_from,author_id:null==l?void 0:null===(i=l.authorInfo)||void 0===i?void 0:i.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length,is_zoom:(0,w.r)()},W.current),{enter_method:"click_pic",aweme_type:(null==l?void 0:l.isSlides)?151:null==l?void 0:l.awemeType})),a.slideTo(e,0),$(!1),Q(e),B([0===a.activeIndex,a.activeIndex===(null==l?void 0:l.images.length)-1])},[a,Q,l]),et=(0,r.useCallback)(e=>{if(a.activeIndex>0){var t,i;G.sendLog("multiPhotoSlide",(0,v._)((0,n._)({enter_from:null===(t=W.current)||void 0===t?void 0:t.enter_from,author_id:null==l?void 0:null===(i=l.authorInfo)||void 0===i?void 0:i.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length,is_zoom:(0,w.r)()},W.current),{enter_method:(null==e?void 0:e.type)==="click"?"click_button":"keyboard",aweme_type:(null==l?void 0:l.isSlides)?151:null==l?void 0:l.awemeType})),$(!1),Q(a.activeIndex-1),a.slidePrev(),B([0===a.activeIndex,a.activeIndex===(null==l?void 0:l.images.length)-1])}},[a,Q,l]),en=(0,r.useCallback)(e=>{if(a.activeIndex{if(F&&(null==l?void 0:l.awemeType)===d.e.Note){let e=e=>{if(e){var t;G.sendLog("enterGraphicDetail",{enter_from:null==S?void 0:S.enter_from,author_id:null==l?void 0:null===(t=l.authorInfo)||void 0===t?void 0:t.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length})}};return F.on(u.Events.FULLSCREEN_CHANGE,e),()=>{F.off(u.Events.FULLSCREEN_CHANGE,e)}}},[l,F]),(0,r.useEffect)(()=>{if(F&&(null==l?void 0:l.awemeType)===d.e.Note){let e=F.getPlugin("AutoPlaySettingPlugin")||F.getPlugin("SearchAutoPlaySettingPlugin");if(e)return e.playeNextWeightNum+=1,()=>{e.playeNextWeightNum-=1}}},[l,F]),(0,r.useEffect)(()=>{if(F&&(null==l?void 0:l.awemeType)===d.e.Note){let e=F.getPlugin("InnerAutoPlayPlugin");if(e)return e.config.innerAutoPlayWeight+=1,()=>{e.config.innerAutoPlayWeight-=1}}},[l,F]),(0,r.useEffect)(()=>{if(F)return F.registerPlugin(el,{fragments:X,duration:K,onInnerClick:ee}),F.getPlugin(p.Z.pluginName)&&F.unRegisterPlugin(p.Z.pluginName,!0),F.getPlugin(f.Z.pluginName)&&F.unRegisterPlugin(f.Z.pluginName,!0),()=>{F.getPlugin(el.pluginName)&&F.unRegisterPlugin(el.pluginName,!0),F.registerPlugin(p.Z,{}),F.registerPlugin(f.Z,{})}},[F,ee]),(0,r.useEffect)(()=>{if(a){let e=!1,t=()=>{e=!1,setTimeout(()=>ee(a.activeIndex))},i=()=>{$(!1),Q(a.activeIndex),e||a.once("touchEnd",t),e=!0};try{a.on("touchMove",i)}catch(e){}return()=>{try{null==a||a.off("touchMove",i)}catch(e){}}}},[a,Q,ee]);let eo=(0,r.useCallback)(()=>{var e,t,i;let n=F.getPlugin("AutoPlaySettingPlugin")||F.getPlugin("SearchAutoPlaySettingPlugin"),o=F.getPlugin("InnerAutoPlayPlugin");n&&(null==n?void 0:null===(e=n.config)||void 0===e?void 0:e.nextAutoPlay)&&(null==n?void 0:n.playeNextWeightNum)<=1&&g&&(null==n?void 0:n.stopFlag)===0?null==h||h():o&&(null===(t=I.Le.getConfig(I.gI.InnerAutoPlay))||void 0===t?void 0:t.modeIndex)===ei.Nomal&&o.config.innerAutoPlayWeight>=0&&g&&(null==o?void 0:o.stopFlag)===0?null==h||h({from:"auto"}):o&&(null===(i=I.Le.getConfig(I.gI.InnerAutoPlay))||void 0===i?void 0:i.modeIndex)===ei.Reverse&&o.config.innerAutoPlayWeight>=0&&y&&(null==o?void 0:o.stopFlag)===0&&(null==_||_({from:"auto"}))},[F,y,g,_,h]);return(0,r.useEffect)(()=>{if(i&&F&&a&&Z&&"video"!==X[a.activeIndex].type){let e=1e3*F.currentTime;e>100&&l.imageAlbumMusicInfo.beginTime>1e3&&(e-=l.imageAlbumMusicInfo.beginTime);let t=()=>{let t=((F.currentTime+F.duration)*1e3-e)%(1e3*F.duration);if(l.imageAlbumMusicInfo.beginTime>1e3){let{beginTime:i,endTime:n}=l.imageAlbumMusicInfo,o=n-i;t=(1e3*F.currentTime-i+o-e)%o}if(t>=eg.singleTime){var i,o,r;if(a.activeIndex===l.images.length-1){eo(),Q(0),B([!0,!1]),a.slideTo(0,0);let e=F.getPlugin("pictureProgress");null==e||null===(o=e.innerList)||void 0===o||o.reset(),G.sendLog("multiPhotoSlide",(0,v._)((0,n._)({enter_from:null==S?void 0:S.enter_from,author_id:null==l?void 0:null===(r=l.authorInfo)||void 0===r?void 0:r.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length,is_zoom:(0,w.r)()},W.current),{enter_method:"auto",aweme_type:(null==l?void 0:l.isSlides)?151:null==l?void 0:l.awemeType})),F.cumulateTime>=5e3&&z.current();return}Q(a.activeIndex+1),B([!1,a.activeIndex+1===(null==l?void 0:l.images.length)-1]),a.slideTo(a.activeIndex+1,eg.speed),G.sendLog("multiPhotoSlide",(0,v._)((0,n._)({enter_from:null==S?void 0:S.enter_from,author_id:null==l?void 0:null===(i=l.authorInfo)||void 0===i?void 0:i.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length,is_zoom:(0,w.r)()},W.current),{enter_method:"auto",aweme_type:(null==l?void 0:l.isSlides)?151:null==l?void 0:l.awemeType}));return}J(X[a.activeIndex].start+t)};return F.on(u.Events.TIME_UPDATE,t),()=>{F.off(u.Events.TIME_UPDATE,t)}}},[null==a?void 0:a.activeIndex,F,i,Z,X,eo]),(0,r.useEffect)(()=>{if(i&&F&&a){let e=e=>{"switch_play_pause"===e.action&&e.paused&&$(!0)};return F.on(u.Events.USER_ACTION,e),()=>{F.off(u.Events.USER_ACTION,e)}}},[i,F,a]),(0,r.useEffect)(()=>{if(i&&F&&a){let e=q.listen(q.EVENT.notevideo,e=>{let{type:t,data:i,index:o,playerId:r}=e;if(F.playerId===r){if("timeupdate"===t&&a.activeIndex===o&&J(X[a.activeIndex].start+i),"end"===t){if(Z){var s,u,d;if(a.activeIndex===l.images.length-1){eo(),Q(0),B([!0,!1]),a.slideTo(0,0);let e=F.getPlugin("pictureProgress");null==e||null===(u=e.innerList)||void 0===u||u.reset(),G.sendLog("multiPhotoSlide",(0,v._)((0,n._)({enter_from:null==S?void 0:S.enter_from,author_id:null==l?void 0:null===(d=l.authorInfo)||void 0===d?void 0:d.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length,is_zoom:(0,w.r)()},W.current),{enter_method:"auto",aweme_type:(null==l?void 0:l.isSlides)?151:null==l?void 0:l.awemeType})),F.cumulateTime>=5e3&&z.current();return}Q(a.activeIndex+1),B([!1,a.activeIndex+1===(null==l?void 0:l.images.length)-1]),a.slideTo(a.activeIndex+1,eg.speed),G.sendLog("multiPhotoSlide",(0,v._)((0,n._)({enter_from:null==S?void 0:S.enter_from,author_id:null==l?void 0:null===(s=l.authorInfo)||void 0===s?void 0:s.uid,group_id:null==l?void 0:l.awemeId,pic_cnt:l.images.length,is_zoom:(0,w.r)()},W.current),{enter_method:"auto",aweme_type:(null==l?void 0:l.isSlides)?151:null==l?void 0:l.awemeType}))}else q.emit(q.EVENT.notevideo,{type:"replay",playerId:F.playerId,index:a.activeIndex})}}});return()=>e()}},[i,F,a,Z,eo]),(0,r.useEffect)(()=>{if(a){let e=()=>{if(a.activeIndex===(null==l?void 0:l.images.length)-1){var t,i,o,r,s,u,d,h;G.sendLog("videoPlayFinish",(0,v._)((0,n._)({urlParamList:["enter_method","trending_topic","previous_page"],enter_from:(0,x.mo)(),author_id:null==l?void 0:null===(t=l.authorInfo)||void 0===t?void 0:t.uid,group_id:null==l?void 0:l.awemeId,log_pb:null==l?void 0:l.logPb,compilation_id:null==l?void 0:null===(i=l.mixInfo)||void 0===i?void 0:i.mixId,playlet_id:null==l?void 0:null===(o=l.seriesInfo)||void 0===o?void 0:o.seriesId,tab_name:(0,P.zD)()||(0,C.Rs)("tab_name")||"",is_visible:String("visible"===document.visibilityState?1:0),is_author_card_expand:(null===(r=I.Le.getConfig(I.gI.IsCollapseAuthorCard))||void 0===r?void 0:r.isCollapseAuthorCard)?0:1,from_follow_list:(null===(s=I.Le.getConfig(I.gI.FromFollowList))||void 0===s?void 0:s.tag)?"1":"0",is_mute:(null==F?void 0:F.muted)?"1":"0",is_force:(null===(u=I.Le.getConfig(I.gI.ForceMuted))||void 0===u?void 0:u.currentMuteType)==="browser"?"1":"0",trending_topic:"",aweme_type:null==l?void 0:l.awemeType,pic_cnt:null==l?void 0:null===(d=l.images)||void 0===d?void 0:d.length,is_small_window:"0",column_type:(null==S?void 0:S.column_type)||(null==S?void 0:null===(h=S.search_params)||void 0===h?void 0:h.column_type)},S,(0,b.Wc)()),{is_selected_label:(null==l?void 0:l.weeklyRecommend)?1:0}));try{a.off("slideChange",e)}catch(e){}null==c||c()}};try{a.slideTo(0,0),B([0===a.activeIndex,a.activeIndex===(null==l?void 0:l.images.length)-1]),a.on("slideChange",e)}catch(e){}return()=>{try{a.off("slideChange",e)}catch(e){}}}},[a,l]),(0,r.useEffect)(()=>{if(a){z.current=()=>{var e,t,i,o,r,a,s;G.sendLog("finishTuji",(0,n._)({urlParamList:["enter_method","trending_topic","previous_page"],enter_from:(0,x.mo)(),author_id:null==l?void 0:null===(e=l.authorInfo)||void 0===e?void 0:e.uid,group_id:null==l?void 0:l.awemeId,log_pb:null==l?void 0:l.logPb,compilation_id:null==l?void 0:null===(t=l.mixInfo)||void 0===t?void 0:t.mixId,playlet_id:null==l?void 0:null===(i=l.seriesInfo)||void 0===i?void 0:i.seriesId,tab_name:(0,P.zD)()||(0,C.Rs)("tab_name")||"",is_visible:String("visible"===document.visibilityState?1:0),is_author_card_expand:(null===(o=I.Le.getConfig(I.gI.IsCollapseAuthorCard))||void 0===o?void 0:o.isCollapseAuthorCard)?0:1,from_follow_list:(null===(r=I.Le.getConfig(I.gI.FromFollowList))||void 0===r?void 0:r.tag)?"1":"0",is_mute:(null==F?void 0:F.muted)?"1":"0",is_force:(null===(a=I.Le.getConfig(I.gI.ForceMuted))||void 0===a?void 0:a.currentMuteType)==="browser"?"1":"0",trending_topic:"",aweme_type:null==l?void 0:l.awemeType,pic_cnt:null==l?void 0:null===(s=l.images)||void 0===s?void 0:s.length,is_small_window:"0"},S)),z.current=()=>{}};let e=()=>{a.activeIndex===(null==l?void 0:l.images.length)-1&&z.current&&!O.current&&z.current()};return a.on("slideChange",e),()=>{a.off("slideChange",e)}}},[a,l]),!T&&(null==l?void 0:null===(t=l.images)||void 0===t?void 0:t.length)>1?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:s()(m.leftArrow,m.arrow,{[m.disabled]:H[0],[m.inSideBar]:N,[m.inSearch]:M,[m.hide]:Y,[A]:A}),style:{width:`${L}px`,height:`${L}px`},children:(0,o.jsx)(V.Z,{src:E.Z,width:L,height:L,viewBox:"0 0 56 56",onClick:et})}),(0,o.jsx)("div",{className:s()(m.rightArrow,m.arrow,{[m.disabled]:H[1],[m.inSideBar]:N,[m.inSearch]:M,[m.hide]:Y,[R]:R}),style:{width:`${L}px`,height:`${L}px`},children:(0,o.jsx)(V.Z,{src:k.Z,width:L,height:L,viewBox:"0 0 56 56",onClick:en})})]}):null};i("780582");var ev=i("463686"),ep="R_tHQXq8",ef="YUwyLc8o";let e_=e=>{let{info:t,activeIndex:i,currentIndex:n,albumMusic:l}=e,a=(0,r.useRef)(),s=(0,U.n)(),d=(0,r.useRef)(!1),c=(0,r.useMemo)(()=>{let e=t.video.bitRateList.find(e=>0===e.isH265);return e&&e.playAddr?e.playAddr.map(e=>({src:(0,ev.preProcessUrl)(e.src).url})).concat({src:e.playApi}):[]},[t.video]);return((0,r.useEffect)(()=>{if(s){if(i===n){if(!s.paused){var e;null===(e=a.current)||void 0===e||e.play()}}else a.current&&(a.current.paused||a.current.pause(),a.current.currentTime=0)}},[s,i,n]),(0,r.useEffect)(()=>{if(s&&i===n){let e=()=>{var e;if(!(s.currentTime<=.5)||!d.current)l.beginTime,null===(e=a.current)||void 0===e||e.play()};return s.on("play",e),()=>{s.off("play",e)}}},[s,i,n]),(0,r.useEffect)(()=>{if(s){let e=()=>{var e;if(!(s.currentTime<=.5)&&!(s.duration-s.currentTime<=.5)&&(!(l.beginTime>1e3)||!(s.currentTime-l.beginTime/1e3<=.5)&&!(l.endTime/1e3-s.currentTime<=.5)))null===(e=a.current)||void 0===e||e.pause()};return s.on("pause",e),()=>{s.off("pause",e)}}},[s]),(0,r.useEffect)(()=>{if(s){let e=()=>{d.current=!0};return s.on("ended",e),()=>{s.off("ended",e)}}},[s]),(0,r.useEffect)(()=>{if(s&&i===n){let e=q.listen(q.EVENT.notevideo,e=>{let{type:t,index:n,playerId:o}=e;a.current&&"replay"===t&&o===s.playerId&&n===i&&a.current.play()});return()=>e()}},[s,i,n]),(0,r.useEffect)(()=>{if(s&&i===n&&a.current){.01===s.volume?a.current.volume=parseFloat(s.config.volume_raw)||0:a.current.volume=s.volume,a.current.muted=s.muted;let e=e=>{if(!0!==e.isInternalOp).01===s.volume?a.current.volume=parseFloat(s.config.volume_raw)||0:a.current.volume=s.volume,a.current.muted=s.muted};return null==s||s.on(u.Events.VOLUME_CHANGE,e),()=>{null==s||s.off(u.Events.VOLUME_CHANGE,e)}}},[s,i,n]),n-i>1||n-i<-1)?null:(0,o.jsx)("div",{className:ep,children:(0,o.jsx)("video",{className:ef,muted:!0,playsInline:!0,"x5-playsinline":!0,"webkit-playsinline":!0,autoPlay:!1,onPlay:()=>{q.emit(q.EVENT.notevideo,{type:"start",playerId:null==s?void 0:s.playerId,index:n})},onEnded:()=>{q.emit(q.EVENT.notevideo,{type:"end",playerId:null==s?void 0:s.playerId,index:n})},onTimeUpdate:()=>{var e,t;q.emit(q.EVENT.notevideo,{type:"timeupdate",playerId:null==s?void 0:s.playerId,data:(null===(e=a.current)||void 0===e?void 0:e.currentTime)*1e3,index:n}),(0,Q.G6)()&&(null==s?void 0:s.paused)&&(null===(t=a.current)||void 0===t||t.pause())},ref:a,children:c.map((e,t)=>(0,o.jsx)("source",{src:e.src},t))})})};var ey=i.p+"media/generalBG.334abb494f88d534.png",ew=i.p+"media/douyinDefault.ee9da4401be3dae0.png",eI={imgBackground:"pW32W85z",baseWidth:"A1yg9vhk",baseHeight:"byyMfSln",isSafari:"eQg_IQJn",playerShowInfo:"kDOafagU",backgroundImg:"XMt1dl0L",backgroundMask:"fTzl9bRi",backgroundImgFirefox:"sPicyeNY",backgroundImgSarari:"kL0r_mK9",isFirefox:"o58YHf3o",imgPlaceHolder:"WGgIkyOs"};let ex=e=>{let{imageInfo:t,className:i,imgPlaceHolderClassName:n,isMini:l}=e,[a,u]=(0,r.useState)(!0),[d,c]=(0,r.useState)(!1),[g,m]=(0,r.useState)(null),[v,p]=(0,r.useState)(-1),f=(0,r.useRef)(0),_=(0,Q.G6)(),y=(0,Q.vU)();f.current=(null==t?void 0:t.width)/(null==t?void 0:t.height);let w=(0,r.useCallback)(()=>{g&&f.current&&(g.offsetWidth/f.current>g.offsetHeight-(l?0:33)?u(!0):u(!1))},[g,l]),I=(0,r.useCallback)(()=>{d||c(!0)},[d]);(0,r.useEffect)(()=>{if(g&&w){let e=h.Z.bind(g,w);return()=>{e&&e()}}},[g,w]),(0,r.useEffect)(()=>{g&&(l?g.setAttribute("normal",""):g.removeAttribute("normal"))},[g,l]);let x=(0,r.useMemo)(()=>{if(d)return null;if(-1!==v)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("img",{src:null==t?void 0:t.urlList[v],className:s()({[eI.baseWidth]:!a,[eI.baseHeight]:a,[eI.isSafari]:_},eI.imgPlaceHolder,n),onError:I}),(0,o.jsxs)("div",{className:s()({[eI.backgroundImg]:!_,[eI.backgroundImgFirefox]:y,[eI.backgroundImgSarari]:_}),children:[(0,o.jsx)("img",{src:_?ey:(null==t?void 0:t.urlList[v])||ey}),!_&&(0,o.jsx)("div",{className:eI.backgroundMask})]})]});{let e=new Image;e.src=null==t?void 0:t.urlList[0];let i=setTimeout(()=>{null==t||t.urlList.map((e,t)=>{let i=new Image;i.src=e,i.onload=()=>p(t)})},2e3);return e.onload=()=>{p(0),clearTimeout(i)},(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("img",{src:ew,className:s()({[eI.baseWidth]:!a,[eI.baseHeight]:a,[eI.isSafari]:_},eI.imgPlaceHolder,n)}),(0,o.jsxs)("div",{className:s()({[eI.backgroundImg]:!_,[eI.backgroundImgFirefox]:y,[eI.backgroundImgSarari]:_}),children:[(0,o.jsx)("img",{src:_?ey:ew}),!_&&(0,o.jsx)("div",{className:eI.backgroundMask})]})]})}},[d,v,I,a]);return(0,o.jsx)("div",{className:s()(i,eI.imgBackground,eI.playerShowInfo,{[eI.isFirefox]:y}),ref:m,children:x})};var eC=i("111482"),eb=i("249782"),eP=i("915825"),eE=i("316061");let ek=e=>{let{isActive:t,awemeInfo:i,playNextFunc:n,playPrevFunc:l,ablePlayPrev:a,ablePlayNext:v,logParams:p,isMini:f,isClientMiniWin:_,onPlayFinish:y,customProps:w,abTestData:I,disableShortCut:x=!1,isShowSideBar:C=!1,inSearch:b}=e,P=(0,U.n)(),[E,k]=(0,r.useState)(null),[S,L]=(0,r.useState)(i),{arrowButtonSize:T=56,disableInactiveCursor:D=!1,leftStyle:N,rightStyle:M}=w||{},A=(0,r.useMemo)(()=>{var e;if((null==i?void 0:i.awemeType)!==d.e.Note)return[];if(t)return null==i?void 0:i.images;return(null==i?void 0:null===(e=i.images)||void 0===e?void 0:e.slice(0,1))||[]},[null==i?void 0:i.images,t,null==i?void 0:i.awemeType]),R=(0,r.useMemo)(()=>{var e,t;return!!(null==i?void 0:null===(t=i.images)||void 0===t?void 0:null===(e=t.find)||void 0===e?void 0:e.call(t,e=>e.video))},[null==i?void 0:i.images]);return((0,r.useEffect)(()=>()=>k(null),[]),(0,r.useEffect)(()=>{let e=null==P?void 0:P.innerContainer;if(e&&(null==i?void 0:i.awemeType)===d.e.Note)return u.Util.addClass(e,"hideXgVideo"),()=>{u.Util.removeClass(e,"hideXgVideo")}},[P,i]),(0,r.useEffect)(()=>{let{beginTime:e=0,endTime:t=Number.MAX_SAFE_INTEGER}=(null==i?void 0:i.imageAlbumMusicInfo)||{},n=()=>{(P.currentTime>=t/1e3||P.currentTime=0&&t>e&&(null==P||P.on(u.Events.TIME_UPDATE,n)),()=>{null==P||P.off(u.Events.TIME_UPDATE,n)}},[P,i]),(0,r.useEffect)(()=>{if(t&&E&&P){var e;E.update();let t=h.Z.bind(null==E?void 0:null===(e=E.$el)||void 0===e?void 0:e[0],()=>{E.update()});return()=>{t&&t()}}},[E,t,P]),(0,r.useEffect)(()=>{L(i)},[i]),(0,r.useEffect)(()=>{var e,n;if(t&&P&&(null==i?void 0:null===(e=i.imageAlbumMusicInfo)||void 0===e?void 0:e.volume)===0)return P.config.volume_raw=P.volume,P.volume=.01,()=>{P.volume=P.config.volume_raw,(0,g.qQ)(c.LocalStorageKeys.PLAYER_VOLUME,P.volume),(0,eE.c)({volume:P.config.volume_raw})};!t&&P&&(null==i?void 0:null===(n=i.imageAlbumMusicInfo)||void 0===n?void 0:n.volume)===0&&P.config.volume_raw&&((0,g.qQ)(c.LocalStorageKeys.PLAYER_VOLUME,P.volume),(0,eE.c)({volume:P.config.volume_raw}))},[t,P]),(null==i?void 0:i.awemeType)!==d.e.Note)?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(eb.t,{direction:0,onSwiper:k,className:s()(m.swiperContainer,"focusPanel"),tabIndex:-1,data:A,slideKey:(e,t)=>`${null==e?void 0:e.uri}_${t}`,speed:250,children:(0,o.jsx)(eP.o,{className:m.pictureFeed,children:e=>{let{slideData:n,activeIndex:r,currentIndex:l}=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{style:{width:"100%",height:"100%",zIndex:2,background:"transparent"},className:s()(m.mask,{[m.inactive]:r!==l&&D}),type:"button",onKeyDown:e=>null==e?void 0:e.preventDefault()}),(0,o.jsx)(ex,{imageInfo:n,isMini:f,className:m.itemImage}),t&&n.video&&(0,o.jsx)(e_,{albumMusic:i.imageAlbumMusicInfo,info:n,isMini:f,activeIndex:r,currentIndex:l})]})}})}),S===i&&t&&!R&&(0,o.jsx)(en,{isActive:t,awemeInfo:i,swiper:E,onPlayFinish:y,playNextFunc:n,playPrevFunc:l,ablePlayNext:v,ablePlayPrev:a,logParams:p,arrowButtonSize:T,isClientMiniWin:_,disableShortCut:x,isShowSideBar:C,inSearch:b,leftStyle:N,rightStyle:M}),S===i&&t&&R&&(0,o.jsx)(em,{isActive:t,awemeInfo:i,swiper:E,onPlayFinish:y,playNextFunc:n,playPrevFunc:l,ablePlayNext:v,ablePlayPrev:a,logParams:p,arrowButtonSize:T,isClientMiniWin:_,disableShortCut:x,isShowSideBar:C,inSearch:b,leftStyle:N,rightStyle:M})]})},eS=e=>{let t=(0,eC.N)();return(0,o.jsx)(l.k,{componentName:"PictureMode",Slardar:t,children:(0,o.jsx)(ek,(0,n._)({},e))})}},316061:function(e,t,i){i.d(t,{J:function(){return s},c:function(){return u}});var n=i(629686),o=i(709705),r=i(409250),l=i(426038);let a=!0,s=e=>{var t,i,n,s;let u=(null!==(t=(0,o.$o)(l.LocalStorageKeys.PLAYER_IS_MUTE))&&void 0!==t?t:0)===1,d=null!==(i=(0,o.$o)(l.LocalStorageKeys.PLAYER_VOLUME))&&void 0!==i?i:.5,c=r.Q.getItem({sKey:l.CookieKeys.VolumeInfo})||{};return(!c.isMute||c.isMute&&c.isUserMute)&&(d=null!==(n=c.volume)&&void 0!==n?n:d,u=null!==(s=c.isMute)&&void 0!==s?s:u),a&&(a=!1),{volume:d<0?.5:d,autoplayMuted:u}},u=e=>{let t=r.Q.getItem({sKey:l.CookieKeys.VolumeInfo});r.Q.setItem(l.CookieKeys.VolumeInfo,(0,n._)({},t,e),1/0)}}}]);