import { computed as h, ref as S, createElementBlock as r, openBlock as n, createElementVNode as k, createVNode as u, toDisplayString as a, unref as o, TransitionGroup as g, withCtx as _, Fragment as b, renderList as x, withModifiers as i, createCommentVNode as y, withDirectives as $, createBlock as N, vShow as V } from "vue";
import { useColor as A, useUser as D, useReaction as E, useReactions as P, countRating as z } from "./composables-BAZQlC3e.js";
import { PostReactionButton as F, AccountBadge as G } from "./components.js";
const L = { class: "p-1 flex flex-wrap gap-2 items-center" }, M = { class: "p-2 font-bold" }, O = ["onClick"], T = {
  key: 0,
  class: "pl-2 text-xl"
}, U = ["onClick"], K = {
  __name: "PostActionReact",
  props: {
    authors: { type: Object, default: () => ({}) },
    hash: { type: String, default: "" },
    tag: { type: String, default: "" },
    back: Boolean
  },
  emits: ["react", "user"],
  setup(d) {
    const l = d;
    A("deep");
    const { user: C } = D(), { reaction: w, react: p } = E({ ...l }), B = h(() => P(l.authors)), f = h(() => z(l.authors)), c = S();
    return (R, m) => {
      var v;
      return n(), r("div", L, [
        k("div", M, a(f.value > 0 ? "+" : "") + a(f.value), 1),
        u(o(F), {
          "is-my": (v = d.authors) == null ? void 0 : v[o(C).pub],
          reaction: o(w),
          onReact: m[0] || (m[0] = (s) => o(p)(s))
        }, null, 8, ["is-my", "reaction"]),
        u(g, { name: "fade" }, {
          default: _(() => [
            (n(!0), r(b, null, x(B.value, (s, e) => (n(), r("div", {
              class: "p-2px flex items-center rounded-3xl bg-light-500 dark-bg-dark-600 gap-1",
              key: e,
              onClick: i((t) => o(p)(e), ["stop", "prevent"])
            }, [
              e !== "true" ? (n(), r("div", T, a(e), 1)) : y("", !0),
              k("div", {
                class: "font-bold px-1",
                onClick: i((t) => c.value = c.value ? null : e, ["stop", "prevent"])
              }, a(s.length), 9, U),
              u(g, { name: "fade" }, {
                default: _(() => [
                  4 > s.length || c.value == e ? (n(!0), r(b, { key: 0 }, x(s, (t) => $((n(), N(o(G), {
                    class: "rounded-full shadow-md min-w-6",
                    key: t,
                    size: 20,
                    selectable: !0,
                    pub: t,
                    "show-name": !1,
                    onClick: i((q) => R.$emit("user", t), ["stop", "prevent"])
                  }, null, 8, ["pub", "onClick"])), [
                    [V, t]
                  ])), 128)) : y("", !0)
                ]),
                _: 2
              }, 1024)
            ], 8, O))), 128))
          ]),
          _: 1
        })
      ]);
    };
  }
};
export {
  K as default
};
//# sourceMappingURL=PostActionReact-B_ouDbi5.js.map
