1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1781],{1781:function(e,t,l){l.d(t,{ShortsCarousel:function(){return d}});var r=l(7437),s=l(2265),n=l(9376),i=l(4502),o=l(1997);function a(e){if(!e)return null;let t=e.match(/^https?:\/\/i\.ytimg\.com\/(?:vi|vi_webp)\/([a-zA-Z0-9_-]{11})\/(?:0|default|mqdefault|hqdefault|sddefault|maxresdefault)\.(?:jpg|jpeg|webp)(?:\?.*)?$/);return t?"https://i.ytimg.com/vi_webp/".concat(t[1],"/maxresdefault.webp"):e}function c(e){if(!e)return null;let t=e.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/);return t||(t=e.match(/youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/))||(t=e.match(/^https?:\/\/i\.ytimg\.com\/(?:vi|vi_webp)\/([a-zA-Z0-9_-]{11})\//))?t[1]:null}function u(e){let{videoId:t}=e,l="https://www.youtube.com/embed/".concat(t,"?autoplay=1&mute=1&controls=0&loop=1&playlist=").concat(t,"&playsinline=1&rel=0&showinfo=0&modestbranding=1&iv_load_policy=3&disablekb=1&fs=0");return(0,r.jsx)("div",{className:"absolute inset-0 z-0 pointer-events-none bg-black",children:(0,r.jsx)("iframe",{src:l,className:"w-full h-full object-cover scale-[1.35]",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",style:{pointerEvents:"none"},tabIndex:-1})})}function d(e){let{shorts:t,title:l="Video News",className:d,hasMore:h=!1,onReachEnd:p,autoScroll:f=!0}=e,[x,m]=(0,s.useState)(0),[b,g]=(0,s.useState)(null),[v,w]=(0,s.useState)(!1),[j,y]=(0,s.useState)(!1),N=(0,n.useRouter)(),k=(0,s.useRef)(null),_=(0,s.useRef)(null),M=(0,s.useRef)(null),C=(0,s.useRef)(!1),E=(0,s.useRef)(null),S=(0,s.useRef)(null),T=(0,s.useCallback)(()=>{h&&p&&!C.current&&(C.current=!0,p())},[h,p]);(0,s.useEffect)(()=>{C.current=!1},[t.length,h]),(0,s.useEffect)(()=>{let e=k.current;if(!e)return;let t=new IntersectionObserver(e=>{let[t]=e;return y(t.isIntersecting)},{threshold:.25});return t.observe(e),()=>t.disconnect()},[]),(0,s.useEffect)(()=>{let e=window.innerWidth<768,l=e?M.current:_.current;if(!f||!l||!j||!e&&t.length<=4)return;let r=e?222:243;return E.current=setInterval(()=>{if(!v){if(l.scrollLeft+l.clientWidth>=l.scrollWidth-1){l.scrollTo({left:0,behavior:"auto"});return}l.scrollBy({left:r,behavior:"smooth"})}},2800),()=>{E.current&&clearInterval(E.current)}},[f,v,t.length,j]),(0,s.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let W=e=>{f&&(S.current&&clearTimeout(S.current),w(!0));let t=window.innerWidth<768,l=t?M.current:_.current;if(!l)return;let r=t?222:243;l.scrollBy({left:"left"===e?-r:r,behavior:"smooth"}),f&&(S.current=setTimeout(()=>{w(!1)},2200))},z=e=>{var l;let r=null===(l=t[e])||void 0===l?void 0:l.slug;r&&N.push("/shorts/".concat(r))};return(0,r.jsxs)("div",{ref:k,className:(0,i.cn)("flex flex-col gap-[25px]",d),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-widest text-white/60",children:l}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:()=>W("left"),className:"w-8 h-8 rounded-full border border-white/15 flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Previous",children:(0,r.jsx)("svg",{className:"w-4 h-4 text-white/60",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)("button",{onClick:()=>W("right"),className:"w-8 h-8 rounded-full border border-white/15 flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Next",children:(0,r.jsx)("svg",{className:"w-4 h-4 text-white/60",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]}),(0,r.jsx)("div",{className:"hidden md:block",children:(0,r.jsx)("div",{ref:_,onScroll:()=>{let e=_.current;e&&e.scrollLeft+e.clientWidth>=e.scrollWidth-40&&T()},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),className:"flex gap-[15px] overflow-x-auto scrollbar-hide",children:t.map((e,t)=>{let l=t===b?c(e.video_url)||c(e.logo_url)||c(e.logo):null;return(0,r.jsx)("button",{onClick:()=>z(t),onMouseEnter:()=>g(t),onMouseLeave:()=>g(null),className:"flex-shrink-0 group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus text-left",style:{width:"228px"},children:(0,r.jsxs)("div",{className:"relative overflow-hidden bg-bg-tertiary px-[17px] py-[14px] flex items-center",style:{width:"228px",height:"405px"},children:[l&&(0,r.jsx)(u,{videoId:l}),(()=>{let t=e.logo||e.logo_url||"",s=a(t)||t;return t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:s,alt:"",loading:"lazy",onError:e=>{t&&e.currentTarget.src!==t&&(e.currentTarget.src=t)},className:(0,i.cn)("absolute inset-0 w-full h-full object-cover",l?"opacity-0 transition-opacity duration-700 delay-500":"opacity-100")}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent to-black/90 pointer-events-none transition-opacity duration-300 group-hover:opacity-80"}),(0,r.jsx)("div",{className:"absolute inset-0 border-2 border-transparent group-hover:border-white/20 rounded-[inherit] pointer-events-none transition-colors duration-300"})]}):(0,r.jsx)("div",{className:"absolute inset-0 bg-bg-tertiary"})})(),(0,r.jsxs)("div",{className:"relative z-10 w-full h-full flex flex-col justify-between pointer-events-none",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,r.jsx)("div",{className:"w-[30px] h-[30px] flex items-center justify-center",children:(0,r.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 24 24",fill:"white",children:[(0,r.jsx)("path",{d:"M9.5 8.965a.5.5 0 0 1 .77-.42l5.576 3.535a.5.5 0 0 1 0 .84l-5.576 3.535a.5.5 0 0 1-.77-.42V8.965Z"}),(0,r.jsx)("path",{d:"M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19ZM1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Z"})]})}),(0,r.jsxs)("div",{className:"bg-black/25 rounded-[40px] h-[30px] w-[79px] flex items-center justify-center gap-[5px]",children:[(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"#f7f7f4",children:(0,r.jsx)("path",{d:"M8 5v14l11-7z"})}),(0,r.jsx)("span",{className:"text-[14px] text-[#f7f7f4] leading-[21px]",children:"0:57"})]})]}),(0,r.jsx)("p",{className:"text-[18px] font-medium text-[#f7f7f4] leading-[27px] line-clamp-3 drop-shadow-md",children:e.title})]})]})}
1,e.title)})})}),(0,r.jsxs)("div",{className:"md:hidden -mx-4",children:[(0,r.jsx)("div",{ref:M,onScroll:()=>{let e=M.current;e&&(m(Math.max(0,Math.min(t.length-1,Math.round(e.scrollLeft/222)))),e.scrollLeft+e.clientWidth>=e.scrollWidth-40&&T())},onTouchStart:()=>w(!0),onTouchEnd:()=>w(!1),className:"flex items-start gap-3 overflow-x-auto scrollbar-hide no-scrollbar snap-x snap-mandatory px-4",children:t.map((e,t)=>{let l=t===x;return(0,r.jsx)("button",{onClick:()=>z(t),className:(0,i.cn)("snap-center [scroll-snap-stop:always] shrink-0 w-[210px] text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus"),children:(0,r.jsxs)("div",{className:(0,i.cn)("relative overflow-hidden rounded-[13px] bg-[#21201c] transition-[height,margin-top] duration-300",l?"h-[373px] px-[15px] py-[18px]":"h-[323px] mt-6"),children:[null,(()=>{let t=e.logo||e.logo_url||"",l=a(t)||t;return t?(0,r.jsx)("img",{src:l,alt:e.title,loading:"lazy",onError:e=>{t&&e.currentTarget.src!==t&&(e.currentTarget.src=t)},className:(0,i.cn)("absolute inset-0 w-full h-full object-cover","opacity-100")}):(0,r.jsx)("div",{className:(0,i.cn)("absolute inset-0 bg-[#2a2924]","opacity-100")})})(),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black/90 pointer-events-none"}),(0,r.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-[15px] z-10",children:[(0,r.jsx)("p",{className:(0,i.cn)("line-clamp-3 font-medium text-white/90 drop-shadow-md","text-[14px] leading-[19.25px] min-h-[57.75px]"),children:e.title}),(0,r.jsx)("time",{className:"mt-1 block text-[10px] leading-[15px] text-[#989896]",children:(0,o.si)(e.date)})]})]})},e.title+t)})}),t.length>1&&(0,r.jsx)("div",{className:"mt-[17px] flex items-center justify-center gap-[6px]",children:t.map((e,t)=>(0,r.jsx)("button",{onClick:()=>{let e=M.current;e&&(e.scrollTo({left:222*t,behavior:"smooth"}),m(t))},"aria-label":"Go to short ".concat(t+1),className:(0,i.cn)("rounded-full transition-all",t===x?"h-[6px] w-[24px] bg-white/60":"h-[6px] w-[6px] bg-white/15")},t))})]})]})}},1997:function(e,t,l){function r(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�?39;/g,"'").replace(/’/g,"â").replace(/‘/g,"â").replace(/“/g,"â").replace(/”/g,"â").replace(/–/g,"â").replace(/—/g,"â").replace(/ /g," "):""}function s(e){let t;if(!e)return"";if(e instanceof Date)t=e;else if(/^\d{2}-\d{2}-\d{4}$/.test(e)){let[l,r,s]=e.split("-").map(Number);t=new Date(s,r-1,l)}else if(/^\d{2}\/\d{2}\/\d{4}$/.test(e)){let[l,r,s]=e.split("/").map(Number);t=new Date(s,r-1,l)}else t=new Date(e);return isNaN(t.getTime())?e.toString():t.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}l.d(t,{m9:function(){return r},si:function(){return s}})}}]);
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.