1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64818],{64818:(e,t,r)=>{r.d(t,{A:()=>m});var n=r(37876),a=r(48230),i=r.n(a),s=r(14e3),o=r(14232),l=r(56535),c=r(92948),d=r(69241);let u=e=>{let{lols:t,likes:r,crys:a,hearts:i,onReactionClick:s,isLikedByCurrentUser:o,isHeartedByCurrentUser:l,isLoledByCurrentUser:c,isCriedByCurrentUser:u}=e;return(0,n.jsx)("div",{className:"flex flex-row items-center justify-between gap-2",children:(0,n.jsxs)("div",{className:"flex flex-row items-center justify-start gap-0.5 rounded bg-zinc-900/70 p-2","aria-haspopup":"dialog","aria-expanded":"false",children:[(0,n.jsx)("button",{type:"button","data-button":"true","aria-label":"React to this post",className:"hidden h-6 w-auto cursor-pointer select-none appearance-none rounded-sm border border-transparent bg-transparent p-0 text-left align-middle font-sans text-xs font-semibold leading-4 text-gray-100 no-underline",children:(0,n.jsx)("div",{className:"flex h-full items-center justify-center overflow-visible",children:(0,n.jsx)("span",{className:"flex h-full items-center overflow-hidden whitespace-nowrap",children:(0,n.jsxs)("div",{className:"flex flex-row items-center justify-start gap-2",children:[(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"tabler-icon tabler-icon-plus",children:[(0,n.jsx)("path",{d:"M12 5l0 14"}),(0,n.jsx)("path",{d:"M5 12l14 0"})]}),(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"tabler-icon tabler-icon-mood-smile",children:[(0,n.jsx)("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),(0,n.jsx)("path",{d:"M9 10l.01 0"}),(0,n.jsx)("path",{d:"M15 10l.01 0"}),(0,n.jsx)("path",{d:"M9.5 15a3.5 3.5 0 0 0 5 0"})]})]})})})}),[{type:"like",emoji:"\uD83D\uDC4D",count:r,active:o},{type:"heart",emoji:"â¤ï¸",count:i,active:l},{type:"lol",emoji:"\uD83D\uDE02",count:t,active:c},{type:"cry",emoji:"\uD83D\uDE22",count:a,active:u}].map(e=>{let{type:t,emoji:r,count:a,active:i}=e;return(0,n.jsx)("button",{className:(0,d.A)(i?"bg-primary-600/40 text-primary-200":"bg-transparent text-gray-100 border-transparent","flex items-center justify-center gap-1 py-0.5 appearance-none border-0 text-left text-sm font-semibold rounded-[2px] cursor-pointer hover:text-[#e9ecef] select-none h-[22px] px-[4px] pt-[2px] pb-[3px] leading-none relative transition duration-200 ease-in-out active:translate-y-[1px]"),type:"button","data-button":"true","data-disabled":"true","aria-label":t,onClick:e=>{e.stopPropagation(),e.preventDefault(),s(t)},children:(0,n.jsxs)("div",{className:"flex items-center justify-center gap-1 flex-grow-0",children:[(0,n.jsx)("span",{className:"text-[15px] flex-grow-0",children:r}),(0,n.jsx)("span",{className:"text-[14px] flex-grow-0",children:a})]})},t)})]})})};var p=r(73665);let h=function(e){let{src:t,type:r,width:a,height:i,poster:s,isNSFW:l,quality:c,onEnded:d,videoRef:u,setVideoRef:h,alt:x,title:m,priority:f=!1}=e,[g,v]=(0,o.useState)(!1),[b,j]=(0,o.useState)(null),[w,y]=(0,o.useState)(!1),[k,N]=(0,o.useState)(!1),C=(0,o.useRef)(!1),E=(0,o.useRef)(null),L=(0,o.useRef)(null),M=s&&(null==s?void 0:s.match(/\.(mp4|webm|mov|avi|mkv)$/i))===null?"VIDEO"===r?s:(0,p.Qr)(s,{width:450,quality:75}):void 0,z="IMAGE"===r&&t?(0,p.Qr)(t,{width:450,quality:75}):t,I=(0,o.useCallback)(e=>{if(!C.current){C.current=!0;try{let t=document.createElement("canvas");t.width=e.videoWidth||320,t.height=e.videoHeight||180;let r=t.getContext("2d");if(r){r.drawImage(e,0,0,t.width,t.height);let n=t.toDataURL("image/jpeg",.7);n&&n.length>1e3&&j(n)}}catch(e){console.debug("[MediaWithLoader] Canvas extraction failed (CORS):",t)}}},[t]),D=(0,o.useCallback)(e=>{I(e.target)},[I]),O=(0,o.useCallback)(e=>{let t=e.currentTarget;if(!M&&!b&&!C.current){let e=Math.min(1,.1*t.duration);t.addEventListener("seeked",D,{once:!0}),t.currentTime=e}},[M,b,D]),R=(w?null:M)||b||void 0;(0,o.useEffect)(()=>
1{if(!M||w)return;let e=new Image;e.onload=()=>y(!1),e.onerror=()=>{y(!0),console.debug("[MediaWithLoader] Poster failed to load:",M)},e.src=M},[M,w]);let A=x||m||"AI generated image",B=()=>{v(!1)};return(0,o.useEffect)(()=>{if("VIDEO"!==r||M&&!w)return;let e=E.current;if(!e)return;let t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(N(!0),t.disconnect())})},{rootMargin:"100px",threshold:.1});return t.observe(e),()=>t.disconnect()},[r,M,w]),(0,o.useEffect)(()=>{let e=M&&!w;if(!k||e||b||C.current)return;let t=L.current;t&&0===t.readyState&&t.load()},[k,M,w,b]),(0,o.useEffect)(()=>{if(u&&d)return u.addEventListener("ended",d),()=>{u.removeEventListener("ended",d)}},[u,d]),(0,n.jsxs)("div",{ref:E,className:"bg-zinc-900",style:{width:"100%",filter:l?"blur(50px)":"none",position:"relative",paddingBottom:"".concat(i&&a?i/a*100:100,"%")},children:["VIDEO"===r&&!R&&(0,n.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, #27272a 0%, #18181b 100%)"},children:(0,n.jsx)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"#52525b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})})}),g&&(0,n.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("div",{children:"Loading..."})}),"VIDEO"===r&&(0,n.jsx)("video",{ref:e=>{L.current=e,e&&h&&h(e)},loop:!1,muted:!0,controls:!1,autoPlay:!1,crossOrigin:"anonymous",src:t,...R&&{poster:R},preload:"metadata",playsInline:!0,onLoadedMetadata:O,onLoadedData:B,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",display:"block"},className:"object-cover object-top transition-all duration-500 ease-in-out group-hover:scale-110",title:A,"aria-label":A}),"IMAGE"===r&&(0,n.jsx)("img",{alt:A,src:z,onLoad:B,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",display:g?"none":"block"},loading:f?"eager":"lazy",fetchPriority:f?"high":"auto",className:"object-cover object-top transition-all duration-500 ease-in-out group-hover:scale-110",title:m})]})};var x=r(25810);let m=(0,o.memo)(e=>{let{id:t,src:r,tags:a,lols:d,crys:p,name:m,slug:f,type:g,image:v,likes:b,width:j,height:w,hearts:y,isIdea:k,isNsfw:N,isAdmin:C,isOwner:E,onEnded:L,videoRef:M,quality:z,onDelete:I,authorId:D,category:O,userName:R,isPlaying:A,sourceImage:B,setVideoRef:S,aiGenerated:W,nsfwSettings:P,userReactions:U,onUpdateMedia:V,onReactionClick:G,priority:$=!1,prompt:_,title:q,description:F}=e,H=(0,s.useRouter)(),Q=N||(a||[]).some(e=>x.v4.includes(e.name.toLowerCase())),[T,X]=(0,o.useState)(!1);if((0,o.useEffect)(()=>{M&&(A?M.play().catch(e=>{console.error("Error playing video:",e)}):M.pause())},[A,M]),!(null==P?void 0:P.showNsfw)&&Q&&!C)return null;let J=B&&!(e=>(null==e?void 0:e.match(/\.(mp4|webm|mov|avi|mkv)$/i))!==null)(B)?B:void 0,K=q||_?"/media/".concat(function(e,t){let r=e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g," ").replace(/\s/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").substring(0,50).replace(/-$/,"");return"".concat(r,"-").concat(t)}(q||_,t)):"/media/".concat(t);return(0,n.jsx)(i(),{href:k?"/ideas/".concat(O.slug,"/").concat(f):K,className:"group block min-w-[75%] rounded-xl",rel:$?void 0:"nofollow",prefetch:!1,children:(0,n.jsxs)("div",{className:"relative overflow-hidden rounded-xl ring-1 ring-zinc-800",onMouseEnter:()=>{M&&(M.loop=!0,M.play().catch(e=>{console.error("Error playing video:",e)}))},onMouseLeave:()=>{M&&(M.loop=!1,M.pause())},children:[(0,n.jsx)("div",{className:"absolute left-4 top-4 z-[99] rounded-md bg-zinc-800/50 p-1 text-zinc-100 ring-1 ring-inset ring-zinc-800/30",children:"VIDEO"===g?(0,n.jsx)(l.pzX,{className:"h-4 w-4"}):(0,n.jsx)(l.hw5,{className:"h-4 w-4"})}),Q&&(0,n.jsx)("div",{className:"absolute left-12 top-4 z-[99] flex h-[24px] cursor-pointer items-center rounded-md bg-red-500/80 px-2 text-[11px] text-zinc-100 shadow-sm",onClick:e=>{e.stopPropagation(),e.preventDefault(),X(!T)},children:(0,n.jsx)("span",{children:"18+"})}),(0,n.jsx)(c.A,{id:t,isNsfw:N,isOwner:E,isAdmin:C,onDelete:I,aiGenerated:W,onUpdateMedia:V}),(0,n.jsx)(h,{src:r||B,type:g,width:j,height:w,...J&&{poster:J},isNSFW:Q&&!T,quality:z,onEnded:L,videoRef:M,setVideoRef:S,alt:_||F||q,title:q||_,priority:$}),(0,n.jsxs)("div",{className:"absolute bottom-0 z-10 flex w-full flex-col items-stretch justify-start gap-[12px] bg-gradient-to-t from-zinc-900/80 to-transparent p-4",children:[(0,n.jsx)("button",{className:"align-start group cursor-pointer appearance-none border-0 bg-transparent p-0 text-base text-white",type:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),H.push("/profile/".concat(R||D))},children:(0,n.jsxs)("div",{className:"flex flex-row flex-nowrap items-center justify-start gap-[8px]",children:[(0,n.jsx)("div",{className:"relative block h-[32px] w-[32px] overflow-hidden rounded",children:v&&(0,n.jsx)("img",{loading:"lazy",className:"h-full w-full object-cover",src:v,alt:"".concat(m,"'s Avatar"),width:32,height:32,crossOrigin:"anonymous"})}),(0,n.jsx)("div",{className:"flex flex-col items-stretch justify-start gap-0",children:(0,n.jsx)("div",{className:"mantine-Group-root mantine-1u5ck20",children:(0,n.jsx)("div",{className:"flex-grow-0",children:(0,n.jsx)("div",{className:"text-ellipsis align-middle text-sm font-medium group-hover:text-primary-200 group-hover:underline",children:m})})})})]})}
1),!k&&(0,n.jsx)(u,{lols:d,likes:b,crys:p,hearts:y,isLikedByCurrentUser:null==U?void 0:U.includes("like"),isHeartedByCurrentUser:null==U?void 0:U.includes("heart"),isCryedByCurrentUser:null==U?void 0:U.includes("cry"),isLoledByCurrentUser:null==U?void 0:U.includes("lol"),onReactionClick:G})]})]})})})}}]);
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.