import { j as n } from "./jsx-runtime-NmMXPjeo.js";
import { createContext as p, useContext as v, isValidElement as f, Fragment as j } from "react";
import { C as a, e as h } from "./css-fOi2x-55.js";
import { S as m } from "./Center-c6LFuqp8.js";
import { I as B, af as C, B as S, W as b } from "./Toggle-E-Bsru_F.js";
import { g as x } from "./aggregator-BIN9LAqD.js";
import "react-hook-form";
const u = p({
  divided: !1,
  level: "h1"
}), l = () => v(u), g = ({
  children: s,
  className: r,
  level: e = "h1",
  divided: o = !1,
  ...t
}) => /* @__PURE__ */ n.jsx(u.Provider, { value: { level: e, divided: o }, children: /* @__PURE__ */ n.jsx(
  m,
  {
    el: "header",
    direction: "x",
    justify: "spaceBetween",
    className: a(
      a.B("header"),
      a.bordered("bottom"),
      o && a.BM("header", "divided"),
      r
    ),
    ...t,
    children: s
  }
) }), z = ({ children: s = [] }) => {
  const { level: r, divided: e } = l();
  return /* @__PURE__ */ n.jsx(
    m,
    {
      direction: "x",
      size: "small",
      align: "center",
      className: a.BE("header", "actions"),
      children: h(s).map((o, t) => /* @__PURE__ */ n.jsx(y, { index: t, level: r, divided: e, children: o }, t))
    }
  );
}, y = ({ index: s, level: r, children: e, divided: o }) => {
  let t = e;
  if (!f(e)) {
    const i = e;
    t = /* @__PURE__ */ n.jsx(
      B,
      {
        onClick: (c) => {
          var d;
          c.stopPropagation(), c.preventDefault(), (d = i.onClick) == null || d.call(i, c);
        },
        size: x[r],
        ...i
      },
      s
    );
  }
  return /* @__PURE__ */ n.jsxs(j, { children: [
    o && /* @__PURE__ */ n.jsx(C, {}),
    t
  ] }, s);
}, A = ({
  children: s = "",
  className: r,
  onClick: e,
  ...o
}) => {
  const { level: t } = l();
  return /* @__PURE__ */ n.jsx(
    S,
    {
      variant: "text",
      size: x[t],
      onClick: e,
      className: a(a.B("header-button-title"), r),
      sharp: !0,
      ...o,
      children: s
    }
  );
}, E = ({
  className: s,
  level: r,
  ...e
}) => {
  const { level: o, divided: t } = l();
  return /* @__PURE__ */ n.jsx(
    b,
    {
      className: a(a.BE("header", "text"), s),
      level: r ?? o,
      divided: t,
      size: 1.5,
      ...e
    }
  );
}, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Actions: z,
  ButtonTitle: A,
  Header: g,
  Title: E,
  useContext: l
}, Symbol.toStringTag, { value: "Module" }));
export {
  z as A,
  A as B,
  g as H,
  H as e
};
//# sourceMappingURL=external-WjDr7EKd.js.map
