import { D as ae, a as ie, b as ce, c as se, d as le, e as re, N as te, f as oe, g as de, h as ue, i as be, j as me, k as _e, l as he, m as pe, n as Ne, o as ve, p as ke, q as ye, r as fe, s as ge, t as $e, u as xe, v as Me, w as we, x as Ce, y as De, z as Se, A as Ee, B as Ie, C as Te, E as Ae, F as We, G as Le, H as Pe, I as Re, J as Be, K as Ke, L as Oe, M as Fe, O as He, P as je, S as ze } from "./NiceModuleLifecyclePanel-CMrPbSw9.js";
import { jsx as e, jsxs as o } from "react/jsx-runtime";
import { forwardRef as E, useState as W, useCallback as L, useEffect as z } from "react";
import { b as I, h as T, W as B } from "./core-Da43q-pO.js";
import { f as Ve } from "./NiceTabs-DzLHzwuA.js";
import { N as Je } from "./NicePagination-DbE-uOkl.js";
const U = E(
  ({
    items: b,
    activeKey: m,
    collapsed: c = !1,
    width: p = 240,
    collapsedWidth: l = 52,
    onItemClick: v,
    onCollapseChange: C,
    header: k,
    footer: d,
    size: _ = "md",
    className: g,
    style: $,
    id: y,
    accessMode: x,
    ...M
  }, N) => {
    const i = I(y), t = T(x, y), [s, u] = W(/* @__PURE__ */ new Set()), r = L((n) => {
      u((D) => {
        const a = new Set(D);
        return a.has(n) ? a.delete(n) : a.add(n), a;
      });
    }, []);
    if (t === "hidden")
      return null;
    const h = (n, D = 0) => {
      const a = n.children && n.children.length > 0, A = s.has(n.key), w = n.key === m;
      return /* @__PURE__ */ o("li", { className: "nice-sidebar-menu__item", children: [
        /* @__PURE__ */ o(
          "button",
          {
            className: `nice-sidebar-menu__btn ${w ? "nice-sidebar-menu__btn--active" : ""} ${n.disabled ? "nice-sidebar-menu__btn--disabled" : ""}`,
            style: { paddingLeft: c ? void 0 : 12 + D * 16 },
            onClick: () => a ? r(n.key) : v?.(n),
            disabled: n.disabled,
            title: c ? n.text : void 0,
            type: "button",
            children: [
              n.icon && /* @__PURE__ */ e("span", { className: "nice-sidebar-menu__icon", children: n.icon }),
              !c && /* @__PURE__ */ e("span", { className: "nice-sidebar-menu__label", children: n.text }),
              !c && n.badge !== void 0 && /* @__PURE__ */ e("span", { className: "nice-sidebar-menu__badge", children: n.badge }),
              !c && a && /* @__PURE__ */ e("span", { className: "nice-sidebar-menu__chevron", children: A ? "▾" : "▸" })
            ]
          }
        ),
        a && A && !c && /* @__PURE__ */ e("ul", { className: "nice-sidebar-menu__children", children: n.children.map((S) => h(S, D + 1)) })
      ] }, n.key);
    };
    return /* @__PURE__ */ o(
      "nav",
      {
        ref: N,
        id: i,
        className: `nice-sidebar-menu nice-sidebar-menu--${_} ${c ? "nice-sidebar-menu--collapsed" : ""} ${g ?? ""}`,
        style: { ...$, width: c ? l : p },
        ...M,
        children: [
          k && /* @__PURE__ */ e("div", { className: "nice-sidebar-menu__header", children: k }),
          /* @__PURE__ */ e("ul", { className: "nice-sidebar-menu__list", role: "list", children: b.map((n) => h(n)) }),
          d && /* @__PURE__ */ e("div", { className: "nice-sidebar-menu__footer", children: d })
        ]
      }
    );
  }
);
U.displayName = "NiceSidebarMenu";
const V = E(
  ({
    items: b,
    activeKey: m,
    onItemClick: c,
    brand: p,
    actions: l,
    size: v = "md",
    className: C,
    style: k,
    id: d,
    accessMode: _,
    ...g
  }, $) => {
    const y = I(d), x = T(_, d), [M, N] = W(null);
    return x === "hidden" ? null : /* @__PURE__ */ o(
      "nav",
      {
        ref: $,
        id: y,
        className: `nice-top-menu nice-top-menu--${v} ${C ?? ""}`,
        style: k,
        ...g,
        children: [
          p && /* @__PURE__ */ e("div", { className: "nice-top-menu__brand", children: p }),
          /* @__PURE__ */ e("ul", { className: "nice-top-menu__items", role: "menubar", children: b.map((i) => {
            const t = i.children && i.children.length > 0, s = M === i.key;
            return /* @__PURE__ */ o(
              "li",
              {
                className: "nice-top-menu__item",
                onMouseEnter: () => t && N(i.key),
                onMouseLeave: () => t && N(null),
                children: [
                  /* @__PURE__ */ o(
                    "button",
                    {
                      className: `nice-top-menu__btn ${i.key === m ? "nice-top-menu__btn--active" : ""}`,
                      onClick: () => t ? N(s ? null : i.key) : c?.(i),
                      role: "menuitem",
                      "aria-haspopup": t,
                      "aria-expanded": s,
                      disabled: i.disabled,
                      type: "button",
                      children: [
                        i.icon && /* @__PURE__ */ e("span", { children: i.icon }),
                        /* @__PURE__ */ e("span", { children: i.text }),
                        t && /* @__PURE__ */ e("span", { className: "nice-top-menu__chevron", children: "▾" })
                      ]
                    }
                  ),
                  t && s && /* @__PURE__ */ e("ul", { className: "nice-top-menu__dropdown", role: "menu", children: i.children.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
                    "button",
                    {
                      className: `nice-top-menu__dropdown-btn ${u.key === m ? "nice-top-menu__dropdown-btn--active" : ""}`,
                      onClick: () => {
                        c?.(u), N(null);
                      },
                      disabled: u.disabled,
                      role: "menuitem",
                      type: "button",
                      children: [
                        u.icon && /* @__PURE__ */ e("span", { children: u.icon }),
                        /* @__PURE__ */ e("span", { children: u.text }),
                        u.badge !== void 0 && /* @__PURE__ */ e("span", { className: "nice-top-menu__badge", children: u.badge })
                      ]
                    }
                  ) }, u.key)) })
                ]
              },
              i.key
            );
          }) }),
          l && /* @__PURE__ */ e("div", { className: "nice-top-menu__actions", children: l })
        ]
      }
    );
  }
);
V.displayName = "NiceTopMenu";
const q = E(
  ({
    tabs: b,
    activeTab: m,
    onTabChange: c,
    onItemClick: p,
    minimized: l = !1,
    onMinimizeToggle: v,
    size: C = "md",
    className: k,
    style: d,
    id: _,
    accessMode: g,
    ...$
  }, y) => {
    const x = I(_), M = T(g, _), [N, i] = W(m ?? b[0]?.key), t = m ?? N, s = b.find((r) => r.key === t), u = L(
      (r) => {
        i(r), c?.(r);
      },
      [c]
    );
    return M === "hidden" ? null : /* @__PURE__ */ o(
      "div",
      {
        ref: y,
        id: x,
        className: `nice-ribbon-menu nice-ribbon-menu--${C} ${l ? "nice-ribbon-menu--minimized" : ""} ${k ?? ""}`,
        style: d,
        ...$,
        children: [
          /* @__PURE__ */ o("div", { className: "nice-ribbon-menu__tabs", role: "tablist", children: [
            b.map((r) => /* @__PURE__ */ e(
              "button",
              {
                className: `nice-ribbon-menu__tab ${r.key === t ? "nice-ribbon-menu__tab--active" : ""}`,
                onClick: () => u(r.key),
                role: "tab",
                "aria-selected": r.key === t,
                type: "button",
                children: r.label
              },
              r.key
            )),
            /* @__PURE__ */ e(
              "button",
              {
                className: "nice-ribbon-menu__minimize",
                onClick: () => v?.(!l),
                type: "button",
                "aria-label": l ? "Expand" : "Minimize",
                children: l ? "▼" : "▲"
              }
            )
          ] }),
          !l && s && /* @__PURE__ */ e("div", { className: "nice-ribbon-menu__panel", role: "tabpanel", children: s.groups.map((r, h) => /* @__PURE__ */ o("div", { className: "nice-ribbon-menu__group", children: [
            /* @__PURE__ */ e("div", { className: "nice-ribbon-menu__group-items", children: r.items.map((n) => /* @__PURE__ */ o(
              "button",
              {
                className: "nice-ribbon-menu__item",
                onClick: () => p?.(n),
                disabled: n.disabled,
                type: "button",
                children: [
                  n.icon && /* @__PURE__ */ e("span", { className: "nice-ribbon-menu__item-icon", children: n.icon }),
                  /* @__PURE__ */ e("span", { className: "nice-ribbon-menu__item-label", children: n.text })
                ]
              },
              n.key
            )) }),
            /* @__PURE__ */ e("div", { className: "nice-ribbon-menu__group-label", children: r.label })
          ] }, h)) })
        ]
      }
    );
  }
);
q.displayName = "NiceRibbonMenu";
const J = E(
  ({
    items: b,
    activeKey: m,
    onItemClick: c,
    position: p = "bottom",
    autoHide: l = !1,
    iconSize: v = 40,
    size: C = "md",
    className: k,
    style: d,
    id: _,
    accessMode: g,
    ...$
  }, y) => {
    const x = I(_), M = T(g, _), [N, i] = W(!1), t = !l || N;
    return M === "hidden" ? null : /* @__PURE__ */ e(
      "div",
      {
        ref: y,
        id: x,
        className: `nice-dock-menu nice-dock-menu--${p} nice-dock-menu--${C} ${l && !t ? "nice-dock-menu--hidden" : ""} ${k ?? ""}`,
        style: d,
        onMouseEnter: () => i(!0),
        onMouseLeave: () => i(!1),
        ...$,
        children: /* @__PURE__ */ e("div", { className: "nice-dock-menu__items", children: b.map((s) => /* @__PURE__ */ o(
          "button",
          {
            className: `nice-dock-menu__item ${s.key === m ? "nice-dock-menu__item--active" : ""}`,
            onClick: () => c?.(s),
            disabled: s.disabled,
            title: s.text,
            type: "button",
            style: { width: v, height: v },
            children: [
              s.icon ? /* @__PURE__ */ e("span", { className: "nice-dock-menu__icon", children: s.icon }) : /* @__PURE__ */ e("span", { children: s.text[0] }),
              s.badge !== void 0 && /* @__PURE__ */ e("span", { className: "nice-dock-menu__badge", children: s.badge })
            ]
          },
          s.key
        )) })
      }
    );
  }
);
J.displayName = "NiceDockMenu";
const Q = E(
  ({
    items: b,
    activeKey: m,
    onItemClick: c,
    open: p,
    onOpenChange: l,
    position: v = "left",
    panelWidth: C = 280,
    header: k,
    footer: d,
    size: _ = "md",
    className: g,
    style: $,
    id: y,
    accessMode: x,
    ...M
  }, N) => {
    const i = I(y), t = T(x, y), { t: s } = B(), [u, r] = W(!1), h = p ?? u, n = L(() => {
      const a = !h;
      r(a), l?.(a);
    }, [h, l]), D = L(
      (a) => {
        c?.(a), r(!1), l?.(!1);
      },
      [c, l]
    );
    return t === "hidden" ? null : /* @__PURE__ */ o(
      "div",
      {
        ref: N,
        id: i,
        className: `nice-hamburger-menu nice-hamburger-menu--${_} ${g ?? ""}`,
        style: $,
        ...M,
        children: [
          /* @__PURE__ */ e(
            "button",
            {
              className: "nice-hamburger-menu__trigger",
              onClick: n,
              "aria-label": s("nav.menu", "Menu"),
              "aria-expanded": h,
              type: "button",
              children: /* @__PURE__ */ o(
                "span",
                {
                  className: `nice-hamburger-menu__icon ${h ? "nice-hamburger-menu__icon--open" : ""}`,
                  children: [
                    /* @__PURE__ */ e("span", {}),
                    /* @__PURE__ */ e("span", {}),
                    /* @__PURE__ */ e("span", {})
                  ]
                }
              )
            }
          ),
          h && /* @__PURE__ */ e("div", { className: "nice-hamburger-menu__backdrop", onClick: n, "aria-hidden": !0 }),
          /* @__PURE__ */ o(
            "div",
            {
              className: `nice-hamburger-menu__panel nice-hamburger-menu__panel--${v} ${h ? "nice-hamburger-menu__panel--open" : ""}`,
              style: { width: C },
              children: [
                k && /* @__PURE__ */ e("div", { className: "nice-hamburger-menu__header", children: k }),
                /* @__PURE__ */ e("ul", { className: "nice-hamburger-menu__list", role: "menu", children: b.map((a) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
                  "button",
                  {
                    className: `nice-hamburger-menu__item ${a.key === m ? "nice-hamburger-menu__item--active" : ""}`,
                    onClick: () => D(a),
                    disabled: a.disabled,
                    role: "menuitem",
                    type: "button",
                    children: [
                      a.icon && /* @__PURE__ */ e("span", { className: "nice-hamburger-menu__item-icon", children: a.icon }),
                      /* @__PURE__ */ e("span", { children: a.text }),
                      a.badge !== void 0 && /* @__PURE__ */ e("span", { className: "nice-hamburger-menu__item-badge", children: a.badge })
                    ]
                  }
                ) }, a.key)) }),
                d && /* @__PURE__ */ e("div", { className: "nice-hamburger-menu__footer", children: d })
              ]
            }
          )
        ]
      }
    );
  }
);
Q.displayName = "NiceHamburgerMenu";
const X = E(
  ({
    canGoBack: b = !1,
    canGoForward: m = !1,
    onBack: c,
    onForward: p,
    onRefresh: l,
    enableShortcuts: v = !0,
    showRefresh: C = !0,
    showStop: k = !0,
    isLoading: d = !1,
    onStop: _,
    size: g = "md",
    variant: $ = "default",
    tooltipPosition: y = "bottom",
    backIcon: x,
    forwardIcon: M,
    refreshIcon: N,
    stopIcon: i,
    className: t,
    style: s,
    id: u,
    accessMode: r,
    disabled: h,
    ...n
  }, D) => {
    const a = I(u), A = T(r, u), { t: w } = B();
    if (z(() => {
      if (!v || h)
        return;
      const P = (f) => {
        const R = f.altKey, j = f.ctrlKey || f.metaKey;
        R && f.key === "ArrowLeft" ? (f.preventDefault(), b && c?.()) : R && f.key === "ArrowRight" ? (f.preventDefault(), m && p?.()) : f.key === "F5" || j && f.key === "r" ? (f.preventDefault(), d ? _?.() : l?.()) : f.key === "Escape" && d && (f.preventDefault(), _?.());
      };
      return window.addEventListener("keydown", P), () => window.removeEventListener("keydown", P);
    }, [
      v,
      h,
      b,
      m,
      d,
      c,
      p,
      l,
      _
    ]), A === "hidden")
      return null;
    const S = A === "disabled" || h, K = x ?? /* @__PURE__ */ e(
      "svg",
      {
        width: "16",
        height: "16",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2",
        children: /* @__PURE__ */ e("polyline", { points: "15 18 9 12 15 6" })
      }
    ), O = M ?? /* @__PURE__ */ e(
      "svg",
      {
        width: "16",
        height: "16",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2",
        children: /* @__PURE__ */ e("polyline", { points: "9 18 15 12 9 6" })
      }
    ), F = N ?? /* @__PURE__ */ o(
      "svg",
      {
        width: "16",
        height: "16",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2",
        children: [
          /* @__PURE__ */ e("polyline", { points: "23 4 23 10 17 10" }),
          /* @__PURE__ */ e("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })
        ]
      }
    ), H = i ?? /* @__PURE__ */ o(
      "svg",
      {
        width: "16",
        height: "16",
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        strokeWidth: "2",
        children: [
          /* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
          /* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
        ]
      }
    );
    return /* @__PURE__ */ o(
      "div",
      {
        ref: D,
        id: a,
        className: `nice-nav-controls nice-nav-controls--${g} nice-nav-controls--${$}${S ? " nice-nav-controls--disabled" : ""}${t ? ` ${t}` : ""}`,
        style: s,
        role: "navigation",
        "aria-label": w("nav.controls", "Navigation controls"),
        ...n,
        children: [
          /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: `nice-nav-controls__btn nice-nav-controls__btn--back${b ? "" : " nice-nav-controls__btn--disabled"}`,
              onClick: c,
              disabled: S || !b,
              "aria-label": w("nav.back", "Back"),
              title: `${w("nav.back", "Back")} (Alt+←)`,
              children: K
            }
          ),
          /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: `nice-nav-controls__btn nice-nav-controls__btn--forward${m ? "" : " nice-nav-controls__btn--disabled"}`,
              onClick: p,
              disabled: S || !m,
              "aria-label": w("nav.forward", "Forward"),
              title: `${w("nav.forward", "Forward")} (Alt+→)`,
              children: O
            }
          ),
          (C || k && d) && (d ? /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: "nice-nav-controls__btn nice-nav-controls__btn--stop nice-nav-controls__btn--loading",
              onClick: _,
              disabled: S,
              "aria-label": w("nav.stop", "Stop"),
              title: `${w("nav.stop", "Stop")} (Esc)`,
              children: H
            }
          ) : /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: "nice-nav-controls__btn nice-nav-controls__btn--refresh",
              onClick: l,
              disabled: S,
              "aria-label": w("nav.refresh", "Refresh"),
              title: `${w("nav.refresh", "Refresh")} (F5)`,
              children: F
            }
          ))
        ]
      }
    );
  }
);
X.displayName = "NiceNavigationControls";
export {
  ae as DEFAULT_SIDEBAR_PREFS,
  ie as DesktopContextMenu,
  ce as DesktopGrid,
  se as DesktopStartMenu,
  le as DesktopSystemTray,
  re as DesktopTaskbar,
  te as NiceAccordion,
  oe as NiceAppLayout,
  de as NiceBottomNavigation,
  ue as NiceBreadcrumb,
  be as NiceCard,
  me as NiceClassicShell,
  _e as NiceCompactShell,
  he as NiceConsole,
  pe as NiceContextMenu,
  Ne as NiceDashboardLayout,
  ve as NiceDashboardShell,
  ke as NiceDesktop,
  ye as NiceDock,
  J as NiceDockMenu,
  fe as NiceDynamicSidebar,
  Q as NiceHamburgerMenu,
  ge as NiceHybridShell,
  $e as NiceKioskShell,
  xe as NiceMdiWorkspace,
  Me as NiceMegaMenu,
  we as NiceMenu,
  Ce as NiceMinimalShell,
  De as NiceModeSelector,
  Se as NiceModernShell,
  Ee as NiceModuleLifecyclePanel,
  Ie as NiceMultiView,
  Te as NiceNavbar,
  X as NiceNavigationControls,
  Ae as NiceOnboardingWizard,
  We as NiceOrganizationProfileForm,
  Je as NicePagination,
  Le as NicePwaShell,
  q as NiceRibbonMenu,
  Pe as NiceSetupWizard,
  U as NiceSidebarMenu,
  Re as NiceSidebarNav,
  Be as NiceSplitter,
  Ke as NiceTabPanel,
  Ve as NiceTabs,
  Oe as NiceTenantSwitcher,
  Fe as NiceToolbar,
  V as NiceTopMenu,
  He as NiceUserMenu,
  je as NiceWizard,
  ze as SIDEBAR_MODE_META
};
