import { cn as e } from "../../../lib/utils.js";
import { t } from "../../../button-BNOmhdpM.js";
import { ArcadeGrid as n } from "../atoms/arcade-grid.js";
import { ArcadeLogo as r } from "../atoms/icons/arcade-logo.js";
import { AuthTemplate as i, AuthTemplateCard as a, AuthTemplateContent as o, AuthTemplateDescription as s, AuthTemplateFooter as c, AuthTemplateHeader as l, AuthTemplateLegal as u, AuthTemplateLegalLink as d, AuthTemplateLogo as f, AuthTemplatePrompt as p, AuthTemplatePromptLink as m, AuthTemplateTitle as h, AuthTemplateVideoBackground as g } from "../templates/auth-template.js";
import { PUBLIC_VIDEO_URL as _ } from "../../../metadata/constants.js";
import { Fragment as v } from "react";
import { jsx as y, jsxs as b } from "react/jsx-runtime";
import { Loader2 as x, LogIn as S } from "lucide-react";
//#region lib/components/ui/pages/login-page.tsx
var C = `${_}/A_L_Orange_Pink.mp4`;
function w({ isLoading: e }) {
	return e ? /* @__PURE__ */ y(x, { className: "size-5 animate-spin" }) : /* @__PURE__ */ y(S, { className: "size-5" });
}
function T({ termsHref: e, privacyHref: t }) {
	let n = [e && {
		href: e,
		label: "Terms of Service"
	}, t && {
		href: t,
		label: "Privacy Policy"
	}].filter((e) => !!e);
	return n.length === 0 ? null : /* @__PURE__ */ b(u, { children: [
		"By continuing, you agree to the",
		" ",
		n.map((e, t) => /* @__PURE__ */ b(v, { children: [t > 0 && /* @__PURE__ */ y("span", { children: " and " }), /* @__PURE__ */ y(d, {
			href: e.href,
			children: e.label
		})] }, e.href))
	] });
}
function E({ isLoading: u = !1, loadingText: d = "Authenticating...", onSubmit: _, privacyHref: v, registerHref: x, submitText: S = "Sign in with Arcade", termsHref: E, videoSrc: D = C }) {
	let O = u ? d : S, k = x || E || v;
	return /* @__PURE__ */ b(i, { children: [
		/* @__PURE__ */ y("div", { className: "absolute -inset-4 z-0 bg-gradient-to-br from-rose-500/70 via-pink-400/50 to-amber-500/70 opacity-60 blur-lg brightness-50" }),
		D && /* @__PURE__ */ y(g, { src: D }),
		/* @__PURE__ */ y("div", {
			className: "absolute inset-0 z-1 opacity-[0.01]",
			children: /* @__PURE__ */ y(n, {
				className: "size-full",
				fill: "currentColor"
			})
		}),
		/* @__PURE__ */ y(f, { children: /* @__PURE__ */ y(r, { className: "h-12 w-auto text-zinc-900 dark:text-white" }) }),
		/* @__PURE__ */ b(a, { children: [
			/* @__PURE__ */ b(l, { children: [/* @__PURE__ */ y(h, { children: "Welcome back" }), /* @__PURE__ */ y(s, { children: "Sign in with your Arcade account to continue" })] }),
			/* @__PURE__ */ y(o, { children: /* @__PURE__ */ b(t, {
				className: e("group relative h-12 w-full overflow-hidden text-base transition-all duration-300", "hover:scale-[1.01] hover:shadow-md hover:brightness-105 active:scale-[0.99]"),
				disabled: u,
				onClick: _,
				size: "lg",
				children: [/* @__PURE__ */ b("span", {
					className: "relative z-10 flex items-center justify-center gap-2",
					children: [/* @__PURE__ */ y(w, { isLoading: u }), O]
				}), /* @__PURE__ */ y("div", { className: e("absolute inset-0 bg-gradient-to-r from-primary/5 via-primary/0 to-primary/5 transition-opacity duration-300 group-hover:opacity-100", u ? "pointer-events-none opacity-0" : "opacity-0") })]
			}) }),
			k && /* @__PURE__ */ b(c, { children: [x && /* @__PURE__ */ b(p, { children: [
				/* @__PURE__ */ y("span", {
					className: "text-muted-foreground text-sm",
					children: "Don't have an account?"
				}),
				" ",
				/* @__PURE__ */ y(m, {
					href: x,
					children: "Register"
				})
			] }), /* @__PURE__ */ y(T, {
				privacyHref: v,
				termsHref: E
			})] })
		] })
	] });
}
//#endregion
export { E as LoginPage };
