PageSourceSearch

https://tesana.com/assets/ProfilePage-CleJEpXl.js

js tesana.com collected 2026-10-09 22:39:49 UTC 12,211 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-motion-hRg_q8lq.js";import{a0 as m,ao as te,b as oe,u as U,aR as ae,aS as ie,L as j,d as q,H as ne,T as le,C as de}from"./index-BKzE8EQ8.js";import{b as me,r as l}from"./vendor-react-E98sgxjj.js";import{q as O,b as ce,u as h,a as ue}from"./vendor-query-bOUN_gKe.js";import{du as v}from"./vendor-fa-Bn2dnpnC.js";import pe from"./DashboardLayout-CkgbJsW1.js";import{P as xe,L as fe}from"./LandingFooter-DjCjfhwD.js";import{A as ge}from"./index-BxtVm1Yj.js";import{E as G}from"./ExploreGameCard-CoU7JXPp.js";import{A as R}from"./Avatar-B60wpoS5.js";import{G as I}from"./GameCardSkeleton-DXy1eHov.js";import he from"./ShareModal-YOmfr9ti.js";import{E as je}from"./exploreLaunch-BPkNcOSK.js";import"./useLocaleNavigate-BNriJdRU.js";import"./SidebarContext-BL6EZ3Xi.js";import"./Tooltip-C8AvPGtA.js";import"./SiteBanner-DKwegxEe.js";import"./index-i1nPji9k.js";import"./paywall-CG7xVZtx.js";import"./plans-CbMJY2XS.js";import"./pricingExperiments-zMZby8z7.js";import"./organization-BuGhuc22.js";import"./useDevModelsVisible-BHgONHQI.js";import"./UserAvatarMenu-BoKKInby.js";import"./tabBarStore-624ukDKJ.js";import"./socialLinks-DmmZmq5v.js";import"./exploreHandoff-RQymaHkp.js";import"./AuthShell-DPeun0C_.js";import"./AuthPanel-B4zt6SJ5.js";import"./pendingReferral-B4JPXhl_.js";import"./LaunchPromoClips-eRoWsyBt.js";import"./MediaImage-DKgx-nW4.js";import"./MediaVideo-CBR0-TKg.js";import"./BadgeRow-Dfwgl-tB.js";import"./PlayingNowBadge-CH2HUoBo.js";import"./playingNowApi-CB_pr25U.js";import"./AdminGameMenu-DlEcDyIv.js";import"./useIsStaff-DZf24Ivp.js";import"./MakeCopy-DWExybqc.js";import"./SubmitVideoModal-DzX5MAqQ.js";import"./earnProgram-B9pqjKbP.js";import"./trailerShare-BGlMG0RV.js";import"./usePublishingFeatures-C8zY31rs.js";const be=o=>O({queryKey:["user-profile",o],queryFn:()=>m.getUserProfile(o)}),we=(o,r)=>O({queryKey:["user-games",o,r],queryFn:()=>m.getUserGames(o,{sort:r,limit:100})});function ye(o){if(typeof window>"u"||!o)return"";const r=new URL(window.location.href);return r.pathname=`/u/${o}`,r.search="",r.hash="",r.toString()}function ve(){return e.jsxs("div",{className:"px-4 md:px-8 pt-22 md:pt-8 pb-12 max-w-[1280px] mx-auto",children:[e.jsxs("div",{className:"mb-8 flex items-start gap-4",children:[e.jsx("div",{className:"h-20 w-20 rounded-full bg-foreground
1/10 animate-pulse"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"h-7 w-48 max-w-full rounded-md bg-foreground/10 animate-pulse"}),e.jsx("div",{className:"mt-2 h-4 w-72 max-w-full rounded bg-foreground/10 animate-pulse"}),e.jsx("div",{className:"mt-3 h-4 w-60 max-w-full rounded bg-foreground/10 animate-pulse"})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-8",children:e.jsx(I,{count:6})})]})}function us(){const o=te(),{username:r}=me(),{user:c,isAuthenticated:u}=oe(),p=ce(),[x,n]=l.useState("recent"),[N,S]=l.useState(!1),[F,k]=l.useState(!1),[$,C]=l.useState(!1),[K,Q]=l.useState("signup"),[z,L]=l.useState(!1),{t}=U("explore"),f=c?.username===r;l.useEffect(()=>{r&&ae(r,f)},[r,f]);const{data:s,isLoading:H,error:Y}=h({...be(r??""),enabled:!!r}),{data:V,isLoading:B}=h({...we(r??"",x),enabled:!!r}),{data:J,isLoading:X}=h({queryKey:["user-followers",r],queryFn:()=>m.getFollowers(r,{limit:100}),enabled:!!r&&N}),{data:W,isLoading:Z}=h({queryKey:["user-following",r],queryFn:()=>m.getFollowing(r,{limit:100}),enabled:!!r&&F}),b=ue({mutationFn:()=>m.toggleFollow(r),onSuccess:a=>{r&&ie(r,a.is_following),p.invalidateQueries({queryKey:["user-profile",r]})}}),w=(a="signup")=>{Q(a),C(!0)},ee=()=>{if(!u){w();return}b.mutate()},se=[{value:"recent",label:t("profile.sortRecent")},{value:"plays",label:t("profile.sortMostPlayed")},{value:"favorites",label:t("profile.sortMostFavorited")}],_=a=>new Date(a).toLocaleDateString("en-US",{month:"long",year:"numeric"}),re=new Set((s?.pinned_games??[]).map(a=>a.id)),P=(V?.games??[]).filter(a=>!re.has(a.id)),M=(()=>{if(H)return e.jsx(ve,{});if(Y||!s)return e.jsx("div",{className:"px-4 md:px-8 pt-22 md:pt-8 pb-12 max-w-[1280px] mx-auto",children:e.jsxs("div",{className:"flex flex-col items-center justify-center h-[60vh] text-center",children:[e.jsx("h1",{className:"text-h3-sm md:text-h3 text-foreground mb-2",children:t("profile.userNotFound")}),e.jsx("p",{className:"text-base text-muted-foreground mb-4",children:t("profile.profileDoesntExist")}),e.jsx(j,{to:je,className:"text-accent hover:underline",children:t("profile.exploreGamesInstead")})]})});const a=s.biography?.trim()?s.biography:t("profile.memberSince",{date:_(s.member_since)});return e.jsxs("div",{className:"px-4 md:px-8 pt-22 md:pt-8 pb-12 max-w-[1280px] mx-auto",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-6",children:[e.jsxs("div",{className:"flex items-start gap-4 min-w-0",children:[e.jsx(R,{user:{username:s.username,profile_picture:s.profile_picture},size:"xl"}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-h3-sm md:text-h3 text-foreground",children:["@",s.username]}),e.jsx("p",{className:"text-base text-muted-foreground mt-1 whitespace-pre-wrap break-words",children:a}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted-foreground mt-3",children:[e.jsx("span",{children:t("profile.gamesCount",{count:s.games_count})}),e.jsx("span",{children:"·"}),e.jsx("span",{children:t("profile.playsCount",{count:s.total_plays})}),e.jsx("span",{children:"·"}),e.jsxs("button",{onClick:()=>S(!0),className:"hover:text-foreground transition-colors cursor-pointer",children:[e.jsx("strong",{className:"text-foreground",children:s.follower_count})," ",t("profile.followers")]}),e.jsx("span",{children:"·"}),e.jsxs("button",{onClick:()=>k(!0),className:"hover:text-foreground transition-colors cursor-pointer",children:[e.jsx("strong",{className:"text-foreground",children:s.following_count})," ",t("profile.followingLabel")]}),s.biography?.trim()&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t("profile.memberSince",{date:_(s.member_since)})})]})]})]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:f?e.jsxs(e.Fragment,{children:[e.jsx(j,{to:"/settings/account",className:"h-9 px-4 rounded-md text-sm text-foreground bg-foreground
1/6 hover:bg-foreground/10 transition-all cursor-pointer flex items-center",children:t("profile.editProfile")}),e.jsxs("button",{onClick:()=>L(!0),className:"h-9 px-4 rounded-md text-sm bg-foreground text-background hover:opacity-80 transition-all cursor-pointer flex items-center gap-2",children:[e.jsx(v,{icon:["far","share-nodes"],className:"text-sm"}),t("profile.share")]})]}):e.jsx("button",{onClick:ee,disabled:b.isPending,className:q("h-9 px-4 rounded-md text-sm transition-all cursor-pointer disabled:opacity-50 flex items-center",s.is_following?"text-foreground bg-foreground/6 hover:bg-foreground/10":"bg-foreground text-background hover:opacity-80"),children:b.isPending?"...":s.is_following?t("profile.followingState"):t("profile.follow")})})]})}),s.pinned_games.length>0&&e.jsxs("section",{className:"mb-12",children:[e.jsxs("h2",{className:"text-lg-sm md:text-lg text-foreground mb-4 flex items-center gap-2",children:[e.jsx(v,{icon:["fas","thumbtack"],className:"text-accent text-base"}),t("profile.pinnedGames")]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-8",children:s.pinned_games.map(i=>e.jsx(G,{game:i,showCreator:!1},i.id))})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-3 mb-6",children:[e.jsx("h2",{className:"text-lg-sm md:text-lg text-foreground",children:t("profile.allGames")}),e.jsx("div",{className:"flex items-center gap-2",children:se.map(i=>e.jsx("button",{onClick:()=>n(i.value),className:q("px-3 py-1.5 rounded-full text-sm transition-colors cursor-pointer",x===i.value?"bg-foreground text-background":"bg-secondary/60 text-muted-foreground hover:text-foreground hover:bg-secondary"),children:i.label},i.value))})]}),B?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-8",children:e.jsx(I,{count:6})}):P.length===0?e.jsxs("div",{className:"text-center py-12 bg-card rounded-md border border-border",children:[e.jsx("p",{className:"text-base text-muted-foreground mb-2",children:s.pinned_games.length>0?t("profile.noPublishedGames"):t("profile.noGamesYet")}),f&&e.jsx(j,{to:"/studio",className:"text-accent hover:underline",children:t("profile.createFirstGame")})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-8",children:P.map(i=>e.jsx(G,{game:i,showCreator:!1},i.id))})]})]})})(),y=s?.username?t("profile.pageTitle",{username:s.username}):t("profile.defaultPageTitle"),g=s?.biography?.trim()?s.biography:s?.username?t("profile.metaDescription",{username:s.username}):t("profile.defaultMetaDescription"),d=s?.profile_picture||void 0,A=s?{"@context":"https://schema.org","@type":"ProfilePage",url:o||void 0,mainEntity:{"@type":"Person",name:`@${s.username}`,alternateName:s.username,url:o||void 0,image:d,description:g}}:null,E=s?.username?e.jsxs(ne,{children:[e.jsx("title",{children:y}),e.jsx("meta",{name:"description",content:g}),o&&e.jsx("link",{rel:"canonical",href:o}),e.jsx("meta",{property:"og:title",content:y}),e.jsx("meta",{property:"og:description",content:g}),e.jsx("meta",{property:"og:type",content:"profile"}),o&&e.jsx("meta",{property:"og:url",content:o}),d&&e.jsx("meta",{property:"og:image",content:d}),e.jsx("meta",{name:"twitter:card",content:d?"summary":"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:y}),e.jsx("meta",{name:"twitter:description",content:g}),d&&e.jsx("meta",{name:"twitter:image",content:d}),A&&e.jsx("script",{type:"application/ld+json",children:JSON.stringify(A)})]}):null,D=e.jsxs(e.Fragment,{children:[N&&e.jsx(T,{title:t("profile.followersModalTitle"),emptyText:t("profile.noFollowersYet"),users:J?.users??[],isLoading:X,onClose:()=>S(!1)}),F&&e.jsx(T,{title:t("profile.followingModalTitle"),emptyText:t("profile.notFollowingAnyone"),users:W?.users??[],isLoading:Z,onClose:()=>k(!1)}),s&&e.jsx(he,{isOpen:z,onClose:()=>L(!1),title:`@${s.username}`,shareUrl:ye(s.username??r)||`${window.location.origin}/u/${s.username}`,previewImage:s.profile_picture||void 0})]});return u?e.jsxs(pe,{children:[E,M,D]}):e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[E,e.jsx(xe,{onAuthClick:a=>w(a||"signup"),skipScrolled:!0}),e.jsx(ge,{isOpen:$,onClose:()=>C(!1),initialMode:K}),e.jsx("div",{className:"pt-24",children:M}),D,e.jsx(fe,{handleAuthClick:a=>w(a||"signup")})]})}function T({title:o,emptyText:r,users:c,isLoading:u,onClose:p}){const{t:x}=U("explore");return e.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-card rounded-md border border-border w-full max-w-md max-h-[80vh] overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg text-foreground",children:o}),e.jsx("button",{onClick:p,"aria-label":o,className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(v,{icon:["far","xmark"]})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:u?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(le,{size:"md",overlayColor:de})}):c.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8",children:r}):e.jsx("div",{className:"space-y-3",children:c.map(n=>e.jsx(j,{to:`/u/${n.username}`,onClick:p,className:"flex items-center justify-between p-3 rounded-md hover:bg-foreground
1/4 transition-colors",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(R,{user:n,size:"md"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-foreground",children:["@",n.username]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:x("profile.gamesCount",{count:n.games_count})})]})]})},n.username))})})]})})}export{us 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.