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