1import{_ as se}from"./DDiIyDE1.js";import{D as ie,o as n,j as w,w as s,E as O,G as le,u as e,n as ne,h as ae,i as re,e as ce,c as a,a as i,b as o,q as de,F as E,r as T,k as h,g as k,d as p,t as c,v as y}from"./B_WuLJym.js";import{_ as ue}from"./D6lCG_OS.js";import{_ as _e}from"./BaQZgAtg.js";import{d as pe,_ as me,a as fe,b as ve,c as ge,A as he}from"./DiXdaZUl.js";import{f as xe,a as be,b as ke,c as ye,d as we,_ as Ce,e as $e}from"./otYXMm_2.js";import{u as Ue}from"./CS05D_pz.js";import{P as De}from"./8kPU5xUN.js";import{i as Ie}from"./DFNanCKW.js";import{c as je}from"./Bagk-sYR.js";import{_ as ze}from"./CNhAY5Lz.js";import{u as Pe}from"./99978-r1.js";import{u as Ve}from"./B22eaYSD.js";import{u as Fe}from"./CtRGFGHa.js";import{P as Ge}from"./LWgHAFR2.js";import{c as Ee}from"./ChmXZpIq.js";import{P as A,T as B}from"./D0kUr-lu.js";import"./DHm_5eoB.js";import"./CE01EtgL.js";var Te=ie({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(x){const d=x;Ue();const m=Ie();return(f,I)=>(n(),w(e(De),le(d,{id:e(m).descriptionId}),{default:s(()=>[O(f.$slots,"default")]),_:3},16,["id"]))}}),Ae=Te;const N=Ee("CameraIcon",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]),Be={__name:"DialogDescription",props:{class:{type:String,default:""}},setup(x){const d=x;return(m,f)=>(n(),w(e(Ae),{class:ne(e(je)("text-sm text-muted-foreground",d.class))},{default:s(()=>[O(m.$slots,"default")]),_:3},8,["class"]))}},Ne={class:"bg-surface py-16 md:py-24"},Oe={class:"max-w-7xl mx-auto px-4 md:px-6 lg:px-8"},Le={class:"flex items-center justify-end mb-6"},qe={key:0,class:"text-zinc-300 text-center py-8"},Me={key:1},Se={class:"group relative h-full"},He={class:"overflow-hidden rounded-lg border border-border-dark/50 bg-card-dark hover:border-accent/30 transition-colors duration-200 h-full flex flex-col"},Re=["src","alt"],Je={key:1,class:"w-full h-full bg-border-dark/20 flex items-center justify-center"},Ke={class:"p-3"},Qe={class:"text-sm font-semibold text-white leading-snug line-clamp-1"},We={key:0,class:"text-xs text-zinc-300 line-clamp-2 mt-1"},Xe={class:"text-xs text-zinc-400 mt-1"},Ye={key:0,class:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10"},Ze=["onClick"],et=["onClick"],tt={key:0,class:"bg-secondary py-20 md:py-28 border-t border-border-dark/50"},ot={class:"max-w-7xl mx-auto px-4 md:px-6 lg:px-8"},st={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4"},it={class:"overflow-hidden rounded-lg border border-border-dark/50 bg-card-dark hover:border-accent/30 transition-colors duration-200"},lt=["src","alt"],nt={key:1,class:"w-full h-full bg-border-dark/20 flex items-center justify-center"},at={class:"p-3"},rt={class:"text-sm font-semibold text-white leading-snug line-clamp-1"},ct={key:0,class:"text-xs text-zinc-300 line-clamp-2 mt-1"},dt={class:"text-xs text-zinc-400 mt-1"},ut={key:0,class:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10"},_t=["onClick"],pt=["onClick"],mt={class:"space-y-4 py-4"},Gt={__name:"index",async setup(x){let d,m;const{isAdmin:f,fetchUser:I}=ae(),{authFetch:C}=Pe(),{data:v,refresh:j}=([d,m]=re(()=>Ve("/api/galleries","$aqMpiC33dh")),d=await d,m(),d);ce(()=>{I()});const u=k(!1),_=k(null),r=k({title:"",description:""});function L(){_.value=null,r.value={title:"",description:""},u.value=!0}function z(g){_.value=g,r.value={title:g.title,description:g.description||""},u.value=!0}const b=k(!1);async function q(){if(r.value.title.trim()){b.value=!0;try{_.value?await C(`/api/galleries/${_.value.id}`,{method:"PUT",body:r.value}):await C("/api/galleries",{method:"POST",body:r.value}),u.value=!1,await j()}finally{b.value=!1}}}async function P(g){confirm("Er du sikker på at du vil slette dette galleri og alle dets billeder?")&&(await C(`/api/galleries/${g}`,{method:"DELETE"}),await j())}const M=he({delay:3e3,stopOnInteraction:!1,stopOnMouseEnter:!0});return Fe({title:"Galleri - Nyråd IF"}),(g,l)=>{const $=se,U=de,V=ue,F=_e,S=fe,H=me,R=ve,J=ge,K=pe,Q=ye,W=Be,X=ke,G=we,Y=Ce,Z=ze,ee=$e,te=be,oe=xe;return n(),a("div",null,[i("section",Ne,[i("div",Oe,[i("div",Le,[o(U,null,{default:s(()=>[e(f)()?(n(),w($,{key:0,class:"bg-accent text-accent-foreground hover:bg-accent/90",onClick:L},{default:s(()=>[o(e(Ge),{class:"h-4 w-4 mr-2"}),l[5]||(l[5]=p(" Nyt galleri ",-1))]),_:1})):h("",!0)]),_:1})]),!e(v)||e(v).length===0?(n(),a("p",qe," Ingen gallerier endnu. ")):(n(),a("div",Me,[o(K,{opts:{align:"start",loop:!0},plugins:[e(M)],class:"w-full"},{default:s(()=>[o(H,null,{default:s(()=>[(n(!0),a(E,null,T(e(v),t=>(n(),w(S,{key:t.id,class:"basis-full sm:basis-1/2 lg:basis-1/4"},{default:s(()=>[i("div",Se,[o(F,{to:`/galleri/${t.id}`,class:"block h-full"},{default:s(()=>[i("div",He,[o(V,{ratio:4/3},{default:s(()=>[t.coverImage?(n(),a("img",{key:0,src:t.coverImage.imageUrl,alt:t.title,class:"w-full h-full object-cover transition-transform duration-200 group-hover:scale-105"},null,8,Re)):(n(),a("div",Je,[o(e(N),{class:"h-12 w-12 text-zinc-400/40"})]))]),_:2}
1,1024),i("div",Ke,[i("h3",Qe,c(t.title),1),t.description?(n(),a("p",We,c(t.description),1)):h("",!0),i("p",Xe,c(t.images?.length||0)+" billeder ",1)])])]),_:2},1032,["to"]),o(U,null,{default:s(()=>[e(f)()?(n(),a("div",Ye,[i("button",{class:"h-8 w-8 flex items-center justify-center rounded-md bg-black/60 text-white/80 hover:bg-black/80 hover:text-white transition-colors duration-200",onClick:y(D=>z(t),["prevent"])},[o(e(A),{class:"h-3.5 w-3.5"})],8,Ze),i("button",{class:"h-8 w-8 flex items-center justify-center rounded-md bg-black/60 text-white/80 hover:bg-black/80 hover:text-destructive transition-colors duration-200",onClick:y(D=>P(t.id),["prevent"])},[o(e(B),{class:"h-3.5 w-3.5"})],8,et)])):h("",!0)]),_:2},1024)])]),_:2},1024))),128))]),_:1}),o(R),o(J)]),_:1},8,["plugins"])]))])]),e(v)&&e(v).length>0?(n(),a("section",tt,[i("div",ot,[l[6]||(l[6]=i("h2",{class:"text-2xl font-bold text-white mb-8"},"Alle gallerier",-1)),i("div",st,[(n(!0),a(E,null,T(e(v),t=>(n(),a("div",{key:t.id,class:"group relative"},[o(F,{to:`/galleri/${t.id}`,class:"block"},{default:s(()=>[i("div",it,[o(V,{ratio:4/3},{default:s(()=>[t.coverImage?(n(),a("img",{key:0,src:t.coverImage.imageUrl,alt:t.title,class:"w-full h-full object-cover transition-transform duration-200 group-hover:scale-105"},null,8,lt)):(n(),a("div",nt,[o(e(N),{class:"h-12 w-12 text-zinc-400/40"})]))]),_:2},1024),i("div",at,[i("h3",rt,c(t.title),1),t.description?(n(),a("p",ct,c(t.description),1)):h("",!0),i("p",dt,c(t.images?.length||0)+" billeder ",1)])])]),_:2},1032,["to"]),o(U,null,{default:s(()=>[e(f)()?(n(),a("div",ut,[i("button",{class:"h-8 w-8 flex items-center justify-center rounded-md bg-black/60 text-white/80 hover:bg-black/80 hover:text-white transition-colors duration-200",onClick:y(D=>z(t),["prevent"])},[o(e(A),{class:"h-3.5 w-3.5"})],8,_t),i("button",{class:"h-8 w-8 flex items-center justify-center rounded-md bg-black/60 text-white/80 hover:bg-black/80 hover:text-destructive transition-colors duration-200",onClick:y(D=>P(t.id),["prevent"])},[o(e(B),{class:"h-3.5 w-3.5"})],8,pt)])):h("",!0)]),_:2},1024)]))),128))])])])):h("",!0),o(oe,{open:e(u),"onUpdate:open":l[4]||(l[4]=t=>u.value=t)},{default:s(()=>[o(te,{onClose:l[3]||(l[3]=t=>u.value=!1)},{default:s(()=>[o(X,null,{default:s(()=>[o(Q,null,{default:s(()=>[p(c(e(_)?"Rediger galleri":"Opret galleri"),1)]),_:1}),o(W,null,{default:s(()=>[p(c(e(_)?"Opdater galleriets titel og beskrivelse.":"Giv dit nye galleri en titel og en valgfri beskrivelse."),1)]),_:1})]),_:1}),i("div",mt,[i("div",null,[o(G,{for:"gallery-title"},{default:s(()=>[...l[7]||(l[7]=[p("Titel",-1)])]),_:1}),o(Y,{id:"gallery-title",modelValue:e(r).title,"onUpdate:modelValue":l[0]||(l[0]=t=>e(r).title=t),placeholder:"F.eks. Sommerfest 2026"},null,8,["modelValue"])]),i("div",null,[o(G,{for:"gallery-desc"},{default:s(()=>[...l[8]||(l[8]=[p("Beskrivelse",-1)])]),_:1}),o(Z,{id:"gallery-desc",modelValue:e(r).description,"onUpdate:modelValue":l[1]||(l[1]=t=>e(r).description=t),placeholder:"Beskriv galleriet...",rows:"3"},null,8,["modelValue"])])]),o(ee,null,{default:s(()=>[o($,{variant:"outline",onClick:l[2]||(l[2]=t=>u.value=!1)},{default:s(()=>[...l[9]||(l[9]=[p("Annuller",-1)])]),_:1}),o($,{disabled:!e(r).title.trim()||e(b),onClick:q},{default:s(()=>[p(c(e(b)?"Gemmer...":e(_)?"Opdater":"Opret"),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])])}}};export{Gt 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.