import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{l as t}from"./vendor-map-UawGledW.js";import{d as n,r,t as i}from"./vendor-react-Botiei7A.js";import{t as a}from"./useTranslation-8J697w9K.js";import{t as o}from"./imageUploadService-C_X9HkPC.js";import{t as ee}from"./userService-D8W-jAMZ.js";import{n as te}from"./AuthContext-nLFdLz-B.js";import{x as s}from"./index-APUcZYWe.js";import{t as ne}from"./SEOHead-pbbP0cGv.js";import{t as re}from"./seoUtils-DY9YQzSR.js";import{t as c}from"./associationService-VEKHV1tJ.js";var l=e(t()),u=i();function ie(e){for(let t of[/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&\n?#]+)/,/youtube\.com\/embed\/([^&\n?#]+)/]){let n=e.match(t);if(n)return n[1]}return null}var d=[`from-slate-700 to-slate-900`,`from-stone-700 to-stone-900`,`from-zinc-700 to-zinc-900`,`from-neutral-700 to-neutral-900`,`from-gray-700 to-gray-900`],f=e=>d[e.charCodeAt(0)%d.length],p=[`bg-slate-700`,`bg-zinc-600`,`bg-stone-600`,`bg-neutral-600`,`bg-gray-700`,`bg-red-800`,`bg-amber-700`,`bg-teal-700`],ae=e=>p[e.charCodeAt(0)%p.length],oe=e=>e.slice(0,2).toUpperCase(),m=()=>{let{t:e}=a(),{id:t}=n(),{user:i}=te(),[d,p]=(0,l.useState)(null),[m,se]=(0,l.useState)([]),[ce,h]=(0,l.useState)(!0),[g,_]=(0,l.useState)(null),[v,y]=(0,l.useState)(!1),[b,x]=(0,l.useState)(``),[S,C]=(0,l.useState)(!1),[w,T]=(0,l.useState)(!1),[E,D]=(0,l.useState)(null),[O,k]=(0,l.useState)(0),[A,le]=(0,l.useState)({}),[j,M]=(0,l.useState)(!1),[N,ue]=(0,l.useState)([]),[P,de]=(0,l.useState)(0),[F,fe]=(0,l.useState)(!1),[I,L]=(0,l.useState)([]),[R,z]=(0,l.useState)(!1),[B,V]=(0,l.useState)(`requests`),H=(0,l.useRef)(null);(0,l.useEffect)(()=>{t&&(async()=>{h(!0),_(null);try{let[n,r]=await Promise.all([c.getAssociation(t),c.getMembers(t,1,30)]);p(n);let a=r.members||[];if(se(a),i?.id){let e=a.find(e=>e.user_id===i.id);e&&(y(!0),x(e.role))}let o={};await Promise.all(a.map(async t=>{try{let n=await ee.getUserById(t.user_id);o[t.user_id]=n.pseudonyme||e(`assoc.detail.defaultMember`)}catch{o[t.user_id]=e(`assoc.detail.defaultMember`)}})),le(o)}catch{_(e(`assoc.detail.loadError`))}finally{h(!1)}})()},[t,i?.id,e]),(0,l.useEffect)(()=>{b===`admin`&&G()},[b,t]);let U=async()=>{if(!t)return;let[e,n]=await Promise.all([c.getAssociation(t),c.getMembers(t,1,30)]);p(e),se(n.members||[])},W=async()=>{if(!(!t||!d)){C(!0);try{d.is_public?(await c.joinAssociation(t),y(!0),x(`member`),await U()):(await c.requestToJoin(t),fe(!0))}catch(t){_(t?.response?.data?.error||t?.response?.data?.details||e(`assoc.detail.joinError`))}finally{C(!1)}}},G=async()=>{if(!(!t||b!==`admin`))try{let[e,n,r]=await Promise.all([c.listJoinRequests(t),c.listInvitations(t),c.getPendingJoinRequestCount(t)]);ue(e),L(n),de(r)}catch{}},K=async(n,r)=>{if(t)try{await c.reviewJoinRequest(t,n,r),await Promise.all([G(),U()])}catch(t){_(t?.response?.data?.error||e(`assoc.detail.reviewError`))}},pe=async()=>{if(t){z(!0);try{let e=await c.generateInvitation(t);L(t=>[e,...t])}catch(t){_(t?.response?.data?.error||e(`assoc.detail.generateError`))}finally{z(!1)}}},me=async e=>{if(t)try{await c.revokeInvitation(t,e),L(t=>t.map(t=>t.id===e?{...t,is_active:!1}:t))}catch{}},he=async()=>{if(t){T(!0);try{await c.leaveAssociation(t),y(!1),x(``),await U()}catch(t){_(t?.response?.data?.details||e(`assoc.detail.leaveError`))}finally{T(!1)}}},ge=async n=>{let r=n.target.files?.[0];if(!(!r||!t||!d)){M(!0);try{let e=(await o.uploadAssociationImage(r,t)).url||``;await c.updateAssociation(t,{cover_url:e}),p({...d,cover_url:e})}catch(t){_(t?.message||e(`assoc.detail.uploadError`))}finally{M(!1),H.current&&(H.current.value=``)}}};if(ce)return(0,u.jsxs)(`div`,{className:`min-h-screen bg-white`,children:[(0,u.jsx)(`div`,{className:`h-[75vh] bg-gray-100 animate-pulse`}),(0,u.jsxs)(`div`,{className:`max-w-6xl mx-auto px-6 py-16 space-y-4`,children:[(0,u.jsx)(`div`,{className:`h-4 w-24 bg-gray-100 rounded-full animate-pulse`}),(0,u.jsx)(`div`,{className:`h-8 w-2/3 bg-gray-100 rounded-full animate-pulse`}),(0,u.jsx)(`div`,{className:`h-4 w-full bg-gray-100 rounded-full animate-pulse`}),(0,u.jsx)(`div`,{className:`h-4 w-5/6 bg-gray-100 rounded-full animate-pulse`})]})]});if(g&&!d)return(0,u.jsxs)(`div`,{className:`min-h-screen bg-white flex flex-col items-center justify-center text-center px-4`,children:[(0,u.jsx)(`div`,{className:`w-14 h-14 bg-red-50 rounded-full flex items-center justify-center mb-4`,children:(0,u.jsx)(`svg`,{className:`w-6 h-6 text-red-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z`})})}),(0,u.jsx)(`p`,{className:`text-sm text-gray-500 mb-4`,children:g}),(0,u.jsx)(r,{to:`/associations`,className:`px-4 py-2 bg-gray-900 text-white text-xs font-semibold rounded-xl hover:bg-gray-800 transition-colors`,children:e(`assoc.detail.backToList`)})]});if(!d)return null;let q=d.gallery_urls||[],J=d.logo_url?s(d.logo_url):null,Y=d.cover_url?s(d.cover_url):q[0]?s(q[0]):null,X=d.video_links||[],Z=[d.city,d.region,d.country].filter(Boolean).join(`, `),Q=X.length>0,$=q.length>0,_e=m.length>0;return(0,u.jsxs)(`div`,{className:`min-h-screen bg-white overflow-x-hidden`,children:[(0,u.jsx)(ne,{...re(d)}),(0,u.jsxs)(`section`,{className:`relative h-[80vh] overflow-hidden`,children:[Y?(0,u.jsx)(`img`,{src:Y,alt:d.name,className:`absolute inset-0 w-full h-full object-cover scale-[1.04]`}):(0,u.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-br ${f(d.id)}`}),(0,u.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-t from-black/90 via-black/50 to-black/25`}),(0,u.jsxs)(r,{to:`/associations`,className:`absolute top-6 left-6 z-10 inline-flex items-center gap-1.5 text-xs text-white/50 hover:text-white/90 transition-colors group`,children:[(0,u.jsx)(`svg`,{className:`w-3.5 h-3.5 group-hover:-translate-x-0.5 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 19l-7-7 7-7`})}),e(`assoc.detail.backLink`)]}),b===`admin`&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`input`,{ref:H,type:`file`,accept:`image/*`,className:`hidden`,onChange:ge}),(0,u.jsxs)(`button`,{type:`button`,onClick:()=>H.current?.click(),disabled:j,className:`absolute top-6 right-6 z-10 flex items-center gap-2 px-3 py-2 bg-black/50 backdrop-blur-sm text-white text-xs font-semibold rounded-xl hover:bg-black/70 transition-all disabled:opacity-50`,children:[j?(0,u.jsx)(`div`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}):(0,u.jsxs)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:[(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]}),e(j?`assoc.detail.uploading`:`assoc.detail.coverPhoto`)]})]}),(0,u.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center text-center px-6`,children:[J&&(0,u.jsx)(`div`,{className:`w-24 h-24 rounded-2xl overflow-hidden border-2 border-white/20 shadow-2xl mb-6 flex-shrink-0 bg-black/40 backdrop-blur-sm p-2`,children:(0,u.jsx)(`img`,{src:J,alt:d.name,className:`w-full h-full object-contain`})}),Z&&(0,u.jsx)(`p`,{className:`text-white/50 text-[11px] font-bold uppercase tracking-[0.25em] mb-4`,children:Z}),(0,u.jsx)(`h1`,{className:`text-4xl md:text-6xl lg:text-7xl font-bold text-white leading-none mb-3 max-w-4xl`,children:d.name}),d.short_name&&(0,u.jsx)(`p`,{className:`text-white/35 text-sm tracking-[0.2em] uppercase`,children:d.short_name})]}),(0,u.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 py-6 px-6`,children:(0,u.jsxs)(`div`,{className:`max-w-6xl mx-auto flex items-center justify-between`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-8`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-white/35 text-[10px] font-bold uppercase tracking-widest mb-0.5`,children:e(`assoc.detail.statsMembers`)}),(0,u.jsx)(`p`,{className:`text-white font-bold text-xl leading-none`,children:d.member_count})]}),d.region&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-white/35 text-[10px] font-bold uppercase tracking-widest mb-0.5`,children:e(`assoc.detail.statsRegion`)}),(0,u.jsx)(`p`,{className:`text-white font-bold text-xl leading-none`,children:d.region})]}),$&&(0,u.jsxs)(`div`,{className:`hidden sm:block`,children:[(0,u.jsx)(`p`,{className:`text-white/35 text-[10px] font-bold uppercase tracking-widest mb-0.5`,children:e(`assoc.detail.statsPhotos`)}),(0,u.jsx)(`p`,{className:`text-white font-bold text-xl leading-none`,children:q.length})]})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i&&v&&(0,u.jsxs)(`span`,{className:`flex items-center gap-1.5 px-3 py-1.5 bg-green-500/20 border border-green-400/30 backdrop-blur-sm rounded-full text-green-300 text-xs font-semibold`,children:[(0,u.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2.5,d:`M5 13l4 4L19 7`})}),e(b===`admin`?`assoc.detail.roleAdmin`:`assoc.detail.roleMember`)]}),i&&!v&&!F&&(0,u.jsx)(`button`,{onClick:W,disabled:S,className:`px-5 py-2.5 bg-white text-gray-900 text-sm font-bold rounded-full hover:bg-gray-100 disabled:opacity-60 transition-colors shadow-lg`,children:S?d?.is_public?e(`assoc.detail.joiningPublic`):e(`assoc.detail.joiningSending`):d?.is_public?e(`assoc.detail.joinPublic`):e(`assoc.detail.joinRequest`)}),i&&!v&&F&&(0,u.jsx)(`span`,{className:`flex items-center gap-1.5 px-3 py-1.5 bg-amber-500/20 border border-amber-400/30 backdrop-blur-sm rounded-full text-amber-300 text-xs font-semibold`,children:e(`assoc.detail.requestSent`)})]})]})})]}),(0,u.jsx)(`section`,{className:`bg-white py-16`,children:(0,u.jsxs)(`div`,{className:`max-w-6xl mx-auto px-6`,children:[g&&(0,u.jsxs)(`div`,{className:`mb-8 flex items-center gap-2 px-4 py-3 bg-red-50 border border-red-100 rounded-2xl text-red-600 text-sm`,children:[(0,u.jsx)(`svg`,{className:`w-4 h-4 flex-shrink-0`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 9v2m0 4h.01`})}),g]}),(0,u.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-12 items-start`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-[11px] font-bold text-gray-300 uppercase tracking-[0.3em] mb-5`,children:e(`assoc.detail.aboutLabel`)}),(0,u.jsx)(`h2`,{className:`text-4xl lg:text-5xl font-bold text-gray-900 leading-[1.1] mb-6`,children:d.name}),(0,u.jsx)(`p`,{className:`text-gray-500 text-lg leading-relaxed mb-8 whitespace-pre-line`,children:d.description||e(`assoc.card.noDescription`)}),(0,u.jsxs)(`div`,{className:`flex flex-wrap gap-2 mb-8`,children:[d.city&&(0,u.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 bg-gray-50 border border-gray-100 rounded-full text-xs font-medium text-gray-600`,children:[(0,u.jsx)(`svg`,{className:`w-3 h-3 text-gray-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0zM15 11a3 3 0 11-6 0 3 3 0 016 0z`})}),d.city]}),d.region&&(0,u.jsx)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 bg-gray-50 border border-gray-100 rounded-full text-xs font-medium text-gray-600`,children:d.region}),(0,u.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 bg-gray-50 border border-gray-100 rounded-full text-xs font-medium text-gray-600`,children:[(0,u.jsx)(`svg`,{className:`w-3 h-3 text-gray-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z`})}),e(`assoc.detail.memberCountTag`,{count:d.member_count})]}),d.is_public&&(0,u.jsx)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 bg-green-50 border border-green-100 rounded-full text-xs font-medium text-green-600`,children:e(`assoc.detail.openToMembers`)})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[d.contact_email&&(0,u.jsxs)(`a`,{href:`mailto:${d.contact_email}`,className:`inline-flex items-center gap-2 px-5 py-3 bg-gray-900 text-white text-sm font-semibold rounded-2xl hover:bg-gray-800 transition-colors`,children:[(0,u.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`})}),e(`assoc.detail.contactButton`)]}),d.website&&(0,u.jsxs)(`a`,{href:d.website,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 px-5 py-3 bg-white border border-gray-200 text-gray-700 text-sm font-semibold rounded-2xl hover:bg-gray-50 transition-colors`,children:[(0,u.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`})}),d.website.replace(/^https?:\/\//,``).split(`/`)[0]]})]})]}),(0,u.jsx)(`div`,{className:`relative`,children:Y||J?(0,u.jsxs)(`div`,{className:`relative aspect-[4/3] rounded-3xl overflow-hidden shadow-xl`,children:[(0,u.jsx)(`img`,{src:Y||J,alt:d.name,className:`w-full h-full object-cover`}),J&&Y&&(0,u.jsx)(`div`,{className:`absolute bottom-4 left-4 w-14 h-14 rounded-xl overflow-hidden border-2 border-white shadow-lg`,children:(0,u.jsx)(`img`,{src:J,alt:`Logo ${d.name}`,className:`w-full h-full object-cover`})})]}):(0,u.jsx)(`div`,{className:`aspect-[4/3] rounded-3xl bg-gradient-to-br ${f(d.id)}`})})]})]})}),$&&(0,u.jsxs)(`section`,{className:`bg-gray-900 py-20 overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`max-w-6xl mx-auto px-6 mb-10 flex items-end justify-between`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-[11px] font-bold text-white/30 uppercase tracking-[0.25em] mb-2`,children:e(`assoc.detail.galleryLabel`)}),(0,u.jsx)(`h2`,{className:`text-3xl font-bold text-white`,children:e(`assoc.detail.galleryTitle`)})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`button`,{onClick:()=>k(e=>(e-1+q.length)%q.length),className:`w-10 h-10 rounded-full border border-white/20 bg-white/10 backdrop-blur-sm flex items-center justify-center text-white/70 hover:bg-white hover:text-gray-900 transition-all`,children:(0,u.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 19l-7-7 7-7`})})}),(0,u.jsx)(`button`,{onClick:()=>k(e=>(e+1)%q.length),className:`w-10 h-10 rounded-full bg-white flex items-center justify-center text-gray-900 hover:bg-gray-100 transition-all`,children:(0,u.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 5l7 7-7 7`})})})]})]}),(0,u.jsxs)(`div`,{className:`relative flex items-center justify-center gap-4 px-6`,children:[q.length>1&&(0,u.jsx)(`button`,{onClick:()=>k(e=>(e-1+q.length)%q.length),className:`hidden lg:block flex-shrink-0 w-52 h-64 rounded-2xl overflow-hidden opacity-35 hover:opacity-50 transition-opacity cursor-pointer`,children:(0,u.jsx)(`img`,{src:s(q[(O-1+q.length)%q.length]),alt:``,className:`w-full h-full object-cover`})}),(0,u.jsx)(`button`,{onClick:()=>D(O),className:`flex-1 max-w-3xl flex-shrink-0 focus:outline-none group`,children:(0,u.jsx)(`div`,{className:`aspect-video rounded-3xl overflow-hidden shadow-2xl`,children:(0,u.jsx)(`img`,{src:s(q[O]),alt:e(`assoc.detail.photoAlt`,{index:O+1}),className:`w-full h-full object-cover group-hover:scale-105 transition-transform duration-500`})})}),q.length>1&&(0,u.jsx)(`button`,{onClick:()=>k(e=>(e+1)%q.length),className:`hidden lg:block flex-shrink-0 w-52 h-64 rounded-2xl overflow-hidden opacity-35 hover:opacity-50 transition-opacity cursor-pointer`,children:(0,u.jsx)(`img`,{src:s(q[(O+1)%q.length]),alt:``,className:`w-full h-full object-cover`})})]}),q.length>1&&(0,u.jsx)(`div`,{className:`flex justify-center gap-2 mt-8`,children:q.map((e,t)=>(0,u.jsx)(`button`,{onClick:()=>k(t),className:`rounded-full transition-all ${t===O?`w-6 h-2 bg-white`:`w-2 h-2 bg-white/30 hover:bg-white/50`}`},t))}),(0,u.jsxs)(`p`,{className:`text-center text-white/30 text-xs mt-4`,children:[O+1,` / `,q.length]})]}),_e&&(0,u.jsx)(`section`,{className:`bg-white py-16`,children:(0,u.jsxs)(`div`,{className:`max-w-6xl mx-auto px-6`,children:[(0,u.jsxs)(`div`,{className:`mb-12`,children:[(0,u.jsx)(`p`,{className:`text-[11px] font-bold text-gray-300 uppercase tracking-[0.25em] mb-2`,children:e(`assoc.detail.teamLabel`)}),(0,u.jsxs)(`h2`,{className:`text-3xl font-bold text-gray-900`,children:[e(`assoc.detail.teamTitle`),(0,u.jsxs)(`span`,{className:`ml-3 text-gray-300 font-light text-2xl`,children:[`· `,d.member_count]})]})]}),(0,u.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4`,children:m.map(t=>{let n=A[t.user_id]||e(`assoc.detail.defaultMember`),r=t.role===`admin`;return(0,u.jsxs)(`div`,{className:`flex flex-col items-center text-center p-5 rounded-2xl border border-gray-100 bg-white hover:shadow-lg hover:-translate-y-0.5 transition-all duration-200`,children:[(0,u.jsx)(`div`,{className:`w-14 h-14 rounded-2xl ${ae(t.user_id)} flex items-center justify-center mb-3 shadow-sm flex-shrink-0`,children:(0,u.jsx)(`span`,{className:`text-white font-bold text-lg`,children:oe(n)})}),(0,u.jsx)(`p`,{className:`text-sm font-bold text-gray-800 leading-tight mb-1.5 w-full truncate`,children:n}),(0,u.jsx)(`span`,{className:`text-[11px] font-semibold px-2 py-0.5 rounded-full flex-shrink-0 ${r?`bg-amber-50 text-amber-700 border border-amber-100`:`bg-gray-50 text-gray-500 border border-gray-100`}`,children:e(r?`assoc.detail.roleAdminBadge`:`assoc.detail.roleMemberBadge`)})]},t.id)})})]})}),Q&&(0,u.jsx)(`section`,{className:`bg-gray-900 py-24`,children:(0,u.jsxs)(`div`,{className:`max-w-6xl mx-auto px-6`,children:[(0,u.jsxs)(`div`,{className:`mb-12`,children:[(0,u.jsx)(`p`,{className:`text-[11px] font-bold text-white/25 uppercase tracking-[0.25em] mb-2`,children:e(`assoc.detail.videosLabel`)}),(0,u.jsx)(`h2`,{className:`text-3xl font-bold text-white`,children:e(`assoc.detail.videosTitle`)})]}),(0,u.jsx)(`div`,{className:`grid gap-5 ${X.length===1?`max-w-2xl`:`grid-cols-1 md:grid-cols-2`}`,children:X.map(t=>{let n=ie(t);return n?(0,u.jsx)(`div`,{className:`aspect-video rounded-2xl overflow-hidden`,children:(0,u.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${n}`,title:e(`assoc.detail.videoTitle`),className:`w-full h-full`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0})},t):(0,u.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-3 p-4 bg-white/10 hover:bg-white/15 rounded-2xl transition-colors`,children:[(0,u.jsx)(`svg`,{className:`w-5 h-5 text-white/50 flex-shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 10l4.553-2.069A1 1 0 0121 8.82v6.36a1 1 0 01-1.447.9L15 14M3 8a2 2 0 012-2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z`})}),(0,u.jsx)(`span`,{className:`text-white/70 text-sm truncate`,children:t})]},t)})})]})}),b===`admin`&&(0,u.jsx)(`section`,{className:`bg-gray-50 border-t border-gray-100 py-12`,children:(0,u.jsxs)(`div`,{className:`max-w-6xl mx-auto px-6`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-3 mb-8`,children:[(0,u.jsx)(`div`,{className:`w-8 h-8 rounded-xl bg-gray-900 flex items-center justify-center`,children:(0,u.jsxs)(`svg`,{className:`w-4 h-4 text-white`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:[(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z`}),(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`})]})}),(0,u.jsx)(`h2`,{className:`text-lg font-bold text-gray-900`,children:e(`assoc.admin.title`)})]}),(0,u.jsxs)(`div`,{className:`flex gap-1 mb-6 p-1 bg-white border border-gray-100 rounded-xl w-fit shadow-sm`,children:[(0,u.jsxs)(`button`,{onClick:()=>V(`requests`),className:`px-4 py-2 text-sm font-semibold rounded-lg transition-colors ${B===`requests`?`bg-gray-900 text-white`:`text-gray-500 hover:text-gray-700`}`,children:[e(`assoc.admin.tabRequests`),P>0&&(0,u.jsx)(`span`,{className:`ml-2 px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full`,children:P})]}),(0,u.jsx)(`button`,{onClick:()=>V(`invitations`),className:`px-4 py-2 text-sm font-semibold rounded-lg transition-colors ${B===`invitations`?`bg-gray-900 text-white`:`text-gray-500 hover:text-gray-700`}`,children:e(`assoc.admin.tabInvitations`)})]}),B===`requests`&&(0,u.jsx)(`div`,{children:N.length===0?(0,u.jsx)(`p`,{className:`text-gray-400 text-sm`,children:e(`assoc.admin.noRequests`)}):(0,u.jsx)(`div`,{className:`space-y-3`,children:N.map(t=>(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-4 p-4 bg-white border border-gray-100 rounded-2xl shadow-sm`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:A[t.user_id]||t.user_id}),t.message&&(0,u.jsx)(`p`,{className:`text-xs text-gray-400 mt-0.5 line-clamp-2`,children:t.message}),(0,u.jsx)(`p`,{className:`text-[10px] text-gray-300 mt-1`,children:t.created_at.slice(0,10)})]}),(0,u.jsxs)(`div`,{className:`flex gap-2 flex-shrink-0`,children:[(0,u.jsx)(`button`,{onClick:()=>K(t.id,`approved`),className:`px-3 py-1.5 bg-green-50 hover:bg-green-100 text-green-700 text-xs font-semibold rounded-lg border border-green-100 transition-colors`,children:e(`assoc.admin.accept`)}),(0,u.jsx)(`button`,{onClick:()=>K(t.id,`rejected`),className:`px-3 py-1.5 bg-red-50 hover:bg-red-100 text-red-700 text-xs font-semibold rounded-lg border border-red-100 transition-colors`,children:e(`assoc.admin.reject`)})]})]},t.id))})}),B===`invitations`&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`button`,{onClick:pe,disabled:R,className:`mb-5 px-4 py-2.5 bg-gray-900 hover:bg-gray-800 text-white text-sm font-semibold rounded-xl disabled:opacity-60 transition-colors`,children:e(R?`assoc.admin.generating`:`assoc.admin.generateInvite`)}),I.length===0?(0,u.jsx)(`p`,{className:`text-gray-400 text-sm`,children:e(`assoc.admin.noInvitations`)}):(0,u.jsx)(`div`,{className:`space-y-3`,children:I.map(t=>(0,u.jsx)(`div`,{className:`p-4 bg-white border rounded-2xl shadow-sm ${t.is_active?`border-gray-100`:`border-gray-50 opacity-50`}`,children:(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,u.jsx)(`span`,{className:`px-2 py-0.5 text-[10px] font-bold rounded-full ${t.is_active?`bg-green-50 text-green-600`:`bg-gray-50 text-gray-400`}`,children:t.is_active?e(`assoc.admin.inviteActive`):e(`assoc.admin.inviteRevoked`)}),(0,u.jsxs)(`span`,{className:`text-[10px] text-gray-300`,children:[t.use_count,` `,e(`assoc.admin.uses`,{count:t.use_count}),t.max_uses?` / ${t.max_uses}`:``]})]}),t.invite_url?(0,u.jsx)(`a`,{href:t.invite_url,className:`text-xs text-gray-500 hover:text-gray-700 font-mono truncate block max-w-xs`,target:`_blank`,rel:`noopener noreferrer`,children:t.invite_url}):(0,u.jsx)(`span`,{className:`text-xs text-gray-400 font-mono`,children:t.token})]}),t.is_active&&(0,u.jsx)(`button`,{onClick:()=>me(t.id),className:`px-3 py-1.5 bg-red-50 hover:bg-red-100 text-red-600 text-xs font-semibold rounded-lg border border-red-100 transition-colors flex-shrink-0`,children:e(`assoc.admin.revoke`)})]})},t.id))})]})]})}),(0,u.jsx)(`section`,{className:`py-24 ${Q?`bg-gray-900 border-t border-white/5`:`bg-gray-900`}`,children:(0,u.jsxs)(`div`,{className:`max-w-3xl mx-auto px-6 text-center`,children:[(0,u.jsx)(`p`,{className:`text-[11px] font-bold text-white/25 uppercase tracking-[0.25em] mb-5`,children:e(`assoc.detail.ctaEyebrow`)}),(0,u.jsxs)(`h2`,{className:`text-3xl md:text-4xl font-bold text-white mb-4 leading-tight`,children:[e(`assoc.detail.ctaTitle`),(0,u.jsx)(`br`,{}),(0,u.jsxs)(`span`,{className:`text-white/60`,children:[d.name,` ?`]})]}),(0,u.jsx)(`p`,{className:`text-white/35 text-sm mb-12 max-w-sm mx-auto leading-relaxed`,children:e(`assoc.detail.ctaSubtitle`)}),(0,u.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center justify-center gap-4 mb-6`,children:[i&&!v&&!F&&(0,u.jsx)(`button`,{onClick:W,disabled:S,className:`px-8 py-4 bg-white text-gray-900 text-sm font-bold rounded-2xl hover:bg-gray-100 disabled:opacity-60 disabled:cursor-not-allowed transition-colors shadow-lg`,children:S?d.is_public?e(`assoc.detail.joiningPublicFull`):e(`assoc.detail.joiningSendingFull`):d.is_public?e(`assoc.detail.ctaJoinPublic`):e(`assoc.detail.joinRequest`)}),i&&!v&&F&&(0,u.jsxs)(`div`,{className:`flex items-center gap-2 px-6 py-4 bg-amber-500/15 border border-amber-400/25 rounded-2xl`,children:[(0,u.jsx)(`svg`,{className:`w-5 h-5 text-amber-400 flex-shrink-0`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})}),(0,u.jsx)(`span`,{className:`text-amber-300 font-semibold text-sm`,children:e(`assoc.detail.requestPending`)})]}),i&&v&&(0,u.jsxs)(`div`,{className:`flex items-center gap-2 px-6 py-4 bg-green-500/15 border border-green-400/25 rounded-2xl`,children:[(0,u.jsx)(`svg`,{className:`w-5 h-5 text-green-400 flex-shrink-0`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2.5,d:`M5 13l4 4L19 7`})}),(0,u.jsx)(`span`,{className:`text-green-300 font-semibold text-sm`,children:e(b===`admin`?`assoc.detail.youAreAdmin`:`assoc.detail.youAreMember`)})]}),d.contact_email&&(0,u.jsx)(`a`,{href:`mailto:${d.contact_email}`,className:`px-8 py-4 bg-white/8 hover:bg-white/12 text-white text-sm font-semibold rounded-2xl border border-white/10 transition-colors`,children:e(`assoc.detail.contactUs`)}),d.website&&(0,u.jsxs)(`a`,{href:d.website,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 px-8 py-4 bg-white/8 hover:bg-white/12 text-white text-sm font-semibold rounded-2xl border border-white/10 transition-colors`,children:[(0,u.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`})}),e(`assoc.detail.website`)]})]}),i&&v&&b!==`admin`&&(0,u.jsx)(`button`,{onClick:he,disabled:w,className:`text-xs text-white/20 hover:text-white/45 transition-colors disabled:opacity-40`,children:e(w?`assoc.detail.leavingInProgress`:`assoc.detail.leaveButton`)})]})}),E!==null&&q.length>0&&(0,u.jsxs)(`div`,{className:`fixed inset-0 bg-black/95 z-50 flex items-center justify-center p-4`,onClick:()=>D(null),children:[(0,u.jsx)(`button`,{onClick:()=>D(null),className:`absolute top-4 right-4 w-9 h-9 bg-white/10 hover:bg-white/20 backdrop-blur-sm text-white rounded-full flex items-center justify-center transition-colors z-10`,children:(0,u.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})}),q.length>1&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{onClick:e=>{e.stopPropagation(),D((E-1+q.length)%q.length)},className:`absolute left-4 top-1/2 -translate-y-1/2 w-9 h-9 bg-white/10 hover:bg-white/20 backdrop-blur-sm text-white rounded-full flex items-center justify-center transition-colors z-10`,children:(0,u.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 19l-7-7 7-7`})})}),(0,u.jsx)(`button`,{onClick:e=>{e.stopPropagation(),D((E+1)%q.length)},className:`absolute right-4 top-1/2 -translate-y-1/2 w-9 h-9 bg-white/10 hover:bg-white/20 backdrop-blur-sm text-white rounded-full flex items-center justify-center transition-colors z-10`,children:(0,u.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 5l7 7-7 7`})})})]}),(0,u.jsx)(`img`,{src:s(q[E]),alt:e(`assoc.detail.photoAlt`,{index:E+1}),className:`max-w-full max-h-[88vh] object-contain rounded-2xl`,onClick:e=>e.stopPropagation()}),q.length>1&&(0,u.jsxs)(`div`,{className:`absolute bottom-4 left-1/2 -translate-x-1/2 text-white/50 text-xs bg-white/10 backdrop-blur-sm px-3 py-1.5 rounded-full`,children:[E+1,` / `,q.length]})]})]})};export{m as default};