import '@das-fed/upf-ui/packages/components/time-line/style.css';
import { withInstall as $ } from "@das-fed/upf-utils/with-install/index";
import { defineComponent as v, provide as E, reactive as N, openBlock as d, createElementBlock as B, createVNode as w, unref as I, mergeProps as k, withCtx as u, renderSlot as a, ref as F, inject as S, onMounted as W, createBlock as L, createElementVNode as r, normalizeStyle as P } from "vue";
import "ant-design-vue/es/timeline/style/css";
import { Timeline as V, TimelineItem as j } from "ant-design-vue";
const z = { class: "das-ui-time-line" }, M = /* @__PURE__ */ v({
  __name: "Index",
  props: {
    layoutType: { default: "right" },
    alignWidth: { default: "" },
    isThrough: { type: Boolean, default: !1 }
  },
  setup(t) {
    return E("DasForm", N({ props: t })), (o, n) => (d(), B("div", z, [
      w(I(V), k(o.$attrs, {
        class: ["timeline-layout", "timeline-layout-" + t.layoutType, { "top-through": t.isThrough }]
      }), {
        default: u(() => [
          a(o.$slots, "default", {}, void 0, !0)
        ]),
        _: 3
        /* FORWARDED */
      }, 16, ["class"])
    ]));
  }
}), C = (t, e) => {
  const o = t.__vccOpts || t;
  for (const [n, l] of e)
    o[n] = l;
  return o;
}, O = /* @__PURE__ */ C(M, [["__scopeId", "data-v-c498830a"]]), q = { class: "das-timeline-dot-wrap" }, x = { class: "das-timeline-label-left" }, G = { class: "das-timeline-label-right" }, H = /* @__PURE__ */ v({
  __name: "TimelineItem",
  props: {
    dotSlot: { type: Boolean, default: !1 },
    color: { default: "#276FF5" },
    layoutType: { default: "right" },
    alignWidth: { default: "" }
  },
  setup(t) {
    const e = F(null), n = S("DasForm").props, l = n.alignWidth, c = n.layoutType;
    return W(() => {
      var s, i, f, m, p, y, h, g, b;
      if (l !== "") {
        (s = e == null ? void 0 : e.value) == null || s.$el;
        const T = (f = (i = e == null ? void 0 : e.value) == null ? void 0 : i.$el) == null ? void 0 : f.getElementsByClassName("ant-timeline-item-tail")[0], _ = (p = (m = e == null ? void 0 : e.value) == null ? void 0 : m.$el) == null ? void 0 : p.getElementsByClassName("ant-timeline-item-head")[0], D = (h = (y = e == null ? void 0 : e.value) == null ? void 0 : y.$el) == null ? void 0 : h.getElementsByClassName("das-timeline-label-left")[0], A = (b = (g = e == null ? void 0 : e.value) == null ? void 0 : g.$el) == null ? void 0 : b.getElementsByClassName("das-timeline-label-right")[0];
        c === "double-left" ? (T.setAttribute(
          "style",
          `
          left:${l};
        `
        ), _.setAttribute(
          "style",
          `
          left:${l};
        `
        ), D.setAttribute(
          "style",
          `
          width:${l};
        `
        )) : c === "double-right" && (T.setAttribute(
          "style",
          `
          left:calc(100% - ${l});
        `
        ), _.setAttribute(
          "style",
          `
        left:calc(100% - ${l});
        `
        ), A.setAttribute(
          "style",
          `
          width:${l};
        `
        ));
      }
    }), (s, i) => (d(), L(
      I(j),
      k({
        ref_key: "$timelineitem",
        ref: e
      }, s.$attrs, { class: ["das-timeline-item"] }),
      {
        dot: u(() => [
          r("span", q, [
            t.dotSlot ? a(s.$slots, "dot", { key: 0 }, void 0, !0) : (d(), B(
              "span",
              {
                key: 1,
                class: "das-timeline-dot-custom",
                style: P({ "background-color": t.color })
              },
              null,
              4
              /* STYLE */
            ))
          ])
        ]),
        default: u(() => [
          r("span", x, [
            a(s.$slots, "left", {}, void 0, !0),
            a(s.$slots, "default", {}, void 0, !0)
          ]),
          i[0] || (i[0] = r(
            "span",
            { class: "das-timeline-label-seprate" },
            null,
            -1
            /* CACHED */
          )),
          r("span", G, [
            a(s.$slots, "right", {}, void 0, !0),
            a(s.$slots, "default", {}, void 0, !0)
          ])
        ]),
        _: 3
        /* FORWARDED */
      },
      16
      /* FULL_PROPS */
    ));
  }
}), J = /* @__PURE__ */ C(H, [["__scopeId", "data-v-ec0b5f5e"]]), X = $(O), Y = $(J);
export {
  X as DasTimeLine,
  Y as DasTimelineItem,
  X as default
};
