import { defineComponent as m, useAccount as f, toRef as _, computed as b, usePrivateChat as g, resolveComponent as k, openBlock as v, createElementBlock as x, createBaseVNode as s, createVNode as o, unref as e, toDisplayString as i } from "./composables-078fa750.js";
import { AccountAvatar as h, ChatInput as C } from "./components.js";
const A = { class: "m-0 flex flex-col" }, S = { class: "flex-0 p-4 flex flex-wrap items-center" }, B = { class: "text-lg font-bold p-2" }, D = { class: "text-lg" }, q = { class: "flex-0 bg-light-900 dark-bg-dark-600 p-4" }, R = /* @__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 (p, t) => {
      var c;
      const u = k("chat-messages");
      return v(), x("div", A, [
        s("div", S, [
          o(e(h), {
            pub: n.pub,
            onClick: t[0] || (t[0] = (d) => p.$emit("user"))
          }, null, 8, ["pub"]),
          s("div", B, i((c = e(l).profile) == null ? void 0 : c.name), 1),
          s("div", D, i(e(l).lastSeen), 1)
        ]),
        o(u, {
          class: "bg-dark-50 dark-bg-dark-400",
          messages: e(r).sorted
        }, null, 8, ["messages"]),
        s("div", q, [
          o(e(C), {
            onSubmit: t[1] || (t[1] = (d) => e(r).send(d))
          })
        ])
      ]);
    };
  }
});
export {
  R as default
};
//# sourceMappingURL=ChatPrivate-048b4073.js.map
