import { defineComponent as b, computed as a, createElementBlock as y, openBlock as h, createVNode as k, createElementVNode as n, unref as t } from "vue";
import { useUser as g, useColor as v, useAvatar as x, selectedUser as S } from "./composables-BAZQlC3e.js";
import { SpaceStatus as w } from "./components.js";
const N = ["opacity"], O = ["fill", "stroke"], U = ["xlink:href"], B = 1e4, z = /* @__PURE__ */ b({
  __name: "SpaceGuest",
  props: {
    pub: { type: String, default: "" },
    status: { type: String, default: "" },
    pos: { type: Object, default: () => ({ x: 0, y: 0 }) },
    mouse: { type: Object, default: () => ({ x: 0, y: 0 }) },
    pulse: { type: Number, default: 0 },
    size: { type: Number, default: 100 }
  },
  emits: ["updateStatus"],
  setup(e) {
    const o = e, { user: r } = g(), i = a(() => Date.now() - Number(o.pulse)), p = a(() => i.value > B), c = v(), l = a(() => c.hex(o.pub)), { avatar: d, blink: m } = x(() => o.pub, () => o.size);
    return (f, s) => (h(), y("g", {
      class: "guest",
      opacity: p.value ? 0.1 : 1
    }, [
      k(t(w), {
        class: "opacity-20 hover-opacity-90 transition font-mono",
        content: e.status,
        onUpdate: s[0] || (s[0] = (u) => f.$emit("updateStatus", u)),
        editable: t(r).pub == e.pub,
        "max-row-length": 30,
        "line-height": 22
      }, null, 8, ["content", "editable"]),
      n("g", {
        class: "avatar",
        onClick: s[1] || (s[1] = (u) => t(S).pub = e.pub)
      }, [
        n("circle", {
          class: "transition duration-1000 ease-out",
          style: { filter: "url(#shadowButton)" },
          r: 26,
          fill: l.value,
          "stroke-width": "8",
          "stroke-opacity": "0.5",
          stroke: t(m) ? l.value : "transparent"
        }, null, 8, O),
        n("image", {
          "xlink:href": t(d),
          x: "-25",
          y: "-25",
          height: "50",
          width: "50",
          "clip-path": "url(#mask)"
        }, null, 8, U)
      ])
    ], 8, N));
  }
});
export {
  z as default
};
//# sourceMappingURL=SpaceGuest-b_FYBZU8.js.map
