import { createElementBlock as a, openBlock as s, normalizeStyle as p, unref as e, createElementVNode as l, toDisplayString as h, withModifiers as k, normalizeClass as v, Fragment as x, renderList as g, createBlock as C, createCommentVNode as b } from "vue";
import { useColor as y, useWord as w, useDictRecordsFor as D, letterFilter as $, dictRecord as r } from "./composables-BAZQlC3e.js";
import { DictDefCard as z } from "./components.js";
import { _export_sfc as B } from "./_plugin-vue_export-helper-DueaC3du.js";
const F = { class: "flex items-center rounded-lg capitalize mb-4" }, S = { class: "text-2xl font-bold" }, W = { class: "flex flex-wrap gap-2" }, E = {
  __name: "DictWordPage",
  props: {
    hash: { type: String, default: "" }
  },
  emits: ["def", "close"],
  setup(o) {
    const d = o, m = y("light"), { word: f } = w(d.hash), c = D(d.hash);
    return (u, t) => (s(), a("div", {
      class: "flex flex-col p-4 rounded-xl",
      style: p({ backgroundColor: e(m).hex(o.hash) })
    }, [
      l("div", F, [
        l("div", S, h(e($)(e(f))), 1),
        l("div", {
          class: v(["i-la-link link", { active: e(r).word == o.hash || e(c)[e(r).def] }]),
          onClick: t[0] || (t[0] = k((i) => e(r).word = e(r).word == o.hash ? null : o.hash, ["stop", "prevent"]))
        }, null, 2),
        t[3] || (t[3] = l("div", { class: "flex-1" }, null, -1)),
        l("button", {
          class: "cursor-pointer p-2",
          onClick: t[1] || (t[1] = (i) => u.$emit("close"))
        }, t[2] || (t[2] = [
          l("div", { class: "i-la-times text-xl" }, null, -1)
        ]))
      ]),
      l("div", W, [
        (s(!0), a(x, null, g(e(c), (i, n) => (s(), a("div", {
          class: "p-0",
          key: n
        }, [
          Object.keys(i).length > 0 ? (s(), C(e(z), {
            key: 0,
            class: "cursor-pointer",
            hash: n,
            onClick: (N) => u.$emit("def", n)
          }, null, 8, ["hash", "onClick"])) : b("", !0)
        ]))), 128))
      ])
    ], 4));
  }
}, I = /* @__PURE__ */ B(E, [["__scopeId", "data-v-bb42b76c"]]);
export {
  I as default
};
//# sourceMappingURL=DictWordPage-BqT3_U3K.js.map
