import { o as I } from "./rolldown-runtime.js";
import { i as R, t as D } from "./vendor/react.js";
import { t } from "./Button.js";
import { t as G } from "./dist.js";
import { t as c } from "./utils.js";
import { t as O } from "./PageBackground.js";
import { t as g } from "./Input2.js";
import { t as w } from "./separator2.js";
import { t as W } from "./BrandIcon.js";
import { t as J } from "./Checkbox.js";
var o = /* @__PURE__ */ I(R(), 1), e = D(), K = G("min-h-screen w-full flex items-center justify-center relative overflow-hidden", {
  variants: { variant: {
    simple: "",
    "social-logins": "",
    "social-leading": ""
  } },
  defaultVariants: { variant: "simple" }
});
function r({ icon: a, label: d, onClick: l, disabled: m }) {
  return /* @__PURE__ */ (0, e.jsx)(t, {
    type: "button",
    appearance: "outline",
    variant: "secondary",
    size: "lg",
    className: "w-full",
    onClick: l,
    disabled: m,
    startIcon: /* @__PURE__ */ (0, e.jsx)("span", {
      "aria-hidden": "true",
      children: a
    }),
    children: d
  });
}
r.displayName = "SocialButton";
function p({ className: a }) {
  return /* @__PURE__ */ (0, e.jsxs)("svg", {
    className: c("size-6", a),
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    "aria-hidden": "true",
    children: [
      /* @__PURE__ */ (0, e.jsx)("path", {
        d: "M22.501 12.2332C22.501 11.3699 22.4296 10.7399 22.2748 10.0865H12.2153V13.9832H18.12C18.001 14.9515 17.3582 16.4099 15.9296 17.3898L15.9096 17.5203L19.0902 19.9349L19.3106 19.9565C21.3343 18.1249 22.501 15.4298 22.501 12.2332Z",
        fill: "var(--brand-google-blue)"
      }),
      /* @__PURE__ */ (0, e.jsx)("path", {
        d: "M12.214 22.5C15.1068 22.5 17.5353 21.5666 19.3092 19.9567L15.9282 17.39C15.0235 18.0083 13.8092 18.4399 12.214 18.4399C9.38069 18.4399 6.97596 16.6083 6.11874 14.0766L5.99309 14.0871L2.68583 16.5954L2.64258 16.7132C4.40446 20.1433 8.0235 22.5 12.214 22.5Z",
        fill: "var(--brand-google-green)"
      }),
      /* @__PURE__ */ (0, e.jsx)("path", {
        d: "M6.12046 14.0767C5.89428 13.4234 5.76337 12.7233 5.76337 12C5.76337 11.2767 5.89428 10.5767 6.10856 9.92337L6.10257 9.78423L2.75386 7.2356L2.64429 7.28667C1.91814 8.71002 1.50146 10.3084 1.50146 12C1.50146 13.6917 1.91814 15.29 2.64429 16.7133L6.12046 14.0767Z",
        fill: "var(--brand-google-yellow)"
      }),
      /* @__PURE__ */ (0, e.jsx)("path", {
        d: "M12.2141 5.55997C14.2259 5.55997 15.583 6.41163 16.3569 7.12335L19.3807 4.23C17.5236 2.53834 15.1069 1.5 12.2141 1.5C8.02353 1.5 4.40447 3.85665 2.64258 7.28662L6.10686 9.92332C6.97598 7.39166 9.38073 5.55997 12.2141 5.55997Z",
        fill: "var(--brand-google-red)"
      })
    ]
  });
}
function Q({ className: a }) {
  return /* @__PURE__ */ (0, e.jsxs)("svg", {
    className: c("size-6", a),
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    "aria-hidden": "true",
    children: [/* @__PURE__ */ (0, e.jsx)("path", {
      d: "M24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 17.9895 4.3882 22.954 10.125 23.8542V15.4688H7.07812V12H10.125V9.35625C10.125 6.34875 11.9166 4.6875 14.6576 4.6875C15.9701 4.6875 17.3438 4.92188 17.3438 4.92188V7.875H15.8306C14.34 7.875 13.875 8.80008 13.875 9.75V12H17.2031L16.6711 15.4688H13.875V23.8542C19.6118 22.954 24 17.9895 24 12Z",
      fill: "var(--brand-facebook)"
    }), /* @__PURE__ */ (0, e.jsx)("path", {
      d: "M16.6711 15.4688L17.2031 12H13.875V9.75C13.875 8.80102 14.34 7.875 15.8306 7.875H17.3438V4.92188C17.3438 4.92188 15.9705 4.6875 14.6576 4.6875C11.9166 4.6875 10.125 6.34875 10.125 9.35625V12H7.07812V15.4688H10.125V23.8542C11.3674 24.0486 12.6326 24.0486 13.875 23.8542V15.4688H16.6711Z",
      fill: "var(--card)"
    })]
  });
}
function T({ className: a }) {
  return /* @__PURE__ */ (0, e.jsx)("svg", {
    className: c("size-6", a),
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    "aria-hidden": "true",
    children: /* @__PURE__ */ (0, e.jsx)("path", {
      d: "M17.5438 23.5312C16.3688 24.4812 15.1125 24.4 13.9125 23.8688C12.6437 23.3188 11.475 23.3 10.15 23.8688C8.46875 24.5938 7.54375 24.475 6.49375 23.5312C0.88125 17.7437 1.71875 8.56875 8.0875 8.24375C9.66875 8.32499 10.7875 9.125 11.7375 9.1875C13.1 8.89375 14.4062 8.075 15.8562 8.18125C17.5938 8.32499 18.9187 9.03125 19.8125 10.2875C16.0875 12.4625 16.9 17.5312 20.3188 18.8812C19.6375 20.6375 18.7438 22.375 17.525 23.55L17.5438 23.5312ZM11.6 8.16875C11.4312 5.6875 13.4625 3.64375 15.7875 3.46875C16.1 6.25 13.2437 8.39375 11.6 8.16875Z",
      fill: "var(--brand-apple)"
    })
  });
}
var U = o.forwardRef(function({ className: d, variant: l = "simple", logo: m, showTabs: y = !0, title: u = "Log in to your account", subtitle: v, submitLabel: N, footerText: L = "Don't have an account?", footerLinkText: k = "Sign up", onSignUpClick: S, onLogInClick: V, onEmailSubmit: f, onForgotPasswordClick: z, onSignUpLinkClick: H, onGoogleSignIn: x, onFacebookSignIn: M, onAppleSignIn: B, onSAMLSignIn: P, loading: s = !1, error: h }, Z) {
  const [n, j] = o.useState(""), [C, _] = o.useState(""), [q, E] = o.useState(!1), b = v ?? (l === "simple" ? "Welcome back! Please enter your details." : void 0), F = N ?? (l === "social-logins" || l === "social-leading" ? "Continue with email" : "Sign in"), A = (i) => {
    i.preventDefault(), l === "social-leading" || l === "social-logins" ? f?.(n) : f?.(n, C);
  };
  return /* @__PURE__ */ (0, e.jsxs)("div", {
    ref: Z,
    "data-slot": "login-page",
    className: c(K({ variant: l }), d),
    children: [/* @__PURE__ */ (0, e.jsx)(O, {
      pattern: l === "social-leading" ? "circular" : "grid",
      offset: "top"
    }), /* @__PURE__ */ (0, e.jsx)("main", {
      className: "relative z-10 w-full max-w-[1280px] px-8 flex flex-col items-center",
      children: /* @__PURE__ */ (0, e.jsxs)("div", {
        className: "w-full max-w-[360px] flex flex-col gap-8 items-center",
        children: [
          /* @__PURE__ */ (0, e.jsxs)("div", {
            className: "w-full flex flex-col gap-6 items-center",
            children: [
              /* @__PURE__ */ (0, e.jsx)("div", {
                className: "delight-stagger",
                children: m || /* @__PURE__ */ (0, e.jsx)(W, {
                  icon: "mark",
                  size: "xl"
                })
              }),
              (l === "simple" || l === "social-logins") && /* @__PURE__ */ (0, e.jsxs)("div", {
                className: "w-full flex flex-col gap-3 text-center delight-stagger",
                style: { "--delight-delay": "100ms" },
                children: [/* @__PURE__ */ (0, e.jsx)("h1", {
                  className: "text-display-xs md:text-display-sm font-semibold text-foreground",
                  children: u
                }), b && /* @__PURE__ */ (0, e.jsx)("p", {
                  className: "text-base leading-6 text-muted-foreground",
                  children: b
                })]
              }),
              l === "social-leading" && /* @__PURE__ */ (0, e.jsx)("h1", {
                className: "text-display-xs md:text-display-sm font-semibold text-foreground text-center w-full delight-stagger",
                style: { "--delight-delay": "100ms" },
                children: u
              }),
              l === "simple" && y && /* @__PURE__ */ (0, e.jsxs)("nav", {
                className: "w-full flex gap-0.5 bg-card/60 border border-border rounded-lg p-0.5 delight-stagger",
                "aria-label": "Account action",
                style: { "--delight-delay": "200ms" },
                children: [/* @__PURE__ */ (0, e.jsx)(t, {
                  type: "button",
                  appearance: "ghost",
                  variant: "secondary",
                  size: "lg",
                  className: "flex-1",
                  onClick: S,
                  children: "Sign up"
                }), /* @__PURE__ */ (0, e.jsx)(t, {
                  type: "button",
                  appearance: "outline",
                  variant: "secondary",
                  size: "lg",
                  className: "flex-1",
                  onClick: V,
                  children: "Log in"
                })]
              })
            ]
          }),
          /* @__PURE__ */ (0, e.jsxs)("form", {
            onSubmit: A,
            className: "w-full flex flex-col gap-6 delight-stagger",
            style: { "--delight-delay": "300ms" },
            children: [
              l === "social-leading" && /* @__PURE__ */ (0, e.jsxs)(e.Fragment, { children: [/* @__PURE__ */ (0, e.jsx)("div", {
                className: "w-full flex flex-col gap-3",
                children: /* @__PURE__ */ (0, e.jsx)(r, {
                  icon: /* @__PURE__ */ (0, e.jsx)(p, {}),
                  label: "Continue with Google",
                  onClick: x,
                  disabled: s
                })
              }), /* @__PURE__ */ (0, e.jsx)(w, {})] }),
              l === "simple" && /* @__PURE__ */ (0, e.jsxs)("div", {
                className: "w-full flex flex-col gap-5",
                children: [/* @__PURE__ */ (0, e.jsx)(g, {
                  type: "email",
                  label: "Email",
                  placeholder: "Enter your email",
                  value: n,
                  onChange: (i) => j(i.target.value),
                  required: !0,
                  disabled: s,
                  error: h
                }), /* @__PURE__ */ (0, e.jsx)(g, {
                  type: "password",
                  label: "Password",
                  placeholder: "••••••••",
                  value: C,
                  onChange: (i) => _(i.target.value),
                  required: !0,
                  disabled: s
                })]
              }),
              (l === "social-logins" || l === "social-leading") && /* @__PURE__ */ (0, e.jsx)("div", {
                className: "w-full flex flex-col gap-4",
                children: /* @__PURE__ */ (0, e.jsx)(g, {
                  type: "email",
                  label: "Email",
                  placeholder: "Enter your email",
                  value: n,
                  onChange: (i) => j(i.target.value),
                  required: !0,
                  disabled: s,
                  error: h
                })
              }),
              l === "simple" && /* @__PURE__ */ (0, e.jsxs)("div", {
                className: "w-full flex items-center justify-between",
                children: [/* @__PURE__ */ (0, e.jsx)(J, {
                  label: "Remember for 30 days",
                  defaultChecked: q,
                  onCheckedChange: E,
                  disabled: s
                }), /* @__PURE__ */ (0, e.jsx)(t, {
                  type: "button",
                  appearance: "link",
                  variant: "primary",
                  size: "sm",
                  onClick: z,
                  disabled: s,
                  children: "Forgot password"
                })]
              }),
              /* @__PURE__ */ (0, e.jsxs)("div", {
                className: "w-full flex flex-col gap-4 delight-stagger",
                style: { "--delight-delay": "400ms" },
                children: [
                  /* @__PURE__ */ (0, e.jsx)(t, {
                    type: "submit",
                    variant: "primary",
                    size: "lg",
                    className: "w-full",
                    loading: s,
                    children: F
                  }),
                  l === "simple" && /* @__PURE__ */ (0, e.jsx)(r, {
                    icon: /* @__PURE__ */ (0, e.jsx)(p, {}),
                    label: "Sign in with Google",
                    onClick: x,
                    disabled: s
                  }),
                  l === "social-logins" && /* @__PURE__ */ (0, e.jsxs)(e.Fragment, { children: [/* @__PURE__ */ (0, e.jsx)(w, { label: "OR" }), /* @__PURE__ */ (0, e.jsxs)("div", {
                    className: "w-full flex flex-col gap-3",
                    children: [
                      /* @__PURE__ */ (0, e.jsx)(r, {
                        icon: /* @__PURE__ */ (0, e.jsx)(p, {}),
                        label: "Continue with Google",
                        onClick: x,
                        disabled: s
                      }),
                      /* @__PURE__ */ (0, e.jsx)(r, {
                        icon: /* @__PURE__ */ (0, e.jsx)(Q, {}),
                        label: "Continue with Facebook",
                        onClick: M,
                        disabled: s
                      }),
                      /* @__PURE__ */ (0, e.jsx)(r, {
                        icon: /* @__PURE__ */ (0, e.jsx)(T, {}),
                        label: "Continue with Apple",
                        onClick: B,
                        disabled: s
                      })
                    ]
                  })] })
                ]
              })
            ]
          }),
          l === "simple" || l === "social-logins" ? /* @__PURE__ */ (0, e.jsxs)("div", {
            className: "w-full flex items-baseline justify-center gap-1 delight-stagger",
            style: { "--delight-delay": "500ms" },
            children: [/* @__PURE__ */ (0, e.jsx)("p", {
              className: "text-sm leading-5 text-muted-foreground",
              children: L
            }), /* @__PURE__ */ (0, e.jsx)(t, {
              type: "button",
              appearance: "link",
              variant: "primary",
              size: "sm",
              onClick: H,
              disabled: s,
              children: k
            })]
          }) : /* @__PURE__ */ (0, e.jsx)(t, {
            type: "button",
            appearance: "link",
            variant: "primary",
            size: "sm",
            className: "delight-stagger",
            style: { "--delight-delay": "500ms" },
            onClick: P,
            disabled: s,
            children: "Continue with SAML SSO"
          })
        ]
      })
    })]
  });
});
U.displayName = "LoginPage";
export {
  r as a,
  U as i,
  Q as n,
  p as r,
  T as t
};

//# sourceMappingURL=LoginPage.js.map