import m from "../../../classnames/index.mjs";
import * as r from "react";
import "../config-provider/index.mjs";
import { ConfigContext as g } from "../config-provider/context.mjs";
var C = globalThis && globalThis.__rest || function(t, a) {
  var s = {};
  for (var e in t)
    Object.prototype.hasOwnProperty.call(t, e) && a.indexOf(e) < 0 && (s[e] = t[e]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
    for (var o = 0, e = Object.getOwnPropertySymbols(t); o < e.length; o++)
      a.indexOf(e[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[o]) && (s[e[o]] = t[e[o]]);
  return s;
};
const y = (t) => {
  var {
    prefixCls: a,
    className: s,
    color: e = "blue",
    dot: o,
    pending: c = !1,
    position: x,
    label: i,
    children: d
  } = t, f = C(t, ["prefixCls", "className", "color", "dot", "pending", "position", "label", "children"]);
  const {
    getPrefixCls: p
  } = r.useContext(g), l = p("timeline", a), b = m(`${l}-item`, {
    [`${l}-item-pending`]: c
  }, s), n = /blue|red|green|gray/.test(e || "") ? void 0 : e, u = m(`${l}-item-head`, {
    [`${l}-item-head-custom`]: !!o,
    [`${l}-item-head-${e}`]: !n
  });
  return /* @__PURE__ */ r.createElement("li", Object.assign({}, f, {
    className: b
  }), i && /* @__PURE__ */ r.createElement("div", {
    className: `${l}-item-label`
  }, i), /* @__PURE__ */ r.createElement("div", {
    className: `${l}-item-tail`
  }), /* @__PURE__ */ r.createElement("div", {
    className: u,
    style: {
      borderColor: n,
      color: n
    }
  }, o), /* @__PURE__ */ r.createElement("div", {
    className: `${l}-item-content`
  }, d));
}, h = y;
export {
  h as default
};
