import { CommonError as f } from "./accelbyte-widgets124.mjs";
import { ArrowIcon as p, ArrowIconStyles as u } from "./accelbyte-widgets125.mjs";
import { Loading as N } from "./accelbyte-widgets136.mjs";
import { ProfileImage as E } from "./accelbyte-widgets305.mjs";
import l from "classnames";
import { EligibleUser as d } from "@accelbyte/sdk-iam";
import e from "react";
import "./accelbyte-widgets306.mjs";
import { Ctx as g } from "./accelbyte-widgets33.mjs";
import { FeatureFlags as y } from "./accelbyte-widgets57.mjs";
const U = ({
  user: r,
  userProfile: a,
  isFetching: o,
  wallet: m,
  error: t,
  toggleMenu: n,
  isMenuShown: i,
  isDisableUsername: s
}) => {
  const c = () => d.safeParse(r).success ? s ? r.displayName || r.userName : r.userName || r.displayName : null;
  return /* @__PURE__ */ e.createElement("div", { className: l("userProfileDropdown", i && "open"), onClick: () => n() }, !o && t && /* @__PURE__ */ e.createElement(f, { error: t }), !o && !t && a ? /* @__PURE__ */ e.createElement(e.Fragment, null, g.hasFeature(y.isAvatarVisible) && /* @__PURE__ */ e.createElement(E, { imageLink: a && a.avatarUrl || "", className: "userProfileImage" }), /* @__PURE__ */ e.createElement("div", { className: "userProfileContainer" }, /* @__PURE__ */ e.createElement("p", { className: "userProfileDisplayName" }, c()), m && /* @__PURE__ */ e.createElement("p", { className: "userProfileWallet" }, m.currencySymbol, " ", m.balance)), /* @__PURE__ */ e.createElement(p, { className: l(u.down, "arrowSize") })) : /* @__PURE__ */ e.createElement(N, null));
};
export {
  U as UserProfileContainer
};
