PageSourceSearch

https://youtube-clone-mitr.netlify.app/assets/WatchLater-d8b43ce0.js

js youtube-clone-mitr.netlify.app collected 2026-10-03 11:38:19 UTC 8,753 bytes, 1 lines download raw bytes

1import{r,C as N,j as e,L as j,D as g,u as W,n as k,o as M,f as T,O as z,p as H}from"./index-e19d23e3.js";const A=t=>t>=1e9?(t/1e9).toFixed(1)+"B":t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e4||t>=1e3?(t/1e3).toFixed(1)+"K":t.toString(),O=({videoId:t,title:l,channelTitle:d,channelId:x,thumbnail:o,views:c,length:h})=>{const{darkMode:a}=r.useContext(N);let m;return c>0?m=A(c):m=0,e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sm:grid hidden",children:e.jsxs("div",{className:` watch-later-parent-layout ${a?"sm:hover:bg-[#272727]":"hover:bg-[#f2f2f2]"} items-center w-full  p-2 rounded-[12px]`,children:[e.jsxs(j,{to:`/watch/${t}`,className:"flex items-center gap-4",children:[a?e.jsx("div",{className:"w-[24px] cursor-grab",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24",children:e.jsx("path",{d:"M180-393.846v-30.77h600v30.77H180Zm0-141.538v-30.77h600v30.77H180Z",fill:"#ffffff"})})}):e.jsx("div",{className:"w-[24px]  cursor-grab",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24",children:e.jsx("path",{d:"M180-393.846v-30.77h600v30.77H180Zm0-141.538v-30.77h600v30.77H180Z"})})}),e.jsxs("div",{className:"watchlater-video-layout gap-2",children:[e.jsx("div",{className:"relative",children:e.jsx("img",{src:o,alt:l,className:"w-[160px]  aspect-video rounded-[8px]"})}),e.jsxs("div",{children:[e.jsx("h1",{className:" font-semibold text-[15px]",children:l}),e.jsxs("div",{className:`${a?"text-[#989898]":"text-[#606060]"}  text-[14px] flex items-center gap-2`,children:[e.jsx(j,{to:`/channel/${x}`,children:e.jsx("span",{className:`text-[13px] font-semibold ${a?"text-[#989898] hover:text-[#f2f2f2]":"text-[#606060] hover:text-[#0f0f0f]"}`,children:d})}),e.jsx("span",{className:"h-[5px] w-[5px] bg-[#7a7a7a] flex items-end rounded-[50%]"}),e.jsxs("p",{children:[m," views"]})]})]})]})]}),a?e.jsx(g,{title:"Remove from watch later",styles:{display:"flex",justifyContent:"start",height:"40px",width:"40px",alignItems:"center",borderRadius:"50%"},videoID:t,titleOfVideo:l}):e.jsx(g,{title:"Remove from watch later",styles:{display:"flex",justifyContent:"start",height:"40px",width:"40px",alignItems:"center",borderRadius:"50%"},videoID:t,titleOfVideo:l})]})}),e.jsx(j,{className:"sm:hidden flex w-full ",children:e.jsx(P,{title:l,videoId:t,thumbnail:o,views:c,channelName:d,channelId:x,length:h})})]})},S=({thumbnail:t,title:l,name:d})=>e.jsxs("div",{children:[e.jsx("div",{className:"md:flex hidden flex-row gap-1",children:e.jsx("div",{className:"fixed w-[360px]",children:e.jsxs("div",{className:"p-5 h-[88vh] relative overflow-hidden rounded-[15px]",children:[e.jsx("img",{src:t,alt:l,className:"h-full z-0 w-full rounded-[15px] object-cover blur-[100px] absolute top-0"}),e.jsx("div",{className:"z-50 flex flex-col items-center",children:e.jsxs("div",{className:"z-50",children:[e.jsx("img",{src:t,alt:l,className:" rounded-[12px]"}),e.jsx("p",{className:"text-[25px] font-bold text-[#f1f1f1] mt-4",children:"Watch Later"}),e.jsx("p",{className:" text-[#f1f1f1] text-[18px]",children:d})]})})]})})}),e.jsx("div",{className:"sm:flex hidden md:hidden flex-row mt-4",children:e.jsx("div",{className:"w-full",children:e.jsxs("div",{className:"p-5 h-[35vh] relative overflow-hidden rounded-[15px] xs:flex hidden",children:[e.jsx("img",{src:t,alt:l,className:"h-full z-0 w-full rounded-[15px] object-cover  blur-[100px] absolute top-0 object-"}),e.jsx("div",{className:"z-50 flex",children:e.jsxs("div",{className:"z-50 flex sm:flex-row flex-col  gap-5",children:[e.jsx("img",{src:t,alt:l,className:"rounded-[12px] aspect-video"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("p",{className:"text-[25px] font-bold text-[#f1f1f1] mt-4",children:"Watch Later"}),e.jsx("p",{className:" text-[#f1f1f1] text-[18px]",children:d})]})]})})]})})})]}),B=t=>t>=1e9?(t/1e9).toFixed(1)+"B":t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e4||t>=1e3?(t/1e3).toFixed(1)+"K":t.toString(),P=({thumbnail:t,title:l,channelName:d,videoId:x,publishedAt:o,length:c,views:h,channelProfile:a,channelId:m})=>{const{activeCategory:v,setActiveCategory:n,category:b,setCategory:y,videos:L,setVideos:w,darkMode:f}=r.useContext(N);let u;return h>0?u=B(h):u=0,e.jsxs("div",{className:"flex w-full flex-col gap-3 justify-center items-start sm:m-0 xs:max-w-[370px]",children:[e.jsx(j,{to:`/watch/${x}`,className:"w-full",children:e.jsxs("div",{className:"relative w-full",children:[e.jsx("img",{src:t,alt:l,className:"rounded-[10px] w-full hover:rounded-none aspect-video object-cover duration-300"}),e.jsx("p",{className:`absolute right-[5px] font-semibold bottom-[5px] bg-[#000000c2]  px-2 rounded-[5px]${f?"  text-white":" text-white"}`,children:c})]})}),e.jsxs("div",{className:"max-w-[360px] w-full flex items-center justify-between text-[16px] gap-5",children:[e.jsxs("div",{className:"font-semibold",children:[e.jsxs("div",{children:[e.jsx("h1",{children:l.length>60?`${l.slice(0,60)}...`:l}),e.jsx(j,{to:`/channel/${m}`,children:e.jsx("span",{className:`text-[14px] ${f?"text-[#989898] hover:text-[#f2f2f2]":"text-[#606060] hover:text-[#0f0f0f]"}`,children:d})})]}),e.jsx(j,{to:`/watch/${x}`,children:e.jsx("div",{className:`${f?"text-[#989898]":"text-[#606060]"}  text-[14px] flex items-center gap-2`,children:o!=null?e.jsxs(e.Fragment,{children:[e.jsxs("h1",{children:[u," views"]}),e.jsx("span",{className:"h-[5px] w-[5px] bg-[#7a7a7a] flex items-end rounded-[50%]"}),e.jsx("h1",{children:o})]}):e.jsxs("h1",{children:[u," views"]})})})]}),f?e.jsx(g,{title:"Remove from watch later",styles:{display:"flex",justifyContent:"start",height:"40px",width:"40px",alignItems:"center",borderRadius:"50%"},videoID:x,titleOfVideo:l}):e.jsx(g,{title:"Remove from watch later",styles:{display:"flex",justifyContent:"start",height:"40px",width:"40px",alignItems:"center",borderRadius:"50%"},videoID:x,titleOfVideo:l})]})]})},q=()=>{var f,u,C,V,$,E,F,I,R,D;const{darkMode:t,activeCategory:l,setActiveCategory:d,videos:x,setVideos:o,videoIdList:c,setVideoIdList:h}=r.useContext(N),[a,m]=r.useState([]);r.useEffect(()=>{o([]),d(8),h([])},[]);const v=document.querySelector("body");t?v.style.backgroundColor="#0f0f0f":v.style.backgroundColor="white",r.useEffect(()=>{document.title="Watch later - YouTube"},[]);const{user:n}=W(),b=n==null?void 0:n.email,y=k(H,`${b}/`);r.useEffect(()=>{M(y).then(s=>{const i=s.items.map(p=>p.name.slice(0,11));h(i)}).catch(s=>{console.error("Error fetching video IDs:",s)})},[c]),r.useEffect(()=>{setTimeout(()=>{const s=new Set(c),i=Array.from(s).map(p=>T(`video/info?id=${p}`));Promise.all(i).then(p=>{m(p)}).catch(p=>{console.error("Error fetching video details:",p)})},1e3)},[a]);const[L,w]=r.useState(navigator.onLine);return r.useEffect(()=>{const s=()=>w(!0),i=()=>w(!1);return window.addEventListener("online",s),window.addEventListener("offline",i),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}},[]),e.jsx(e.Fragment,{children:L?e.jsx("div",{className:`main-page ${t?"bg-dark text-white":"bg-light text-black"}`,children:e.jsx("div",{className:"mt-5",children:c.length>0&&a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"md:grid hidden px-5",children:[e.jsx(S,{thumbnail:(V=(C=a[0])==null?void 0:C.thumbnail[((u=(f=a[0])==null?void 0:f.thumbnail)==null?void 0:u.length)-1])==null?void 0:V.url,title:($=a[0])==null?void 0:$.t
1itle,name:n==null?void 0:n.name}),e.jsx("div",{className:"flex flex-col ml-[365px]",children:a.map((s,i)=>e.jsx("div",{children:s.thumbnail?e.jsx(O,{title:s.title,thumbnail:s.thumbnail[s.thumbnail.length-1].url,channelTitle:s.channelTitle,views:s.viewCount,videoId:s.id,channelId:s.channelId,length:s.lengthSeconds}):null},i))})]}),e.jsxs("div",{className:"md:hidden flex flex-col px-5",children:[e.jsx("h1",{className:"sm:hidden text-[25px] font-bold m-5 mt-0",children:"Watch Later"}),e.jsx(S,{thumbnail:(R=(I=a[0])==null?void 0:I.thumbnail[((F=(E=a[0])==null?void 0:E.thumbnail)==null?void 0:F.length)-1])==null?void 0:R.url,title:(D=a[0])==null?void 0:D.title,name:n==null?void 0:n.name}),e.jsx("div",{className:"grid xs:grid-cols-2 grid-cols-1 sm:grid-cols-1 sm:mt-5 sm:gap-0 gap-4",children:a.map((s,i)=>e.jsx("div",{children:s.thumbnail?e.jsx(O,{title:s.title,thumbnail:s.thumbnail[s.thumbnail.length-1].url,channelTitle:s.channelTitle,views:s.viewCount,videoId:s.id,channelId:s.channelId}):null},i))})]})]}):e.jsxs("div",{children:[e.jsx("h1",{className:"text-[25px] font-bold ml-10 mt-10",children:"Watch Later"}),e.jsxs("div",{className:"flex items-center gap-2  ml-10 text-[13px]  font-semibold mt-5",children:[e.jsx("p",{children:"No videos"}),e.jsx("p",{children:"No views"}),e.jsx("p",{children:"Updated today"})]})]})})}):e.jsx(z,{})})};export{q as default};

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.