import { defineComponent as V, toRef as z, computed as E, resolveComponent as t, openBlock as s, createElementBlock as b, createElementVNode as c, normalizeStyle as x, unref as o, createVNode as u, toDisplayString as g, createBlock as m, createCommentVNode as d, Fragment as y, renderList as N } from "vue";
import { useAccount as O, useUser as P, useBackground as R, useProjects as H } from "./composables-5f691338.js";
const I = { class: "flex flex-col rounded-3xl overflow-hidden shadow-xl" }, U = { class: "flex flex-col ml-4 mx-4" }, W = { class: "text-2xl font-bold" }, F = { class: "mt-2" }, K = /* @__PURE__ */ c("div", { class: "flex-1" }, null, -1), L = { class: "p-4 flex flex-col" }, M = /* @__PURE__ */ c("div", { class: "text-xl font-bold p-2 mt-4" }, "Projects", -1), T = { class: "flex flex-col gap-4" }, Q = /* @__PURE__ */ V({
  __name: "AccountHome",
  props: {
    pub: { type: String, default: "OKrDaDeD8VeA27d673RqlodSnebnaDq6Ci23Ys_ABWE.q8fI2lkxO46R8TMjeUeAf7I0yBS5mdH_Cb9_285Wkqk" }
  },
  emits: ["browse", "feed", "post", "chat", "user", "project"],
  setup(e) {
    const i = e, { account: a } = O(z(i, "pub")), { user: f } = P(), j = E(() => R({ pub: i.pub, size: 600, light: 0.5, draw: "circles" })), { projects: v } = H(i.pub);
    return (r, n) => {
      var k, _;
      const C = t("account-avatar"), h = t("mate-button"), w = t("chat-private-count"), $ = t("account-petname"), B = t("account-profile"), S = t("gift-wallets"), A = t("mate-list"), D = t("project-card"), q = t("account-reactions");
      return s(), b("div", I, [
        c("div", {
          class: "p-4 flex items-center bg-cover border-b-6",
          style: x({ borderColor: o(a).color, ...o(j) })
        }, [
          u(C, {
            pub: e.pub,
            size: 120,
            onClick: n[0] || (n[0] = (l) => r.$emit("user", e.pub))
          }, null, 8, ["pub"]),
          c("div", U, [
            c("div", W, g((k = o(a).profile) == null ? void 0 : k.name), 1),
            c("div", F, g((_ = o(a)) == null ? void 0 : _.lastSeen), 1)
          ]),
          K,
          u(h, {
            class: "m-4",
            pub: e.pub
          }, null, 8, ["pub"]),
          o(f).is ? (s(), m(w, {
            key: 0,
            pub: e.pub,
            onChat: n[1] || (n[1] = (l) => r.$emit("chat"))
          }, null, 8, ["pub"])) : d("", !0)
        ], 4),
        e.pub != o(f).pub ? (s(), m($, {
          key: 0,
          pub: e.pub,
          style: x({ backgroundColor: o(a).color })
        }, null, 8, ["pub", "style"])) : d("", !0),
        u(B, {
          class: "p-4",
          pub: e.pub
        }, null, 8, ["pub"]),
        c("div", L, [
          u(S, { pub: e.pub }, null, 8, ["pub"]),
          u(A, {
            pub: e.pub,
            onBrowse: n[2] || (n[2] = (l) => r.$emit("browse", l))
          }, null, 8, ["pub"]),
          Object.keys(o(v)).length > 0 ? (s(), b(y, { key: 0 }, [
            M,
            c("div", T, [
              (s(!0), b(y, null, N(o(v), (l, p) => (s(), m(D, {
                key: p,
                project: l,
                path: p + "@" + e.pub,
                onClick: (Y) => r.$emit("project", p + "@" + e.pub)
              }, null, 8, ["project", "path", "onClick"]))), 128))
            ]),
            u(q, {
              class: "m-2",
              pub: e.pub,
              onPost: n[3] || (n[3] = (l) => r.$emit("post", l))
            }, null, 8, ["pub"])
          ], 64)) : d("", !0)
        ])
      ]);
    };
  }
});
export {
  Q as default
};
//# sourceMappingURL=AccountHome-e22630ba.js.map
