'use client';
import { jsx as s, jsxs as y, Fragment as q } from "react/jsx-runtime";
import { Card as R, CardHeader as X, Divider as z, CardBody as Y, CardFooter as Z } from "@heroui/react";
import { motion as _ } from "framer-motion";
import { SignInForm as E } from "./sign-in-form.js";
import { useConfig as F } from "../../../hooks/use-config.js";
import { useTheme as G } from "../../../hooks/use-theme.js";
function ts({
  variant: A = "shadow",
  className: v = "",
  padding: a = "lg",
  radius: x = "lg",
  shadow: N = "md",
  isBlurred: $ = !1,
  methods: C = ["password", "oauth", "magic-link"],
  email: S,
  organizationId: w,
  redirectUrl: j,
  onSuccess: h,
  onError: I,
  title: l,
  subtitle: o,
  size: V = "md",
  showBranding: b = !0,
  disabled: k = !1,
  footer: r,
  header: B,
  backgroundImage: f,
  backgroundGradient: p,
  animated: D = !0,
  maxWidth: n = 400,
  centered: t = !1,
  fullHeight: L = !1,
  showOrganizationBranding: O = !0,
  cardHeader: m,
  cardFooter: u,
  hideCardHeader: c = !1,
  hideCardFooter: g = !1
}) {
  const { components: J, organizationSettings: K } = F(), { getColorValue: W } = G(), P = J.SignInCard;
  if (P)
    return /* @__PURE__ */ s(P, { variant: A, className: v, padding: a, radius: x, shadow: N, isBlurred: $, methods: C, email: S, organizationId: w, redirectUrl: j, onSuccess: h, onError: I, title: l, subtitle: o, size: V, showBranding: b, disabled: k, footer: r, header: B, backgroundImage: f, backgroundGradient: p, animated: D, maxWidth: n, centered: t, fullHeight: L, showOrganizationBranding: O, cardHeader: m, cardFooter: u, hideCardHeader: c, hideCardFooter: g });
  const M = {
    hidden: {
      opacity: 0,
      y: 20,
      scale: 0.95
    },
    visible: {
      opacity: 1,
      y: 0,
      scale: 1,
      transition: {
        duration: 0.3,
        ease: "easeOut"
      }
    }
  }, i = {};
  f && (i.backgroundImage = `url(${f})`, i.backgroundSize = "cover", i.backgroundPosition = "center"), p && (i.background = p), n && (i.maxWidth = typeof n == "number" ? `${n}px` : n);
  const e = O && K?.branding, Q = [
    t ? "flex items-center justify-center min-h-screen p-4" : "",
    L ? "h-full" : ""
  ].filter(Boolean).join(" "), T = /* @__PURE__ */ y(
    R,
    {
      className: `${v} ${t ? "w-full" : ""}`,
      style: i,
      shadow: N,
      radius: x,
      isBlurred: $,
      children: [
        !c && (m || l || o || e) && /* @__PURE__ */ s(X, { className: `flex flex-col items-center text-center gap-2 p-${a}`, children: m || /* @__PURE__ */ y(q, { children: [
          e?.logoUrl && /* @__PURE__ */ s(
            "img",
            {
              src: e.logoUrl,
              alt: "Organization Logo",
              className: "h-12 w-auto mb-2"
            }
          ),
          l && /* @__PURE__ */ s("h1", { className: "text-2xl font-bold text-foreground", children: l }),
          o && /* @__PURE__ */ s("p", { className: "text-default-500 text-sm max-w-sm", children: o }),
          B
        ] }) }),
        !c && (m || l || o || e) && !g && /* @__PURE__ */ s(z, {}),
        /* @__PURE__ */ s(Y, { className: `p-${a}`, children: /* @__PURE__ */ s(
          E,
          {
            methods: C,
            email: S,
            organizationId: w,
            redirectUrl: j,
            onSuccess: h,
            onError: I,
            title: c ? l : void 0,
            subtitle: c ? o : void 0,
            size: V,
            showBranding: c ? b : !1,
            disabled: k,
            variant: "minimal",
            className: "space-y-4"
          }
        ) }),
        !g && (u || r) && /* @__PURE__ */ y(q, { children: [
          /* @__PURE__ */ s(z, {}),
          /* @__PURE__ */ s(Z, { className: `p-${a} text-center`, children: u || r })
        ] })
      ]
    }
  ), U = D ? /* @__PURE__ */ s(
    _.div,
    {
      initial: "hidden",
      animate: "visible",
      variants: M,
      style: { maxWidth: n },
      className: t ? "w-full" : "",
      children: T
    }
  ) : /* @__PURE__ */ s("div", { style: { maxWidth: n }, className: t ? "w-full" : "", children: T });
  return t ? /* @__PURE__ */ s("div", { className: Q, children: U }) : U;
}
export {
  ts as SignInCard
};
//# sourceMappingURL=sign-in-card.js.map
