PageSourceSearch

https://static.wuubi.com/_next/static/chunks/pages/group/[detail]-ec9c95712d84f87c.js

js wuubi.com collected 2026-09-24 14:21:04 UTC 128,883 bytes, 159 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c3f5ccdb-d756-43e7-9190-1d65f6555ceb",e._sentryDebugIdIdentifier="sentry-dbid-c3f5ccdb-d756-43e7-9190-1d65f6555ceb")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6345],{1629:(e,t,s)=>{"use strict";s.d(t,{w:()=>n});var a=s(33274),r=s(30225),l=s(40097),i=s(97685);let n=()=>{let{openModal:e}=(0,a.A)(),t=(0,r.A)();return(0,l.n)({mutationFn:async({user:s,postId:a,optionId:r})=>{if(!a||!r||!s?._id)return!1;let l=await fetch(`https://api.wuubi.com/api/group/post/${a}/quiz/answer`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t?{Authorization:t}:{}},credentials:"include",body:JSON.stringify({optionId:r})}),n=await l.json();if(!n?.responseResult?.status)return i.Ay.error(n?.responseResult?.exceptionDetail?.[0]||"Bilgi yarışması cevabı kaydedilemedi"),!1;let d=n?.responseResult?.achievement||[];if(Array.isArray(d)&&d.length>0){let{title:t,description:s,icon:a}=d[0];t&&s&&a&&e(t,s,a)}return n?.result?.data||!1}})}},4622:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var a=s(85278);let r=(0,s(99542).eU)({isOpen:!1,title:"",description:"",icon:"",iconReady:!1}),l=()=>{let[e,t]=(0,a.fp)(r);return{modalState:e,setModalState:t}}},19357:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/group/[detail]",function(){return s(29341)}])},19899:(e,t,s)=>{"use strict";s.d(t,{m:()=>n});var a=s(33274),r=s(30225),l=s(40097),i=s(97685);let n=()=>{let{openModal:e}=(0,a.A)(),t=(0,r.A)();return(0,l.n)({mutationFn:async({user:s,postId:a})=>{if(!a||!s?._id)return!1;let r=`https://api.wuubi.com/api/group/${a}/like`,l=await fetch(r,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t?{Authorization:t}:{}},credentials:"include"}),n=await l.json();if(!n||!n.responseResult.status)return i.Ay.error(n.responseResult.exceptionDetail?.[0]),!1;if(n.responseResult.achievement&&n.responseResult.achievement.length>0){let{title:t,description:s,icon:a}=n.responseResult.achievement[0];e(t,s,a)}return!0}})}},27062:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var a=s(37876);s(14232);var r=s(65590),l=s.n(r);let i=({variant:e="primary",size:t="md",fullWidth:s=!1,iconOnly:r=!1,className:i="",type:n="button",onMouseEnter:d,onMouseLeave:o,onMouseDown:c,onMouseUp:m,onBlur:x,disabled:u,...p})=>{let h=[l().button,l()[e],l()[t],s?l().fullWidth:"",r?l().iconOnly:"",i].filter(Boolean).join(" ");return(0,a.jsx)("button",{type:n,className:h,disabled:u,onMouseEnter:d,onMouseLeave:o,onMouseDown:c,onMouseUp:m,onBlur:x,...p})}},29341:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>e7,default:()=>e8});var a=s(37876),r=s(65127),l=s(35750),i=s(24178),n=s(87185),d=s(5797),o=s(6978),c=s(14232),m=s(11629),x=s(41575),u=s(93673),p=s(54587),h=s.n(p),b=s(48230),g=s.n(b),f=s(6220),y=s(40097),j=s(30225),v=s(92963),w=s(97685);let N=({isOpen:e,onClose:t,group:s,onSuccess:r})=>{let[l,i]=(0,c.useState)("admins"),[n,p]=(0,c.useState)(""),b=(()=>{(0,v.A)();let e=(0,j.A)();return(0,y.n)({mutationFn:async({groupId:t,userId:s})=>{let a=await fetch("https://api.wuubi.com/api/group/admin/assign",{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:e}:{}},credentials:"include",body:JSON.stringify({groupId:t,userId:s})}),r=await a.json();if(!a.ok)throw Error(r.message||"Y\xf6netici atanamadı");return r},onSuccess:e=>{w.Ay.success(e.message||"Y\xf6netici atandı")},onError:e=>{w.Ay.error(e.message||"Y\xf6netici atanamadı")}})})(),N=(()=>{(0,v.A)();let e=(0,j.A)();return(0,y.n)({mutationFn:async({groupId:t,userId:s})=>{let a=await fetch("https://api.wuubi.com/api/group/admin/remove",{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:e}:{}},credentials:"include",body:JSON.stringify({groupId:t,userId:s})}),r=await a.json();if(!a.ok)throw Error(r.message||"Y\xf6netici kaldırılamadı");return r},onSuccess:e=>{w.Ay.success(e.message||"Y\xf6netici kaldırıldı")},onError:e=>{w.Ay.error(e.message||"Y\xf6netici kaldırılamadı")}})})(),k=(()=>{(0,v.A)();let e=(0,j.A)();return(0,y.n)({mutationFn:async({groupId:t,newOwnerId:s})=>{let a=await fetch("https://api.wuubi.com/api/group/owner/transfer",{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:e}:{}},credentials:"include",body:JSON.stringify({groupId:t,userId:s})}),r=await a.json();if(!a.ok)throw Error(r.message||"Sahiplik devredilemedi");return r},onSuccess:e=>{w.Ay.success(e.message||"Sahiplik devredildi")},onError:e=>{w.Ay.error(e.message||"Sahiplik devredilemedi")}})})(),A=s.members.filter(e=>!s.admins.some(t=>t._id===e._id)),C=s.members.filter(e=>s.admins.some(t=>t._id===e._id));return(0,a.jsx)(d.e,{appear:!0,show:e,as:c.Fragment,children:(0,a.jsxs)(o.lG,{as:"div",className:"relative z-50",onClose:t,children:[(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),(0,a.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,a.jsxs)(o.lG.Panel,{className:"w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)(o.lG.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900",children:"Y\xf6netici Ayarları"}),(0,a.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:(0,a.jsx)(m.A,{className:"h-6 w-6"})})]}),s.isCreator&&(0,a.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,a.jsx)("button",{onClick:()=>i("admins"),className:`flex-1 px-4 py-2 rounded-2xl transition-all ${"admins"===l?"btn btn-secondary":"btn btn-light"}`,children:"Y\xf6neticileri Y\xf6net"}),(0,a.jsx)("button",{onClick:()=>i("transfer"),className:`flex-1 px-4 py-2 rounded-2xl transition-all ${"transfer"===l?"btn btn-secondary":"btn btn-light"}`,children:"Sahipliği Devret"})]}),"admins"===l?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h4",{className:"label",children:["Mevcut Y\xf6neticiler (",s.admins.length,"/5)"]}),(0,a.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:C.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 bg-soft rounded-2xl",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(g(),{href:`/profile/${e.username}`,className:"flex items-center gap-2 transition-opacity hover:opacity-80",children:[(0,a.jsx)(f.A,{sx:{width:32,height:32},children:(0,a.jsx)(h(),{src:e.profilePicture||"",alt:e.username,width:32,height:32,className:"rounded-full"})}),(0,a.jsx)("span",{className:"text-sm text-dark font-medium",children:e.username})]}),e._id===s.createdBy._id&&(0,a.jsx)(x.A,{className:"h-4 w-4 text-warning"})]}),s.isCreator&&e._id!==s.createdBy._id&&(0,a.jsx)("button",{onClick:()=>{var t;return t=e._id,void N.mutate({groupId:s._id,userId:t},{onSuccess:()=>{r()}})},disabled:N.isPending,className:"text-error hover:text-error/80 disabled:opacity-50 transition-colors",children:(0,a.jsx)(u.A,{className:"h-5 w-5"})})]},e._id))})]}),s.isCreator&&s.admins.length<5&&A.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"label",children:"Yeni Y\xf6netici Ata"}),(0,a.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:A.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 bg-soft rounded-2xl",children:[(0,a.jsxs)(g(),{href:`/profile/${e.username}`,className:"flex items-center gap-2 transition-opacity hover:opacity-80",children:[(0,a.jsx)(f.A,{sx:{width:32,height:32},children:(0,a.jsx)(h(),{src:e.profilePicture||"",alt:e.username,width:32,height:32,className:"rounded-full"})}),(0,a.jsx)("span",{className:"text-sm text-dark font-medium",children:e.username})]}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e._id,void b.mutate({groupId:s._id,userId:t},{onSuccess:()=>{r(),p("")}})},disabled:b.isPending,className:"btn btn-secondary btn-sm",children:"Ata"})]},e._id))})]})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Grup sahipliğini başka bir \xfcyeye devredin. Devir sonrası normal bir y\xf6netici olacaksınız."}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"label",children:"Yeni Sahip Se\xe7in"}),(0,a.jsxs)("select",{value:n,onChange:e=>p(e.target.value),className:"input w-full",children:[(0,a.jsx)("option",{value:"",children:"Bir \xfcye se\xe7in..."}),s.members.filter(e=>e._id!==s.createdBy._id).map(e=>(0,a.jsx)("option",{value:e._id,children:e.username},e._id))]})]}),(0,a.jsx)("button",{onClick:()=>{n&&k.mutate({groupId:s._id,newOwnerId:n},{onSuccess:()=>{r(),t()}})},disabled:!n||k.isPending,className:"btn btn-warning w-full",children:k.isPending?"Devrediliyor...":"Sahipliği Devret"})]})]})})})})]})})};var k=s(89099),A=s(85616),C=s(28192),_=s(90709),S=s(4153),I=s(32615),P=s(44542);let z=["image/png","image/jpeg","image/jpg"],G=({isOpen:e,onClose:t,group:s,onSuccess:r})=>{let[l,i]=(0,c.useState)(s.title),[n,x]=(0,c.useState)(s.description||""),[u,p]=(0,c.useState)(s.isPublic),[b,g]=(0,c.useState)(!1),[f,N]=(0,c.useState)(null),[G,$]=(0,c.useState)(null),[T,F]=(0,c.useState)(!1),[D,B]=(0,c.useState)(null),[R,O]=(0,c.useState)(""),[M,E]=(0,c.useState)({x:0,y:0}),[q,L]=(0,c.useState)(1),[Y,K]=(0,c.useState)(null),W=(0,c.useRef)(null),H=(0,c.useRef)(null),J=(()=>{(0,v.A)();let e=(0,j.A)();return(0,y.n)({mutationFn:async t=>{let s=await fetch("https://api.wuubi.com/api/group/settings",{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:e}:{}},credentials:"include",body:JSON.stringify(t)}),a=await s.json();if(!s.ok)throw Error(a.message||"Grup ayarları g\xfcncellenemedi");return a},onSuccess:e=>{w.Ay.success(e.message||"Grup ayarları g\xfcncellendi")},onError:e=>{w.Ay.error(e.message||"Grup ayarları g\xfcncellenemedi")}})})(),Q=(()=>{(0,v.A)();let e=(0,j.A)(),t=(0,k.useRouter)();return(0,y.n)({mutationFn:async({groupId:t})=>{let s=await fetch("https://api.wuubi.com/api/group/delete",{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:e}:{}},credentials:"include",body:JSON.stringify({groupId:t})}),a=await s.json();if(!s.ok)throw Error(a.message||"Grup silinemedi");return a},onSuccess:e=>{w.Ay.success(e.message||"Grup silindi"),t.push("/home")},onError:e=>{w.Ay.error(e.message||"Grup silinemedi")}})})(),U=async(e,t)=>{let s=await new Promise((t,s)=>{let a=document.createElement("img");a.addEventListener("load",()=>t(a)),a.addEventListener("error",()=>s(Error("Failed to load image"))),a.setAttribute("crossOrigin","anonymous"),a.src=e}),a=document.createElement("canvas"),r=a.getContext("2d");if(!r)throw Error("No 2d context");return a.width=t.width,a.height=t.height,r.drawImage(s,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise(e=>{a.toBlob(t=>{if(!t)return;let s=new FileReader;s.onloadend=()=>{e(s.result)},s.readAsDataURL(t)},"image/jpeg")})},V=async()=>
1{if(Y&&R)try{let e=await U(R,Y);"thumbnail"===D?N({name:`thumbnail-cropped-${Date.now()}`,url:e,file:null}):"cover"===D&&$({name:`cover-cropped-${Date.now()}`,url:e,file:null}),F(!1),B(null),E({x:0,y:0}),L(1)}catch(e){(0,P.vV)("Error cropping image:",e)}},Z=async(e,t)=>{if(!e.target.files)return;let s=e.target.files[0];if(s){let e=new FileReader;e.onloadend=()=>{O(e.result),B(t),F(!0),E({x:0,y:0}),L(1)},e.readAsDataURL(s)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.e,{appear:!0,show:e,as:c.Fragment,children:(0,a.jsxs)(o.lG,{as:"div",className:"relative z-50",onClose:t,children:[(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),(0,a.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,a.jsxs)(o.lG.Panel,{className:"w-full max-w-2xl transform overflow-hidden rounded-3xl bg-white p-0 text-left align-middle shadow-2xl transition-all",children:[(0,a.jsxs)("div",{className:"bg-gradient-to-r from-secondary to-secondary/90 px-8 py-6 relative overflow-hidden",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48cGF0dGVybiBpZD0iZ3JpZCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLW9wYWNpdHk9IjAuMSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyaWQpIi8+PC9zdmc+')] opacity-20"}),(0,a.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.lG.Title,{as:"h3",className:"text-2xl font-bold text-white",children:"Grup Ayarları"}),(0,a.jsx)("p",{className:"text-white/80 text-sm mt-1",children:"Grubunuzu \xf6zelleştirin ve y\xf6netin"})]}),(0,a.jsx)("button",{onClick:t,className:"text-white/80 hover:text-white transition-colors bg-white/10 hover:bg-white/20 rounded-full p-2",children:(0,a.jsx)(m.A,{className:"h-6 w-6"})})]})]}),(0,a.jsx)("div",{className:"px-8 py-6",children:b?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Bu grubu silmek istediğinizden emin misiniz? Bu işlem geri alınamaz."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:()=>{Q.mutate({groupId:s._id},{onSuccess:()=>{t()}})},disabled:Q.isPending,className:"btn btn-danger flex-1",children:Q.isPending?"Siliniyor...":"Evet, Sil"}),(0,a.jsx)("button",{onClick:()=>g(!1),className:"btn btn-light flex-1",children:"İptal"})]})]}):(0,a.jsxs)("form",{className:"flex flex-col gap-8",onSubmit:e=>{e.preventDefault(),(()=>{let e={};if(l&&0!==l.trim().length?(l.length<12||l.length>100)&&(e.title=`Grup adı 12-100 karakter arasında olmalıdır`):e.title="Grup adı zorunludur",n&&0!==n.trim().length?(n.length<20||n.length>500)&&(e.description=`A\xe7ıklama 20-500 karakter arasında olmalıdır`):e.description="A\xe7ıklama zorunludur",f&&f.file&&(z.includes(f.file.type?.toLowerCase())||(e.thumbnailImage="Yalnızca png, jpg veya jpeg y\xfckleyin"),f.file.size>5242880&&(e.thumbnailImage="G\xf6rsel boyutu en fazla 5MB olmalıdır")),G&&G.file&&(z.includes(G.file.type?.toLowerCase())||(e.coverImage="Yalnızca png, jpg veya jpeg y\xfckleyin"),G.file.size>5242880&&(e.coverImage="G\xf6rsel boyutu en fazla 5MB olmalıdır")),Object.keys(e).length>0)return Object.entries(e).forEach(([e,t])=>{w.Ay.error(t)});let a={groupId:s._id,title:l,description:n,isPublic:u};f&&(a.thumbnailImage={name:f.name,url:f.url}),G&&(a.coverImage={name:G.name,url:G.url}),J.mutate(a,{onSuccess:()=>{w.Ay.success("Grup ayarları g\xfcncellendi"),r(),t()},onError:()=>{w.Ay.error("Grup ayarları g\xfcncellenemedi")}})})()},children:[(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-6 bg-gray-50 rounded-xl p-6 border border-gray-100",children:[(0,a.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500 mb-1",children:"Grup G\xf6rseli"}),(0,a.jsxs)("div",{className:"relative w-[120px] h-[120px]",children:[(0,a.jsx)("input",{type:"file",ref:W,className:"hidden",accept:"image/png,image/jpeg,image/jpg",onChange:e=>Z(e,"thumbnail")}
1),f?(0,a.jsx)(h(),{src:f.url,alt:"Thumbnail",fill:!0,sizes:"96px",className:"rounded-xl object-cover border border-gray-200"}):s.thumbnail?(0,a.jsx)(h(),{src:s.thumbnail,alt:"Thumbnail",fill:!0,sizes:"96px",className:"rounded-xl object-cover border border-gray-200"}):(0,a.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gray-100 rounded-xl border border-gray-200",children:(0,a.jsx)(A.A,{className:"w-10 h-10 text-gray-300"})}),(0,a.jsx)("button",{type:"button",onClick:()=>W.current?.click(),className:"absolute bottom-2 right-2 bg-white/90 hover:bg-white transition-colors rounded-full p-1 shadow-md border border-gray-200",title:"G\xf6rseli Değiştir",children:(0,a.jsx)(C.A,{className:"w-5 h-5 text-secondary"})})]})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500 mb-1",children:"Kapak G\xf6rseli"}),(0,a.jsxs)("div",{className:"relative w-[220px] h-[80px]",children:[(0,a.jsx)("input",{type:"file",ref:H,className:"hidden",accept:"image/png,image/jpeg,image/jpg",onChange:e=>Z(e,"cover")}),G?(0,a.jsx)(h(),{src:G.url,alt:"Cover",fill:!0,sizes:"(max-width: 639px) calc(100vw - 4rem), 480px",className:"rounded-xl object-cover border border-gray-200"}):s.coverImage?(0,a.jsx)(h(),{src:s.coverImage,alt:"Cover",fill:!0,sizes:"(max-width: 639px) calc(100vw - 4rem), 480px",className:"rounded-xl object-cover border border-gray-200"}):(0,a.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gray-100 rounded-xl border border-gray-200",children:(0,a.jsx)(A.A,{className:"w-10 h-10 text-gray-300"})}),(0,a.jsx)("button",{type:"button",onClick:()=>H.current?.click(),className:"absolute bottom-2 right-2 bg-white/90 hover:bg-white transition-colors rounded-full p-1 shadow-md border border-gray-200",title:"Kapak G\xf6rselini Değiştir",children:(0,a.jsx)(C.A,{className:"w-5 h-5 text-secondary"})})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 mb-1",children:"Grup Adı"}),(0,a.jsx)("input",{type:"text",value:l,onChange:e=>i(e.target.value),className:"input w-full",placeholder:"Grup adını girin",required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 mb-1",children:"A\xe7ıklama"}),(0,a.jsx)("textarea",{value:n,onChange:e=>x(e.target.value),rows:3,className:"textarea w-full",placeholder:"Grup a\xe7ıklamasını girin"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-lg border border-gray-100",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Gizlilik Ayarı"}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:u?(0,a.jsxs)("span",{children:[(0,a.jsx)(_.A,{className:"w-4 h-4 inline-block mr-1"}),"Herkese A\xe7ık Grup"]}):(0,a.jsxs)("span",{children:[(0,a.jsx)(S.A,{className:"w-4 h-4 inline-block mr-1"}),"\xd6zel Grup"]})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>p(!u),className:`relative w-14 h-8 rounded-full transition-colors ${u?"bg-secondary":"bg-gray-300"}`,children:(0,a.jsx)("div",{className:`absolute top-1 w-6 h-6 bg-white rounded-full transition-transform ${u?"translate-x-7":"translate-x-1"}`})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row justify-end items-center gap-3 mt-4 border-t pt-6",children:[(0,a.jsx)("button",{type:"submit",disabled:J.isPending,className:"btn btn-secondary min-w-[180px]",children:J.isPending?"Kaydediliyor...":"Değişiklikleri Kaydet"}),s.isCreator&&(0,a.jsx)("button",{type:"button",onClick:()=>g(!0),className:"btn btn-danger min-w-[140px]",children:"Grubu Sil"})]})]})})]})})})})]})}),(0,a.jsx)(d.e,{appear:!0,show:T,as:c.Fragment,children:(0,a.jsxs)(o.lG,{as:"div",className:"relative z-50",onClose:()=>F(!1),children:[(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),(0,a.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,a.jsxs)(o.lG.Panel,{className:"w-full max-w-2xl transform overflow-hidden rounded-3xl bg-white p-8 text-left align-middle shadow-2xl transition-all",children:[(0,a.jsx)(o.lG.Title,{as:"h3",className:"text-2xl font-bold text-dark mb-4",children:"thumbnail"===D?"Grup G\xf6rselini Kırp":"Kapak G\xf6rselini Kırp"}),(0,a.jsx)("div",{className:"relative w-full bg-gray-100 rounded-xl overflow-hidden mb-4",style:{height:"400px"},children:(0,a.jsx)(I.Ay,{image:R,crop:M,zoom:q,aspect:"thumbnail"===D?1:16/9,cropShape:"rect",showGrid:!1,onCropChange:E,onCropComplete:(e,t)=>
1K(t),onZoomChange:L})}),(0,a.jsx)("div",{className:"flex flex-col gap-4 mb-4",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Yakınlaştırma"}),(0,a.jsx)("input",{type:"range",min:"1",max:"3",step:"0.1",value:q,onChange:e=>L(Number(e.target.value)),className:"w-full"})]})}),(0,a.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,a.jsx)("button",{onClick:()=>F(!1),className:"btn btn-light",children:"İptal"}),(0,a.jsx)("button",{onClick:V,className:"btn btn-secondary",children:"Kırpı Uygula"})]})]})})})})]})})]})};var $=s(74359),T=s(67768),F=s(78028),D=s(58346),B=s(63611);let R="https://api.wuubi.com/api",O=(e,t)=>{if(F.A.isAxiosError(e)){let s=e.response?.data;return(0,D.S)(s,t)}return t};var M=s(96440),E=s(93792);let q=({groupId:e,requests:t,isLoading:s})=>{let r=(()=>{let e=(0,T.jE)(),t=(0,v.A)(),s=(0,j.A)();return(0,y.n)({mutationFn:async({groupId:e,userId:t})=>(await F.A.post(`${R}/group/requests/approve`,{groupId:e,userId:t},{withCredentials:!0,headers:{...s?{Authorization:s}:{}}})).data.result.data,onSuccess:(s,{groupId:a})=>{if(w.Ay.success("Kat\xc4\xb1l\xc4\xb1m talebi onayland\xc4\xb1"),e.invalidateQueries({queryKey:["memberRequests",a]}),s?.group?.slug&&t?._id){let a=s.group.slug;e.setQueryData(["getGroupDetail",a,t._id],e=>e?{...e,...s.group}:e),e.invalidateQueries({queryKey:["getGroupDetail",a]})}},onError:e=>{w.Ay.error(O(e,"Kat\xc4\xb1l\xc4\xb1m talebi onaylan\xc4\xb1rken bir sorun olu\xc5Ÿtu"))}})})(),l=(()=>{let e=(0,T.jE)(),t=(0,v.A)(),s=(0,j.A)();return(0,y.n)({mutationFn:async({groupId:e,userId:t})=>(await F.A.post(`${R}/group/requests/reject`,{groupId:e,userId:t},{withCredentials:!0,headers:{...s?{Authorization:s}:{}}})).data.result.data,onSuccess:(s,{groupId:a})=>{if(w.Ay.success("Kat\xc4\xb1l\xc4\xb1m talebi reddedildi"),e.invali
1dateQueries({queryKey:["memberRequests",a]}),s?.group?.slug&&t?._id){let a=s.group.slug;e.setQueryData(["getGroupDetail",a,t._id],e=>e?{...e,...s.group}:e),e.invalidateQueries({queryKey:["getGroupDetail",a]})}},onError:e=>{w.Ay.error(O(e,"Kat\xc4\xb1l\xc4\xb1m talebi reddedilirken bir sorun olu\xc5Ÿtu"))}})})();return s?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-secondary"})}):t&&0!==t.length?(0,a.jsx)("div",{className:"space-y-3 max-h-96 overflow-y-auto",children:t.map(t=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-lg border border-gray-100 hover:border-gray-200 transition-colors",children:[(0,a.jsxs)(g(),{href:`/profile/${t.userId.username}`,className:"flex items-center gap-3 min-w-0 transition-opacity hover:opacity-80",children:[t.userId.profilePicture?(0,a.jsx)("div",{className:"relative w-10 h-10 flex-shrink-0",children:(0,a.jsx)(h(),{src:t.userId.profilePicture,alt:t.userId.username,fill:!0,sizes:"48px",className:"rounded-full object-cover"})}):(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-secondary/20 flex items-center justify-center flex-shrink-0",children:(0,a.jsx)("span",{className:"text-sm font-semibold text-secondary",children:t.userId.username.charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-gray-900 truncate",children:t.userId.username}),(0,a.jsxs)("p",{className:"text-xs text-gray-500",children:[t.userId.firstName," ",t.userId.lastName]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-4",children:[(0,a.jsx)("button",{onClick:()=>{var s;return s=t.userId._id,void r.mutate({groupId:e,userId:s})},disabled:r.isPending||l.isPending,className:"p-2 rounded-full bg-green-100 hover:bg-green-200 text-green-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Onayla",children:(0,a.jsx)(M.A,{className:"w-5 h-5"})}),(0,a.jsx)("button",{onClick:()=>{var s;return s=t.userId._id,void l.mutate({groupId:e,userId:s})},disabled:r.isPending||l.isPending,className:"p-2 rounded-full bg-red-100 hover:bg-red-200 text-red-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Reddet",children:(0,a.jsx)(E.A,{className:"w-5 h-5"})})]})]},t.userId._id))}):(0,a.jsx)("div",{className:"text-center py-12 text-gray-500",children:(0,a.jsx)("p",{className:"text-sm",children:"Onay bekleyen katılım talebi yok"})})};var L=s(25175);let Y=({isOpen:e,onClose:t,group:s,onSuccess:r})=>{let[l,i]=(0,c.useState)("members"),n=(()=>{(0,v.A)();let e=(0,j.A)();return(0,y.n)({mutationFn:async({groupId:t,userId:s})=>{let a=await fetch("https://api.wuubi.com/api/group/member/remove",{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:e}:{}},credentials:"include",body:JSON.stringify({groupId:t,userId:s})}),r=await a.json();if(!a.ok)throw Error(r.message||"\xdcye kaldırılamadı");return r},onSuccess:e=>{w.Ay.success(e.message||"\xdcye \xe7ıkarıldı")},onError:e=>{w.Ay.error(e.message||"\xdcye kaldırılamadı")}})})(),{data:x=[],isLoading:p}=((e,t=!0)=>{let s=(0,v.A)(),a=(0,j.A)(),{isHydrating:r}=(0,B.N)(),l=s?._id||"guest";return(0,$.I)({queryKey:["memberRequests",e,l],queryFn:async()=>(await F.A.get(`${R}/group/requests/${e}`,{withCredentials:!0,headers:{...a?{Authorization:a}:{}}})).data.result.data.requests,enabled:!!e&&!!s?._id&&!r&&t,refetchInterval:!!t&&15e3,refetchIntervalInBackground:!0,refetchOnMount:"always",refetchOnReconnect:"always",refetchOnWindowFocus:!0})})(s._id,e),b=s.members.filter(e=>!s.admins.some(t=>t._id===e._id));return(0,a.jsx)(d.e,{appear:!0,show:e,as:c.Fragment,children:(0,a.jsxs)(o.lG,{as:"div",className:"relative z-50",onClose:t,children:[(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),(0,a.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,a.jsxs)(o.lG.Panel,{className:"w-full max-w-md transform overflow-hidden rounded-2xl bg-white text-left align-middle shadow-xl transition-all",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b",children:[(0,a.jsx)(o.lG.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900",children:"\xdcye Y\xf6netimi"}),(0,a.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:(0,a.jsx)(m.A,{className:"h-6 w-6"})})]}),(0,a.jsxs)("div",{className:"flex border-b",children:[(0,a.jsx)("button",{onClick:()=>i("members"),className:`flex-1 py-3 px-4 text-sm font-medium transition-colors ${"members"===l?"text-secondary border-b-2 border-secondary":"text-gray-600 hover:text-gray-900"}`,children:"\xdcyeleri Y\xf6net"}),(0,a.jsxs)("button",{onClick:()=>i("requests"),className:`flex-1 py-3 px-4 text-sm font-medium transition-colors ${"requests"===l?"text-secondary border-b-2 border-secondary":"text-gray-600 hover:text-gray-900"}`,children:["Onay Bekleyenler"," ",x.length>0&&(0,a.jsx)("span",{className:"ml-1 bg-warning text-white text-xs rounded-full px-2 py-0.5",children:x.length})]})]}),(0,a.jsx)("div",{className:"p-6",children:"members"===l?(0,a.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:0===b.length?(0,a.jsx)("p",{className:"text-sm text-gray-500 text-center py-4",children:"Y\xf6netilecek \xfcye yok. T\xfcm \xfcyeler y\xf6netici."}):b.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 bg-soft rounded-2xl hover:bg-soft/80 transition-colors",children:[(0,a.jsxs)(g(),{href:`/profile/${e.username}`,className:"flex items-center gap-3 transition-opacity hover:opacity-80",children:[(0,L.EN)(e.profilePicture)?(0,a.jsx)(h(),{src:(0,L.EN)(e.profilePicture),alt:e.username,width:40,height:40,sizes:"40px",className:"w-10 h-10 rounded-full object-cover"}):(0,a.jsx)("span",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-slate-200 text-sm font-semibold text-slate-500",children:e.username.charAt(0).toUpperCase()}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-sm font-medium text-dark",children:e.username}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"\xdcye"})]})]}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e._id,void n.mutate({groupId:s._id,userId:t},{onSuccess:()=>{r()}})},disabled:n.isPending,className:"text-error hover:text-error/80 disabled:opacity-50 p-2 rounded-xl hover:bg-error/10 transition-colors",title:"\xdcyeyi \xe7ıkar",children:(0,a.jsx)(u.A,{className:"h-5 w-5"})})]},e._id))}):(0,a.jsx)(q,{groupId:s._id,requests:x,isLoading:p})}),(0,a.jsx)("div",{className:"border-t p-6",children:(0,a.jsx)("button",{onClick:t,className:"btn btn-light w-full",children:"Kapat"})})]})})})})]})})};var K=s(85278),W=s(99542);
1let H=(0,W.eU)(),J=[["i�in","i\xe7in"],["I�in","I\xe7in"],["İ�in","İ\xe7in"],["g�nder","g\xf6nder"],["G�nder","G\xf6nder"],["be�endi","beğendi"],["Be�endi","Beğendi"],["i�eri","i\xe7eri"],["İ�eri","İ\xe7eri"],["yan�t","yanıt"],["Yan�t","Yanıt"],["\xc3ƒ\xe2€ž\xc3‚\xc2\xb0","İ"],["\xc3ƒ\xe2€ž\xc3‚\xc2\xb1","ı"],["\xc3ƒ\xc6’\xc3‚\xc2\xa7","\xe7"],["\xc3ƒ\xe2€\xa1","\xc7"],["\xc3ƒ\xe2€ž\xc3…\xc5\xb8","ş"],["\xc3ƒ\xe2€\xa6\xc3…\xc5\xb8","ş"],["\xc3ƒ\xe2€\xa6\xc3…\xc2\xbd","Ş"],["\xc3ƒ\xe2€ž\xc3…\xc2\xbe","ğ"],["\xc3ƒ\xc6’\xc3‚\xc2\xbc","\xfc"],["\xc3ƒ\xc6’\xc3…\xe2€œ","\xdc"],["\xc3ƒ\xc6’\xc3‚\xc2\xb6","\xf6"],["\xc3ƒ\xc6’\xc3\xa2\xe2‚\xac\xe2€œ","\xd6"],["\xc3„\xc2\xb1","ı"],["\xc3„\xc2\xb0","İ"],["\xc3„\xc5\xb8","ğ"],["\xc3„\xc5\xbe","Ğ"],["\xc3ƒ\xc2\xbc","\xfc"],["\xc3ƒ\xc5“","\xdc"],["\xc3ƒ\xc2\xb6","\xf6"],["\xc3ƒ\xe2€“","\xd6"],["\xc3ƒ\xc2\xa7","\xe7"],["\xc3…\xc5\xb8","ş"],["\xc3…\xc5\xbe","Ş"],["\xc3ƒ\xc2\xa2","\xe2"],["\xc3‚\xc2\xb7","\xb7"],["\xc2\xb7","\xb7"],["\xc3\xa2\xe2‚\xac\xc2\xa2","•"],["\xe2€\xa2","•"]];function Q(e){return e?J.reduce((e,[t,s])=>e.split(t).join(s),e):""}var U=s(94764);let V=(0,W.eU)([]),Z=(0,W.eU)({currentPage:1,limit:10,totalPages:0,totalPosts:0}),X=()=>{let[e,t]=(0,K.fp)(V),[s,a]=(0,K.fp)(Z);return{GroupPosts:e,GroupPostsSet:t,GroupPostsPagination:s,GroupPostsPaginationSet:a}};var ee=s(66599),et=s(75021),es=s(23893),ea=s(82126),er=s(64357),el=s(12450),ei=s(11912),en=s(44804),ed=s(39899),eo=s(66348),ec=s(91673),em=s(11085),ex=s(66741),eu=s(44287),ep=s(58500),eh=s(54738),eb=s(12838),eg=s(10235),ef=s(60022),ey=s(4296),ej=s(1629),ev=s(19899),ew=s(92895),eN=s(29999),ek=s(84629),eA=s(45084),eC=s(18787),e_=s(29349),eS=s(62855),eI=s(28022),eP=s(57572),ez=s(81744),eG=s(18201),e$=s(41744);let eT={standard:{label:"G\xf6nderi",icon:eA.A,tone:"bg-slate-100 text-slate-700"},poll:{label:"Anket",icon:eC.A,tone:"bg-sky-100 text-sky-700"},quiz:{label:"Bilgi yarışması",icon:e_.A,tone:"bg-amber-100 text-amber-700"}};function eF({post:e,isCommentSectionOpen:t,setIsCommentSectionOpen:s,openActionPostId:r,setOpenActionPostId:l,isFullPost:i=!1,refetchPosts:n}){let{GroupPostsSet:d}=X(),o=(0,v.A)(),{mutateAsync:m}=(0,ev.m)(),{mutateAsync:x,isPending:u}=(()=>{let e=(0,j.A)();return(0,y.n)({mutationFn:async({user:t,postId:s})=>{if(!s||!t?._id)return!1;let a=`https://api.wuubi.com/api/group/post/${s}`,r=await fetch(a,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",...e?{Authorization:e}:{}},credentials:"include"}),l=await r.json();return l?.responseResult?.status?(w.Ay.success("G\xf6nderi silindi."),!0):(w.Ay.error(l?.responseResult?.exceptionDetail?.[0]||"G\xf6nderi silinirken bir hata oluştu."),!1)}})})(),{mutateAsync:p,isPending:b}=(0,ew.I)(),{mutateAsync:f,isPending:N}=(0,ej.w)(),[k,A]=(0,c.useState)(e),[C,_]=(0,c.useState)(!1),[S,I]=(0,c.useState)(!1),[P,z]=(0,c.useState)(!1),G=(0,c.useRef)(null);(0,c.useEffect)(()=>{A(e)},[e]);let{_id:$,content:T,images:F,image:D,likes:B,comments:R,createdAt:O,isLiked:M,createdBy:E,poll:q,quiz:L,type:Y="standard"}=k,K=Array.isArray(B)?B.length:k.likesCount||Number(B||0),W=F&&F.length>0?F[0]:D||null,H=E?.username?`/profile/${E.username}`:"",J=!!k.isNsfw,Q=J&&!P,U=eT[Y||"standard"],V=U.icon,Z=E?._id&&o?._id&&E._id===o._id,ee=void 0!==r?r===$:C;(0,c.useEffect)(()=>{if(!ee)return;let e=e=>{G.current&&!G.current.contains(e.target)&&(l?l(null):_(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[ee,l]),(0,c.useEffect)(()=>{z(!1)},[$,J,i]);let et=e=>{A(e),d(t=>Array.isArray(t)?t.map(t=>t._id===e._id?{...t,...e}:t):t)},es=async e=>{await m({user:o,postId:$})&&et({...k,isLiked:"like"===e,likesCount:"like"===e?K+1:Math.max(0,K-1),likes:Array.isArray(k.likes)?"like"===e?[...k.likes,o._id]:k.likes.filter(e=>e!==o._id):k.likes})},ea=async e=>{if(!o?._id||!q)return;let t=await p({user:o,postId:$,optionId:e});t&&et(t)},er=async e=>{if(!o?._id||!L||L.isAnswered)return;let t=await f({user:o,postId:$,optionId:e});t&&et(t)},el=async()=>{Z&&o&&!u&&window.confirm("Bu grup g\xf6nderisini silmek istiyor musun?")&&await x({user:o,postId:$})&&(d(e=>Array.isArray(e)?e.filter(e=>e._id!==$):e),n?.())},ei=(0,c.useMemo)(()=>Array.isArray(q?.options)?q.options.reduce((e,t)=>
1e+Number(t.votesCount||0),0):0,[q]),en=(0,c.useMemo)(()=>Array.isArray(L?.options)?L.options.reduce((e,t)=>e+Number(t.selectedCount||0),0):0,[L]);return(0,a.jsxs)("div",{className:`overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-[0_20px_55px_rgba(15,23,42,0.06)] ${i?"w-full":""}`,children:[(0,a.jsxs)("div",{className:"px-5 pb-5 pt-5 md:px-6",children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("div",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-[11px] font-semibold ${U.tone}`,children:[(0,a.jsx)(V,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:U.label})]}),(0,a.jsxs)("span",{className:"inline-flex items-center rounded-full border border-sky-200 bg-sky-50 px-2.5 py-1 text-[11px] font-semibold text-sky-700",children:["Sv. ",Math.max(1,Number(E?.level||1))]}),J?(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-amber-200 bg-amber-50 px-2.5 py-1 text-[11px] font-semibold text-amber-700",children:"Hassas i\xe7erik"}):null]}),(0,a.jsx)("span",{className:"text-xs font-medium text-slate-500",children:(0,ek.Y)(O)})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(ey.H8,{user:{...E,profilePicture:E?.profilePicture},href:H||void 0,size:"md"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[H?(0,a.jsx)(g(),{href:H,className:"text-sm font-semibold text-slate-900 transition hover:text-slate-700",children:[E?.firstName,E?.lastName].filter(Boolean).join(" ").trim()||E?.username||"Kullanıcı"}):(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:[E?.firstName,E?.lastName].filter(Boolean).join(" ").trim()||E?.username||"Kullanıcı"}),(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-slate-500",children:[H?(0,a.jsxs)(g(),{href:H,className:"transition-colors hover:text-slate-700",children:["@",E?.username]}):(0,a.jsxs)("span",{children:["@",E?.username]}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:"Topluluk g\xf6nderisi"})]})]}),o?._id?(0,a.jsxs)("div",{className:"relative",ref:G,children:[(0,a.jsx)("button",{type:"button",onClick:()=>{l?l(ee?null:$):_(e=>!e)},className:"rounded-full border border-slate-200 bg-white p-1.5 text-slate-500 transition hover:bg-slate-50",children:(0,a.jsx)(eS.A,{className:"h-5 w-5"})}),ee?(0,a.jsx)("div",{className:"absolute right-0 z-30 mt-2 w-40 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-xl",children:Z?(0,a.jsxs)("button",{type:"button",disabled:u,onClick:()=>{l?l(null):_(!1),el()},className:"flex w-full items-center gap-2 px-3 py-2 text-sm font-semibold text-rose-600 transition hover:bg-rose-50 disabled:opacity-50",children:[(0,a.jsx)(eI.A,{className:"h-4 w-4"}),u?"Siliniyor...":"Sil"]}):(0,a.jsxs)("button",{type:"button",onClick:()=>{l?l(null):_(!1),I(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm font-semibold text-rose-600 transition hover:bg-rose-50",children:[(0,a.jsx)(eP.A,{className:"h-4 w-4"}),"Şikayet et"]})}):null]}):null]}),J&&!P?(0,a.jsx)(eg.A,{compact:!i,title:"Hassas grup g\xf6nderisi",description:i?"Bu g\xf6nderiyi g\xf6rmeden \xf6nce a\xe7ık onay vermen gerekir.":"Bu g\xf6nderinin \xf6n izlemesi gizlendi.",onReveal:i?()=>z(!0):void 0,className:"mt-4"}):T?(0,a.jsx)("div",{className:"mt-4 text-sm leading-7 text-slate-700",children:(0,a.jsx)(eN.A,{value:T})}):null]}),!Q&&W&&(0,a.jsx)("div",{className:"px-5 pb-5 md:px-6",children:(0,a.jsx)("div",{className:"overflow-hidden rounded-[26px] bg-slate-950/95",children:(0,a.jsx)(h(),{src:W,alt:"G\xf6nderi g\xf6rseli",width:960,height:540,className:"h-auto w-full object-cover",style:{maxHeight:"520px"}})})}),!Q&&q&&(0,a.jsx)("div",{className:"px-5 pb-5 md:px-6",children:(0,a.jsxs)("div",{className:"rounded-[26px] border border-sky-100 bg-sky-50/70 px-5 py-5",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-sky-700",children:"Topluluk anketi"}),(0,a.jsx)("h3",{className:"mt-1 text-lg font-semibold text-slate-900",children:q.question})]}),(0,a.jsx)("div",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold text-sky-700 shadow-sm",children:q.allowMultipleVotes?"\xc7oklu oy a\xe7ık":"Tekli se\xe7im"})]}),(0,a.jsx)("div",{className:"mt-4 space-y-3",children:q.options.map(e=>{let t=ei>0?Math.round(Number(e.votesCount||0)/ei*100):0;return(0,a.jsx)("button",{type:"button",disabled:b,onClick:()=>ea(e.id),className:`w-full overflow-hidden rounded-[22px] border text-left transition ${e.isVoted?"border-sky-300 bg-white shadow-sm":"border-sky-100 bg-white/90 hover:border-sky-200 hover:bg-white"}`,children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"absolute inset-y-0 left-0 bg-sky-100/80",style:{width:`${t}%`}}),(0,a.jsxs)("div",{className:"relative flex items-center justify-between gap-3 px-4 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:e.text}),(0,a.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:e.isVoted?"Senin oyun burada":"Oy vermek i\xe7in dokun"})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:e.votesCount||0}),(0,a.jsxs)("p",{className:"text-xs text-slate-500",children:["%",t]})]})]})]})},e.id)})}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2 text-xs text-sky-800",children:[(0,a.jsxs)("span",{className:"rounded-full bg-white px-3 py-1 font-semibold shadow-sm",children:[ei," toplam oy"]}),q.expiresAt?(0,a.jsxs)("span",{className:"rounded-full bg-white px-3 py-1 font-semibold shadow-sm",children:["Bitiş: ",new Date(q.expiresAt).toLocaleStr
1ing("tr-TR")]}):null]})]})}),!Q&&L&&(0,a.jsx)("div",{className:"px-5 pb-5 md:px-6",children:(0,a.jsxs)("div",{className:"rounded-[26px] border border-amber-100 bg-amber-50/70 px-5 py-5",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-amber-700",children:"Mini quiz"}),(0,a.jsx)("h3",{className:"mt-1 text-lg font-semibold text-slate-900",children:L.question})]}),(0,a.jsx)("div",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold text-amber-700 shadow-sm",children:L.isAnswered?L.isCorrect?"Doğru cevaplandı":"Yanıtlandı":"Cevap bekliyor"})]}),(0,a.jsx)("div",{className:"mt-4 grid gap-3",children:L.options.map((e,t)=>{let s=L.isAnswered?e.isCorrect?"border-emerald-300 bg-emerald-50":e.isSelected?"border-rose-300 bg-rose-50":"border-slate-200 bg-white":"border-amber-100 bg-white hover:border-amber-200";return(0,a.jsx)("button",{type:"button",disabled:L.isAnswered||N,onClick:()=>er(e.id),className:`rounded-[22px] border px-4 py-4 text-left transition ${s}`,children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:`flex h-8 w-8 items-center justify-center rounded-full text-xs font-bold ${L.isAnswered&&e.isCorrect?"bg-emerald-500 text-white":L.isAnswered&&e.isSelected&&!e.isCorrect?"bg-rose-500 text-white":"bg-amber-100 text-amber-700"}`,children:L.isAnswered&&e.isCorrect?"✓":t+1}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:e.text}),(0,a.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:L.isAnswered?e.isCorrect?"Doğru se\xe7enek":e.isSelected?"Se\xe7tiğin cevap":"Alternatif se\xe7enek":"Cevaplamak i\xe7in se\xe7"})]}),(0,a.jsx)("div",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold text-slate-600 shadow-sm",children:e.selectedCount||0})]})},e.id)})}),L.isAnswered&&L.explanation&&(0,a.jsxs)("div",{className:"mt-4 rounded-[22px] border border-amber-200 bg-white px-4 py-4 text-sm leading-6 text-slate-700 shadow-sm",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-amber-700",children:"A\xe7ıklama"}),(0,a.jsx)("p",{className:"mt-2",children:L.explanation})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2 text-xs text-amber-800",children:[(0,a.jsxs)("span",{className:"rounded-full bg-white px-3 py-1 font-semibold shadow-sm",children:[en," toplam yanıt"]}),L.isAnswered?(0,a.jsx)("span",{className:`rounded-full px-3 py-1 font-semibold shadow-sm ${L.isCorrect?"bg-emerald-100 text-emerald-700":"bg-rose-100 text-rose-700"}`,children:L.isCorrect?"Cevabın doğru":"Cevabın yanlış"}):null]})]})}),(0,a.jsx)("div",{className:"border-t border-slate-100 px-5 py-4 md:px-6",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-slate-500",children:[(0,a.jsxs)("span",{className:"rounded-full bg-slate-100 px-3 py-1.5 font-semibold text-slate-600",children:[K," beğeni"]}),(0,a.jsxs)("span",{className:"rounded-full bg-slate-100 px-3 py-1.5 font-semibold text-slate-600",children:[R||0," yorum"]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("button",{onClick:()=>es(M?"removeLike":"like"),className:`inline-flex items-center gap-2 rounded-full border px-3.5 py-2 text-sm font-semibold transition ${M?"border-rose-200 bg-rose-50 text-rose-600":"border-slate-200 bg-white text-slate-600 hover:border-rose-200 hover:text-rose-500"}`,children:[M?(0,a.jsx)(eG.A,{className:"h-5 w-5 text-rose-500"}):(0,a.jsx)(ez.A,{className:"h-5 w-5 text-slate-500"}),(0,a.jsx)("span",{children:K})]}),(0,a.jsxs)("button",{onClick:()=>{t.postId===$?s({postId:$,isOpen:!t.isOpen}):s({postId:$,isOpen:!0})},className:"inline-flex items-center gap-2 rounded-full border border-slate-200 bg-white px-3.5 py-2 text-sm font-semibold text-slate-600 transition hover:border-sky-200 hover:text-sky-600",children:[(0,a.jsx)(eA.A,{className:"h-5 w-5"}),(0,a.jsx)("span",{children:R||0})]})]})]})}),t.postId===$&&t.isOpen&&!Q?(0,a.jsx)("div",{className:"border-t border-slate-100",children:(0,a.jsx)(e$.A,{postId:$,GroupPostsSet:d})}):null,(0,a.jsx)(ef.default,{open:S,targetId:$,targetType:"groupPost",title:"Grup g\xf6nderisini şikayet et",onClose:()=>I(!1)})]},$)}var eD=s(82437),eB=s(33274),eR=s(49588),eO=s(31010),eM=s(71551),eE=s(15608);let eq=["image/png","image/jpeg","image/jpg"],eL=[{key:"standard",title:"Standart g\xf6nderi",description:"Kısa metin ve g\xf6rsel paylaş.",icon:A.A,accent:"border-slate-900 bg-slate-900 text-white"},{key:"poll",title:"Anket",description:"Soru sor, oy topla.",icon:eC.A,accent:"border-sky-600 bg-sky-600 text-white"},{key:"quiz",title:"Bilgi yarışması",description:"Tek doğru cevaplı mini bilgi yarışması paylaş.",icon:e_.A,accent:"border-amber-500 bg-amber-500 text-white"}],eY=()=>({name:"",url:"",file:null}),eK=()=>[{id:"option_1",text:"",isCorrect:!0},{id:"option_2",text:"",isCorrect:!1}];function eW({refetchPosts:e,onCreated:t}){let[s,r]=(0,c.useState)("standard"),[l,i]=(0,c.useState)(""),[n,d]=(0,c.useState)(eY()),[o,m]=(0,c.useState)(""),[x,u]=(0,c.useState)(["",""]),[p,b]=(0,c.useState)(!1),[g,f]=(0,c.useState)(""),[N,C]=(0,c.useState)(""),[_,S]=(0,c.useState)(""),[I,P]=(0,c.useState)(eK()),[z,G]=(0,c.useState)(!1),[$,T]=(0,c.useState)(!1),[F,D]=(0,c.useState)(!1),[B,R]=(0,c.useState)(""),O=(0,c.useRef)(null),{mutateAsync:M,isPending:E}=(()=>{let e=(0,v.A)(),t=(0,j.A)(),{openModal:s}=(0,eB.A)(),a=(0,k.useRouter)().query.detail;return(0,y.n)({mutationFn:async({values:r})=>{let l=`https://api.wuubi.com/api/group/${a}/posts/create`;if(!e?._id||!a)return!1;let i=await fetch(l,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t?{Authorization:t}:{}},credentials:"include",body:JSON.stringify({...r})}),n=await i.json();if(!n||!n.responseResult.status)return w.Ay.error(n.responseResult.exceptionDetail?.[0]),!1;if(n.responseResult.achievement&&n.responseResult.achievement.length>0){let{title:e,description:t,icon:a}=n.responseResult.achievement[0];s(e,t,a)}return n}})})(),q=eL.find(e=>e.key===s),L=x.filter(e=>e.trim().length>0).length,Y=I.filter(e=>e.text.trim().length>0).length,K=async()=>
1{if(!(()=>{if("standard"===s&&l.trim().length<5)return w.Ay.error(`G\xf6nderin en az 5 karakter olmalı`),!1;if("poll"===s){let e=o.trim(),t=x.map(e=>e.trim()).filter(Boolean);if(e.length<10||e.length>100)return w.Ay.error(`Anket sorusu 10-100 karakter olmalı`),!1;if(t.length<2)return w.Ay.error("Anket i\xe7in en az iki se\xe7enek gerekli"),!1}if("quiz"===s){let e=N.trim(),t=I.filter(e=>e.text.trim().length>0),s=t.filter(e=>e.isCorrect).length;if(e.length<10||e.length>100)return w.Ay.error(`Bilgi yarışması sorusu 10-100 karakter olmalı`),!1;if(t.length<2||1!==s)return w.Ay.error("Bilgi yarışması i\xe7in en az iki se\xe7enek ve tek doğru cevap gerekli"),!1}return!0})())return;let a={type:s,isNsfw:z,content:l.trim(),image:n.url?{name:n.name,url:n.url}:eY()};"poll"===s&&(a.poll={question:o.trim(),allowMultipleVotes:p,expiresAt:g?new Date(g).toISOString():null,options:x.map((e,t)=>({id:`option_${t+1}`,text:e.trim()})).filter(e=>e.text.length>0)}),"quiz"===s&&(a.quiz={question:N.trim(),explanation:_.trim(),options:I.map((e,t)=>({id:`option_${t+1}`,text:e.text.trim(),isCorrect:e.isCorrect})).filter(e=>e.text.length>0)}),await M({values:a})&&(r("standard"),i(""),d(eY()),m(""),u(["",""]),b(!1),f(""),C(""),S(""),P(eK()),G(!1),O.current&&(O.current.value=""),e(),t?.())},W=async e=>{if(!e.target.files)return;let t=e.target.files[0];if(!t)return;if(!eq.includes(t.type.toLowerCase()))return void w.Ay.error("Yalnızca PNG veya JPG y\xfckleyebilirsin");if(t.size>5242880)return void w.Ay.error("G\xf6rsel boyutu en fazla 5 MB olmalı");let s=new FileReader;s.onloadend=()=>{R(s.result),D(!0)},s.readAsDataURL(t)};return(0,a.jsxs)("div",{className:"overflow-hidden rounded-[34px] border border-slate-200 bg-[linear-gradient(180deg,rgba(255,255,255,1),rgba(244,247,251,0.96))] shadow-[0_28px_80px_rgba(15,23,42,0.14)]",children:[(0,a.jsx)(eE.A,{open:$,onClose:()=>T(!1),className:"flex items-center justify-center",children:(0,a.jsx)("div",{className:"card-flat w-full max-w-2xl",children:(0,a.jsx)("div",{className:"card-body",children:n.url&&(0,a.jsx)(h(),{src:n.url,alt:n.name||"G\xf6nderi g\xf6rseli",className:"h-auto w-full rounded-lg",width:500,height:500})})})}),(0,a.jsx)("div",{className:"border-b border-slate-200 bg-white/90 px-5 py-5 md:px-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"inline-flex w-fit items-center rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-500",children:"Grup paylaşımı"}),(0,a.jsx)("h2",{className:"text-xl font-semibold text-slate-950",children:"Yeni g\xf6nderi oluştur"}),(0,a.jsx)("p",{className:"max-w-2xl text-sm leading-6 text-slate-500",children:"Paylaşım t\xfcr\xfcn\xfc se\xe7in ve g\xf6nderinizi hazırlayın."})]})}),(0,a.jsxs)("div",{className:"grid gap-6 p-5 lg:grid-cols-[240px,minmax(0,1fr)] lg:p-6",children:[(0,a.jsxs)("aside",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-[26px] border border-slate-200 bg-white p-3 shadow-sm",children:[(0,a.jsx)("p",{className:"px-2 pb-2 text-xs font-semibold uppercase tracking-[0.18em] text-slate-400",children:"Paylaşım tipi"}),(0,a.jsx)("div",{className:"space-y-2",children:eL.map(e=>{let t=e.icon,l=s===e.key;return(0,a.jsx)("button",{type:"button",onClick:()=>r(e.key),className:`w-full rounded-[20px] border px-4 py-3 text-left transition ${l?e.accent:"border-slate-200 bg-slate-50 text-slate-700 hover:border-slate-300 hover:bg-white"}`,children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:`flex h-10 w-10 items-center justify-center rounded-2xl ${l?"bg-white/15 text-white":"bg-white text-slate-700 shadow-sm"}`,children:(0,a.jsx)(t,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold",children:e.title}),(0,a.jsx)("p",{className:`mt-1 text-xs leading-5 ${l?"text-white/80":"text-slate-500"}`,children:e.description})]})]})},e.key)})})]}),(0,a.jsxs)("div",{className:"rounded-[26px] border border-slate-200 bg-white p-4 shadow-sm",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-amber-50 text-amber-600",children:(0,a.jsx)(eO.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:"Hassas i\xe7erik"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-5 text-slate-500",children:"A\xe7ıldığında g\xf6nderi hassas i\xe7erik uyarısı ile g\xf6sterilir."})]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>G(e=>!e),className:`mt-4 inline-flex w-full items-center justify-between rounded-full border px-4 py-2.5 text-sm font-semibold transition ${z?"border-amber-300 bg-amber-50 text-amber-700":"border-slate-200 bg-slate-50 text-slate-600"}`,children:[(0,a.jsx)("span",{children:z?"Hassas i\xe7erik a\xe7ık":"Hassas i\xe7erik kapalı"}),(0,a.jsx)("span",{className:`h-2.5 w-2.5 rounded-full ${z?"bg-amber-500":"bg-slate-300"}`})]})]})]}),(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"rounded-[28px] border border-slate-200 bg-white p-5 shadow-sm",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:"G\xf6rsel"}),(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Paylaşımınıza tek bir g\xf6rsel ekleyebilirsiniz."})]}),n.url?(0,a.jsx)("button",{type:"button",className:"rounded-full border border-slate-200 bg-white px-3 py-1.5 text-xs font-semibold text-slate-600 transition hover:bg-slate-50",onClick:()=>T(!0),children:"\xd6nizle"}):null]}),n.url?(0,a.jsxs)("div",{className:"overflow-hidden rounded-[24px] border border-slate-200 bg-slate-50",children:[(0,a.jsx)("button",{type:"button",className:"w-full",onClick:()=>T(!0),children:(0,a.jsx)(h(),{src:n.url,alt:n.name||"G\xf6nderi g\xf6rseli",width:1200,height:800,className:"h-auto w-full object-cover"})}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 border-t border-slate-200 px-4 py-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:"G\xf6rsel hazır"}),(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"\xd6nizlemek i\xe7in g\xf6rsele dokunabilir veya kaldırabilirsin."})]}),(0,a.jsxs)("button",{type:"button",className:"btn btn-danger btn-sm",onClick:()=>{d(eY()),O.current&&(O.current.value="")},children:[(0,a.jsx)(eM.A,{className:"h-4 w-4"}),"Kaldır"]})]})]}):(0,a.jsxs)("div",{className:"rounded-[24px] border border-dashed border-slate-300 bg-slate-50 px-4 py-8 text-center",children:[(0,a.jsx)("input",{type:"file",ref:O,className:"hidden",id:"thumbnailImageUpload",accept:"image/png,image/jpeg,image/jpg",onChange:W}),(0,a.jsx)("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-2xl bg-white text-slate-600 shadow-sm",children:(0,a.jsx)(A.A,{className:"h-6 w-6"})}),(0,a.jsx)("p",{className:"mt-4 text-sm font-semibold text-slate-900",children:"G\xf6rsel ekle"}),(0,a.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:"Kare kırpma ile otomatik uyumlu hale getirilir."}),(0,a.jsxs)("label",{className:"btn btn-dark mt-4 inline-flex",htmlFor:"thumbnailImageUpload",children:[(0,a.jsx)(A.A,{className:"h-5 w-5"}),"G\xf6rsel se\xe7"]})]})]}),(0,a.jsxs)("section",{className:"rounded-[28px] border border-slate-200 bg-white p-5 shadow-sm",children:[(0,a.jsxs)("div",{className:"mb-3 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:"Ana metin"}),(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"G\xf6nderinizde g\xf6r\xfcnecek kısa a\xe7ıklamayı yazın."})]}),(0,a.jsxs)("span",{className:"rounded-full bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-500",children:[l.trim().length," karakter"]})]}),(0,a.jsx)(eR.A,{value:l,onValueChange:i,rows:"standard"===s?5:4,placeholder:"standard"===s?"G\xf6nderi metni":"poll"===s?"Anket i\xe7in kısa a\xe7ıklama":"Bilgi yarışması i\xe7in kısa a\xe7ıklama",className:"w-full rounded-[22px] border border-slate-200 bg-slate-50 px-4 py-4 text-sm leading-7 text-slate-700 outline-none transition focus:border-sky-400 focus:bg-white focus:ring-2 focus:ring-sky-100"})]}),"poll"===s?(0,a.jsxs)("section",{className:"rounded-[28px] border border-sky-200 bg-sky-50/70 p-5 shadow-sm",children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-sky-900",children:"Anket alanı"}),(0,a.jsx)("p",{className:"text-xs text-sky-700/80",children:"Soru net olsun, se\xe7enekler kısa kalsın."})]}),(0,a.jsxs)("span",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold text-sky-700 shadow-sm",children:[L," dolu se\xe7enek"]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("input",{type:"text",value:o,onChange:e=>m(e.target.value),placeholder:"Anket sorusu",className:"w-full rounded-[18px] border border-sky-100 bg-white px-4 py-3 text-sm text-slate-700 outline-none transition focus:border-sky-300 focus:ring-2 focus:ring-sky-100"}),(0,a.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:x.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-[18px] border border-sky-100 bg-white px-3 py-3 shadow-sm",children:[(0,a.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-sky-100 text-xs font-semibold text-sky-700",children:t+1}
1),(0,a.jsx)("input",{type:"text",value:e,onChange:e=>{var s;return s=e.target.value,void u(e=>e.map((e,a)=>a===t?s:e))},placeholder:`Se\xe7enek ${t+1}`,className:"w-full bg-transparent text-sm outline-none"}),x.length>2?(0,a.jsx)("button",{type:"button",className:"rounded-full p-1 text-slate-400 transition hover:bg-slate-100 hover:text-rose-500",onClick:()=>u(e=>e.filter((e,s)=>s!==t)),children:(0,a.jsx)(eM.A,{className:"h-4 w-4"})}):null]},`poll-option-${t}`))}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:()=>u(e=>[...e,""]),children:"Se\xe7enek ekle"}),(0,a.jsxs)("label",{className:"inline-flex items-center gap-2 rounded-full bg-white px-4 py-2 text-xs font-semibold text-slate-600 shadow-sm",children:[(0,a.jsx)("input",{type:"checkbox",checked:p,onChange:e=>b(e.target.checked)}),"\xc7oklu oy a\xe7ık olsun"]}),(0,a.jsx)("input",{type:"datetime-local",value:g,onChange:e=>f(e.target.value),className:"rounded-full border border-slate-200 bg-white px-4 py-2 text-xs font-semibold text-slate-600 outline-none"})]})]})]}):null,"quiz"===s?(0,a.jsxs)("section",{className:"rounded-[28px] border border-amber-200 bg-amber-50/70 p-5 shadow-sm",children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-amber-900",children:"Bilgi yarışması alanı"}),(0,a.jsx)("p",{className:"text-xs text-amber-700/80",children:"Tek doğru cevabı se\xe7, istersen kısa a\xe7ıklama ekle."})]}),(0,a.jsxs)("span",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold text-amber-700 shadow-sm",children:[Y," dolu se\xe7enek"]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("input",{type:"text",value:N,onChange:e=>C(e.target.value),placeholder:"Bilgi yarışması sorusu",className:"w-full rounded-[18px] border border-amber-100 bg-white px-4 py-3 text-sm text-slate-700 outline-none transition focus:border-amber-300 focus:ring-2 focus:ring-amber-100"}),(0,a.jsx)("textarea",{rows:3,value:_,onChange:e=>S(e.target.value),placeholder:"Cevap sonrası kısa a\xe7ıklama",className:"w-full rounded-[18px] border border-amber-100 bg-white px-4 py-3 text-sm text-slate-700 outline-none transition focus:border-amber-300 focus:ring-2 focus:ring-amber-100"}),(0,a.jsx)("div",{className:"grid gap-3",children:I.map((e,t)=>(0,a.jsxs)("div",{className:"rounded-[18px] border border-amber-100 bg-white px-4 py-3 shadow-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>P(e=>e.map((e,s)=>({...e,isCorrect:s===t}))),className:`flex h-8 w-8 items-center justify-center rounded-full border text-xs font-bold transition ${e.isCorrect?"border-emerald-500 bg-emerald-500 text-white":"border-slate-200 bg-white text-slate-400 hover:border-amber-300"}`,children:e.isCorrect?"✓":t+1}),(0,a.jsx)("input",{type:"text",value:e.text,onChange:e=>{var s;return s=e.target.value,void P(e=>e.map((e,a)=>a===t?{...e,text:s}:e))},placeholder:`Se\xe7enek ${t+1}`,className:"w-full bg-transparent text-sm outline-none"}),I.length>2?(0,a.jsx)("button",{type:"button",className:"rounded-full p-1 text-slate-400 transition hover:bg-slate-100 hover:text-rose-500",onClick:()=>P(e=>{let s=e.filter((e,s)=>s!==t).map((e,t)=>({...e,id:`option_${t+1}`}));return!s.some(e=>e.isCorrect)&&s[0]&&(s[0].isCorrect=!0),s}),children:(0,a.jsx)(eM.A,{className:"h-4 w-4"})}):null]}),(0,a.jsx)("p",{className:"mt-2 text-xs text-slate-500",children:e.isCorrect?"Bu se\xe7enek doğru cevap olarak işaretli.":"Doğru cevap yapmak i\xe7in sol butonu kullan."})]},e.id))}),(0,a.jsx)("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:()=>P(e=>[...e,{id:`option_${e.length+1}`,text:"",isCorrect:!1}]),children:"Se\xe7enek ekle"})]})]}):null]})]}),(0,a.jsx)("div",{className:"border-t border-slate-200 bg-white/90 px-5 py-4 md:px-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-slate-500",children:[(0,a.jsx)("span",{className:"rounded-full bg-slate-100 px-3 py-1.5 font-semibold text-slate-600",children:q?.title}),(0,a.jsx)("span",{className:"rounded-full bg-slate-100 px-3 py-1.5 font-semibold text-slate-600",children:n.url?"G\xf6rsel eklendi":"G\xf6rsel yok"}),z?(0,a.jsx)("span",{className:"rounded-full bg-amber-50 px-3 py-1.5 font-semibold text-amber-700",children:"Hassas i\xe7erik işaretli"}):null]}),(0,a.jsx)("button",{type:"button",className:"btn btn-primary",onClick:K,disabled:E,children:E?"G\xf6nderiliyor...":"G\xf6nderiyi payla
1ş"})]})}),(0,a.jsx)(eD.A,{isOpen:F,imageSrc:B,title:"G\xf6nderi g\xf6rselini kırp (1:1)",aspect:1,onClose:()=>{D(!1),R(""),O.current&&(O.current.value="")},onApply:e=>{d({name:`group-post-${Date.now()}.jpg`,url:e,file:null}),D(!1),R("")}})]})}var eH=s(54431),eJ=s(79350);let eQ=(0,eJ.J1)`
2  query GetGroupMembers($slug: String!, $page: Int!) {
3    getGroupMembers(slug: $slug, page: $page) {
4      members {
5        _id
6        firstName
7        lastName
8        username
9        profilePicture
10        isFollowing
11      }
12      totalPages
13      currentPage
14      totalCount
15    }
16  }
17`;var eU=s(37285),eV=s(19414),eZ=s(6193),eX=s(90201),e0=s(78464),e1=s(1707);function e2({groupSlug:e}){let[t,s]=(0,c.useState)(1),{data:i,loading:n,refetch:d}=function(e,t){(0,v.A)();let s=(0,j.A)();return(0,eH.IT)(eQ,{variables:{slug:e,page:t},skip:!e,notifyOnNetworkStatusChange:!0,context:{headers:{...s?{Authorization:s}:{}}}})}(e,t),{mutateAsync:o}=(0,eU.g)(),m=(0,v.A)(),p=(0,k.useRouter)(),h=i?.getGroupMembers?.members||[],b=Math.max(1,i?.getGroupMembers?.totalPages||1),y=async({username:e})=>{e.toLowerCase()!==m?.username?.toLowerCase()&&await o({username:e})&&d()};return n?(0,a.jsx)("div",{className:"rounded-[28px] border border-slate-200 bg-white py-16",children:(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(r.A,{size:"small",text:""})})}):0===h.length?(0,a.jsxs)("div",{className:"rounded-[28px] border border-dashed border-slate-300 bg-[linear-gradient(180deg,#f8fafc,#ffffff)] px-6 py-16 text-center",children:[(0,a.jsx)("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-[22px] bg-white text-slate-400 shadow-sm",children:(0,a.jsx)(eV.A,{className:"h-8 w-8"})}),(0,a.jsx)("p",{className:"mt-5 text-base font-extrabold text-slate-900",children:"Hen\xfcz \xfcye yok"}),(0,a.jsx)("p",{className:"mx-auto mt-2 max-w-sm text-sm leading-6 text-slate-500",children:"Topluluğa katılan kullanıcılar profil bilgileriyle burada g\xf6r\xfcnecek."})]}):(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"flex flex-col gap-3 rounded-[28px] border border-slate-200 bg-[linear-gradient(135deg,#ffffff,#f0fdfa)] px-5 py-5 shadow-sm sm:flex-row sm:items-end sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[10px] font-extrabold uppercase tracking-[0.2em] text-teal-700",children:"Topluluk rehberi"}),(0,a.jsx)("h2",{className:"mt-1 text-2xl font-extrabold tracking-tight text-slate-950",children:"Grup \xfcyeleri"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:"Profilleri incele, takip et veya doğrudan konuşma başlat."})]}),(0,a.jsxs)("span",{className:"w-fit rounded-full border border-teal-100 bg-white px-3 py-1.5 text-xs font-bold text-teal-700",children:["Sayfa ",t," / ",b]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:h.map((e,t)=>{let s=e?._id||e?.id,r=s===m?._id||e?.username?.toLowerCase()===m?.username?.toLowerCase(),i=[e.firstName,e.lastName].filter(Boolean).join(" ")||e.username||"Wuubi \xfcyesi",n=e.isCreator?"Kurucu":e.isAdmin||"admin"===e.role?"Y\xf6netici":"\xdcye";return(0,a.jsx)(l.A,{delay:Math.min(35*t,280),yOffset:8,children:(0,a.jsxs)("article",{className:"group relative overflow-hidden rounded-[26px] border border-slate-200 bg-white p-4 shadow-[0_14px_38px_rgba(15,23,42,0.06)] transition hover:-translate-y-0.5 hover:border-teal-200 hover:shadow-[0_20px_48px_rgba(15,23,42,0.1)]",children:[(0,a.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-16 bg-[linear-gradient(135deg,rgba(20,184,166,0.12),rgba(245,158,11,0.08))]"}),(0,a.jsxs)("div",{className:"relative flex items-start gap-4",children:[(0,a.jsx)(g(),{href:`/profile/${e.username}`,className:"rounded-full bg-gradient-to-br from-amber-400 to-teal-500 p-[2px]",children:(0,a.jsx)(f.A,{alt:i,src:e.profilePicture||"",sx:{width:62,height:62,border:"3px solid white",backgroundColor:"#ccfbf1",color:"#0f766e",fontSize:20,fontWeight:800},children:i.charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 pt-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(g(),{href:`/profile/${e.username}`,className:"truncate text-sm font-extrabold text-slate-950 transition hover:text-teal-700",children:i}),(0,a.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-1 text-[9px] font-extrabold uppercase tracking-wide ${"\xdcye"===n?"bg-slate-100 text-slate-500":"bg-amber-50 text-amber-700"}`,children:["\xdcye"!==n?(0,a.jsx)(x.A,{className:"h-3 w-3"}):null,n]})]}),(0,a.jsxs)(g(),{href:`/profile/${e.username}`,className:"mt-1 block truncate text-xs font-semibold text-slate-500 hover:text-teal-700",children:["@",e.username]}),e.level||e.levelTitle?(0,a.jsxs)("p",{className:"mt-2 text-[10px] font-bold text-teal-700",children:["Seviye ",e.level||1,e.levelTitle?` \xb7 ${e.levelTitle}`:""]}):null]})]}),(0,a.jsxs)("div",{className:"relative mt-4 grid grid-cols-2 gap-2 border-t border-slate-100 pt-3",children:[r?(0,a.jsx)(g(),{href:`/profile/${e.username}`,className:"inline-flex items-center justify-center rounded-xl bg-slate-100 px-3 py-2.5 text-xs font-extrabold text-slate-600",children:"Profilim"}):(0,a.jsxs)("button",{type:"button",className:`inline-flex items-center justify-center gap-1.5 rounded-xl px-3 py-2.5 text-xs font-extrabold transition ${e.isFollowing?"bg-rose-50 text-rose-700 hover:bg-rose-100":"bg-teal-600 text-white hover:bg-teal-700"}`,onClick:()=>y({username:e.username}),children:[e.isFollowing?(0,a.jsx)(u.A,{className:"h-4 w-4"}):(0,a.jsx)(eZ.A,{className:"h-4 w-4"}),e.isFollowing?"Takibi bırak":"Takip et"]}),(0,a.jsxs)("button",{type:"button",disabled:r,onClick:()=>(e=>{let t=e?._id||e?.id;t&&p.push({pathname:"/messages",query:{userId:t,username:e.username||"",firstName:e.firstName||"",lastName:e.lastName||"",profilePicture:e.profilePicture||""}})})(e),className:"inline-flex items-center justify-center gap-1.5 rounded-xl border border-slate-200 bg-white px-3 py-2.5 text-xs font-extrabold text-slate-700 transition hover:border-teal-200 hover:text-teal-700 disabled:cursor-not-allowed disabled:opacity-45",children:[(0,a.jsx)(eX.A,{className:"h-4 w-4"}),"Mesaj"]})]})]})},s||e.username)})}),b>1?(0,a.jsxs)("div",{className:"flex flex-col gap-3 rounded-[24px] border border-slate-200 bg-white px-4 py-4 shadow-sm sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-extrabold text-slate-900",children:"\xdcye listesi"}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-slate-500",children:["Sayfa ",t," / ",b]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsxs)("button",{type:"button",disabled:t<=1,className:"inline-flex items-center justify-center gap-2 rounded-xl border border-slate-200 px-4 py-2.5 text-xs font-extrabold text-slate-700 transition hover:border-slate-300 disabled:opacity-40",onClick:()=>s(e=>Math.max(1,e-1)),children:[(0,a.jsx)(e0.A,{className:"h-4 w-4"}),"\xd6nceki"]}),(0,a.jsxs)("button",{type:"button",disabled:t>=b,className:"inline-flex items-center justify-center gap-2 rounded-xl bg-slate-950 px-4 py-2.5 text-xs font-extrabold text-white transition hover:bg-slate-800 disabled:opacity-40",onClick:()=>s(e=>Math.min(b,e+1)),children:["Sonraki",(0,a.jsx)(e1.A,{className:"h-4 w-4"})]})]})]}):null]})}var e5=s(24610),e4=s(49790);let e3=["about","posts","members"],e6=({group:e,posts:t})=>e.isPublic?(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("section",{className:"overflow-hidden rounded-[32px] border border-slate-200 bg-white shadow-sm",children:[(0,a.jsxs)("div",{className:"relative h-48 w-full bg-slate-100 md:h-64",children:[e.coverImage?(0,a.jsx)(h(),{src:e.coverImage,alt:`${e.title} kapak g\xf6rseli`,fill:!0,sizes:"(max-width: 1279px) 100vw, 1200px",className:"object-cover"}):null,(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-950/60 via-slate-900/20 to-transparent"})]}),(0,a.jsxs)("div",{className:"relative px-6 pb-6",children:[(0,a.jsxs)("div",{className:"-mt-12 flex flex-col gap-5 md:flex-row md:items-end md:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-end gap-4",children:[(0,a.jsx)("div",{className:"relative h-24 w-24 overflow-hidden rounded-3xl border-4 border-white bg-slate-100 shadow-sm",children:e.thumbnail?(0,a.jsx)(h(),{src:e.thumbnail,alt:`${e.title} g\xf6rseli`,fill:!0,sizes:"96px",className:"object-cover"}):null}),(0,a.jsxs)("div",{className:"pb-2",children:[(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-emerald-50 px-3 py-1 text-xs font-semibold text-emerald-700",children:[(0,a.jsx)(ea.A,{className:"h-4 w-4"}),"Herkese a\xe7ık grup"]}),(0,a.jsx)("h1",{className:"mt-3 text-3xl font-bold text-slate-950",children:e.title})]})]}),(0,a.jsx)(g(),{href:"/sign-in",className:"btn btn-secondary",children:"Katılmak i\xe7in giriş yap"})]}),(0,a.jsx)("p",{className:"mt-5 max-w-3xl text-sm leading-7 text-slate-600",children:e.description}),(0,a.jsx)("div",{className:"mt-6 grid grid-cols-2 gap-3 md:grid-cols-4",children:[["\xdcye",e.memberCount||e.members?.length||0],["G\xf6nderi",e.postsCount||t.length],["Admin",e.admins?.length||0],["Kuruluş",new Date(e.createdAt).getFullYear()]].map(([e,t])=>(0,a.jsxs)("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-4",children:[(0,a.jsx)("div",{className:"ui-kicker text-slate-500",children:e}),(0,a.jsx)("div",{className:"mt-2 text-2xl font-bold text-slate-900",children:t})]},String(e)))})]})]}),(0,a.jsxs)("section",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-2xl font-bold text-slate-950",children:"Grup akışı"}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:"Public gruplara ait son g\xf6nderiler burada listelenir."})]}),0===t.length?(0,a.jsx)("div",{className:"rounded-3xl border border-dashed border-slate-300 bg-white p-8 text-center text-slate-500",children:"Hen\xfcz public g\xf6nderi g\xf6r\xfcnm\xfcyor."}):(0,a.jsx)("div",{className:"grid gap-4",children:t.map(e=>(0,a.jsxs)("article",{className:"rounded-[28px] border border-slate-200 bg-white p-5 shadow-sm",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"text-sm font-semibold text-slate-900",children:[e.createdBy?.firstName||""," ",e.createdBy?.lastName||""]}),(0,a.jsx)("span",{className:"text-xs text-slate-500",children:new Date(e.createdAt).toLocaleDateString("tr-TR")})]}),(0,a.jsx)("p",{className:"mt-4 line-clamp-5 text-sm leading-7 text-slate-700",children:e.content}),e.image||e.images?.[0]?(0,a.jsx)("div",{className:"relative mt-4 h-56 overflow-hidden rounded-2xl bg-slate-100",children:(0,a.jsx)(h(),{src:e.image||e.images?.[0]||"/img/cover-image.png",alt:e.content||"Grup g\xf6nderisi",fill:!0,sizes:"(max-width: 767px) calc(100vw - 2rem), 760px",className:"object-cover"})}):null]},e._id))})]})]}):(0,a.jsxs)("section",{className:"rounded-[32px] border border-slate-200 bg-white p-8 shadow-sm",children:[(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-600",children:[(0,a.jsx)(es.A,{className:"h-4 w-4"}),"\xd6zel grup"]}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold text-slate-950",children:e.title}),(0,a.jsx)("p",{className:"mt-3 max-w-3xl text-sm leading-7 text-slate-600",children:"Bu topluluk yalnızca \xfcyelerine a\xe7ıktır. Grup \xf6zetini g\xf6r\xfcnt\xfcleyebilir, tam akışı g\xf6rme
17k ve katılmak i\xe7in giriş yapabilirsiniz."}),(0,a.jsxs)("div",{className:"mt-6 flex flex-wrap gap-3",children:[(0,a.jsx)(g(),{href:"/sign-in",className:"btn btn-secondary",children:"Giriş yap"}),(0,a.jsx)(g(),{href:"/",className:"btn btn-outline",children:"Ana sayfaya d\xf6n"})]})]}),e9=({initialGroup:e,initialGroupPosts:t,siteUrl:s})=>{let i=(0,k.useRouter)(),m=(0,v.A)(),{isHydrating:x}=(0,B.N)(),[u,p]=(0,c.useState)("about"),[b,A]=(0,c.useState)({postId:"",isOpen:!1}),[C,_]=(0,c.useState)(null),[S,I]=(0,c.useState)(!1),[z,F]=(0,c.useState)(!1),[R,O]=(0,c.useState)(!1),[M,E]=(0,c.useState)(!1),[q,L]=(0,c.useState)(!1),[W,J]=(0,c.useState)(!1),[V,Z]=(0,c.useState)("all"),eg=i.query.detail,{mutateAsync:ef,isPending:ey}=(()=>{let e=(0,v.A)(),t=(0,j.A)(),s=(0,T.jE)();return(0,y.n)({mutationFn:async({groupId:e})=>{let s=await fetch("https://api.wuubi.com/api/group/requests/cancel",{method:"POST",headers:{"Content-Type":"application/json",...t?{Authorization:t}:{}},credentials:"include",body:JSON.stringify({groupId:e})}),a=await s.json();if(!s.ok)throw Error(a.error||"\xc4\xb0stek iptal edilemedi");return a},onSuccess:(t,{groupSlug:a})=>{w.Ay.success(t.data?.message||"\xc4\xb0stek iptal edildi"),e?._id&&s.setQueryData(["getGroupDetail",a,e._id],e=>e?{...e,hasPendingRequest:!1}:e),s.invalidateQueries({queryKey:["getGroupDetail",a]})},onError:e=>{w.Ay.error(e.message||"\xc4\xb0stek iptal edilemedi")}})})(),{mutateAsync:ej,isPending:ev}=(()=>{let e=(0,v.A)(),t=(0,j.A)(),s=(0,T.jE)();return(0,y.n)({mutationFn:async({groupId:s})=>{if(!e?._id||!s)return!1;let a=await fetch("https://api.wuubi.com/api/group/join-or-leave",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t?{Authorization:t}:{}},credentials:"include",body:JSON.stringify({groupId:s})}),r=await a.json();return r&&r.responseResult.status?(r.result?.data?.hasPendingRequest||r.result?.data?.group?.hasPendingRequest?w.Ay.success(r.result?.data?.message||"Katılım talebiniz g\xf6nderildi. Y\xf6netici onayını bekliyorsunuz."):w.Ay.success(r.result?.data?.message||"Gruba başarıyla katıldınız!"),r):(w.Ay.error(r.responseResult.exceptionDetail?.[0]||"Bir hata oluştu"),!1)},onSuccess:(t,a)=>{if(t&&t.result?.data?.group&&e?._id){let{group:r}=t.result.data,l=r.slug;s.setQueryData(["getGroupDetail",l,e._id],e=>{if(!e)return e;let t=!!r.isMember;return{...e,isMember:t,isAdmin:!!t&&e.isAdmin,isCreator:!!t&&e.isCreator,hasPendingRequest:!!r.hasPendingRequest,memberCount:"number"==typeof r.memberCount?r.memberCount:e.memberCount}}),s.invalidateQueries({queryKey:["memberRequests",a.groupId]}),s.invalidateQueries({queryKey:["getGroupDetail",l]}),s.invalidateQueries({queryKey:["getGroupPosts",l]})}}})})(),ew=t.posts||[],{data:eN,isLoading:ek,refetch:eA}=function(e){let{GroupDetailSet:t}=(()=>{let[e,t]=(0,K.fp)(H);return{GroupDetail:e,GroupDetailSet:t}})(),s=(0,v.A)(),a=(0,j.A)(),{isHydrating:r}=(0,B.N)(),l=s?._id||"guest";return(0,$.I)({queryKey:["getGroupDetail",e,l],queryFn:async()=>{let{url:s,init:r}=(0,U.d)(`https://api.wuubi.com/api/group/${e}`,a,{method:"GET",headers:{Accept:"application/json"}}),l=await fetch(s,r),i=await l.json();if(!i||!i.responseResult.status){let e=i?.responseResult?.exceptionDetail?.[0];return"string"==typeof e&&e.trim()&&w.Ay.error(Q(e)),!1}let n=function e(t){return"string"==typeof t?Q(t):Array.isArray(t)?t.map(t=>e(t)):t&&"object"==typeof t?Object.fromEntries(Object.entries(t).map(([t,s])=>[t,e(s)])):t}(i.result.data);return t(n),n},enabled:!!e&&!r,staleTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1})}(eg),eC=eN||e,{data:e_,isLoading:eS,refetch:eI}=function(e){let{GroupPostsSet:t,GroupPostsPagination:s,GroupPostsPaginationSet:a}=X(),r=(0,v.A)(),l=(0,j.A)(),{isHydrating:i}=(0,B.N)(),n=(0,k.useRouter)().query.detail,d=r?._id||"guest",o=e&&s.currentPage===e.currentPage&&s.limit===e.pageSize?e:void 0,m=(0,$.I)({queryKey:["getGroupPosts",n,d,s.currentPage,s.limit],queryFn:async()=>{let{url:e,init:t}=(0,U.d)(`https://api.wuubi.com/api/group/${n}/posts?page=${s.currentPage}&limit=${s.limit}`,l,{method:"GET",headers:{Accept:"application/json"}}),a=await fetch(e,t),r=await a.json();if(!r||!r.responseResult.status)return 403===a.status?{posts:[],currentPage:1,totalCount:0,totalPages:0,pageSize:s.limit,hasMore:!1}:(w.Ay.error((0,D.S)(r,"Grup g\xc3\xb6nderileri y\xc3\xbcklenemedi")),null);let i=r.result.data;return{posts:r.result.data.posts,totalCount:i.totalCount,totalPages:i.totalPages,currentPage:i.currentPage,pageSize:i.pageSize,hasMore:i.hasMore}},enabled:!!n&&!i,initialData:o,staleTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1});return(0,c.useEffect)(()=>{m.data&&(t(m.data.posts),a({currentPage:m.data.currentPage,limit:m.data.pageSize,totalPages:m.data.totalPages,totalPosts:m.data.totalCount}))},[a,t,m.data]),m}(t),{GroupPosts:eP,GroupPostsPagination:ez,GroupPostsPaginationSet:eG}=X(),e$=e_?.posts||eP||ew;(0,c.useEffect)(()=>
17{if(!i.isReady)return;let e="string"==typeof i.query.tab?i.query.tab:"";p(e3.includes(e)?e:"about")},[i.isReady,i.query.tab]);let eT=e=>{if(!e||0===e.length)return 0;let t=new Date;return t.setDate(t.getDate()-7),e.filter(e=>new Date(e.createdAt)>t).length};if((ek||x)&&!eC&&!eg)return(0,a.jsx)(r.A,{size:"large"});if(!eC)return null;let eD=m?._id||"",eB=!!(eD&&(eC.isCreator||eC.createdBy?._id===eD)),eR=!!(eD&&(eC.isAdmin||eB||eC.admins?.some(e=>e._id===eD))),eO=!!(eD&&(eC.isMember||eR||eC.members?.some(e=>e._id===eD))),eM=(0,a.jsx)(n.A,{title:`${eC.title} | Wuubi Grup`,description:(0,e4.Yi)(eC.description,`${eC.title} grubuna ait a\xe7ıklama, \xfcyelik bilgileri ve a\xe7ık g\xf6nderiler Wuubi \xfczerinde listelenir.`),canonicalPath:`/group/${eC.slug}`,siteUrl:s,noindex:!0,jsonLd:[(0,e5.tV)(s,{title:`${eC.title} grubu`,description:eC.description||`${eC.title} grubuna ait a\xe7ıklama, \xfcyelik bilgileri ve a\xe7ık g\xf6nderiler.`,path:`/group/${eC.slug}`}),(0,e5.Y8)(s,[{name:"Ana Sayfa",path:"/"},{name:eC.title,path:`/group/${eC.slug}`}])]});if(!m)return(0,a.jsxs)("div",{className:"mx-auto max-w-7xl px-1.5 py-4 md:px-4 md:py-10",children:[eM,(0,a.jsx)(e6,{group:eC,posts:ew})]});let eE=async()=>{try{await ej({groupId:eC._id})}catch(e){(0,P.vV)("Error joining or leaving group:",e)}},eq=async()=>{try{await ef({groupId:eC._id,groupSlug:eC.slug})}catch(e){(0,P.vV)("Error canceling join request:",e)}},eL=async()=>{if(m?.token&&eO&&!W)try{J(!0);let e=(await (0,ee.$G)(m.token,eC._id)).conversation;if(!e?._id)throw Error("Grup sohbeti hazirlanamadi.");await i.push({pathname:"/messages",query:{conversationId:e._id,groupId:eC._id,groupSlug:e.groupSlug||eC.slug,groupName:e.title||eC.title,groupAvatar:e.avatar||eC.thumbnail||"",memberCount:"number"==typeof e.memberCount?String(e.memberCount):String(eC.memberCount||eC.members?.length||0)}})}catch(e){(0,P.vV)("Error opening group chat:",e)}finally{J(!1)}},eY=()=>{eA(),eI()},eK=e=>{e<1||e===ez.currentPage||ez.totalPages>0&&e>ez.totalPages||(eG(t=>({...t,currentPage:e})),_(null),A({postId:"",isOpen:!1}),window.requestAnimationFrame(()=>{document.getElementById("group-post-stream")?.scrollIntoView({behavior:"smooth",block:"start"})}))};return(0,a.jsxs)("div",{className:"mx-auto max-w-7xl px-1.5 py-4 md:px-4 md:py-10",children:[eM,(0,a.jsx)("div",{className:"flex w-full flex-col gap-6 md:gap-8",children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("section",{className:"relative mb-6 overflow-hidden rounded-[34px] border border-slate-200 bg-white shadow-[0_28px_90px_rgba(15,23,42,0.1)] md:mb-8",children:[(0,a.jsxs)("div",{className:"relative h-56 bg-slate-900 md:h-80",style:{backgroundImage:eC.coverImage?`url(${eC.coverImage})`:"linear-gradient(135deg,#0f172a,#0f766e)",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"},children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-950 via-slate-950/35 to-slate-950/10"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_85%_10%,rgba(45,212,191,0.24),transparent_34%)]"}),(0,a.jsxs)("div",{className:"absolute left-4 top-4 z-10 flex flex-wrap gap-2 md:left-6 md:top-6",children:[(0,a.jsxs)("span",{className:`ui-badge inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 uppercase backdrop-blur ${eC.isPublic?"border-emerald-300/30 bg-emerald-500/20 text-emerald-50":"border-white/20 bg-white/10 text-white"}`,children:[eC.isPublic?(0,a.jsx)(ea.A,{className:"h-3.5 w-3.5"}):(0,a.jsx)(es.A,{className:"h-3.5 w-3.5"}),eC.isPublic?"Herkese a\xe7ık":"\xd6zel topluluk"]}),eO?(0,a.jsxs)("span",{className:"ui-badge inline-flex items-center gap-1.5 rounded-full border border-amber-300/30 bg-amber-400/20 px-3 py-1.5 uppercase text-amber-50 backdrop-blur",children:[(0,a.jsx)(ed.A,{className:"h-3.5 w-3.5"}),eR?"Y\xf6netici":"\xdcyesin"]}):null]}),(0,a.jsxs)("div",{className:"absolute inset-x-0 bottom-0 px-5 pb-16 text-white md:px-8 md:pb-20",children:[(0,a.jsx)("p",{className:"ui-kicker text-teal-200",children:"Wuubi topluluğu"}),(0,a.jsx)("h1",{className:"mt-2 max-w-4xl break-words text-3xl font-bold tracking-tight md:text-5xl",children:eC.title})]})]}),(0,a.jsx)("div",{className:"relative z-20 -mt-12 px-3 pb-5 md:-mt-14 md:px-6 md:pb-6",children:(0,a.jsxs)("div",{className:"rounded-[28px] border border-white/80 bg-white/95 p-4 shadow-[0_22px_60px_rgba(15,23,42,0.12)] backdrop-blur-xl md:p-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-center lg:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-4 md:gap-5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>E(!0),disabled:!eC.thumbnail,className:"group relative h-24 w-24 shrink-0 overflow-hidden rounded-[24px] border-4 border-white bg-[linear-gradient(135deg,#ccfbf1,#fef3c7)] shadow-[0_16px_38px_rgba(15,23,42,0.14)] md:h-28 md:w-28 md:rounded-[28px]",children:eC.thumbnail?(0,a.jsx)(h(),{src:eC.thumbnail,alt:eC.title,fill:!0,sizes:"160px",className:"object-cover transition-transform duration-300 group-hover:scale-105",priority:!0}):(0,a.jsx)(eh.A,{className:"absolute inset-0 m-auto h-9 w-9 text-teal-700"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 pt-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("span",{className:"ui-badge rounded-full bg-teal-50 px-3 py-1 uppercase text-teal-700",children:[eC.memberCount||eC.members?.length||0," \xfcye"]}),(0,a.jsxs)("span",{className:"ui-badge rounded-full bg-amber-50 px-3 py-1 uppercase text-amber-700",children:[eC.postsCount||0," g\xf6nderi"]})]}),(0,a.jsx)("p",{className:"mt-3 line-clamp-3 max-w-3xl text-sm leading-6 text-slate-600 md:text-[15px]",children:eC.description||"Bu topluluk hen\xfcz bir a\xe7ıklama eklememiş."}),(0,a.jsxs)("p",{className:"mt-2 text-xs font-semibold text-slate-400",children:[new Date(eC.createdAt).toLocaleDateString("tr-TR",{year:"numeric",month:"long"})," ","tarihinde kuruldu"]})]})]}),(0,a.jsxs)("div",{className:"w-full rounded-[22px] border border-slate-200 bg-slate-50 p-3 lg:w-auto lg:min-w-[260px]",children:[(0,a.jsx)("p",{className:"ui-kicker mb-2 px-1 text-slate-400",children:"Topluluk aksiyonları"}),((e=!1)=>(0,a.jsxs)("div",{className:`flex flex-col gap-2 ${e?"":"md:flex-row md:flex-wrap md:items-center"}
17`,children:[eO?(0,a.jsxs)("button",{className:"btn btn-secondary",onClick:eL,disabled:W,children:[(0,a.jsx)(er.A,{className:"w-5 h-5"}),W?"Sohbet hazirlaniyor":"Grup sohbeti"]}):null,eC.hasPendingRequest&&!eO?(0,a.jsxs)("button",{className:"btn btn-dark",onClick:eq,disabled:ey,children:[(0,a.jsx)(ec.A,{className:"w-5 h-5"}),"İsteği İptal Et"]}):eO?(0,a.jsxs)("button",{className:"btn btn-dark",onClick:eE,disabled:ev,children:[(0,a.jsx)(ex.A,{className:"w-5 h-5"}),"Gruptan Ayrıl"]}):(0,a.jsxs)("button",{className:"btn btn-secondary",onClick:eE,disabled:ev,children:[(0,a.jsx)(em.A,{className:"w-5 h-5"}),"Gruba Katıl"]}),eR&&(0,a.jsxs)(et.W1,{as:"div",className:"relative inline-block text-left z-50",children:[(0,a.jsxs)(et.W1.Button,{className:`btn btn-secondary inline-flex items-center gap-2 ${e?"w-full justify-center":""}`,children:[(0,a.jsx)(eu.A,{className:"w-5 h-5"}),"Y\xf6netici Ayarları"]}),(0,a.jsx)(d.e,{as:c.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,a.jsx)(et.W1.Items,{className:`absolute mt-2 w-56 origin-top-left rounded-2xl bg-white shadow-2xl ring-1 ring-black ring-opacity-5 focus:outline-none z-[100] ${e?"right-0":"left-0"}`,children:(0,a.jsxs)("div",{className:"p-2",children:[(0,a.jsx)(et.W1.Item,{children:({active:e})=>(0,a.jsxs)("button",{onClick:()=>I(!0),className:`${e?"bg-soft":""} group flex w-full items-center rounded-xl px-3 py-3 text-sm text-dark transition-colors`,children:[(0,a.jsx)(eu.A,{className:"mr-3 h-5 w-5 text-secondary"}),"Grup Ayarları"]})}),(0,a.jsx)(et.W1.Item,{children:({active:e})=>(0,a.jsxs)("button",{onClick:()=>F(!0),className:`${e?"bg-soft":""} group flex w-full items-center rounded-xl px-3 py-3 text-sm text-dark transition-colors`,children:[(0,a.jsx)(ed.A,{className:"mr-3 h-5 w-5 text-warning"}),"Y\xf6netici Ayarları"]})}),(0,a.jsx)(et.W1.Item,{children:({active:e})=>(0,a.jsxs)("button",{onClick:()=>O(!0),className:`${e?"bg-soft":""} group flex w-full items-center rounded-xl px-3 py-3 text-sm text-dark transition-colors`,children:[(0,a.jsx)(ep.A,{className:"mr-3 h-5 w-5 text-secondary"}),"\xdcye Y\xf6netimi"]})})]})})})]})]}))(!0)]})]}),(0,a.jsx)("div",{className:"mt-5 grid grid-cols-2 gap-2 border-t border-slate-100 pt-5 md:grid-cols-4",children:[{label:"\xdcye",value:eC.memberCount||eC.members?.length||0,icon:eh.A,tone:"bg-sky-50 text-sky-700"},{label:"G\xf6nderi",value:eC.postsCount||0,icon:eo.A,tone:"bg-violet-50 text-violet-700"},{label:"Y\xf6netici",value:eC.admins?.length||0,icon:ed.A,tone:"bg-amber-50 text-amber-700"},{label:"Bu hafta",value:`${eT(e$)} paylaşım`,icon:er.A,tone:"bg-teal-50 text-teal-700"}].map(e=>{let t=e.icon;return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-[18px] bg-slate-50 px-3 py-3",children:[(0,a.jsx)("span",{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl ${e.tone}`,children:(0,a.jsx)(t,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"min-w-0",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-semibold text-slate-950",children:e.value}),(0,a.jsx)("span",{className:"ui-meta block",children:e.label})]})]},e.label)})})]})}),(0,a.jsx)("nav",{role:"tablist","aria-label":"Grup b\xf6l\xfcmleri",className:"mx-3 mb-4 grid grid-cols-3 gap-2 rounded-[22px] border border-slate-200 bg-slate-50 p-1.5 md:mx-6 md:mb-6",children:[{key:"about",label:"Hakkında",meta:"Topluluk \xf6zeti",icon:eb.A},{key:"posts",label:"G\xf6nderiler",meta:`${eC.postsCount||0} i\xe7erik`,icon:eo.A},{key:"members",label:"\xdcyeler",meta:`${eC.memberCount||eC.members?.length||0} kişi`,icon:eh.A}].map(e=>{let t=e.icon,s=u===e.key;return(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":s,onClick:()=>(e=>{p(e),i.replace({pathname:i.pathname,query:{...i.query,tab:e}},void 0,{shallow:!0,scroll:!1})})(e.key),className:`flex min-w-0 items-center justify-center gap-2 rounded-[17px] px-3 py-3 text-sm font-semibold transition ${s?"bg-white text-slate-950 shadow-[0_8px_24px_rgba(15,23,42,0.08)]":"text-slate-500 hover:bg-white/70 hover:text-slate-800"}`,children:[(0,a.jsx)(t,{className:`h-4 w-4 shrink-0 ${s?"text-teal-600":"text-slate-400"}`}),(0,a.jsx)("span",{className:"truncate",children:e.label}),(0,a.jsx)("span",{className:`ui-tab-meta hidden rounded-full px-2.5 py-1 lg:inline ${s?"bg-teal-50 text-teal-700":"bg-slate-200/70 text-slate-500"}`,children:e.meta})]},e.key)})})]}),(0,a.jsx)("div",{className:"mb-8 px-1 md:px-2",children:(e=>{let t=(e=>e&&0!==e.length?Math.round(e.reduce((e,t)=>
17e+(Array.isArray(t.likes)?t.likes.length:t.likes||0),0)/e.length):0)(e$),s=eT(e$),i=(e=>{if(!e||0===e.length)return null;let t=[...e].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())[0],s=Math.floor((new Date().getTime()-new Date(t.createdAt).getTime())/36e5),a=Math.floor(s/24);return s<1?"Az \xf6nce":s<24?`${s} saat \xf6nce`:a<7?`${a} g\xfcn \xf6nce`:`${Math.floor(a/7)} hafta \xf6nce`})(e$),n=(e=>{let t=new Date,s=new Date(e),a=Math.ceil(Math.abs(t.getTime()-s.getTime())/864e5),r=Math.floor(a/30),l=Math.floor(r/12);return l>0?`${l} yıl`:r>0?`${r} ay`:`${a} g\xfcn`})(e.createdAt);switch(u){case"about":return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("section",{className:"grid gap-5 lg:grid-cols-[minmax(0,1.35fr)_minmax(280px,0.65fr)]",children:[(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-[30px] border border-slate-200 bg-[linear-gradient(135deg,#ffffff,#f0fdfa)] p-6 shadow-[0_18px_50px_rgba(15,23,42,0.06)] md:p-7",children:[(0,a.jsx)("div",{className:"pointer-events-none absolute -right-16 -top-16 h-44 w-44 rounded-full bg-teal-200/30 blur-3xl"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("span",{className:`ui-badge inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 uppercase ${e.isPublic?"bg-emerald-50 text-emerald-700":"bg-slate-100 text-slate-600"}`,children:[e.isPublic?(0,a.jsx)(ea.A,{className:"h-3.5 w-3.5"}):(0,a.jsx)(es.A,{className:"h-3.5 w-3.5"}),e.isPublic?"A\xe7ık topluluk":"\xd6zel topluluk"]}),i&&s>0?(0,a.jsxs)("span",{className:"ui-badge inline-flex items-center gap-1.5 rounded-full bg-sky-50 px-3 py-1.5 uppercase text-sky-700",children:[(0,a.jsx)(er.A,{className:"h-3.5 w-3.5"}),"Aktif"]}):null]}),(0,a.jsx)("p",{className:"ui-kicker mt-5 text-teal-700",children:"Topluluk hakkında"}),(0,a.jsx)("h2",{className:"mt-2 text-2xl font-bold tracking-tight text-slate-950",children:"Birlikte \xfcretilen alan"}),(0,a.jsx)("p",{className:"mt-3 whitespace-pre-line text-sm leading-7 text-slate-600 md:text-[15px]",children:e.description||"Bu grup i\xe7in hen\xfcz ayrıntılı bir a\xe7ıklama paylaşılmamış."})]})]}),(0,a.jsxs)("div",{className:"rounded-[30px] border border-slate-200 bg-slate-950 p-5 text-white shadow-[0_18px_50px_rgba(15,23,42,0.12)]",children:[(0,a.jsx)("p",{className:"ui-kicker text-teal-300",children:"Aktivite \xf6zeti"}),(0,a.jsx)("div",{className:"mt-5 space-y-4",children:[{label:"Son g\xf6nderi",value:i||"Hen\xfcz g\xf6nderi yok",icon:el.A},{label:"Topluluk yaşı",value:n,icon:ei.A},{label:"Bu hafta",value:`${s} g\xf6nderi`,icon:er.A},{label:"Ortalama etkileşim",value:`${t} beğeni`,icon:en.A}].map(e=>{let t=e.icon;return(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b border-white/10 pb-4 last:border-0 last:pb-0",children:[(0,a.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-white/10 text-teal-200",children:(0,a.jsx)(t,{className:"h-5 w-5"})}),(0,a.jsxs)("span",{className:"min-w-0",children:[(0,a.jsx)("span",{className:"ui-kicker block text-white/45",children:e.label}),(0,a.jsx)("span",{className:"mt-0.5 block truncate text-sm font-semibold",children:e.value})]})]},e.label)})})]})]}),e.groupAchievements?.length?(0,a.jsxs)("section",{className:"rounded-[30px] border border-slate-200 bg-white p-5 shadow-[0_18px_50px_rgba(15,23,42,0.05)] md:p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"ui-kicker text-teal-700",children:"Ortak ilerleme"}),(0,a.jsx)("h3",{className:"mt-1 text-xl font-bold text-slate-950",children:"Topluluk rozetleri"})]}),(0,a.jsxs)("span",{className:"ui-badge rounded-full bg-emerald-50 px-3 py-1 text-emerald-700",children:[e.groupAchievements.filter(e=>e.unlocked).length," ","a\xe7ık"]})]}),(0,a.jsx)("div",{className:"mt-5 grid grid-cols-1 gap-3 md:grid-cols-2",children:e.groupAchievements.map(e=>{let t=Math.min(100,Math.round(Number(e.metric||0)/Math.max(1,Number(e.target||1))*100));return(0,a.jsxs)("div",{className:`relative overflow-hidden rounded-[24px] border p-4 ${e.unlocked?"border-emerald-200 bg-emerald-50/60":"border-slate-200 bg-slate-50"}`,children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center overflow-hidden rounded-2xl bg-white text-teal-700 shadow-sm",style:{color:e.accentColor||void 0},children:e.icon?(0,a.jsx)(h(),{src:e.icon,alt:"",width:28,height:28}):(0,a.jsx)(ed.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsx)("p",{className:"font-semibold text-slate-950",children:e.title}),(0,a.jsx)("span",{className:`ui-badge shrink-0 rounded-full px-2.5 py-1 uppercase ${e.unlocked?"bg-emerald-600 text-white":"bg-white text-slate-500"}`,children:e.unlocked?"A\xe7ıldı":"Devam"})]}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-5 text-slate-500",children:e.description})]})]}),(0,a.jsx)("div",{className:"mt-4 h-2 overflow-hidden rounded-full bg-white",children:(0,a.jsx)("div",{className:"h-full rounded-full bg-gradient-to-r from-teal-500 to-emerald-400",style:{width:`${t}%`}})}),(0,a.jsxs)("p",{className:"ui-badge mt-2 text-teal-700",children:[e.metric,"/",e.target," \xb7 %",t]})]},e.key)})})]}):null,e.groupQuests?.length?(0,a.jsxs)("section",{className:"rounded-[30px] border border-slate-200 bg-[linear-gradient(135deg,#ffffff,#eff6ff)] p-5 shadow-[0_18px_50px_rgba(15,23,42,0.05)] md:p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"ui-kicker text-sky-700",children:"Haftalık ritim"}),(0,a.jsx)("h3",{className:"mt-1 text-xl font-bold text-slate-950",children:"Grup hedefleri"})]}),(0,a.jsx)("span",{className:"ui-badge rounded-full bg-white px-3 py-1 text-sky-700",children:"Birlikte ilerleyin"})]}),(0,a.jsx)("div",{className:"mt-5 grid grid-cols-1 gap-3",children:e.groupQuests.map(e=>{let t=Math.max(6,Math.round(e.progress/Math.max(1,e.target)*100));return(0,a.jsxs)("div",{className:"rounded-[22px] border border-sky-100 bg-white p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("p",{className:"font-semibold text-slate-950",children:e.title}),(0,a.jsx)("span",{className:"ui-badge rounded-full bg-sky-50 px-2.5 py-1 text-sky-700",children:e.completed?"Hazır":"Devam"})]}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-5 text-slate-500",children:e.description}),(0,a.jsx)("div",{className:"mt-4 h-2.5 overflow-hidden rounded-full bg-slate-100",children:(0,a.jsx)("div",{className:"h-full rounded-full bg-gradient-to-r from-sky-500 to-teal-400",style:{width:`${t}%`}})}),(0,a.jsxs)("p",{className:"ui-badge mt-3 text-sky-700",children:[e.progress,"/",e.target," ",e.unit," \xb7"," ",e.rewardLabel||"Topluluk bonusu"]})]},e.key)})})]}):null,e.groupLeaderboard?.length?(0,a.jsxs)("section",{className:"rounded-[30px] border border-slate-200 bg-slate-950 p-5 text-white shadow-[0_20px_60px_rgba(15,23,42,0.14)] md:p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"ui-kicker text-amber-300",children:"Topluluk liderliği"}),(0,a.jsx)("h3",{className:"mt-1 text-xl font-bold",children:"Haftanın katkıcıları"})]}),(0,a.jsxs)("span",{className:"ui-badge rounded-full bg-white/10 px-3 py-1 text-amber-200",children:[e.groupLeaderboard.length," kişi"]})]}),(0,a.jsx)("div",{className:"mt-5 grid grid-cols-1 gap-3",children:e.groupLeaderboard.map(e=>(0,a.jsxs)(g(),{href:`/profile/${e.user.username}`,className:`flex items-center gap-3 rounded-[22px] border p-3.5 transition hover:-translate-y-0.5 ${1===e.rank?"border-amber-300/30 bg-amber-300/10":"border-white/10 bg-white/5 hover:bg-white/10"}`,children:[(0,a.jsxs)("span",{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl text-sm font-bold ${1===e.rank?"bg-amber-400 text-slate-950":"bg-white/10 text-white/70"}`,children:["#",e.rank]}),(0,a.jsx)(f.A,{alt:e.user.username,src:e.user.profilePicture||"",sx:{width:44,height:44,backgroundColor:"#134e4a",color:"#ccfbf1",fontWeight:800},children:String(e.user.firstName||e.user.username||"W").charAt(0).toUpperCase()}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"truncate text-sm font-semibold",children:[e.user.firstName," ",e.user.lastName]}),(0,a.jsxs)("p",{className:"mt-0.5 truncate text-xs text-white/50",children:["@",e.user.username]}),(0,a.jsxs)("p",{className:"ui-meta mt-1 text-white/50",children:[e.posts," g\xf6nderi \xb7 ",e.comments," yorum \xb7"," ",e.reactions," beğeni \xb7 ",e.votes," oy"]})]}),(0,a.jsxs)("span",{className:"ui-badge shrink-0 rounded-full bg-teal-400/15 px-3 py-1.5 text-teal-200",children:[e.score," puan"]})]},`${e.user._id}-${e.rank}`))})]}):null,e.admins&&e.admins.length>0&&(0,a.jsxs)("section",{className:"rounded-[30px] border border-slate-200 bg-white p-5 shadow-[0_18px_50px_rgba(15,23,42,0.05)] md:p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)(ed.A,{className:"w-5 h-5 text-amber-600"}),(0,a.jsx)("h3",{className:"text-lg font-extrabold text-slate-950",children:"Y\xf6neticiler"}),(0,a.jsx)("span",{className:"px-2 py-0.5 bg-amber-50 text-amber-700 text-xs font-semibold rounded-full",children:e.admins.length})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.admins.map(t=>(0,a.jsxs)(g(),{href:`/profile/${t.username}`,className:"flex items-center gap-3 rounded-[20px] border border-slate-200 bg-slate-50 p-3.5 transition hover:border-amber-200 hover:bg-white",children:[(0,a.jsxs)("div",{className:"relative flex-shrink-0 rounded-full bg-gradient-to-br from-amber-400 to-teal-500 p-[2px]",children:[(0,a.jsx)(f.A,{src:t.profilePicture||"",alt:t.username,sx:{width:48,height:48,border:"2px s
17olid white",backgroundColor:"#fef3c7",color:"#b45309",fontWeight:800},children:String(t.firstName||t.username||"W").charAt(0).toUpperCase()}),t._id===e.createdBy._id&&(0,a.jsx)("div",{className:"absolute -bottom-0.5 -right-0.5 rounded-full bg-amber-500 p-1 ring-2 ring-white",children:(0,a.jsx)(ed.A,{className:"w-3 h-3 text-white"})})]}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("p",{className:"truncate font-extrabold text-slate-950",children:[t.firstName," ",t.lastName]}),(0,a.jsxs)("p",{className:"text-sm text-gray-500 truncate",children:["@",t.username]})]}),t._id===e.createdBy._id&&(0,a.jsx)("span",{className:"px-2.5 py-1 bg-amber-50 text-amber-700 text-xs font-semibold rounded-full border border-amber-200",children:"Kurucu"})]},t._id))})]}),(0,a.jsx)("div",{className:"border-t border-gray-200 pt-6",children:(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-4 text-sm",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-gray-600",children:[(0,a.jsx)(ei.A,{className:"w-4 h-4 text-gray-400"}),(0,a.jsx)("span",{className:"font-medium",children:"Oluşturulma:"}),(0,a.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString("tr-TR",{year:"numeric",month:"long",day:"numeric"})})]})})})]});case"members":if(eO||e.isPublic)return(0,a.jsx)(e2,{groupSlug:eg});return(0,a.jsxs)("div",{className:"rounded-[30px] border border-dashed border-slate-300 bg-[linear-gradient(180deg,#f8fafc,#ffffff)] px-6 py-16 text-center",children:[(0,a.jsx)("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-[22px] bg-white text-slate-400 shadow-sm",children:(0,a.jsx)(es.A,{className:"h-8 w-8"})}),(0,a.jsx)("p",{className:"mt-5 text-base font-extrabold text-slate-900",children:"\xdcye rehberi gizli"}),(0,a.jsx)("p",{className:"mx-auto mt-2 max-w-sm text-sm leading-6 text-slate-500",children:"Grup \xfcyelerini g\xf6rmek i\xe7in gruba katılmalısınız"})]});case"posts":{if(!(e.isPublic||eO))return(0,a.jsxs)("div",{className:"rounded-[28px] border border-slate-200 bg-slate-50 px-6 py-12 text-center",children:[(0,a.jsx)("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-2xl bg-white shadow-sm",children:(0,a.jsx)(es.A,{className:"h-7 w-7 text-slate-400"})}),(0,a.jsx)("p",{className:"mt-4 text-base font-semibold text-slate-900",children:"Bu akış yalnızca \xfcyelere a\xe7ık"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-slate-500",children:"G\xf6nderileri g\xf6rmek i\xe7in gruba katılmalısınız"})]});let s=ez.totalPosts||e.postsCount||e$.length,n=Math.max(1,ez.totalPages||1),m=ez.currentPage||1,x=ez.limit||10,u=e$.length?(m-1)*x+1:0,p=e$.length?u+e$.length-1:0,h=e$.reduce((e,t)=>{let s=t.type||"standard";return e[s]+=1,e},{standard:0,poll:0,quiz:0}),g="all"===V?e$:e$.filter(e=>(e.type||"standard")===V),f=[{key:"all",label:"T\xfcm\xfc",count:e$.length},{key:"standard",label:"G\xf6nderi",count:h.standard},{key:"poll",label:"Anket",count:h.poll},{key:"quiz",label:"Bilgi yarışması",count:h.quiz}],y=f.find(e=>e.key===V)?.label||"T\xfcm\xfc",j=m>1,v=ez.totalPages>0?m<ez.totalPages:e$.length===x;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{id:"group-
17post-stream",className:"grid gap-5 xl:grid-cols-[280px,minmax(0,1fr)]",children:[(0,a.jsx)("aside",{className:"space-y-4 xl:sticky xl:top-24 xl:self-start",children:(0,a.jsxs)("section",{className:"overflow-hidden rounded-[30px] border border-slate-200 bg-white shadow-[0_20px_50px_rgba(15,23,42,0.06)]",children:[(0,a.jsxs)("div",{className:"border-b border-slate-100 bg-[radial-gradient(circle_at_top_left,_rgba(15,23,42,0.08),_transparent_55%),linear-gradient(180deg,#ffffff_0%,#f8fafc_100%)] px-5 py-5",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-slate-950",children:"G\xf6nderiler"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-slate-500",children:"Bu gruptaki g\xf6nderiler burada listelenir."})]}),(0,a.jsxs)("div",{className:"space-y-4 px-5 py-5",children:[eO?(0,a.jsxs)("button",{type:"button",onClick:()=>L(!0),className:"flex w-full items-center justify-between rounded-[22px] bg-slate-950 px-4 py-4 text-left text-white transition hover:bg-slate-800",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold",children:"Yeni paylaşım"}),(0,a.jsx)("p",{className:"mt-1 text-xs text-white/70",children:"G\xf6nderi, anket veya quiz paylaşın."})]}),(0,a.jsx)("span",{className:"rounded-full bg-white/10 px-3 py-1 text-xs font-semibold",children:"A\xe7"})]}):(0,a.jsxs)("div",{className:"rounded-[22px] border border-slate-200 bg-slate-50 px-4 py-4",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:"Sadece izleme modu"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-5 text-slate-500",children:"Paylaşım yapmak i\xe7in \xf6nce gruba katılman gerekiyor."})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"ui-kicker text-slate-400",children:"G\xf6r\xfcn\xfcm filtresi"}),f.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>Z(e.key),className:`flex w-full items-center justify-between rounded-[18px] border px-4 py-3 text-left text-sm font-semibold transition ${V===e.key?"border-slate-900 bg-slate-900 text-white shadow-lg shadow-slate-900/10":"border-slate-200 bg-slate-50 text-slate-700 hover:border-slate-300 hover:bg-white"}`,children:[(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:`rounded-full px-2.5 py-1 text-xs ${V===e.key?"bg-white/10 text-white":"bg-white text-slate-500"}`,children:e.count})]},e.key))]}),(0,a.jsxs)("div",{className:"rounded-[22px] bg-slate-50 p-4",children:[(0,a.jsx)("p",{className:"ui-kicker text-slate-400",children:"Kısa \xf6zet"}),(0,a.jsxs)("div",{className:"mt-3 space-y-3 text-sm text-slate-600",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Akış tipi"}),(0,a.jsx)("span",{className:"font-semibold text-slate-900",children:e.isPublic?"A\xe7ık":"\xdcyelere \xf6zel"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Son hareket"}),(0,a.jsx)("span",{className:"font-semibold text-slate-900",children:i||"Hen\xfcz yok"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Ort. beğeni"}),(0,a.jsx)("span",{className:"font-semibold text-slate-900",children:t})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Bu sayfa"}),(0,a.jsxs)("span",{className:"font-semibold text-slate-900",children:[u>0?`${u}-${p}`:"0"," /"," ",s]})]})]})]})]})]})}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("section",{className:"rounded-[30px] border border-slate-200 bg-white px-5 py-5 shadow-[0_20px_50px_rgba(15,23,42,0.06)] md:px-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-end md:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-600",children:[(0,a.jsx)("span",{children:y}),(0,a.jsx)("span",{className:"h-1 w-1 rounded-full bg-slate-300"}),(0,a.jsxs)("span",{children:[g.length," sonu\xe7"]})]}),(0,a.jsx)("h3",{className:"mt-3 text-2xl font-semibold tracking-tight text-slate-950",children:s>0?`${s} g\xf6nderilik akış`:"Topluluk akışı"}),(0,a.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-slate-500",children:g.length>0?"G\xf6nderiler se\xe7ilen filtreye g\xf6re listelenir.":"all"===V?"Bu grupta hen\xfcz paylaşım yok.":`${y} filtresinde g\xf6sterilecek g\xf6nderi bulunamadı.`})]}),n>1?(0,a.jsxs)("div",{className:"rounded-[22px] border border-slate-200 bg-slate-50 px-4 py-3",children:[(0,a.jsx)("p",{className:"ui-kicker text-slate-400",children:"Sayfalama"}),(0,a.jsxs)("p",{className:"mt-1 text-sm font-semibold text-slate-900",children:[m," / ",n]})]}):null]})}),eS&&0===e$.length?(0,a.jsx)("div",{className:"rounded-[28px] border border-slate-200 bg-white px-6 py-12 shadow-[0_20px_50px_rgba(15,23,42,0.05)]",children:(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(r.A,{size:"small",text:""})})}):0===e$.length?(0,a.jsxs)("div",{className:"rounded-[28px] border border-dashed border-slate-300 bg-[linear-gradient(180deg,#f8fafc_0%,#ffffff_100%)] px-6 py-16 text-center",children:[(0,a.jsx)("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-[24px] bg-white shadow-sm",children:(0,a.jsx)(eo.A,{className:"h-7 w-7 text-slate-400"})}),(0,a.jsx)("p",{className:"mt-5 text-base font-semibold text-slate-900",children:"Hen\xfcz g\xf6nderi yok"}),(0,a.jsx)("p",{className:"mx-auto mt-2 max-w-md text-sm leading-6 text-slate-500",children:eO?"Akışı ilk paylaşım ile başlatabilirsin.":"Bu grupta hen\xfcz g\xf6r\xfcn\xfcr bir paylaşım bulunmuyor."})]}):0===g.length?(0,a.jsxs)("div",{className:"rounded-[28px] border border-dashed border-slate-300 bg-[linear-gradient(180deg,#f8fafc_0%,#ffffff_100%)] px-6 py-16 text-center",children:[(0,a.jsx)("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-[24px] bg-white shadow-sm",children:(0,a.jsx)(eo.A,{className:"h-7 w-7 text-slate-400"})}),(0,a.jsx)("p",{className:"mt-5 text-base font-semibold text-slate-900",children:"Bu g\xf6r\xfcn\xfcm boş"}),(0,a.jsxs)("p",{className:"mx-auto mt-2 max-w-md text-sm leading-6 text-slate-500",children:[y," filtresini temizleyerek diğer g\xf6nderileri g\xf6rebilirsin."]})]}):(0,a.jsx)("div",{className:"space-y-4",children:g.map((e,t)=>(0,a.jsx)(l.A,{delay:Math.min(35*t,250),yOffset:8,children:(0,a.jsx)(eF,{post:e,setIsCommentSectionOpen:A,isCommentSectionOpen:b,openActionPostId:C,setOpenActionPostId:_,refetchPosts:eI}
17)},e._id))}),n>1&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 rounded-[28px] border border-slate-200 bg-white px-5 py-4 shadow-[0_20px_50px_rgba(15,23,42,0.05)] sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-sm font-semibold text-slate-900",children:["Sayfa ",m," / ",n]}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-slate-500",children:["Toplam ",s," g\xf6nderi arasında geziniyorsun."]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",className:"btn btn-outline",disabled:!j,onClick:()=>eK(m-1),children:"\xd6nceki"}),(0,a.jsx)("button",{type:"button",className:"btn btn-secondary",disabled:!v,onClick:()=>eK(m+1),children:"Sonraki"})]})]})]})]}),(0,a.jsx)(d.e,{appear:!0,show:q,as:c.Fragment,children:(0,a.jsxs)(o.lG,{as:"div",className:"relative z-[220]",onClose:()=>L(!1),children:[(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-150",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-slate-950/60 backdrop-blur-md"})}),(0,a.jsx)("div",{className:"fixed inset-0 overflow-y-auto px-3 py-4 md:px-6 md:py-8",children:(0,a.jsx)("div",{className:"flex min-h-full items-start justify-center",children:(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-200",enterFrom:"opacity-0 translate-y-5 scale-[0.98]",enterTo:"opacity-100 translate-y-0 scale-100",leave:"ease-in duration-150",leaveFrom:"opacity-100 translate-y-0 scale-100",leaveTo:"opacity-0 translate-y-5 scale-[0.98]",children:(0,a.jsxs)(o.lG.Panel,{className:"relative w-full max-w-6xl",children:[(0,a.jsx)("button",{type:"button",onClick:()=>L(!1),className:"absolute right-4 top-4 z-20 rounded-full border border-white/70 bg-white/90 p-2 text-slate-500 shadow-lg transition hover:bg-white",children:(0,a.jsx)(ec.A,{className:"h-5 w-5"})}),(0,a.jsx)(eW,{refetchPosts:eI,onCreated:()=>L(!1)})]})})})})]})})]})}}})(eC)})]},eC._id)}),(0,a.jsx)(d.e,{appear:!0,show:M,as:c.Fragment,children:(0,a.jsxs)(o.lG,{as:"div",className:"relative z-[200]",onClose:()=>E(!1),children:[(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-black/90"})}),(0,a.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,a.jsx)(d.e.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,a.jsxs)(o.lG.Panel,{className:"relative w-full max-w-4xl mx-auto",children:[(0,a.jsx)("button",{onClick:()=>E(!1),className:"absolute -top-12 right-0 text-white hover:text-gray-300 transition-colors z-50",children:(0,a.jsx)("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("div",{className:"relative w-full h-[600px] max-h-[90vh]",children:(0,a.jsx)(h(),{src:eC.thumbnail,alt:eC.title,fill:!0,sizes:"(max-width: 767px) calc(100vw - 3rem), 480px",className:"object-contain",priority:!0})})]})})})})]})}),eR&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(G,{isOpen:S,onClose:()=>I(!1),group:{_id:eC._id,title:eC.title,description:eC.description,isPublic:eC.isPublic,isCreator:eB,thumbnail:eC.thumbnail,coverImage:eC.coverImage},onSuccess:eY}),(0,a.jsx)(N,{isOpen:z,onClose:()=>F(!1),group:{_id:eC._id,admins:eC.admins,members:eC.members,createdBy:eC.createdBy,isCreator:eB},onSuccess:eY}),(0,a.jsx)(Y,{isOpen:R,onClose:()=>O(!1),group:{_id:eC._id,members:eC.members,admins:eC.admins},onSuccess:eY})]})]})};var e7=!0;let e8=e9;e9.getLayout=e=>(0,a.jsx)(i.A,{children:e})},33274:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var a=s(4622),r=s(41679);function l(){let{setModalState:e}=(0,a.A)();return{openModal:(t,s,a)=>{let l=r=>{e({isOpen:!0,title:t,description:s,icon:a,iconReady:r})};if(!a)return void l(!1);if((0,r.k)(a))return void l(!0);let i=!1,n=window.setTimeout(()=>{i=!0,l(!1)},180);(0,r.u)(a).then(t=>{if(window.clearTimeout(n),i){t&&e(e=>e.isOpen&&e.icon===a?{...e,iconReady:!0}:e);return}l(t)})},closeModal:()=>{e({isOpen:!1,title:"",description:"",icon:"",iconReady:!1})}}}},35750:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var a=s(37876);s(14232);var r=s(40625);let l=({children:e,delay:t=0,yOffset:s=16,once:l=!0,className:i=""})=>{let{ref:n,inView:d}=(0,r.Wx)({triggerOnce:l,threshold:.15,rootMargin:"0px 0px -5% 0px"});return(0,a.jsx)("div",{ref:n,style:{opacity:+!!d,transform:d?"translate3d(0, 0, 0) scale(1)":`translate3d(0, ${s}px, 0) scale(0.985)`,transition:"opacity 500ms ease, transform 500ms ease",transitionDelay:`${t}ms`},className:i,children:e})}},37285:(e,t,s)=>{"use strict";s.d(t,{g:()=>i});var a=s(40097),r=s(92963),l=s(97685);let i=()=>{let e=(0,r.A)();return(0,a.n)({mutationFn:async({username:t})=>{if(!e||!e.token||!t)return l.Ay.error("Bir kullanıcıyı takip etmek i\xe7in giriş yapmalısınız"),!1;if(t.toLowerCase()===e.username?.toLowerCase())return l.Ay.error("Kendi hesabını takip edemezsin"),!1;let s=`https://api.wuubi.com/api/user/${t}/follow`,a=await fetch(s,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`${e&&`Bearer ${e.token}`}`}}),r=await a.json();return!!r&&!!r.responseResult.status||(l.Ay.error(r.responseResult.exceptionDetail?.[0]),!1)}})}},41679:(e,t,s)=>{"use strict";s.d(t,{k:()=>l,u:()=>i});let a=new Set,r=new Map;function l(e){return!!(e&&a.has(e))}function i(e){if(!e)return Promise.resolve(!1);if(a.has(e))return Promise.resolve(!0);let t=r.get(e);if(t)return t;let s=new Promise(t=>{let s=new window.Image,l=!1,i=s=>{l||(l=!0,r.delete(e),s&&a.add(e),t(s))};s.decoding="async",s.onload=()=>i(!0),s.onerror=()=>i(!1),s.src=e,s.complete&&i(!0)});return r.set(e,s),s}},41744:(e,t,s)=>{"use strict";s.d(t,{A:()=>f});var a=s(37876),r=s(50292),l=s(79350);let i=(0,l.J1)`
18  query GetGroupPostComments($postId: String!, $page: Int!) {
19    getGroupPostComments(postId: $postId, page: $page) {
20      comments {
21        _id
22        postId
23        userId {
24          _id
25          firstName
26          lastName
27          username
28          profilePicture
29        }
30        content
31        likes
32        dislikes
33        score
34        isLiked
35        isDisliked
36        parentCommentId
37        rootCommentId
38        depth
39        repliesCount
40        createdAt
41        replies {
42          _id
43          postId
44          userId {
45            _id
46            firstName
47            lastName
48            username
49            profilePicture
50          }
51          content
52          likes
53          dislikes
54          score
55          isLiked
56          isDisliked
57          parentCommentId
58          rootCommentId
59          depth
60          repliesCount
61          createdAt
62          replies {
63            _id
64            postId
65            userId {
66              _id
67              firstName
68              lastName
69              username
70              profilePicture
71            }
72            content
73            likes
74            dislikes
75            score
76            isLiked
77            isDisliked
78            parentCommentId
79            rootCommentId
80            depth
81            repliesCount
82            createdAt
83            replies {
84              _id
85              postId
86              userId {
87                _id
88                firstName
89                lastName
90                username
91                profilePicture
92              }
93              content
94              likes
95              dislikes
96              score
97              isLiked
98              isDisliked
99              parentCommentId
100              rootCommentId
101              depth
102              repliesCount
103              createdAt
104            }
105          }
106        }
107      }
108      totalPages
109      currentPage
110      totalCount
111      rootCount
112      replyCount
113    }
114  }
115`;var n=s(60022),d=s(64177);let o=(0,l.J1)`
116  mutation AddGroupPostComment(
117    $content: String!
118    $postId: String!
119    $parentCommentId: String
120  ) {
121    addGroupPostComment(
122      content: $content
123      postId: $postId
124      parentCommentId: $parentCommentId
125    ) {
126      _id
127      postId
128      userId
129      content
130      likes
131      dislikes
132      parentCommentId
133      rootCommentId
134      depth
135      repliesCount
136      createdAt
137    }
138  }
139`,c=(0,l.J1)`
140  mutation DislikeGroupPostComment($commentId: String!) {
141    dislikeGroupPostComment(commentId: $commentId) {
142      status
143      code
144      commentId
145      userId
146      postId
147    }
148  }
149`;var m=s(54431);let x=(0,l.J1)`
150  mutation LikeGroupPostComment($commentId: String!) {
151    likeGroupPostComment(commentId: $commentId) {
152      status
153      code
154      commentId
155      userId
156      postId
157    }
158  }
159`;var u=s(78464),p=s(1707),h=s(14232),b=s(92963),g=s(97685);function f({postId:e,GroupPostsSet:t}){let[s,l]=(0,h.useState)(1),[f,y]=(0,h.useState)(""),[j,v]=(0,h.useState)(null),[w]=(0,d.n)(o),N=(0,b.A)(),[k]=(0,d.n)(x,{refetchQueries:e=>[{query:i,variables:{postId:e.data.likeGroupPostComment.postId,page:1}}]}),[A]=(0,d.n)(c,{refetchQueries:e=>[{query:i,variables:{postId:e.data.dislikeGroupPostComment.postId,page:1}}]}),{data:C,loading:_,error:S,refetch:I}=(0,m.IT)(i,{variables:{postId:e,page:s},skip:!e}),P=C?.getGroupPostComments?.comments??[],z=C?.getGroupPostComments?.totalPages??0,G=C?.getGroupPostComments?.totalCount??0,$=async(a,r)=>{let l=(r??f).trim();if(N?._id&&l)try{await w({variables:{content:l,postId:e,parentCommentId:a||null},refetchQueries:[{query:i,variables:{postId:e,page:s}}]}),a||y(""),t&&t(t=>Array.isArray(t)?t.map(t=>t._id===e?{...t,comments:Number(t.comments||0)+1}:t):t),await I()}catch{g.Ay.error("Yorum g\xf6nderilemedi")}},T=async e=>{try{await k({variables:{commentId:e}}),await I()}catch{g.Ay.error("Beğeni g\xfcncellenemedi")}},F=async e=>{try{await A({variables:{commentId:e}}),await I()}catch{g.Ay.error("Oy g\xfcncellenemedi")}};return S?(0,a.jsx)("div",{className:"rounded-2xl border border-rose-200 bg-rose-50 px-6 py-5 text-sm text-rose-700",children:"Grup g\xf6nderisi yorumları y\xfcklenemedi."}):(0,a.jsxs)("div",{className:"border-t border-slate-100 bg-gradient-to-b from-slate-50/70 to-transparent px-4 py-5",children:[(0,a.jsx)(r.A,{loading:_,comments:P,currentUser:N,composerValue:f,composerPlaceholder:"Yorum yaz...",onComposerChange:y,onSubmitRoot:()=>$(),onSubmitReply:(e,t)=>$(e,t),onLike:T,onDislike:F,onReport:e=>v(e._id),emptyDescription:"İlk yorumu sen yaz.",messageHrefBuilder:e=>({pathname:"/messages",query:{userId:e._id,username:e.username||"",firstName:e.firstName||"",lastName:e.lastName||"",profilePicture:e.profilePicture||""}})}),(0,a.jsx)(n.default,{open:!!j,targetId:j||"",targetType:"groupPostComment",title:"Grup yorumunu şikayet et",onClose:()=>v(null)}),z>1&&(0,a.jsxs)("div",{className:"mt-4 flex items-center justify-center gap-2",children:[(0,a.jsx)("button",{className:"btn btn-primary btn-sm",onClick:()=>l(e=>Math.max(1,e-1)),disabled:1===s,children:(0,a.jsx)(u.A,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"rounded-full bg-slate-100 px-4 py-2 text-xs font-semibold text-slate-600",children:["Sayfa ",s," / ",z," \xb7 ",G," yorum"]}),(0,a.jsx)("button",{className:"btn btn-primary btn-sm",onClick:()=>l(e=>Math.min(z,e+1)),disabled:s===z,children:(0,a.jsx)(p.A,{className:"h-4 w-4"})})]})]})}},44542:(e,t,s)=>{"use strict";s.d(t,{fH:()=>l,vV:()=>i});let a=console;function r(e,t,s){if("error"!==e&&"warn"!==e)return;let r=`[WuubiWeb][${e}] ${t}`;return"error"===e?void a?.error?.(r,s):"warn"===e?void a?.warn?.(r,s):"debug"===e?void a?.debug?.(r,s):void a?.info?.(r,s)}function l(e,t){r("info",e,t)}function i(e,t){r("error",e,t)}},65127:(e,t,s)=>{"use strict";s.d(t,{A:()=>d});var a=s(37876);let r={src:"https://static.wuubi.com/_next/static/media/loading.896201e9.svg",height:200,width:200,blurWidth:0,blurHeight:0};var l=s(54587),i=s.n(l),n=s(14232);function d({size:e="medium",text:t="Y\xfckleniyor...",description:s="L\xfctfen bekleyin, i\xe7erik hazırlanıyor.",variant:l="inline"}
159){let[d,o]=(0,n.useState)(22);return(0,n.useEffect)(()=>{let e=22,t=setInterval(()=>{let t=Math.max(1,Math.ceil(.18*(96-e)));o(e=Math.min(96,e+t))},240);return()=>{clearInterval(t),o(100)}},[]),(0,a.jsx)("div",{className:`flex items-center justify-center ${"overlay"===l?"":`w-full ${({small:"min-h-[8rem]",medium:"min-h-[14rem]",large:"min-h-screen"})[e]}`}`,children:(0,a.jsxs)("div",{className:`relative overflow-hidden rounded-2xl border border-slate-200/80 shadow-xl ${"overlay"===l?"bg-white/90 backdrop-blur-xl px-9 py-8 w-[min(92vw,420px)]":"bg-white px-6 py-5"}`,children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-slate-50 via-white to-blue-50"}),(0,a.jsx)("div",{className:"absolute -top-14 -right-14 h-32 w-32 rounded-full bg-blue-200/35 blur-2xl"}),(0,a.jsx)("div",{className:"absolute -bottom-14 -left-14 h-32 w-32 rounded-full bg-slate-300/30 blur-2xl"}),(0,a.jsxs)("div",{className:"relative flex flex-col items-center justify-center gap-3 text-center",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-100 blur-sm"}),(0,a.jsx)("div",{className:"absolute -inset-2 rounded-full border border-blue-200/70 animate-pulse"}),(0,a.jsx)(i(),{src:r,alt:"Y\xfckleniyor",className:`${{small:"h-12 w-12",medium:"h-16 w-16",large:"h-20 w-20"}[e]} relative`})]}),t&&(0,a.jsx)("p",{className:"text-base font-semibold text-slate-800",children:t}),t&&s&&(0,a.jsx)("p",{className:"max-w-[260px] text-xs text-slate-500",children:s}),(0,a.jsx)("div",{className:"mt-1 h-1.5 w-44 overflow-hidden rounded-full bg-slate-200/80",children:(0,a.jsx)("div",{className:"h-full rounded-full bg-gradient-to-r from-blue-500 to-slate-700 transition-[width] duration-200 ease-out",style:{width:`${d}%`}})}),(0,a.jsxs)("p",{className:"text-[11px] font-medium text-slate-500",children:[d,"%"]}),(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 animate-bounce [animation-delay:-0.2s]"}),(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-slate-400 animate-bounce [animation-delay:-0.1s]"}),(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 animate-bounce"})]})]})]})})}},65590:e=>{e.exports={button:"Button_button__pHaIp",primary:"Button_primary__0EPvY",secondary:"Button_secondary__LtFsR",ghost:"Button_ghost__7J8Mx",danger:"Button_danger__Hfnga",sm:"Button_sm__zkEHc",md:"Button_md__clc99",lg:"Button_lg__LAWzu",fullWidth:"Button_fullWidth__7kdFL",iconOnly:"Button_iconOnly__gRDjQ"}},82437:(e,t,s)=>{"use strict";s.d(t,{A:()=>m});var a=s(37876),r=s(27062);let l=async(e,t,s="image/jpeg",a=.92)=>{let r=await new Promise((t,s)=>{let a=document.createElement("img");a.addEventListener("load",()=>t(a)),a.addEventListener("error",()=>s(Error("Image could not be loaded"))),a.setAttribute("crossOrigin","anonymous"),a.src=e}),l=document.createElement("canvas"),i=l.getContext("2d");if(!i)throw Error("2D context is not available");return l.width=t.width,l.height=t.height,i.drawImage(r,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((e,t)=>{l.toBlob(s=>{if(!s)return void t(Error("Could not create cropped image blob"));let a=new FileReader;a.onloadend=()=>e(a.result),a.onerror=()=>t(Error("Could not read cropped blob")),a.readAsDataURL(s)},s,a)})};var i=s(5797),n=s(6978),d=s(14232),o=s(32615),c=s(97685);let m=({isOpen:e,imageSrc:t,title:s="G\xf6rseli kırp",aspect:m,onClose:x,onApply:u})=>{let[p,h]=(0,d.useState)({x:0,y:0}),[b,g]=(0,d.useState)(1),[f,y]=(0,d.useState)(null),[j,v]=(0,d.useState)(!1),w=(0,d.useCallback)((e,t)=>{y(t)},[]),N=async()=>{if(f&&t&&!j)try{v(!0);let e=await l(t,f);u(e),h({x:0,y:0}),g(1)}catch{c.Ay.error("G\xf6rsel kırpılırken hata oluştu")}finally{v(!1)}},k=()=>{j||(h({x:0,y:0}),g(1),x())};return(0,a.jsx)(i.e,{appear:!0,show:e,as:d.Fragment,children:(0,a.jsxs)(n.lG,{as:"div",className:"relative z-[2147483646]",onClose:k,children:[(0,a.jsx)(i.e.Child,{as:d.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-black/40"})}),(0,a.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,a.jsx)(i.e.Child,{as:d.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,a.jsxs)(n.lG.Panel,{className:"w-full max-w-2xl transform overflow-hidden rounded-2xl bg-white p-5 shadow-2xl transition-all",children:[(0,a.jsx)(n.lG.Title,{as:"h3",className:"mb-4 text-lg font-semibold text-dark",children:s}),(0,a.jsx)("div",{className:"relative h-[420px] w-full overflow-hidden rounded-xl bg-gray-100",children:(0,a.jsx)(o.Ay,{image:t,crop:p,zoom:b,as
159pect:m,showGrid:!1,cropShape:"rect",onCropChange:h,onCropComplete:w,onZoomChange:g})}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("label",{className:"mb-2 block text-sm text-gray-600",children:"Yakınlaştırma"}),(0,a.jsx)("input",{type:"range",min:1,max:3,step:.1,value:b,onChange:e=>g(Number(e.target.value)),className:"w-full"})]}),(0,a.jsxs)("div",{className:"mt-5 flex items-center justify-end gap-2",children:[(0,a.jsx)(r.A,{type:"button",variant:"ghost",onClick:k,disabled:j,children:"İptal"}),(0,a.jsx)(r.A,{type:"button",variant:"secondary",onClick:N,disabled:j,children:j?"Uygulanıyor...":"Kırpmayı uygula"})]})]})})})})]})})}},92895:(e,t,s)=>{"use strict";s.d(t,{I:()=>n});var a=s(33274),r=s(30225),l=s(40097),i=s(97685);let n=()=>{let{openModal:e}=(0,a.A)(),t=(0,r.A)();return(0,l.n)({mutationFn:async({user:s,postId:a,optionId:r})=>{if(!a||!r||!s?._id)return!1;let l=await fetch(`https://api.wuubi.com/api/group/post/${a}/poll/vote`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t?{Authorization:t}:{}},credentials:"include",body:JSON.stringify({optionId:r})}),n=await l.json();if(!n?.responseResult?.status)return i.Ay.error(n?.responseResult?.exceptionDetail?.[0]||"Oy kaydedilemedi"),!1;let d=n?.responseResult?.achievement||[];if(Array.isArray(d)&&d.length>0){let{title:t,description:s,icon:a}=d[0];t&&s&&a&&e(t,s,a)}return n?.result?.data||!1}})}}},e=>{e.O(0,[4938,6701,152,975,3514,1750,6978,6220,5608,2615,6312,53,4473,4178,4296,6732,7055,202,636,6593,8792],()=>e(e.s=19357)),_N_E=e.O()}]);

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.