import { jsxs as a, jsx as e } from "react/jsx-runtime";
import { EyeOff as m, Eye as d } from "lucide-react";
import { useState as p } from "react";
import { Button as f } from "../atoms/button.js";
import { Input as u } from "../atoms/input.js";
const N = ({
  mode: o,
  secretIsSet: i,
  disabled: t,
  ...c
}) => {
  const [r, l] = p(!1);
  let s = "Leave empty to keep current, or enter new secret to replace";
  return o === "create" ? s = "Enter client secret" : t && (s = "Client secret is configured and cannot be modified"), /* @__PURE__ */ a("div", { className: "space-y-2", children: [
    !!(o === "rotate" && (i ?? !1)) && /* @__PURE__ */ e("div", { className: "flex items-center justify-between rounded border-2 border-amber-200/60 bg-amber-50/30 p-2 dark:border-amber-800/40 dark:bg-amber-950/20", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
      /* @__PURE__ */ e("div", { className: "h-1.5 w-1.5 rounded-full bg-amber-500" }),
      /* @__PURE__ */ e("span", { className: "font-medium text-xs", children: "A secret is set" })
    ] }) }),
    /* @__PURE__ */ a("div", { className: "relative", children: [
      /* @__PURE__ */ e(
        u,
        {
          autoComplete: "client-secret",
          disabled: t,
          placeholder: s,
          type: r ? "text" : "password",
          ...c
        }
      ),
      /* @__PURE__ */ e(
        f,
        {
          "aria-label": r ? "Hide secret" : "Show secret",
          className: "absolute top-1/2 right-2 h-auto -translate-y-1/2 px-2 py-1",
          disabled: t,
          onClick: () => l((n) => !n),
          size: "sm",
          type: "button",
          variant: "ghost",
          children: r ? /* @__PURE__ */ e(m, { className: "size-4" }) : /* @__PURE__ */ e(d, { className: "size-4" })
        }
      )
    ] })
  ] });
};
export {
  N as ClientSecretInput
};
