1import{h as z,Z as K,u as G,i as J,r as B,s as d,a0 as h,j as e,c as _,S as Q,V as W,C as u,e as p,G as O,H as Z,J as Y,B as o,U as C,ab as X,W as g,Y as j,a as ee,f as w}from"./index-CqZBbo2d.js";import{S as b}from"./skeleton-pb8zxHP5.js";import{T as se,a as ae,b as L,c as M}from"./tabs-vd6b1b-s.js";import{t as A}from"./urls-BBblIgNm.js";import{U as te}from"./user-9bHG05j4.js";import{M as v}from"./message-square-B9XkxRS4.js";import{T as re}from"./target-iGKrKCDc.js";import{C as D}from"./clock-C25hlMCx.js";import{f}from"./formatDistanceToNow-B7EdvvwJ.js";import"./en-US-DWrl2lTx.js";import"./endOfMonth-DIWrT0r0.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const U=z("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]),$=({className:i})=>e.jsx("svg",{className:i,viewBox:"0 0 100 100",fill:"currentColor",children:e.jsx("polygon",{points:"50,0 61,35 100,35 68,57 79,91 50,70 21,91 32,57 0,35 39,35"})}),le=({className:i})=>e.jsx("svg",{className:i,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2L13.5 8.5L20 10L13.5 11.5L12 18L10.5 11.5L4 10L10.5 8.5L12 2Z"})}),ie=({className:i})=>e.jsx("svg",{className:i,viewBox:"0 0 120 40",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:e.jsx("path",{d:"M5,20 Q20,5 35,20 T65,20 T95,20 T115,20"})}),fe=()=>{var q;const{username:i,userId:t}=K(),F=G();J();const[H,S]=B.useState("about"),[T,I]=B.useState(null);B.useEffect(()=>{d.auth.getSession().then(({data:{session:s}})=>{I((s==null?void 0:s.user)??null)})},[]);const{data:n,isLoading:P}=h({queryKey:["user-profile",i||t],queryFn:async()=>{let s=d.from("public_profiles").select("id, user_id, username, avatar_url, created_at");i?s=s.eq("username",i):t&&(s=s.eq("user_id",t));const{data:a,error:r}=await s.maybeSingle();if(r)throw r;return a},enabled:!!(i||t)}),{data:N}=h({queryKey:["user-quiz-submission",t],queryFn:async()=>{const{data:s}=await d.from("public_profiles").select("id").eq("user_id",t).maybeSingle();if(!s)return null;const{data:a,error:r}=await d.from("quiz_submissions").select("*").eq("profile_id",s.id).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(r)throw r;return a},enabled:!!t}),{data:x}=h({queryKey:["user-memberships",t],queryFn:async()=>{const{data:s,error:a}=await d.from("hustle_hub_memberships").select(` 7 hustle_id, 8 joined_at, 9 side_hustles ( 10 id, 11 name, 12 slug, 13 logo_url 14 ) 15 `).eq("user_id",t);if(a)throw a;return s},enabled:!!t}),{data:y}=h({queryKey:["user-hustle-signups",t],queryFn:async()=>{const{data:s,error:a}=await d.from("user_hustle_signups").select(` 16 hustle_id, 17 signed_up_at, 18 side_hustles ( 19 id, 20 name, 21 slug, 22 logo_url 23 ) 24 `).eq("user_id",t);if(a)throw a;return s},enabled:!!t}),{data:m}=h({queryKey:["user-threads",t],queryFn:async()=>{const{data:s,error:a}=await d.from("forum_threads").select(` 25 id, 26 title, 27 slug, 28 category, 29 likes_count, 30 replies_count, 31 created_at, 32 hustle_id, 33 side_hustles ( 34 name, 35 slug 36 ) 37 `).eq("author_id",t).order("created_at",{ascending:!1}).limit(10);if(a)throw a;return s},enabled:!!t}),{data:k}=h({queryKey:["user-replies",t],queryFn:async()=>{const{data:s,error:a}=await d.from("forum_replies").select(` 38 id, 39 content, 40 likes_count, 41 created_at, 42 thread_id, 43 forum_threads ( 44 id, 45 title, 46 slug, 47 hustle_id, 48 side_hustles ( 49 name, 50 slug 51 ) 52 ) 53 `).eq("author_id",t).order("created_at",{ascending:!1}).limit(10);if(a)throw a;return s},enabled:!!t}),l=(()=>{if(!(N!=null&&N.answers))return null;const s=N.answers;return{motivation:s.motivation,workTypes:s.workTypes,skills:s.successVision,earningsMilestone:s.earningsMilestone,hasVehicle:s.hasVehicle,locationPreference:s.locationPreference}})();if(P)return e.jsx("div",{className:"min-h-screen bg-[#FEF3E8] py-8 px-4",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx(b,{className:"h-8 w-32 mb-6"}),e.jsxs("div",{className:"flex items-center gap-6 mb-8",children:[e.jsx(b,{className:"w-24 h-24 rounded-full"}),e.jsxs("div",{children:[e.jsx(b,{className:"h-8 w-48 mb-2"}),e.jsx(b,{className:"h-4 w-32"})]})]}),e.jsx(b,{className:"h-64 w-full"})]})});if(!n)return e.jsx("div",{className:"min-h-screen bg-[#FEF3E8] flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-black text-[#1a1a1a] uppercase mb-2",children:"User not found"}),e.jsx(_,{onClick:()=>F(-1),className:"bg-[#1a1a1a] text-white hover:bg-[#333]",children:"Go Back"})]})});const R={"extra-cash":"Extra Cash","replace-job":"Replace Job Income","build-business":"Build a Business","passion-project":"Passion Project","financial-freedom":"Financial Freedom"},V={"online-selling":"Online Selling",services:"Services",driving:"Driving/Delivery",content:"Content Creation",freelance:"Freelancing",rental:"Rental/Sharing"};return e.jsxs("div",{className:"min-h-screen bg-[#FEF3E8] relative overflow-hidden",children:[e.jsx(Q,{title:`${n.username||"Hustler"} | SideHustlr`,description:`Check out ${n.username||"this hustler"}'s SideHustlr profile.`,canonical:`/u/${n.username||""}`}),e.jsx($,{className:"absolute top-20 right-10 w-16 h-16 text-[#FF6B35]/20 animate-pulse hidden md:block"}),e.jsx(le,{className:"absolute top-40 left-10 w-10 h-10 text-[#70CC40]/30 hidden md:block"}),e.jsx($,{className:"absolute bottom-40 left-20 w-12 h-12 text-[#FF8000]/15 hidden md:block"}),e.jsx(ie,{className:"absolute bottom-20 right-20 w-32 h-12 text-[#FF6B35]/20 hidden md:block"}),e.jsx("div",{className:"relative z-10 py-8 px-4",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs(_,{variant:"ghost",size:"sm",onClick:()=>F(-1),className:"mb-6 text-[#1a1a1a] hover:bg-[#FF6B35]/10",children:[e.jsx(W,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsx(u,{className:"mb-6 border-2 border-[#1a1a1a] shadow-[4px_4px_0_#1a1a1a] bg-white",children:e.jsx(p,{className:"p-6 md:p-8",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:items-start gap-6",children:[e.jsxs(O,{className:"w-24 h-24 md:w-28 md:h-28 ring-4 ring-[#FF6B35]/20 ring-offset-2",children:[n.avatar_url&&e.jsx(Z,{src:n.avatar_url,alt:n.username||"User"}),e.jsx(Y,{className:"bg-[#FF6B35]/10 text-[#FF6B35] text-2xl font-black",children:((q=n.username)==null?void 0:q.slice(0,2).toUpperCase())||e.jsx(te,{className:"w-10 h-10"})})]}),e.jsxs("div",{className:"text-center sm:text-left flex-1",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-black text-[#1a1a1a] uppercase tracking-tight mb-2",children:n.username||"Anonymous Hustler"}),e.jsxs("p",{className:"text-[#666] text-sm mb-4",children:["Member since ",f(new Date(n.created_at||new Date),{addSuffix:!0})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 justify-center sm:justify-start mb-4",children:[x&&x.length>0&&e.jsxs(o,{className:"bg-[#FF6B35]/10 text-[#FF6B35] border-[#FF6B35]/30 flex items-center gap-1",children:[e.jsx(C,{className:"w-3 h-3"}),x.length," Communities"]}),m&&m.length>0&&e.jsxs(o,{variant:"outline",className:"border-[#1a1a1a] text-[#1a1a1a] flex items-center gap-1",children:[e.jsx(v,{className:"w-3 h-3"}),m.length," Posts"]})]}),T&&T.id!==t&&e.jsxs(_,{onClick:()=>{F(`/messages?userId=${t}`)},className:"bg-[#1a1a1a] text-white hover:bg-[#333] gap-2 rounded-full px-6",children:[e.jsx(X,{className:"w-4 h-4"}),"Send Message"]})]})]})})}),e.jsxs(se,{value:H,onValueChange:S,className:"space-y-4",children:[e.jsxs(ae,{className:"grid w-full grid-cols-2 bg-white border-2 border-[#1a1a1a] shadow-[2px_2px_0_#1a1a1a] p-1",children:[e.jsx(L,{value:"about",className:"font-bold uppercase text-sm data-[state=active]:bg-[#FF6B35] data-[state=active]:text-white",children:"About"}),e.jsx(L,{value:"activity",className:"font-bold uppercase text-sm data-[state=active]:bg-[#FF6B35] data-[state=active]:text-white",children:"Activity"})]}),e.jsxs(M,{value:"about",className:"space-y-4",children:[e.jsxs(u,{className:"border-2 border-[#1a1a1a] shadow-[3px_3px_0_#1a1a1a] bg-white",children:[e.jsx(g,{children:e.jsxs(j,{className:"flex items-center gap-2 font-black text-[#1a1a1a] uppercase tracking-tight",children:[e.jsx(ee,{className:"w-5 h-5 text-[#FF6B35]"}),"Interests & Goals"]})}),e.jsx(p,{className:"space-y-4",children:l?e.jsxs(e.Fragment,{children:[l.motivation&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#666] mb-2 font-medium",children:"Motivation"}),e.jsxs(o,{className:"bg-[#70CC40]/10 text-[#4a9c2d] border-[#70CC40]/30",children:[e.jsx(re,{className:"w-3 h-3 mr-1"}),R[l.motivation]||l.motivation]})]}),l.workTypes&&Array.isArray(l.workTypes)&&l.workTypes.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#666] mb-2 font-medium",children:"Work Interests"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:l.workTypes.map(s=>e.jsx(o,{variant:"outline",className:"border-[#1a1a1a] text-[#1a1a1a]",children:V[s]||s},s))})]}),l.earningsMilestone&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#666] mb-2 font-medium",children:"Earnings Goal"}),e.jsxs(o,{className:"bg-[#FF8000]/10 text-[#FF6B35] border-[#FF8000]/30",children:[l.earningsMilestone==="500"&&"$500/month",l.earningsMilestone==="1000"&&"$1,000/month",l.earningsMilestone==="2500"&&"$2,500/month",l.earningsMilestone==="5000"&&"$5,000+/month"]})]}),l.skills&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#666] mb-2 font-medium",children:"Vision"}),e.jsxs("p",{className:"text-[#1a1a1a] text-sm italic bg-[#fdf5d8] p-3 rounded-lg border border-[#e5d9a8]",children:['"',l.skills,'"']})]})]}):e.jsx("p",{className:"text-[#666]",children:"No quiz information available."})})]}),e.jsxs(u,{className:"border-2 border-[#1a1a1a] shadow-[3px_3px_0_#1a1a1a] bg-white",children:[e.jsx(g,{children:e.jsxs(j,{className:"flex items-center gap-2 font-black text-[#1a1a1a] uppercase tracking-tight",children:[e.jsx(U,{className:"w-5 h-5 text-[#FF6B35]"}),"Side Hustles"]})}),e.jsx(p,{children:y&&y.length>0?e.jsx("div",{className:"grid gap-3",children:y.map(s=>{var a,r,c;return e.jsxs(w,{to:`/hustle/${((a=s.side_hustles)==null?void 0:a.slug)||s.hustle_id}`,className:"flex items-center gap-3 p-3 rounded-lg border-2 border-transparent hover:border-[#FF6B35]/50 hover:bg-[#FEF3E8] transition-all",children:[(r=s.side_hustles)!=null&&r.logo_url?e.jsx("img",{src:s.side_hustles.logo_url,alt:s.side_hustles.name,className:"w-10 h-10 rounded-lg object-cover"}):e.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#FF6B35]/10 flex items-center justify-center",children:e.jsx(U,{className:"w-5 h-5 text-[#FF6B35]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-[#1a1a1a]",children:(c=s.side_hustles)==null?void 0:c.name}),e.jsxs("p",{className:"text-xs text-[#666]",children:["Signed up ",f(new Date(s.signed_up_at),{addSuffix:!0})]})]})]},s.hustle_id)})}):e.jsx("p",{className:"text-[#666]",children:"No side hustles yet."})})]}),e.jsxs(u,{className:"border-2 border-[#1a1a1a] shadow-[3px_3px_0_#1a1a1a] bg-white",children:[e.jsx(g,{children:e.jsxs(j,{className:"flex items-center gap-2 font-black text-[#1a1a1a] uppercase tracking-tight",children:[e.jsx(C,{className:"w-5 h-5 text-[#FF6B35]"}),"Communities Joined"]})}),e.jsx(p,{children:x&&x.length>0?e.jsx("div",{className:"grid gap-3",children:x.map(s=>{var a,r,c;return e.jsxs(w,{to:`/hub/${((a=s.side_hustles)==null?void 0:a.slug)||s.hustle_id}`,className:"flex items-center gap-3 p-3 rounded-lg border-2 border-transparent hover:border-[#FF6B35]/50 hover:bg-[#FEF3E8] transition-all",children:[(r=s.side_hustles)!=null&&r.logo_url?e.jsx("img",{src:s.side_hustles.logo_url,alt:s.side_hustles.name,className:"w-10 h-10 rounded-lg object-cover"}):e.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#FF6B35]/10 flex items-center justify-center",children:e.jsx(C,{className:"w-5 h-5 text-[#FF6B35]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-[#1a1a1a]",children:(c=s.side_hustles)==null?void 0:c.name}),e.jsxs("p",{className:"text-xs text-[#666]",children:["Joined ",f(new Date(s.joined_at),{addSuffix:!0})]})]})]},s.hustle_id)})}):e.jsx("p",{className:"text-[#666]",children:"Not a member of any communities yet."})})]}),e.jsx("div",{className:"flex justify-center pt-4",children:e.jsxs(_,{onClick:()=>S("activity"),className:"gap-2 bg-[#1a1a1a] text-white hover:bg-[#333] rounded-full px-8",children:[e.jsx(v,{className:"w-4 h-4"}),"Show Activity"]})})]}),e.jsxs(M,{value:"activity",className:"space-y-4",children:[e.jsxs(u,{className:"border-2 border-[#1a1a1a] shadow-[3px_3px_0_#1a1a1a] bg-white",children:[e.jsx(g,{children:e.jsxs(j,{className:"flex items-center gap-2 font-black text-[#1a1a1a] uppercase tracking-tight",children:[e.jsx(v,{className:"w-5 h-5 text-[#FF6B35]"}),"Recent Posts"]})}),e.jsx(p,{children:m&&m.length>0?e.jsx("div",{className:"space-y-3",children:m.map(s=>{var a,r;return e.jsx(w,{to:A(s,(a=s.side_hustles)==null?void 0:a.slug),className:"block p-3 rounded-lg border-2 border-transparent hover:border-[#FF6B35]/50 hover:bg-[#FEF3E8] transition-all",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-bold text-[#1a1a1a] truncate",children:s.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(o,{variant:"outline",className:"text-xs border-[#1a1a1a] text-[#1a1a1a]",children:(r=s.side_hustles)==null?void 0:r.name}),e.jsxs("span",{className:"text-xs text-[#666]",children:[s.replies_count," replies ⢠",s.likes_count," likes"]}
53)]})]}),e.jsxs("span",{className:"text-xs text-[#666] whitespace-nowrap",children:[e.jsx(D,{className:"w-3 h-3 inline mr-1"}),f(new Date(s.created_at),{addSuffix:!0})]})]})},s.id)})}):e.jsx("p",{className:"text-[#666]",children:"No posts yet."})})]}),e.jsxs(u,{className:"border-2 border-[#1a1a1a] shadow-[3px_3px_0_#1a1a1a] bg-white",children:[e.jsx(g,{children:e.jsxs(j,{className:"flex items-center gap-2 font-black text-[#1a1a1a] uppercase tracking-tight",children:[e.jsx(v,{className:"w-5 h-5 text-[#70CC40]"}),"Recent Replies"]})}),e.jsx(p,{children:k&&k.length>0?e.jsx("div",{className:"space-y-3",children:k.map(s=>{var a,r,c,E;return e.jsxs(w,{to:A({id:s.thread_id,slug:(a=s.forum_threads)==null?void 0:a.slug},(c=(r=s.forum_threads)==null?void 0:r.side_hustles)==null?void 0:c.slug),className:"block p-3 rounded-lg border-2 border-transparent hover:border-[#FF6B35]/50 hover:bg-[#FEF3E8] transition-all",children:[e.jsx("p",{className:"text-sm text-[#1a1a1a] line-clamp-2 mb-2",children:s.content}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(o,{variant:"outline",className:"text-xs border-[#1a1a1a] text-[#1a1a1a]",children:["Re: ",(E=s.forum_threads)==null?void 0:E.title]}),e.jsxs("span",{className:"text-xs text-[#666]",children:[s.likes_count," likes"]}),e.jsxs("span",{className:"text-xs text-[#666]",children:[e.jsx(D,{className:"w-3 h-3 inline mr-1"}),f(new Date(s.created_at),{addSuffix:!0})]})]})]},s.id)})}):e.jsx("p",{className:"text-[#666]",children:"No replies yet."})})]})]})]})]})})]})};export{fe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.