import { useColor as _, usePost as N, computed as V, resolveComponent as $, openBlock as o, createElementBlock as l, createBaseVNode as c, normalizeStyle as b, unref as t, createCommentVNode as a, toDisplayString as v, createVNode as w, createBlock as D, renderSlot as T, pushScopeId as U, popScopeId as j } from "./composables-Ci32s3jE.js";
import { UiLink as z, PostActionReact as A } from "./components.js";
import { _export_sfc as E } from "./_plugin-vue_export-helper-DueaC3du.js";
const L = (s) => (U("data-v-452f279b"), s = s(), j(), s), O = {
  class: "flex flex-wrap items-center max-w-full w-full backdrop-blur-lg rounded-2xl bg-light-100 bg-opacity-80 dark-bg-dark-400 dark-bg-opacity-80 backdrop-blur-sm backdrop-filter shadow-md",
  style: { flex: "14 1 620px" }
}, R = {
  key: 0,
  class: "p-0",
  style: { flex: "1 1 40px" }
}, q = ["src"], F = {
  key: 1,
  class: "flex flex-col p-2 overflow-hidden",
  style: { flex: "10 1 280px" }
}, G = { class: "px-2" }, H = { class: "flex items-center" }, J = { class: "flex flex-col" }, K = {
  key: 0,
  class: "text-xl font-bold my-2"
}, M = {
  key: 1,
  class: "statement"
}, Q = /* @__PURE__ */ L(() => /* @__PURE__ */ c("div", { class: "flex-1" }, null, -1)), W = { class: "flex items-center flex-wrap items-center mt-2 gap-2" }, X = {
  key: 0,
  class: "i-la-youtube mx-1"
}, Y = {
  key: 1,
  class: "i-mdi-text-long mx-1"
}, Z = {
  key: 2,
  class: "flex gap-1 rounded-xl p-1 bg-dark-50 bg-opacity-20 flex-wrap items-center",
  style: { flex: "1 1 230px" }
}, ee = {
  __name: "PostCard",
  props: {
    hash: { type: String, default: "" },
    authors: { type: Object, default: () => ({}) },
    tag: { type: [String, Boolean], default: "" },
    back: Boolean,
    actions: { type: Boolean, default: !0 }
  },
  emits: ["user"],
  setup(s) {
    _("light");
    const S = _("deep"), B = s, { post: e } = N({ hash: B.hash }), C = V(() => e.icon || e.title || e.statement || e.link);
    return (n, d) => {
      var i, r, u, h, p, m, f, x, k, y, g;
      const I = $("post-link");
      return o(), l("div", {
        class: "card",
        style: b({ backgroundImage: `url(${((i = t(e)) == null ? void 0 : i.cover) || ((r = t(e)) == null ? void 0 : r.raw)})`, backgroundColor: t(S).hex(s.hash) })
      }, [
        c("div", {
          class: "p-0",
          style: b({ paddingTop: (u = t(e)) != null && u.cover || (h = t(e)) != null && h.raw ? "18em" : "0" })
        }, null, 4),
        c("div", O, [
          (p = t(e)) != null && p.icon ? (o(), l("div", R, [
            c("img", {
              class: "w-20 max-h-20 rounded-full m-2",
              src: t(e).icon,
              width: "40px"
            }, null, 8, q)
          ])) : a("", !0),
          C.value ? (o(), l("div", F, [
            c("div", G, [
              c("div", H, [
                c("div", J, [
                  (m = t(e)) != null && m.title ? (o(), l("div", K, v(t(e).title), 1)) : a("", !0),
                  (f = t(e)) != null && f.statement ? (o(), l("div", M, v(t(e).statement), 1)) : a("", !0)
                ]),
                Q,
                w(I, { hash: s.hash }, null, 8, ["hash"])
              ])
            ]),
            c("div", W, [
              (x = t(e)) != null && x.youtube ? (o(), l("div", X)) : a("", !0),
              (k = t(e)) != null && k.text ? (o(), l("div", Y)) : a("", !0),
              (y = t(e)) != null && y.link ? (o(), D(t(z), {
                key: 2,
                url: (g = t(e)) == null ? void 0 : g.link
              }, null, 8, ["url"])) : a("", !0),
              T(n.$slots, "default", {}, void 0, !0)
            ])
          ])) : a("", !0),
          s.actions ? (o(), l("div", Z, [
            w(t(A), {
              authors: s.authors,
              hash: s.hash,
              tag: s.tag,
              back: s.back,
              onUser: d[0] || (d[0] = (P) => n.$emit("user", P))
            }, null, 8, ["authors", "hash", "tag", "back"])
          ])) : a("", !0)
        ])
      ], 4);
    };
  }
}, le = /* @__PURE__ */ E(ee, [["__scopeId", "data-v-452f279b"]]);
export {
  le as default
};
//# sourceMappingURL=PostCard-CrvQXFSd.js.map
