import { jsx as r, jsxs as i } from "react/jsx-runtime";
import { useState as o, useRef as Me, useCallback as L, useEffect as we, useMemo as h } from "react";
import { useNavigate as Ue, useParams as Ge, useSearchParams as We } from "react-router-dom";
import { useTranslation as $e } from "react-i18next";
import { Loader2 as ne, Power as Ye, EyeOff as Te, Check as ke, Eye as Ze, ArrowLeft as Qe, RotateCcw as qe, Palette as Xe } from "lucide-react";
import { u as er } from "./useTabNavigation-Bsbskz0i.js";
import { j as rr, v as I, ae as Pe, ac as Oe, au as M, af as tr, ai as ar, P as Ae, $ as oe, aa as ir, aj as nr, ak as or } from "./index-CeEMms9z.js";
import { C as sr } from "./ConfirmModal-Ve-8m7xp.js";
import { e as U } from "./extractErrorMessage-C0uxTGn5.js";
import { I as dr, A as cr, T as lr, D as ur, B as mr, L as pr } from "./DataVizEditor-ymsAbmGw.js";
const G = {
  card: "large",
  button: "medium",
  badge: "medium",
  input: "medium",
  modal: "xlarge",
  menuItem: "medium"
}, gr = ["identity", "accent", "backgrounds", "dashboard", "typography", "spacing", "activation"];
function y(e, s) {
  if (!e) return s;
  try {
    return JSON.parse(e);
  } catch {
    return s;
  }
}
function W(e) {
  return JSON.stringify([
    e.name.trim(),
    e.description.trim(),
    e.icon.trim(),
    e.accent,
    e.itemPalette,
    e.typographyOverride,
    e.borderRadiusOverride,
    e.backgroundOverride,
    e.dataVizOverride
  ]);
}
function br(e) {
  const s = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
  if (!s) return !1;
  const d = parseInt(s[1], 16), B = parseInt(s[2], 16), c = parseInt(s[3], 16);
  return (d * 299 + B * 587 + c * 114) / 1e3 > 128;
}
function Pr() {
  const { t: e } = $e("admin"), s = Ue(), { id: d } = Ge(), [B] = We(), c = !d || d === "new", { loadFromServer: z } = rr(), { activeTab: l, setActiveTab: Se } = er("identity", gr), [u, se] = o(null), [Z, De] = o([]), [R, Q] = o(""), [w, de] = o(e("uiConfiguration.newPreset")), [T, ce] = o(""), [O, le] = o("Palette"), [m, ue] = o("indigo"), [A, Ie] = o(null), [p, q] = o(null), [g, X] = o(null), [x, me] = o(null), [C, pe] = o(!1), [N, ge] = o(!1), [b, ee] = o(null), [v, be] = o(!1), [ze, ve] = o(!0), [k, E] = o(!1), [Re, re] = o(!1), [fe, f] = o(null), F = Me(""), [S, V] = o(null), K = L(async () => {
    ve(!0), f(null);
    try {
      const t = await I.uiThemes.list(!0);
      if (De(t), c) {
        const a = B.get("themeId") ?? t[0]?.id ?? "";
        Q(a), F.current = W({
          name: e("uiConfiguration.newPreset"),
          description: "",
          icon: "Palette",
          accent: "indigo",
          itemPalette: null,
          typographyOverride: null,
          borderRadiusOverride: null,
          backgroundOverride: null,
          dataVizOverride: null
        });
      } else {
        const a = await I.uiPresets.getById(d);
        se(a), Q(a.themeId), de(a.name), ce(a.description ?? ""), le(a.icon ?? "Palette"), ue(a.accentColorKey), Ie(a.itemPaletteKey);
        const ae = y(a.typographyJson, null);
        q(ae), pe(ae !== null);
        const ie = y(a.borderRadiusJson, null);
        X(ie), ge(ie !== null);
        const Ne = y(a.backgroundOverrideJson, null);
        me(Ne);
        let j = null;
        a.dataVizColorsJson && a.dataVizColorsJson.trim().length > 0 && a.dataVizColorsJson !== "{}" && (j = Pe(a.dataVizColorsJson, Oe)), ee(j), be(j !== null), F.current = W({
          name: a.name,
          description: a.description ?? "",
          icon: a.icon ?? "Palette",
          accent: a.accentColorKey,
          itemPalette: a.itemPaletteKey,
          typographyOverride: ae,
          borderRadiusOverride: ie,
          backgroundOverride: Ne,
          dataVizOverride: j
        });
      }
    } catch (t) {
      f(U(t));
    } finally {
      ve(!1);
    }
  }, [c, d, B, e]);
  we(() => {
    K();
  }, [K]);
  const n = h(
    () => Z.find((t) => t.id === R) ?? null,
    [Z, R]
  ), H = h(
    () => n ? y(n.backgroundsJson, {}) : {},
    [n]
  ), he = h(
    () => n ? y(n.textColorsJson, {}) : {},
    [n]
  ), te = h(
    () => n ? y(n.borderColorsJson, {}) : {},
    [n]
  ), Ve = h(
    () => n ? y(n.statusColorsJson, {}) : {},
    [n]
  ), Je = h(
    () => n ? y(n.defaultTypographyJson, M) : M,
    [n]
  ), Le = h(
    () => n ? y(n.defaultBorderRadiusJson, G) : G,
    [n]
  ), P = C && p ? p : Je, Be = N && g ? g : Le, J = H.app && br(H.app) ? "light" : "dark", _ = h(
    () => Pe(
      n?.dataVizColorsJson ?? null,
      J === "dark" ? Oe : tr
    ),
    [n, J]
  ), Ee = v && b ? b : _;
  we(() => {
    ar(P.fontFamily);
  }, [P.fontFamily]);
  const ye = L(async () => {
    if (!n) {
      f("Thème parent introuvable.");
      return;
    }
    E(!0), f(null);
    try {
      const t = {
        themeId: R,
        // Scope inherited from parent theme (corporate use case: a Tenant theme → Tenant preset)
        scope: n.scope,
        tenantId: n.tenantId,
        name: w.trim() || "Preset",
        description: T.trim() || null,
        icon: O.trim() || null,
        sortOrder: u?.sortOrder ?? 100,
        accentColorKey: m,
        itemPaletteKey: A,
        typographyJson: C && p ? JSON.stringify(p) : null,
        borderRadiusJson: N && g ? JSON.stringify(g) : null,
        backgroundOverrideJson: x ? JSON.stringify(x) : null,
        dataVizColorsJson: v && b ? JSON.stringify(b) : null,
        // Category colours always inherited from the parent theme — preset-level
        // override not exposed in v1 (extend here when needed).
        categoryColorsJson: null
      };
      if (c) {
        const a = await I.uiPresets.create(t);
        re(!0), z(), setTimeout(() => s(`/administration/uiconfiguration/presets/${a}/edit`), 400);
      } else
        await I.uiPresets.update(d, t), F.current = W({
          name: w.trim() || "Preset",
          description: T.trim(),
          icon: O.trim() || "Palette",
          accent: m,
          itemPalette: A,
          typographyOverride: C ? p : null,
          borderRadiusOverride: N ? g : null,
          backgroundOverride: x,
          dataVizOverride: v ? b : null
        }), re(!0), z(), setTimeout(() => re(!1), 2e3);
    } catch (t) {
      f(U(t));
    } finally {
      E(!1);
    }
  }, [c, d, u, n, R, w, T, O, m, A, C, p, N, g, x, v, b, z, s]), xe = h(() => W({
    name: w,
    description: T,
    icon: O,
    accent: m,
    itemPalette: A,
    typographyOverride: C ? p : null,
    borderRadiusOverride: N ? g : null,
    backgroundOverride: x,
    dataVizOverride: v ? b : null
  }) !== F.current, [w, T, O, m, A, C, p, N, g, x, v, b]), Fe = L(async () => {
    try {
      f(null), await K();
    } catch (t) {
      f(U(t));
    } finally {
      V(null);
    }
  }, [K]), Ke = L(async () => {
    await ye(), V(null);
  }, [ye]), He = L(async () => {
    if (!(c || !d || !u)) {
      E(!0), f(null);
      try {
        await I.uiPresets.setDisabled(d, !u.isDisabled);
        const t = await I.uiPresets.getById(d);
        se(t), z();
      } catch (t) {
        f(U(t));
      } finally {
        E(!1);
      }
    }
  }, [c, d, u, z]);
  if (ze)
    return /* @__PURE__ */ r(Ae, { title: e("common:loading"), children: /* @__PURE__ */ r(ne, { className: "w-5 h-5 animate-spin" }) });
  const D = !!u?.isBuiltin, Ce = [
    { id: "identity", label: e("uiConfiguration.presetTabIdentity") },
    { id: "accent", label: e("uiConfiguration.presetTabAccent") },
    { id: "backgrounds", label: e("uiConfiguration.presetTabBackgrounds") },
    { id: "dashboard", label: e("uiConfiguration.dataViz.tabLabel") },
    { id: "typography", label: e("uiConfiguration.presetTabTypography") },
    { id: "spacing", label: e("uiConfiguration.presetTabSpacing") }
  ], _e = c || D ? Ce : [...Ce, { id: "activation", label: e("uiConfiguration.presetTabActivation") }], je = u?.scope === "Tenant" || n?.scope === "Tenant" ? e("uiConfiguration.presetScopeTenant") : e("uiConfiguration.presetScopePlatform");
  return /* @__PURE__ */ i(
    Ae,
    {
      title: c ? e("uiConfiguration.newPreset") : w,
      subtitle: T || void 0,
      icon: /* @__PURE__ */ r(Xe, { className: "w-6 h-6" }),
      actions: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
        xe && !k && /* @__PURE__ */ i("span", { className: "hidden sm:inline-flex items-center gap-1.5 px-2 py-1 text-xs font-medium rounded bg-[var(--warning-bg)] text-[var(--warning-text)] border border-[var(--warning-border)]", children: [
          /* @__PURE__ */ r("span", { className: "w-1.5 h-1.5 rounded-full bg-[var(--warning-text)]" }),
          e("uiConfiguration.dirtyIndicator")
        ] }),
        /* @__PURE__ */ i(
          "button",
          {
            type: "button",
            onClick: () => s("/administration/uiconfiguration/presets"),
            className: "flex items-center gap-1.5 px-3 py-2 rounded-[var(--radius-button)] text-sm text-[var(--text-secondary)] hover:bg-[var(--bg-secondary)]",
            children: [
              /* @__PURE__ */ r(Qe, { className: "w-4 h-4" }),
              " ",
              e("common:back")
            ]
          }
        ),
        /* @__PURE__ */ i(
          "button",
          {
            type: "button",
            onClick: () => V("reset"),
            disabled: !xe || D || k,
            className: "flex items-center gap-1.5 px-3 py-2 rounded-[var(--radius-button)] text-sm text-[var(--text-secondary)] border border-[var(--border-color)] hover:bg-[var(--bg-secondary)] disabled:opacity-40 disabled:cursor-not-allowed",
            children: [
              /* @__PURE__ */ r(qe, { className: "w-4 h-4" }),
              " ",
              e("common:reset")
            ]
          }
        ),
        /* @__PURE__ */ i(
          "button",
          {
            type: "button",
            onClick: () => V("save"),
            disabled: k || D,
            className: "flex items-center gap-1.5 px-3 py-2 rounded-[var(--radius-button)] bg-[var(--color-accent-500)] text-white text-sm font-medium hover:bg-[var(--color-accent-600)] disabled:opacity-50",
            children: [
              k ? /* @__PURE__ */ r(ne, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ r(ke, { className: "w-4 h-4" }),
              e(Re ? "common:saved" : "common:save")
            ]
          }
        )
      ] }),
      children: [
        fe && /* @__PURE__ */ r("div", { className: "mb-4 p-3 rounded-[var(--radius-card)] bg-[var(--error-bg)] border border-[var(--error-border)] text-sm text-[var(--error-text)]", children: fe }),
        D && /* @__PURE__ */ r("div", { className: "mb-4 p-3 rounded-[var(--radius-card)] bg-[var(--warning-bg)] border border-[var(--warning-border)] text-sm text-[var(--warning-text)]", children: e("uiConfiguration.presetBuiltinReadonly") }),
        /* @__PURE__ */ r("div", { className: "flex gap-6 border-b border-[var(--border-color)] overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden mb-6", children: _e.map((t) => {
          const a = t.id === l;
          return /* @__PURE__ */ r(
            "button",
            {
              type: "button",
              onClick: () => Se(t.id),
              className: [
                "py-3 text-sm font-medium whitespace-nowrap transition-colors border-b-2 -mb-px",
                a ? "text-[var(--text-primary)] border-[var(--color-accent-500)]" : "text-[var(--text-muted)] border-transparent hover:text-[var(--text-secondary)]"
              ].join(" "),
              children: t.label
            },
            t.id
          );
        }) }),
        l === "activation" && !c && u && /* @__PURE__ */ i("section", { className: "rounded-[var(--radius-card)] bg-[var(--bg-secondary)] border border-[var(--border-color)] p-5 space-y-4", children: [
          /* @__PURE__ */ i("div", { children: [
            /* @__PURE__ */ i("h3", { className: "text-base font-semibold text-[var(--text-primary)] flex items-center gap-2", children: [
              /* @__PURE__ */ r(Ye, { className: "w-4 h-4" }),
              e("uiConfiguration.presetsActivationTitle")
            ] }),
            /* @__PURE__ */ r("p", { className: "text-sm text-[var(--text-secondary)] mt-1", children: e("uiConfiguration.presetsActivationHint") })
          ] }),
          /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-4 p-4 rounded-[var(--radius-card)] bg-[var(--bg-primary)] border border-[var(--border-color)]", children: [
            /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: u.isDisabled ? /* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium uppercase tracking-wider rounded bg-[var(--bg-secondary)] text-[var(--text-muted)] border border-[var(--border-color)]", children: [
              /* @__PURE__ */ r(Te, { className: "w-3.5 h-3.5" }),
              e("uiConfiguration.presetsStatusDisabled")
            ] }) : /* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium uppercase tracking-wider rounded bg-[var(--success-bg)] text-[var(--success-text)] border border-[var(--success-border)]", children: [
              /* @__PURE__ */ r(ke, { className: "w-3.5 h-3.5" }),
              e("uiConfiguration.presetsStatusActive")
            ] }) }),
            /* @__PURE__ */ i(
              "button",
              {
                type: "button",
                onClick: He,
                disabled: k,
                className: [
                  "flex items-center gap-1.5 px-3 py-2 rounded-[var(--radius-button)] text-sm font-medium disabled:opacity-50",
                  u.isDisabled ? "bg-[var(--color-accent-500)] text-white hover:bg-[var(--color-accent-600)]" : "bg-[var(--bg-secondary)] text-[var(--text-primary)] border border-[var(--border-color)] hover:bg-[var(--bg-tertiary)]"
                ].join(" "),
                children: [
                  k ? /* @__PURE__ */ r(ne, { className: "w-4 h-4 animate-spin" }) : u.isDisabled ? /* @__PURE__ */ r(Ze, { className: "w-4 h-4" }) : /* @__PURE__ */ r(Te, { className: "w-4 h-4" }),
                  u.isDisabled ? e("uiConfiguration.presetsActionEnable") : e("uiConfiguration.presetsActionDisable")
                ]
              }
            )
          ] })
        ] }),
        l !== "activation" && /* @__PURE__ */ i("div", { className: "grid lg:grid-cols-2 gap-6", children: [
          /* @__PURE__ */ i("fieldset", { disabled: D, className: "space-y-6 disabled:opacity-60 min-w-0", children: [
            l === "identity" && /* @__PURE__ */ i("div", { className: "rounded-[var(--radius-card)] bg-[var(--bg-secondary)] border border-[var(--border-color)] p-5 space-y-4", children: [
              /* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-[auto_1fr] gap-4 items-end", children: [
                /* @__PURE__ */ r(Y, { label: e("uiConfiguration.fieldIcon"), children: /* @__PURE__ */ r(dr, { value: O, onChange: le }) }),
                /* @__PURE__ */ r(Y, { label: e("uiConfiguration.fieldName"), children: /* @__PURE__ */ r(
                  "input",
                  {
                    type: "text",
                    value: w,
                    onChange: (t) => de(t.target.value),
                    className: "w-full px-3 py-2 rounded-[var(--radius-input)] bg-[var(--bg-primary)] border border-[var(--border-color)] text-[var(--text-primary)]"
                  }
                ) })
              ] }),
              /* @__PURE__ */ r(Y, { label: e("uiConfiguration.fieldDescription"), children: /* @__PURE__ */ r(
                "textarea",
                {
                  rows: 2,
                  value: T,
                  onChange: (t) => ce(t.target.value),
                  className: "w-full px-3 py-2 rounded-[var(--radius-input)] bg-[var(--bg-primary)] border border-[var(--border-color)] text-[var(--text-secondary)] resize-none"
                }
              ) }),
              /* @__PURE__ */ i(Y, { label: e("uiConfiguration.presetParentTheme"), children: [
                /* @__PURE__ */ r(
                  "select",
                  {
                    value: R,
                    onChange: (t) => Q(t.target.value),
                    disabled: !c,
                    className: "w-full px-3 py-2 rounded-[var(--radius-input)] bg-[var(--bg-primary)] border border-[var(--border-color)] text-[var(--text-primary)] disabled:opacity-50",
                    children: Z.map((t) => /* @__PURE__ */ r("option", { value: t.id, children: t.name }, t.id))
                  }
                ),
                !c && /* @__PURE__ */ r("p", { className: "text-xs text-[var(--text-muted)] mt-1", children: e("uiConfiguration.presetParentThemeLocked") })
              ] }),
              /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 rounded-[var(--radius-input)] bg-[var(--bg-primary)] border border-[var(--border-color)]", children: [
                /* @__PURE__ */ r("span", { className: "text-xs uppercase tracking-wider font-medium text-[var(--text-muted)]", children: e("uiConfiguration.presetsColScope") }),
                /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-medium rounded bg-[var(--bg-secondary)] text-[var(--text-primary)] border border-[var(--border-color)]", children: je }),
                /* @__PURE__ */ i("span", { className: "text-xs text-[var(--text-muted)] ml-auto", children: [
                  "(",
                  e("uiConfiguration.presetParentTheme"),
                  ")"
                ] })
              ] })
            ] }),
            l === "accent" && /* @__PURE__ */ r($, { title: e("uiConfiguration.presetTabAccent"), children: /* @__PURE__ */ r(cr, { value: m, onChange: ue, readOnly: D }) }),
            l === "backgrounds" && /* @__PURE__ */ r(
              lr,
              {
                values: {
                  backgrounds: ir(J, H, oe[m]?.shades[500] ?? "#6366f1", x),
                  text: he,
                  border: te,
                  accentHex: oe[m]?.shades[500] ?? "#6366f1",
                  borderWidth: te.width ?? 1
                },
                readOnlyCategories: ["text", "border"],
                readOnlyHint: e("uiConfiguration.presetTextBorderHint"),
                onChange: (t) => {
                  if (!t.backgrounds) return;
                  const a = t.backgrounds;
                  me({
                    mode: "custom",
                    custom: {
                      app: a.app,
                      primary: a.primary,
                      secondary: a.secondary,
                      card: a.card
                    }
                  });
                }
              }
            ),
            l === "dashboard" && /* @__PURE__ */ i($, { title: e("uiConfiguration.dataViz.tabLabel"), children: [
              /* @__PURE__ */ i("label", { className: "flex items-center gap-2 cursor-pointer", children: [
                /* @__PURE__ */ r(
                  "input",
                  {
                    type: "checkbox",
                    checked: v,
                    onChange: (t) => {
                      be(t.target.checked), t.target.checked && !b && ee(_);
                    },
                    className: "w-4 h-4"
                  }
                ),
                /* @__PURE__ */ r("span", { className: "text-sm text-[var(--text-primary)]", children: e("uiConfiguration.dataViz.presetInheritToggle") })
              ] }),
              !v && /* @__PURE__ */ r("p", { className: "text-xs text-[var(--text-tertiary)] mt-2", children: e("uiConfiguration.dataViz.presetInheritedHint") }),
              v && /* @__PURE__ */ r("div", { className: "mt-4", children: /* @__PURE__ */ r(
                ur,
                {
                  value: b ?? _,
                  onChange: ee,
                  mode: J,
                  seedAccentHex: oe[m]?.shades[500] ?? "#6366f1",
                  inherited: _
                }
              ) })
            ] }),
            l === "typography" && /* @__PURE__ */ i($, { title: e("uiConfiguration.presetTabTypography"), children: [
              /* @__PURE__ */ i("label", { className: "flex items-center gap-2 cursor-pointer", children: [
                /* @__PURE__ */ r(
                  "input",
                  {
                    type: "checkbox",
                    checked: C,
                    onChange: (t) => {
                      pe(t.target.checked), t.target.checked && !p && q(M);
                    },
                    className: "w-4 h-4"
                  }
                ),
                /* @__PURE__ */ r("span", { className: "text-sm text-[var(--text-primary)]", children: e("uiConfiguration.presetOverrideTypography") })
              ] }),
              C && /* @__PURE__ */ r(nr, { value: p ?? M, onChange: q })
            ] }),
            l === "spacing" && /* @__PURE__ */ i($, { title: e("uiConfiguration.presetTabSpacing"), children: [
              /* @__PURE__ */ i("label", { className: "flex items-center gap-2 cursor-pointer", children: [
                /* @__PURE__ */ r(
                  "input",
                  {
                    type: "checkbox",
                    checked: N,
                    onChange: (t) => {
                      ge(t.target.checked), t.target.checked && !g && X(G);
                    },
                    className: "w-4 h-4"
                  }
                ),
                /* @__PURE__ */ r("span", { className: "text-sm text-[var(--text-primary)]", children: e("uiConfiguration.presetOverrideRadius") })
              ] }),
              N && /* @__PURE__ */ r(mr, { value: g ?? G, onChange: X })
            ] })
          ] }),
          /* @__PURE__ */ r("div", { className: "lg:sticky lg:top-6 lg:self-start lg:max-h-[calc(100vh-3rem)] lg:overflow-y-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: /* @__PURE__ */ r(
            pr,
            {
              displayName: n?.name ?? "Preview",
              tagline: "",
              subdomain: "",
              defaultAccentColorKey: m,
              defaultThemeMode: J,
              defaultBorderRadius: Be,
              customAccentColors: [],
              itemPaletteKey: A ?? n?.defaultItemPaletteKey ?? "neutral",
              backgroundOverride: x,
              overridePalette: {
                backgrounds: H,
                text: he,
                border: te,
                status: Ve
              },
              typography: {
                fontStack: or(P.fontFamily),
                baseSize: P.baseSize,
                headingWeight: P.headingWeight,
                scale: P.scale,
                fontLabel: P.fontFamily
              },
              secondarySection: l === "typography" ? "typography" : l === "dashboard" ? "dataviz" : l === "spacing" ? "none" : "palettes",
              dataViz: Ee
            }
          ) })
        ] }),
        /* @__PURE__ */ r(
          sr,
          {
            isOpen: S !== null,
            variant: S === "reset" ? "warning" : "info",
            title: e(S === "reset" ? "uiConfiguration.resetConfirmTitle" : "uiConfiguration.saveConfirmTitle"),
            message: e(S === "reset" ? "uiConfiguration.resetConfirmMessage" : c ? "uiConfiguration.saveConfirmCreate" : "uiConfiguration.saveConfirmUpdate"),
            confirmLabel: e(S === "reset" ? "common:reset" : "common:save"),
            loading: k,
            onConfirm: S === "reset" ? Fe : Ke,
            onCancel: () => V(null)
          }
        )
      ]
    }
  );
}
function $({ title: e, description: s, children: d }) {
  return /* @__PURE__ */ i("section", { className: "rounded-[var(--radius-card)] bg-[var(--bg-secondary)] border border-[var(--border-color)] p-5 space-y-4", children: [
    /* @__PURE__ */ i("div", { children: [
      /* @__PURE__ */ r("h3", { className: "text-base font-semibold text-[var(--text-primary)]", children: e }),
      s && /* @__PURE__ */ r("p", { className: "text-sm text-[var(--text-secondary)] mt-1", children: s })
    ] }),
    d
  ] });
}
function Y({ label: e, children: s }) {
  return /* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
    /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-[var(--text-primary)]", children: e }),
    s
  ] });
}
export {
  Pr as PresetEditorPage
};
//# sourceMappingURL=PresetEditorPage-Cf_ahEDS.js.map
