import { defineComponent as m, openBlock as o, createElementBlock as l, normalizeStyle as h, unref as s, normalizeClass as a, renderSlot as y, Fragment as d, createCommentVNode as f, createElementVNode as n } from "vue";
import { useTheme as _ } from "../../composables/useTheme.js";
const g = /* @__PURE__ */ n("line", {
  x1: "12",
  y1: "5",
  x2: "12",
  y2: "19"
}, null, -1), k = /* @__PURE__ */ n("polyline", { points: "19 12 12 19 5 12" }, null, -1), v = /* @__PURE__ */ n("line", {
  x1: "12",
  y1: "19",
  x2: "12",
  y2: "5"
}, null, -1), b = /* @__PURE__ */ n("polyline", { points: "5 12 12 5 19 12" }, null, -1), B = {
  key: 2,
  d: "m3 9l4-4l4 4M7 5v14m14-4l-4 4l-4-4m4 4V5"
}, r = {
  sort: [1, -1, void 0],
  textAlign: ["left", "center", "right", "justify"]
}, x = {
  sort: {
    type: Number,
    validator: (t) => r.sort.includes(t)
  },
  sortable: Boolean,
  textAlign: {
    type: String,
    default: "left",
    validator: (t) => r.textAlign.includes(t)
  },
  stickyHeader: Boolean
}, C = { name: "XTableHeader", validators: r }, S = /* @__PURE__ */ m({
  ...C,
  props: x,
  setup(t) {
    const c = t, { styles: u, classes: i, className: p } = _("TableHeader", {}, c);
    return (e, H) => (o(), l("th", {
      style: h(s(u)),
      class: a([s(p), s(i).th, "group/th"])
    }, [
      y(e.$slots, "default"),
      e.sortable ? (o(), l("svg", {
        key: 0,
        class: a([
          s(i).sortIcon,
          [e.sort && [1, -1].includes(e.sort) ? "" : "invisible group-hover/th:visible"]
        ]),
        width: "24",
        height: "24",
        viewBox: "0 0 24 24",
        stroke: "currentColor",
        "stroke-linejoin": "round",
        "stroke-linecap": "round",
        fill: "none",
        role: "presentation"
      }, [
        e.sort === -1 ? (o(), l(d, { key: 0 }, [
          g,
          k
        ], 64)) : e.sort === 1 ? (o(), l(d, { key: 1 }, [
          v,
          b
        ], 64)) : (o(), l("path", B))
      ], 2)) : f("", !0)
    ], 6));
  }
});
export {
  S as default
};
