1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{84979:function(e,t,l){"use strict";l.d(t,{Z:function(){return o}});var n=l(84297);let o=(0,n.Z)("ChevronUp",[["polyline",{points:"18 15 12 9 6 15",key:"1uugdp"}]])},92559:function(e,t,l){"use strict";l.d(t,{Z:function(){return o}});var n=l(84297);let o=(0,n.Z)("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]])},29876:function(e,t,l){"use strict";l.d(t,{Z:function(){return o}});var n=l(84297);let o=(0,n.Z)("VolumeX",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]])},61253:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/video-ngan/[index]",function(){return l(11584)}])},20380:function(e,t,l){"use strict";var n=l(85893),o=l(9008),r=l.n(o),s=l(11163);t.Z=e=>{let{title:t,description:l,type:o,image:i,imageWidth:a,imageHeight:c}=e,d=(0,s.useRouter)();return(0,n.jsxs)(r(),{children:[(0,n.jsx)("title",{children:t}),!!l&&(0,n.jsx)("meta",{name:"description",content:l},"desc"),!!l&&(0,n.jsx)("meta",{property:"og:description",content:l},"og_desc"),!!o&&(0,n.jsx)("meta",{property:"og:type",content:o},"og_type"),(0,n.jsx)("meta",{property:"og:url",content:"https://fireant.vn".concat(d.asPath)},"og_url"),!!i&&(0,n.jsx)("meta",{property:"og:image",content:i},"og_image"),!!a&&(0,n.jsx)("meta",{property:"og:image:width",content:a.toString()},"og_imageWidth"),!!c&&(0,n.jsx)("meta",{property:"og:image:height",content:c.toString()},"og_imageHeight")]})}},11584:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return S}});var n=l(85893),o=l(20380),r=l(11163),s=l.n(r),i=l(11201),a=l(92678),c=l(67294),d=l(76618),u=l(9473),h=l(84979),p=l(8971),g=l(29876),f=l(925
159),m=l(20508),v=l(96486),x=l.n(v),y=l(25935),b=l(56616);function VideoStory(e){var t,l,o,r;let{postSelectedId:i}=e,v=(0,u.I0)(),w=(0,u.v9)(e=>m.ueT(e,d.ib)),j=(0,u.v9)(e=>m.ueT(e,d.ZS)),[N,k]=(0,c.useState)(0),[S,I]=(0,c.useState)(!1),P=(0,c.useRef)([]),_=(0,c.useRef)([]),[Z,E]=(0,c.useState)(null),[T,q]=(0,c.useState)(5),[U,V]=(0,c.useState)(!0),C=x().uniqBy(null!==(r=(null!==(t=null==w?void 0:w.posts)&&void 0!==t?t:[]).concat(null!==(l=null==j?void 0:j.posts)&&void 0!==l?l:[]).concat(null!==(o=(0,u.v9)(e=>i?m.pNi(e,i):[]))&&void 0!==o?o:[]).sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime()))&&void 0!==r?r:[],"postID"),D=i?[...C.filter(e=>e.postID===i),...C.filter(e=>e.postID!==i)].slice(0,T).map((e,t)=>({...e,videoUrl:t>=N-1&&t<=N+1?e.videoUrl:void 0})):C.slice(0,T).map((e,t)=>({...e,videoUrl:t>=N-1&&t<=N+1?e.videoUrl:void 0})),handleVideoClick=e=>{let t=P.current[e];if(t){if(Z===e)t.pause(),E(null);else{var l;null===(l=P.current[Z])||void 0===l||l.pause(),t.play().catch(console.error),E(e)}}},handleMuteToggle=e=>{e.stopPropagation(),V(e=>!e)},handleNavigate=e=>{var t;let l="up"===e?Math.max(0,N-1):Math.min(D.length-1,N+1);k(l),console.log(l),null===(t=_.current[l])||void 0===t||t.scrollIntoView({behavior:"smooth",block:"center"})};return(0,c.useEffect)(()=>{let e=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){let n=_.current.findIndex(t=>t===e.target);if(-1!==n){k(n);let e=P.current[n];if(e&&e.play().then(()=>E(n)).catch(e=>{console.error("Error playing video:",e),E(null)}),n+2===T&&T===C.length){var t,l;v(a.cq.requestVideosUser(0,0,d.ib,10,(null!==(t=null==w?void 0:w.offset)&&void 0!==t?t:0)+10)),v(a.cq.requestVideosUser(0,0,d.ZS,10,(null!==(l=null==j?void 0:j.offset)&&void 0!==l?l:0)+10))}n>=D.length-2&&T<C.length&&q(e=>Math.min(e+5,C.length))}}else{let t=_.current.findIndex(t=>t===e.target);if(-1!==t){let e=P.current[t];e&&(e.pause(),E(null))}}})},{root:null,rootMargin:"0px",threshold:.5});return _.current.forEach(t=>{t&&e.observe(t)}),()=>{_.current.forEach(t=>{t&&e.unobserve(t)})}},[T,C.length,S]),(0,c.useEffect)(()=>{C&&N<C.length?window.history.replaceState({},"","/video-ngan/".concat(C[N].postID)):window.location.pathname.startsWith("/video-ngan/")&&window.history.replaceState({},"",window.location.pathname.split("/video-ngan/")[0])},[C,N]),(0,c.useEffect)(()=>{let e;let handleScroll=()=>{I(!0),clearTimeout(e),e=setTimeout(()=>{I(!1);let e=P.current[N];e&&e.play().then(()=>E(N)).catch(e=>{console.error("Error playing video:",e),E(null)})},150)},t=document.querySelector(".overflow-y-auto");if(t)return t.addEventListener("scroll",handleScroll),()=>{t.removeEventListener("scroll",handleScroll),clearTimeout(e)}},[N]),(0,c.useEffect)(()=>{i&&!C.some(e=>e.postID===i)&&v(a.cq.requestPost(i))},[i,C,v]),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("img",{src:"/logo.png",alt:"Stockbiz",width:200,height:70,className:"absolute top-6 left-6 cursor-pointer z-50",onClick:()=>s().push("/")}),(0,n.jsx)("div",{className:"min-w-full h-dvh !shadow-none !rounded-none bg-black !border-none flex justify-center text-white items-center p-0 md:p-6",children:(0,n.jsx)("div",{className:"w-full h-full overflow-y-auto no-scrollbar scroll-smooth",children:(0,n.jsx)("div",{className:"w-full h-full overflow-y-auto no-scrollbar scroll-smooth",style:{scrollSnapType:"y mandatory"},children:D.map((e,t)=>(0,n.jsx)("div",{ref:e=>{_.current[t]=e},className:"w-full h-[95vh] relative mt-6 flex justify-center items-center",style:{scrollSnapAlign:"center",scrollSnapStop:"always"},children:(0,n.jsx)("div",{className:"w-full h-full flex justify-center",children:(0,n.jsxs)("div",{className:"relative cursor-pointer max-w-[510px]",onClick:()=>handleVideoClick(t),children:[(0,n.jsx)("button",{onClick:()=>handleNavigate("up"),disabled:0===N,className:"fixed bottom-1/2 right-4 -translate-x-1/2 bg-gray-800 p-2 rounded-full hover:bg-gray-700 transition-colors disabled:bg-gray-950 disabled:opacity-50 disabled:pointer-events-none z-50 mb-2",children:(0,n.jsx)(h.Z,{className:"w-8 h-8 text-white"})}),(0,n.jsx)("button",{onClick:()=>handleNavigate("down"),disabled:N===D.length-1,className:"fixed top-1/2 right-4 -translate-x-1/2 bg-gray-800 p-2 rounded-full hover:bg-gray-700 transition-colors disabled:bg-gray-950 disabled:opacity-50 disabled:pointer-events-none z-50",children:(0,n.jsx)(p.Z,{className:"w-8 h-8 text-white"})}),e.videoUrl?(0,n.jsx)("video",{ref:e=>{P.current[t]=e},className:"h-full object-contain rounded-xl",src:e.videoUrl,playsInl
1ine:!0,muted:U,preload:"auto",onPlay:()=>E(t),onPause:()=>E(null)}):(0,n.jsx)("img",{src:e.videoThumbnailUrl,alt:"Thumbnail ".concat(e.postID),className:"h-full object-contain rounded-xl"}),(0,n.jsx)("div",{className:"absolute w-full h-[200px] bottom-0 right-0 bg-gradient-to-b from-transparent to-[#1e293b] rounded-b-xl"}),(0,n.jsxs)("div",{className:"absolute bottom-0 p-4 flex flex-col items-start justify-start gap-2",children:[(0,n.jsx)("img",{src:"/logo.png",alt:"Stockbiz",width:100,height:50}),(0,y.ZP)((0,b.pk)(e.content))]}),(0,n.jsx)("button",{onClick:handleMuteToggle,className:"absolute top-4 right-4 bg-black/50 p-2 rounded-full hover:bg-black/70 transition-colors",children:U?(0,n.jsx)(g.Z,{className:"w-6 h-6 text-white"}):(0,n.jsx)(f.Z,{className:"w-6 h-6 text-white"})})]})})},e.postID))})})})]})}var w=l(82010),j=l(11792),N=l(37624);let k=(0,c.memo)(e=>{let{children:t}=e;return(0,n.jsx)(N.un,{children:(0,n.jsxs)(w.f,{attribute:"class",defaultTheme:"light",children:[(0,n.jsx)("main",{className:"relative flex-grow",children:t}),(0,n.jsx)(j.x,{})]})})}),Page=()=>{let{query:e}=(0,r.useRouter)(),t=parseInt(e.index);return(0,n.jsxs)("div",{className:"w-full h-full",children:[(0,n.jsx)(o.Z,{title:"Video ngắn",description:"Cáºp nháºt tin tức vá»i video ngắn trong Stockbiz"}),(0,n.jsx)(VideoStory,{postSelectedId:t})]})};Page.getLayout=e=>(0,n.jsx)(k,{children:e}),Page.getInitialProps=a.ZP.getInitialPageProps(e=>async t=>{let{pathname:l,req:n,res:o,query:r}=t;if(r.index){let t=parseInt(r.index.toString());e.dispatch(a.cq.requestPost(t))}e.dispatch(a.cq.requestVideosUser(0,0,d.ib,10,0)),e.dispatch(a.cq.requestVideosUser(0,0,d.ZS,10,0)),n&&(e.dispatch(i.uR),await e.sagaTask.toPromise())});var S=Page}},function(e){e.O(0,[5935,9774,2888,179],function(){return e(e.s=61253)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.