import { createElementBlock as s, openBlock as t, createElementVNode as n, createBlock as d, createCommentVNode as f, unref as e, withCtx as g, withModifiers as v } from "vue";
import { currentRoom as _, useRoom as b, useUser as k, useRoomLogo as x } from "./composables-BAZQlC3e.js";
import { FormPicture as y } from "./components.js";
const h = { class: "flex flex-col relative items-center justify-center" }, R = ["src"], L = { class: "text-2xl" }, N = {
  key: 0,
  class: "i-la-camera"
}, E = {
  __name: "RoomLogo",
  props: {
    pub: { type: String, default: _.pub },
    size: { type: Number, default: 120 },
    pic: { type: Number, default: 200 }
  },
  setup(u) {
    const { room: c, updateRoomProfile: B } = b(), { user: p } = k(), r = u, { logo: i, uploadLogo: a, removeLogo: m } = x(r.pub);
    return (C, o) => (t(), s("div", h, [
      n("img", {
        src: e(i) || "https://gun-vue.js.org/media/gun-vue-logo.svg"
      }, null, 8, R),
      e(c).hosts[e(p).pub] ? (t(), d(e(y), {
        key: 0,
        class: "absolute",
        options: { picSize: r.pic, preserveRatio: !1 },
        onUpdate: o[1] || (o[1] = (l) => e(a)(l))
      }, {
        default: g(() => [
          n("div", L, [
            e(i) ? (t(), s("div", {
              key: 1,
              class: "i-la-trash-alt",
              onClick: o[0] || (o[0] = v((l) => e(m)(), ["stop", "prevent"]))
            })) : (t(), s("div", N))
          ])
        ]),
        _: 1
      }, 8, ["options"])) : f("", !0)
    ]));
  }
};
export {
  E as default
};
//# sourceMappingURL=RoomLogo-LZZI2L0J.js.map
