1import{_ as W}from"./DtXCka8O.js";import{I as H}from"./uWVYgc1G.js";import{d as T,u as D,U as E,a as f,H as F,r as M,v as $,w as P,a7 as q,b as G,j as r,o as a,l as t,c as h,s as k,E as v,p as n,m as o,F as J,x as K,K as z,q as x,ae as I,k as O,J as Q,al as X,aM as Y,_ as Z,W as ee}from"./DZ7mik94.js";import{a as te}from"./CWaiZ3M9.js";import{u as se}from"./D_TQQ2rA.js";import"./BETpJ00V.js";const le={class:"gallery-container h-full flex flex-col relative"},ae={class:"flex-1 flex flex-col overflow-hidden"},oe={class:"ad-section px-4 py-3 flex gap-4 justify-center border-b border-slate-100 bg-slate-50/50"},ie={class:"ad-slot w-[300px] h-[60px] rounded-lg bg-gradient-to-r from-slate-100 to-slate-50 flex items-center justify-center text-slate-400 text-sm font-medium border border-slate-200/50"},re={key:0,class:"ad-slot w-[300px] h-[60px] rounded-lg bg-gradient-to-r from-slate-100 to-slate-50 flex items-center justify-center text-slate-400 text-sm font-medium border border-slate-200/50"},ne={class:"filter-section px-4 py-3 flex items-center gap-4 border-b border-slate-100"},ue={class:"flex gap-2"},de=["onClick"],ce={class:"flex-1 overflow-hidden"},pe={class:"rounded-xl overflow-hidden bg-white border border-slate-100 h-full"},fe={key:1,class:"flex items-center justify-center h-full"},me={class:"text-center"},_e={class:"text-slate-500 font-medium"},ge=["src"],he={key:2,class:"w-full h-full bg-slate-100 flex items-center justify-center"},ve={class:"absolute inset-0 bg-gradient-to-t from-black/60 via-trans
1parent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"},xe={class:"absolute bottom-0 left-0 right-0 p-3 flex items-end gap-2"},ye={class:"flex-1 min-w-0"},be={class:"flex items-center gap-1.5 mb-1"},we=["src"],ke={key:1,class:"w-4 h-4 rounded-full bg-indigo-500 flex items-center justify-center text-[10px] text-white font-bold"},ze={class:"text-white/90 text-xs font-medium truncate max-w-[100px]"},Ie={class:"text-white text-sm line-clamp-2 mb-1.5 font-medium"},Se={class:"flex items-center gap-1 text-white/80 text-xs"},je={class:"absolute bottom-2 right-2 flex items-center gap-1.5 text-white text-xs shrink-0 font-medium bg-black/20 px-2 py-1 rounded-full backdrop-blur-[2px] z-10 transition-transform active:scale-95 duration-200 hover:bg-black/30"},Le={key:3,class:"p-4 flex justify-center"},Me=T({__name:"gallery",setup($e){const{t:u}=D();E(f(()=>({title:u("studio.gallery.title"),meta:[{name:"description",content:u("studio.gallery.description")}]})));const l=se(),C=F();X();const N=Y(),c=f(()=>C.isMobile),{width:m}=te(),_=f(()=>m.value<768?2:m.value<1024?3:m.value<1280?4:m.value<1536?5:6),p=M("all"),S=f(()=>p.value==="all"?l.items:l.items.filter(i=>i.task_type===p.value));$(async()=>{l.items.length===0&&await l.fetchItems({reset:!0})}),P(p,async i=>{const s=i==="all"?void 0:i;await l.fetchItems({reset:!0,task_type:s})});const y=M(null),A=()=>{if(!y.value?.virtualizer||l.isLoading||!l.hasMore)return;const s=y.value.virtualizer.getVirtualItems().at(-1);if(!s)return;const g=S.value.length;s.index>=g-5&&l.loadMore()};let b=null;$(()=>{b=q(A,500)}),G(()=>{b&&clearInterval(b)});const U=f(()=>N.params.id||""),j=[200,250,300,350];function L(i){const s=(i*11+7)%17;return j[s%j.length]}return(i,s)=>{const g=W,V=H,B=Q,R=Z;return a(),r("div",le,[t("div",ae,[t("div",oe,[t("div",ie,[s[2]||(s[2]=t("i",{class:"pi pi-megaphone mr-2"},null,-1)),v(" "+n(o(u)("studio.gallery.ad_slot")),1)]),c.value?k("",!0):(a(),r("div",re,[s[3]||(s[3]=t("i",{class:"pi pi-megaphone mr-2"},null,-1)),v(" "+n(o(u)("studio.gallery.ad_slot")),1)]))]),t("div",ne,[t("div",ue,[(a(),r(J,null,K(["all","image","video"],e=>t("button",{key:e,onClick:d=>p.value=e,class:x(["px-4 py-1.5 rounded-full text-sm font-medium transition-all",p.value===e?"bg-slate-900 text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200"])},n(e==="all"?o(u)("common.all"):o(u)(`common.categories.${e}`)),11,de)),64))])]),t("div",ce,[o(l).isLoading&&o(l).items.length===0?(a(),h(g,{items:Array.from({length:20}).map((e,d)=>({id:d,_height:L(d)})),orientation:"vertical",virtualize:{gap:c.value?2:12,lanes:_.value,estimateSize:280},class:x([c.value?"py-2 px-1":"p-4","w-full h-full"]),key:"skeleton-"+_.value},{default:z(({item:e})=>[t("div",pe,[t("div",{class:"w-full h-full bg-slate-100 animate-pulse relative",style:I({height:`${e._height}px`})},[...s[4]||(s[4]=[t("div",{class:"absolute bottom-0 left-0 right-0 p-3 flex items-end gap-2 z-10"},[t("div",{class:"flex-1 space-y-2"},[t("div",{class:"h-3 bg-slate-200 rounded w-3/4"}),t("div",{class:"h-3 bg-slate-200 rounded w-1/4"})])],-1)])],4)])]),_:1},8,["items","virtualize","class"])):!o(l).isLoading&&o(l).items.length===0?(a(),r("div",fe,[t("div",me,[s[5]||(s[5]=t("i",{class:"pi pi-images text-5xl text-slate-300 mb-4"},null,-1)),t("p",_e,n(o(u)("studio.gallery.empty")),1)])])):(a(),h(g,{ref_key:"scrollAreaRef",ref:y,items:S.value.map((e,d)=>({...e,_height:L(d)})),orientation:"vertical",virtualize:{gap:c.value?2:12,lanes:_.value,estimateSize:280},class:x([c.value?"py-2 px-1":"p-4","w-full h-full"]),key:_.value},{default:z(({item:e,index:d})=>[O(B,{to:i.$localePath(`/studio/gallery/${e.id}`)},{default:z(()=>[t("div",{class:"gallery-item group relative rounded-xl overflow-hidden bg-white shadow-sm hover:shadow-lg transition-all duration-300 cursor-pointer border border-slate-100",style:I({height:`${e._height}px`})},[e.task_type==="image"&&e.output_url?(a(),h(V,{key:0,src:`${e.output_url}`,alt:e.prompts,class:"w-full h-full","img-class":"w-full h-full object-cover",loading:d>8?"lazy":"eager",style:I({viewTransitionName:`gallery-image-${e.id}`})},null,8,["src","alt","loading","style"])):e.task_type==="video"&&e.output_url?(a(),r("video",{key:1,src:e.output_url,class:"w-full h-full object-cover",muted:"",loop:"",onMouseenter:s[0]||(s[0]=w=>w.target.play()),onMouseleave:s[1]||(s[1]=w=>w.target.pause())},null,40,ge)):(a(),r("div",he,[...s[6]||(s[6]=[t("i",{class:"pi pi-image text-slate-300 text-3xl"},null,-1)])])),t("div",ve,[t("div",xe,[t("div",ye,[t("div",be,[e.author_avatar?(a(),r("img",{key:0,src:e.author_avatar,class:"w-4 h-4 rounded-full object-cover"},null,8,we)):(a(),r("div",ke,n((e.author_name||e.user_id||"A").toString().charAt(0).toUpperCase()),1)),t("span",ze,n(e.author_name||e.user_id),1)]),t("p",Ie,n(e.prompts||"Untitled"),1),t("div",Se,[s[7]||(s[7]=t("i",{class:"pi pi-eye"},null,-1)),v(" "+n(e.view_count||0),1)])])])]),t("div",je,[t("i",{class:x(["pi before:text-xs",e.is_liked?"pi-heart-fill text-red-400":"pi-heart text-white/90"])},null,2),v(" "+n(e.like_count||0),1)])],4)]),_:2},1032,["to"])]),_:1},8,["items","virtualize","class"])),o(l).isLoading&&o(l).items.length>0?(a(),r("div",Le,[...s[8]||(s[8]=[t("i",{class:"pi pi-spin pi-spinner text-slate-400"},null,-1)])])):k("",!0)])]),U.value?(a(),h(R,{key:0})):k("",!0)])}}}),Re=ee(Me,[["__scopeId","data-v-2a8ebca6"]]);export{Re 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.