import { j as s } from "../../node_modules/react/jsx-runtime.mjs";
import { useState as k } from "react";
import N from "../../node_modules/classnames/index.mjs";
import { createNamespace as B } from "../../utils/create.mjs";
import C from "../../node_modules/rc-resize-observer/es/index.mjs";
import "./index.less.mjs";
import y from "../../node_modules/antd/es/avatar/index.mjs";
import w from "../../node_modules/antd/es/space/index.mjs";
import A from "../../node_modules/antd/es/breadcrumb/Breadcrumb.mjs";
import F from "../../node_modules/@ant-design/icons/es/icons/ArrowRightOutlined.mjs";
import O from "../../node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.mjs";
const P = (t, e, i, n) => !i || !n ? null : s.jsx("div", { className: `${t}-back ${e}`.trim(), children: s.jsx("div", { role: "button", onClick: (o) => {
  n == null || n(o);
}, className: `${t}-back-button ${e}`.trim(), "aria-label": "back", children: i }) }), T = (t, e) => {
  var i;
  return (i = t.items) != null && i.length ? s.jsx(A, { ...t, className: N(`${e}-breadcrumb`, t.className) }) : null;
}, H = (t, e = "ltr") => t.backIcon !== void 0 ? t.backIcon : e === "rtl" ? s.jsx(F, {}) : s.jsx(O, {}), S = (t, e, i = "ltr", n) => {
  const { title: o, avatar: l, subTitle: a, tags: m, extra: d, onBack: f } = e, c = `${t}-heading`, r = o || a || m || d;
  if (!r)
    return null;
  const u = H(e, i), $ = P(t, n, u, f), x = $ || l || r;
  return s.jsxs("div", { className: c + " " + n, children: [x && s.jsxs("div", { className: `${c}-left ${n}`.trim(), children: [$, l && s.jsx(y, { className: N(`${c}-avatar`, n, l.className), ...l }), o && s.jsx("span", { className: `${c}-title ${n}`.trim(), title: typeof o == "string" ? o : void 0, children: o }), a && s.jsx("span", { className: `${c}-sub-title ${n}`.trim(), title: typeof a == "string" ? a : void 0, children: a }), m && s.jsx("span", { className: `${c}-tags ${n}`.trim(), children: m })] }), d && s.jsx("span", { className: `${c}-extra ${n}`.trim(), children: s.jsx(w, { children: d }) })] });
}, E = (t, e, i) => s.jsx("div", { className: `${t}-content ${i}`.trim(), children: e }), L = (t, e, i) => e ? s.jsx("div", { className: `${t}-footer ${i}`.trim(), children: e }) : null, Z = (t) => {
  const [e, i] = B("bitz-page-header"), n = "ltr", o = "id_123123", [l, a] = k(!1), m = ({ width: R }) => a(R < 768), { style: d, footer: f, children: c, breadcrumb: r, breadcrumbRender: u, className: $, contentWidth: x } = t, j = (() => (r && !(r != null && r.items) && (r != null && r.routes) && (r.items = r.routes), r != null && r.items ? T(r, e) : null))(), v = r && "props" in r, D = (u == null ? void 0 : u({ ...t, prefixCls: e }, j)) ?? j, p = v ? r : D, z = N(e, o, $, {
    [`${e}-has-breadcrumb`]: !!p,
    [`${e}-has-footer`]: !!f,
    // [`${prefixCls}-rtl`]: direction === 'rtl',
    [`${e}-compact`]: l,
    [`${e}-wide`]: x === "Fixed",
    [`${e}-ghost`]: !0
  }), g = S(e, t, n, o), h = c && E(e, c, o), b = L(e, f, o);
  return !p && !g && !b && !h ? null : s.jsx(C, { onResize: m, children: s.jsxs("div", { className: z, style: d, children: [p, g, h, b] }) });
};
export {
  Z as default
};
