try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`817a908d-a154-4dbe-8d1b-702301c2a3da`,e._sentryDebugIdIdentifier=`sentry-dbid-817a908d-a154-4dbe-8d1b-702301c2a3da`)}catch{}import"./rolldown-runtime-nx40z1zs.js";import{$m as e,Ag as t,Hm as n,Oi as r,Qh as i,Zm as a,_r as o,mp as s,ng as c,op as l}from"./entry.client-mpghtlrl.js";import{t as u}from"./GuidePageLayout-eh7novzv.js";import{t as d}from"./GuideIllustration-pex5y7xc.js";import{t as f}from"./GuideL2Header-a2pogkf0.js";import{n as p,t as m}from"./ProfileCardLoading-k9ac00on.js";import{t as h}from"./OtherUserProfileCard-kedqd0oe.js";var g=t(),_=c(),v=t=>{let r=(0,g.c)(25),{person:i,currentUser:a,isError:o,isOtherUserPending:s,isCurrentUserPending:c}=t,{locSomethingWentWrong:l,locGenericErrorSubheading:v}=n(),{t:y}=e(`Guide`),b=h.useComponent(),x;r[0]===y?x=r[1]:(x=y(`Profile`,{shortKey:`profile_dialog_description_fallback`}),r[0]=y,r[1]=x);let S=x;if(s||c){let e;r[2]===S?e=r[3]:(e=(0,_.jsx)(f,{description:S}),r[2]=S,r[3]=e);let t;r[4]===c?t=r[5]:(t=(0,_.jsx)(m,{isCurrentUserPending:c}),r[4]=c,r[5]=t);let n;return r[6]!==e||r[7]!==t?(n=(0,_.jsxs)(u,{id:`guide-profile-card-loading`,children:[e,t]}),r[6]=e,r[7]=t,r[8]=n):n=r[8],n}else if(o||!i||!a){let e;r[9]===S?e=r[10]:(e=(0,_.jsx)(f,{description:S}),r[9]=S,r[10]=e);let t;r[11]===l?t=r[12]:(t=l(),r[11]=l,r[12]=t);let n;r[13]===v?n=r[14]:(n=v(),r[13]=v,r[14]=n);let i;r[15]!==t||r[16]!==n?(i=(0,_.jsx)(d,{title:t,subtitle:n,illustrationType:`error`}),r[15]=t,r[16]=n,r[17]=i):i=r[17];let a;return r[18]!==e||r[19]!==i?(a=(0,_.jsxs)(u,{id:`guide-profile-card-error`,children:[e,i]}),r[18]=e,r[19]=i,r[20]=a):a=r[20],a}let C;return r[21]!==i||r[22]!==a.xuid||r[23]!==b?(C=(0,_.jsx)(_.Fragment,{children:i.xuid===a.xuid?(0,_.jsx)(p,{person:i}):(0,_.jsx)(b,{person:i})}),r[21]=i,r[22]=a.xuid,r[23]=b,r[24]=C):C=r[24],C},y=o(v,()=>{let{xuid:e}=s({from:l.dialog.guide.people.profileCard.id}),{profile:t}=a(),{data:n,isError:r,isPending:o}=i(t.queries.person.getActiveUserQuery().getOptions({xuid:e})),{data:c,isError:u,isPending:d}=i(t.queries.person.getActiveUserQuery().getOptions()),{isPending:f}=i(t.queries.profileBadges.getActiveUserQuery().getOptions({xuid:e}));return{person:n,currentUser:c,isError:r||u,isOtherUserPending:o||f,isCurrentUserPending:d}}),b=r(()=>(0,_.jsx)(y.useComponent(),{}),`ProfileCard`);export{b as ProfileCard,b as default,y as ProfileCardConnection,v as PureProfileCard};