import { defineComponent as m, useAccount as f, toRef as _, computed as b, usePrivateChat as g, resolveComponent as k, openBlock as v, createElementBlock as h, createBaseVNode as t, createVNode as o, unref as e, toDisplayString as u, renderSlot as x } from "./composables-9e873712.js";
import { AccountAvatar as C, ChatInput as S } from "./components.js";
const A = { class: "m-0 flex flex-col" }, B = { class: "flex-0 p-4 flex flex-wrap items-center" }, D = { class: "text-lg font-bold p-2" }, q = { class: "text-lg" }, y = /* @__PURE__ */ t("div", { class: "flex-1" }, null, -1), I = { class: "flex-0 bg-light-900 dark-bg-dark-600 p-4" }, $ = /* @__PURE__ */ m({
  __name: "ChatPrivate",
  props: {
    pub: {
      default: "OKrDaDeD8VeA27d673RqlodSnebnaDq6Ci23Ys_ABWE.q8fI2lkxO46R8TMjeUeAf7I0yBS5mdH_Cb9_285Wkqk",
      type: String
    }
  },
  emits: ["user"],
  setup(n) {
    const a = n, { account: l } = f(_(a, "pub")), r = b(() => g(a.pub));
    return (c, s) => {
      var d;
      const p = k("chat-messages");
      return v(), h("div", A, [
        t("div", B, [
          o(e(C), {
            pub: n.pub,
            onClick: s[0] || (s[0] = (i) => c.$emit("user"))
          }, null, 8, ["pub"]),
          t("div", D, u((d = e(l).profile) == null ? void 0 : d.name), 1),
          t("div", q, u(e(l).lastSeen), 1),
          y,
          x(c.$slots, "default")
        ]),
        o(p, {
          class: "bg-dark-50 dark-bg-dark-400",
          messages: e(r).sorted
        }, null, 8, ["messages"]),
        t("div", I, [
          o(e(S), {
            onSubmit: s[1] || (s[1] = (i) => e(r).send(i))
          })
        ])
      ]);
    };
  }
});
export {
  $ as default
};
//# sourceMappingURL=ChatPrivate-bb60b8d0.js.map
