@burdenoff/microfe-auth 2026.518.1 → 2026.518.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,16 +4,17 @@ import { useMyWorkspaces as n } from "../hooks/useMyWorkspaces.js";
4
4
  import { useOAuthOperations as r } from "../hooks/useOAuthOperations.js";
5
5
  import "../hooks/index.js";
6
6
  import { AuthLayout as i } from "../components/AuthLayout.js";
7
- import { AlertIcon as a, EmailIcon as ee, EyeIcon as te, EyeOffIcon as ne, GoogleIcon as re, LockIcon as ie, MicrosoftIcon as ae, SpinnerIcon as oe } from "../components/AuthIcons.js";
8
- import { useCaptchaV3 as se } from "../hooks/useCaptchaV3.js";
9
- import { useCallback as o, useEffect as s, useRef as ce, useState as c } from "react";
10
- import { SSORedirectSpinner as le, getSSORedirectUrl as ue } from "@burdenoff/fe-libs/shared/components";
11
- import { useLocation as de, useNavigate as fe, useSearchParams as pe } from "react-router-dom";
12
- import { useActiveContext as me, useI18n as he } from "@burdenoff/fe-libs/shared/providers/shell";
13
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
14
- import { getProfileTokens as ge, getProfileUser as _e, getProfiles as ve, resolveActiveProfileId as ye } from "@burdenoff/fe-libs/shared/providers/shell/ProfileStorageManager";
7
+ import { AlertIcon as a, EmailIcon as o, EyeIcon as s, EyeOffIcon as ee, GoogleIcon as c, LockIcon as l, MicrosoftIcon as u, SpinnerIcon as te } from "../components/AuthIcons.js";
8
+ import { useCaptchaV3 as ne } from "../hooks/useCaptchaV3.js";
9
+ import { useCallback as d, useEffect as f, useRef as re, useState as p } from "react";
10
+ import { SSORedirectSpinner as ie, getSSORedirectUrl as ae } from "@burdenoff/fe-libs/shared/components";
11
+ import { useLocation as oe, useNavigate as se, useSearchParams as ce } from "react-router-dom";
12
+ import { useActiveContext as le, useI18n as ue } from "@burdenoff/fe-libs/shared/providers/shell";
13
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
14
+ import { resolveAuthBridgeConfig as de } from "@burdenoff/fe-libs/shared/config";
15
+ import { getProfileTokens as _, getProfileUser as v, getProfileWorkspaceToken as fe, getProfiles as pe, resolveActiveProfileId as me } from "@burdenoff/fe-libs/shared/providers/shell/ProfileStorageManager";
15
16
  //#region src/auth/pages/LoginPage.tsx
16
- function be(e) {
17
+ function he(e) {
17
18
  try {
18
19
  let t = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "="), r = JSON.parse(atob(n));
19
20
  return typeof r.exp == "number" && r.exp > Date.now() / 1e3;
@@ -21,7 +22,7 @@ function be(e) {
21
22
  return !1;
22
23
  }
23
24
  }
24
- function xe(e) {
25
+ function ge(e) {
25
26
  if (!e) return null;
26
27
  try {
27
28
  let t = new URL(decodeURIComponent(e), window.location.origin);
@@ -30,48 +31,70 @@ function xe(e) {
30
31
  return null;
31
32
  }
32
33
  }
33
- function f() {
34
- let f = fe(), p = de(), [m] = pe(), { t: h } = he(), g = o((e, t) => {
35
- let n = h(e);
34
+ function y() {
35
+ let y = se(), _e = oe(), [b] = ce(), { t: ve } = ue(), x = d((e, t) => {
36
+ let n = ve(e);
36
37
  return n === e ? t : n;
37
- }, [h]), { signIn: Se, isLoading: _, error: v, errorCode: y, resendVerification: Ce } = t(), { completeAuthFlow: we } = n(), { setWorkspace: b, setOrganization: x } = me(), { initiateGoogleOAuth: Te, initiateMicrosoftOAuth: Ee, isProviderConfigured: S } = r(), C = e((e) => e.mfaRequired), { executeRecaptcha: De } = se(), [w, T] = c(!1), [Oe, ke] = c(!1), E = o((e) => {
38
+ }, [ve]), { signIn: ye, isLoading: be, error: S, errorCode: C, resendVerification: xe } = t(), { completeAuthFlow: Se } = n(), { setWorkspace: w, setOrganization: T } = le(), { initiateGoogleOAuth: Ce, initiateMicrosoftOAuth: we, isProviderConfigured: E } = r(), D = e((e) => e.mfaRequired), { executeRecaptcha: Te } = ne(), [O, k] = p(!1), [Ee, De] = p(!1), A = d((e) => {
39
+ if (typeof window > "u") return e;
40
+ try {
41
+ let t = de(), n = new URL(t.url), r = window.location.origin;
42
+ if (n.origin === r) return e;
43
+ let i = new URL(e, r).href, a = me();
44
+ if (!a) return e;
45
+ let o = _(a), s = v(a);
46
+ if (!o || !s) return e;
47
+ let ee = fe(a), c = {
48
+ profileId: a,
49
+ tokens: JSON.stringify({
50
+ ...o,
51
+ workspaceToken: ee
52
+ }),
53
+ user: JSON.stringify(s),
54
+ profiles: JSON.stringify(pe())
55
+ }, l = btoa(JSON.stringify(c)), u = new URL("/auth/sso-deposit", n.origin);
56
+ return u.searchParams.set("returnTo", i), `${u.href}#sso=${l}`;
57
+ } catch {
58
+ return e;
59
+ }
60
+ }, []), j = d((e) => {
38
61
  if (typeof window < "u") {
39
62
  try {
40
63
  sessionStorage.setItem("bf-post-login-return-to", e);
41
64
  } catch {}
42
- window.location.assign(e);
65
+ window.location.assign(A(e));
43
66
  return;
44
67
  }
45
- f(e);
46
- }, [f]), [D, Ae] = c(!1), [O, k] = c(!1), [je, A] = c(!1), [Me, j] = c(!1), [M, N] = c(!1), [P, F] = c(!1), [I, L] = c(!1), [Ne, R] = c(!1), [z, B] = c(null), [V, H] = c(null), [U, W] = c({
68
+ y(e);
69
+ }, [y, A]), [M, Oe] = p(!1), [N, P] = p(!1), [ke, F] = p(!1), [Ae, I] = p(!1), [L, R] = p(!1), [z, B] = p(!1), [V, H] = p(!1), [je, U] = p(!1), [Me, W] = p(null), [Ne, Pe] = p(null), [G, K] = p({
47
70
  email: "",
48
71
  password: "",
49
72
  rememberMe: !1
50
- }), [G, K] = c(null), [q, J] = c(!1), Y = m.get("mode") === "add-account", X = m.get("returnTo"), Z = ce(X);
51
- s(() => {
52
- !Z.current && X && (Z.current = X);
53
- }, [X]), s(() => {
54
- if (Y || w) return;
55
- let t = ye();
73
+ }), [q, J] = p(null), [Fe, Y] = p(!1), X = b.get("mode") === "add-account", Z = b.get("returnTo"), Q = re(Z);
74
+ f(() => {
75
+ !Q.current && Z && (Q.current = Z);
76
+ }, [Z]), f(() => {
77
+ if (X || O) return;
78
+ let t = me();
56
79
  if (t) {
57
- let n = ge(t), r = _e(t);
58
- if (n?.accessToken && r && be(n.accessToken)) {
59
- e.getState().loadFromProfile(t), E(xe(X) ?? "/");
80
+ let n = _(t), r = v(t);
81
+ if (n?.accessToken && r && he(n.accessToken)) {
82
+ e.getState().loadFromProfile(t), j(ge(Z) ?? "/");
60
83
  return;
61
84
  }
62
85
  }
63
- let n = ue();
64
- n && (ke(!0), window.location.replace(n));
86
+ let n = ae();
87
+ n && (De(!0), window.location.replace(n));
65
88
  }, [
66
- Y,
67
- w,
68
- E,
69
- X
70
- ]), s(() => {
89
+ X,
90
+ O,
91
+ j,
92
+ Z
93
+ ]), f(() => {
71
94
  try {
72
95
  localStorage.removeItem("remembered_password");
73
96
  let e = localStorage.getItem("remembered_email");
74
- e && W((t) => ({
97
+ e && K((t) => ({
75
98
  ...t,
76
99
  email: e,
77
100
  rememberMe: !0
@@ -79,14 +102,14 @@ function f() {
79
102
  } catch (e) {
80
103
  console.warn("[LoginPage] Failed to load remembered email:", e);
81
104
  }
82
- }, []), s(() => {
83
- let e = p.state;
84
- e?.message && H(e.message), e?.email && W((t) => ({
105
+ }, []), f(() => {
106
+ let e = _e.state;
107
+ e?.message && Pe(e.message), e?.email && K((t) => ({
85
108
  ...t,
86
109
  email: e.email
87
110
  })), e && window.history.replaceState({}, document.title);
88
- }, [p.state]);
89
- let Pe = (e, t) => {
111
+ }, [_e.state]);
112
+ let Ie = (e, t) => {
90
113
  if (t) switch (t) {
91
114
  case "ACCOUNT_DELETED": return "DELETED";
92
115
  case "ACCOUNT_SUSPENDED": return "SUSPENDED";
@@ -99,44 +122,44 @@ function f() {
99
122
  let n = e.toLowerCase();
100
123
  return n.includes("deleted") || n.includes("permanently deleted") ? "DELETED" : n.includes("suspended") ? "SUSPENDED" : n.includes("oauth provider") || n.includes("oauth-only") || n.includes("oauth only") ? "OAUTH_ONLY" : n.includes("inactive") || n.includes("deactivated") || n.includes("not active") ? "INACTIVE" : n.includes("verify your email") || n.includes("email not verified") || n.includes("email_not_verified") ? "EMAIL_NOT_VERIFIED" : null;
101
124
  };
102
- s(() => {
103
- let e = m.get("email");
104
- if (e && W((t) => ({
125
+ f(() => {
126
+ let e = b.get("email");
127
+ if (e && K((t) => ({
105
128
  ...t,
106
129
  email: e
107
- })), m.get("expired") === "true") {
108
- H(g("auth.login.sessionExpired", "Your session has expired. Please sign in again."));
130
+ })), b.get("expired") === "true") {
131
+ Pe(x("auth.login.sessionExpired", "Your session has expired. Please sign in again."));
109
132
  let e = window.location.pathname;
110
133
  window.history.replaceState({}, document.title, e);
111
134
  }
112
- }, [m, g]), s(() => {
113
- C && f("/auth/mfa-verify");
114
- }, [C, f]);
115
- let Fe = async (t) => {
116
- t.preventDefault(), k(!1), A(!1), j(!1), N(!1), F(!1), J(!1), R(!1), K(null);
117
- let n = (U.email ?? "").trim();
135
+ }, [b, x]), f(() => {
136
+ D && y("/auth/mfa-verify");
137
+ }, [D, y]);
138
+ let Le = async (t) => {
139
+ t.preventDefault(), P(!1), F(!1), I(!1), R(!1), B(!1), Y(!1), U(!1), J(null);
140
+ let n = (G.email ?? "").trim();
118
141
  if (!n) {
119
- K(g("auth.login.enterEmailOrUsername", "Please enter your email or username"));
142
+ J(x("auth.login.enterEmailOrUsername", "Please enter your email or username"));
120
143
  return;
121
144
  }
122
145
  if (n.includes("@") && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)) {
123
- K(g("auth.login.invalidEmail", "Please enter a valid email address"));
146
+ J(x("auth.login.invalidEmail", "Please enter a valid email address"));
124
147
  return;
125
148
  }
126
- if (!U.password || U.password.length < 1) {
127
- K(g("auth.login.enterPassword", "Please enter your password"));
149
+ if (!G.password || G.password.length < 1) {
150
+ J(x("auth.login.enterPassword", "Please enter your password"));
128
151
  return;
129
152
  }
130
- if (Y && ve().some((e) => e.email.toLowerCase() === n.toLowerCase())) {
131
- J(!0), K(null);
153
+ if (X && pe().some((e) => e.email.toLowerCase() === n.toLowerCase())) {
154
+ Y(!0), J(null);
132
155
  return;
133
156
  }
134
- J(!1);
157
+ Y(!1);
135
158
  try {
136
- let e = await De("login"), t = await Se({
159
+ let e = await Te("login"), t = await ye({
137
160
  email: n,
138
- password: U.password,
139
- rememberMe: U.rememberMe,
161
+ password: G.password,
162
+ rememberMe: G.rememberMe,
140
163
  ...e ? { recaptchaToken: e } : {}
141
164
  });
142
165
  if (t.requiresMFA) return;
@@ -152,14 +175,14 @@ function f() {
152
175
  }
153
176
  } catch {}
154
177
  try {
155
- U.rememberMe ? localStorage.setItem("remembered_email", n) : localStorage.removeItem("remembered_email");
178
+ G.rememberMe ? localStorage.setItem("remembered_email", n) : localStorage.removeItem("remembered_email");
156
179
  } catch (e) {
157
180
  console.warn("[LoginPage] Failed to save/clear remembered email:", e);
158
181
  }
159
- T(!0);
160
- let e = Z.current || X, r = e ? decodeURIComponent(e) : "/dashboard";
182
+ k(!0);
183
+ let e = Q.current || Z, r = e ? decodeURIComponent(e) : "/dashboard";
161
184
  try {
162
- let e = await Promise.race([we(t.token), new Promise((e) => {
185
+ let e = await Promise.race([Se(t.token), new Promise((e) => {
163
186
  window.setTimeout(() => {
164
187
  e({
165
188
  success: !1,
@@ -167,270 +190,270 @@ function f() {
167
190
  });
168
191
  }, 5e3);
169
192
  })]);
170
- e.success ? (e.workspace && (b(e.workspace.id), e.workspace.organizationId && x(e.workspace.organizationId)), E(r)) : e.error?.includes("No workspaces found") ? f("/onboarding/create-workspace") : (e.workspace && (b(e.workspace.id), e.workspace.organizationId && x(e.workspace.organizationId)), console.warn("Auth flow warning:", e.error), E(r));
193
+ e.success ? (e.workspace && (w(e.workspace.id), e.workspace.organizationId && T(e.workspace.organizationId)), j(r)) : e.error?.includes("No workspaces found") ? y("/onboarding/create-workspace") : (e.workspace && (w(e.workspace.id), e.workspace.organizationId && T(e.workspace.organizationId)), console.warn("Auth flow warning:", e.error), j(r));
171
194
  } catch (e) {
172
- console.error("Auth flow error (login succeeded):", e), E(r);
195
+ console.error("Auth flow error (login succeeded):", e), j(r);
173
196
  } finally {
174
- T(!1);
197
+ k(!1);
175
198
  }
176
199
  }
177
200
  } catch (t) {
178
201
  let n = t instanceof Error ? t.message : String(t);
179
- n.includes("reCAPTCHA") && K(n);
180
- let r = e.getState().errorCode, i = Pe(n, r);
181
- i === "DELETED" ? A(!0) : i === "SUSPENDED" ? j(!0) : i === "OAUTH_ONLY" ? N(!0) : i === "INACTIVE" ? k(!0) : i === "EMAIL_NOT_VERIFIED" && F(!0);
202
+ n.includes("reCAPTCHA") && J(n);
203
+ let r = e.getState().errorCode, i = Ie(n, r);
204
+ i === "DELETED" ? F(!0) : i === "SUSPENDED" ? I(!0) : i === "OAUTH_ONLY" ? R(!0) : i === "INACTIVE" ? P(!0) : i === "EMAIL_NOT_VERIFIED" && B(!0);
182
205
  }
183
206
  };
184
- s(() => {
185
- if (v) {
186
- let e = Pe(v, y);
187
- e === "DELETED" ? A(!0) : e === "SUSPENDED" ? j(!0) : e === "OAUTH_ONLY" ? N(!0) : e === "INACTIVE" ? k(!0) : e === "EMAIL_NOT_VERIFIED" && F(!0);
207
+ f(() => {
208
+ if (S) {
209
+ let e = Ie(S, C);
210
+ e === "DELETED" ? F(!0) : e === "SUSPENDED" ? I(!0) : e === "OAUTH_ONLY" ? R(!0) : e === "INACTIVE" ? P(!0) : e === "EMAIL_NOT_VERIFIED" && B(!0);
188
211
  }
189
- }, [v, y]);
190
- let Ie = () => {
191
- B(null);
212
+ }, [S, C]);
213
+ let $ = () => {
214
+ W(null);
192
215
  try {
193
- Te();
216
+ Ce();
194
217
  } catch (e) {
195
- B(e instanceof Error ? e.message : g("auth.login.googleSignInFailed", "Failed to initiate Google sign in"));
218
+ W(e instanceof Error ? e.message : x("auth.login.googleSignInFailed", "Failed to initiate Google sign in"));
196
219
  }
197
- }, Q = () => {
198
- B(null);
220
+ }, Re = () => {
221
+ W(null);
199
222
  try {
200
- Ee();
223
+ we();
201
224
  } catch (e) {
202
- B(e instanceof Error ? e.message : g("auth.login.microsoftSignInFailed", "Failed to initiate Microsoft sign in"));
225
+ W(e instanceof Error ? e.message : x("auth.login.microsoftSignInFailed", "Failed to initiate Microsoft sign in"));
203
226
  }
204
- }, Le = async () => {
205
- L(!0), R(!1);
227
+ }, ze = async () => {
228
+ H(!0), U(!1);
206
229
  try {
207
- (await Ce((U.email ?? "").trim())).success ? R(!0) : K(g("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
230
+ (await xe((G.email ?? "").trim())).success ? U(!0) : J(x("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
208
231
  } catch (e) {
209
- console.error("Failed to resend verification email:", e), K(e instanceof Error ? e.message : g("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
232
+ console.error("Failed to resend verification email:", e), J(e instanceof Error ? e.message : x("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
210
233
  } finally {
211
- L(!1);
234
+ H(!1);
212
235
  }
213
- }, Re = S("google"), $ = S("microsoft"), ze = [{
236
+ }, Be = E("google"), Ve = E("microsoft"), He = [{
214
237
  name: "Google",
215
- icon: re,
216
- onClick: Ie,
217
- disabled: !Re,
218
- tooltip: Re ? void 0 : g("auth.login.googleNotConfigured", "Google sign in is not configured")
238
+ icon: c,
239
+ onClick: $,
240
+ disabled: !Be,
241
+ tooltip: Be ? void 0 : x("auth.login.googleNotConfigured", "Google sign in is not configured")
219
242
  }, {
220
243
  name: "Microsoft",
221
- icon: ae,
222
- onClick: Q,
223
- disabled: !$,
224
- tooltip: $ ? void 0 : g("auth.login.microsoftNotConfigured", "Microsoft sign in is not configured")
244
+ icon: u,
245
+ onClick: Re,
246
+ disabled: !Ve,
247
+ tooltip: Ve ? void 0 : x("auth.login.microsoftNotConfigured", "Microsoft sign in is not configured")
225
248
  }];
226
- return Oe ? /* @__PURE__ */ u(le, {}) : /* @__PURE__ */ d(i, {
227
- title: g("auth.login.welcomeBack", "Welcome back"),
228
- subtitle: g("auth.login.enterCredentials", "Enter your credentials to continue"),
249
+ return Ee ? /* @__PURE__ */ h(ie, {}) : /* @__PURE__ */ g(i, {
250
+ title: x("auth.login.welcomeBack", "Welcome back"),
251
+ subtitle: x("auth.login.enterCredentials", "Enter your credentials to continue"),
229
252
  children: [
230
- /* @__PURE__ */ d("form", {
231
- onSubmit: Fe,
253
+ /* @__PURE__ */ g("form", {
254
+ onSubmit: Le,
232
255
  className: "space-y-5",
233
256
  children: [
234
- V && /* @__PURE__ */ d("div", {
257
+ Ne && /* @__PURE__ */ g("div", {
235
258
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-info-bg-subtle border-status-info-border",
236
- children: [/* @__PURE__ */ u("svg", {
259
+ children: [/* @__PURE__ */ h("svg", {
237
260
  className: "w-5 h-5 flex-shrink-0 mt-0.5 text-text-link",
238
261
  fill: "none",
239
262
  viewBox: "0 0 24 24",
240
263
  stroke: "currentColor",
241
- children: /* @__PURE__ */ u("path", {
264
+ children: /* @__PURE__ */ h("path", {
242
265
  strokeLinecap: "round",
243
266
  strokeLinejoin: "round",
244
267
  strokeWidth: 2,
245
268
  d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
246
269
  })
247
- }), /* @__PURE__ */ u("p", {
270
+ }), /* @__PURE__ */ h("p", {
248
271
  className: "text-sm text-status-info-text",
249
- children: V
272
+ children: Ne
250
273
  })]
251
274
  }),
252
- G && /* @__PURE__ */ d("div", {
275
+ q && /* @__PURE__ */ g("div", {
253
276
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-warning-bg-subtle border-status-warning-border",
254
- children: [/* @__PURE__ */ u(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ u("p", {
277
+ children: [/* @__PURE__ */ h(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ h("p", {
255
278
  className: "text-sm text-status-warning-text",
256
- children: G
279
+ children: q
257
280
  })]
258
281
  }),
259
- q && /* @__PURE__ */ d("div", {
282
+ Fe && /* @__PURE__ */ g("div", {
260
283
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-warning-bg-subtle border-status-warning-border",
261
- children: [/* @__PURE__ */ u(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ d("div", {
284
+ children: [/* @__PURE__ */ h(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ g("div", {
262
285
  className: "flex-1",
263
286
  children: [
264
- /* @__PURE__ */ u("p", {
287
+ /* @__PURE__ */ h("p", {
265
288
  className: "text-sm font-medium text-status-warning-text",
266
- children: g("auth.login.duplicateAccount", "This account is already signed in.")
289
+ children: x("auth.login.duplicateAccount", "This account is already signed in.")
267
290
  }),
268
- /* @__PURE__ */ u("p", {
291
+ /* @__PURE__ */ h("p", {
269
292
  className: "mt-1 text-sm text-status-warning-text/80",
270
- children: g("auth.login.duplicateAccountHint", "Please use a different account, or go back and switch to this account from the profile menu.")
293
+ children: x("auth.login.duplicateAccountHint", "Please use a different account, or go back and switch to this account from the profile menu.")
271
294
  }),
272
- (Z.current || X) && /* @__PURE__ */ d("button", {
295
+ (Q.current || Z) && /* @__PURE__ */ g("button", {
273
296
  type: "button",
274
- onClick: () => f(decodeURIComponent(Z.current || X || "/dashboard")),
297
+ onClick: () => y(decodeURIComponent(Q.current || Z || "/dashboard")),
275
298
  className: "mt-3 inline-flex items-center gap-2 px-4 py-2.5 rounded-xl border border-status-warning-border bg-bg-surface text-status-warning-text text-sm font-medium hover:bg-status-warning-bg-subtle hover:border-status-warning-border transition-all shadow-sm",
276
- children: [/* @__PURE__ */ u("svg", {
299
+ children: [/* @__PURE__ */ h("svg", {
277
300
  className: "w-4 h-4",
278
301
  fill: "none",
279
302
  viewBox: "0 0 24 24",
280
303
  stroke: "currentColor",
281
- children: /* @__PURE__ */ u("path", {
304
+ children: /* @__PURE__ */ h("path", {
282
305
  strokeLinecap: "round",
283
306
  strokeLinejoin: "round",
284
307
  strokeWidth: 2,
285
308
  d: "M10 19l-7-7m0 0l7-7m-7 7h18"
286
309
  })
287
- }), g("auth.login.goBackSwitchAccount", "Go back and switch account")]
310
+ }), x("auth.login.goBackSwitchAccount", "Go back and switch account")]
288
311
  })
289
312
  ]
290
313
  })]
291
314
  }),
292
- v && !G && !q && /* @__PURE__ */ d("div", {
293
- className: `flex items-start gap-3 p-4 rounded-xl border ${O || M || P ? "bg-status-warning-bg-subtle border-status-warning-border" : "bg-status-error-bg-subtle border-status-error-border"}`,
294
- children: [/* @__PURE__ */ u(a, { className: `w-5 h-5 flex-shrink-0 mt-0.5 ${O || M || P ? "text-status-warning-text" : "text-status-error-text"}` }), /* @__PURE__ */ d("div", {
315
+ S && !q && !Fe && /* @__PURE__ */ g("div", {
316
+ className: `flex items-start gap-3 p-4 rounded-xl border ${N || L || z ? "bg-status-warning-bg-subtle border-status-warning-border" : "bg-status-error-bg-subtle border-status-error-border"}`,
317
+ children: [/* @__PURE__ */ h(a, { className: `w-5 h-5 flex-shrink-0 mt-0.5 ${N || L || z ? "text-status-warning-text" : "text-status-error-text"}` }), /* @__PURE__ */ g("div", {
295
318
  className: "flex-1",
296
319
  children: [
297
- /* @__PURE__ */ u("p", {
298
- className: `text-sm ${O || M || P ? "text-status-warning-text" : "text-status-error-text"}`,
299
- children: je ? g("auth.login.accountDeleted", "This account has been permanently deleted and cannot be recovered.") : Me ? g("auth.login.accountSuspended", "Your account has been suspended. Please contact support for assistance.") : O ? g("auth.login.accountDeactivated", "Your account has been deactivated.") : M ? g("auth.login.oauthOnly", "This account uses OAuth sign-in. Please use Google or Microsoft to sign in.") : P ? g("auth.login.emailNotVerified", "Please verify your email before signing in. Check your inbox for the verification link.") : v
320
+ /* @__PURE__ */ h("p", {
321
+ className: `text-sm ${N || L || z ? "text-status-warning-text" : "text-status-error-text"}`,
322
+ children: ke ? x("auth.login.accountDeleted", "This account has been permanently deleted and cannot be recovered.") : Ae ? x("auth.login.accountSuspended", "Your account has been suspended. Please contact support for assistance.") : N ? x("auth.login.accountDeactivated", "Your account has been deactivated.") : L ? x("auth.login.oauthOnly", "This account uses OAuth sign-in. Please use Google or Microsoft to sign in.") : z ? x("auth.login.emailNotVerified", "Please verify your email before signing in. Check your inbox for the verification link.") : S
300
323
  }),
301
- O && /* @__PURE__ */ u("button", {
324
+ N && /* @__PURE__ */ h("button", {
302
325
  type: "button",
303
- onClick: () => f("/auth/reactivate", { state: { email: U.email } }),
326
+ onClick: () => y("/auth/reactivate", { state: { email: G.email } }),
304
327
  className: "mt-2 text-sm font-semibold text-status-warning-text hover:text-status-warning-text underline underline-offset-2",
305
- children: g("auth.login.clickReactivate", "Click here to reactivate your account")
328
+ children: x("auth.login.clickReactivate", "Click here to reactivate your account")
306
329
  }),
307
- P && /* @__PURE__ */ u("div", {
330
+ z && /* @__PURE__ */ h("div", {
308
331
  className: "mt-3",
309
- children: Ne ? /* @__PURE__ */ d("div", {
332
+ children: je ? /* @__PURE__ */ g("div", {
310
333
  className: "flex items-center gap-2 text-sm text-status-success-text",
311
- children: [/* @__PURE__ */ u("svg", {
334
+ children: [/* @__PURE__ */ h("svg", {
312
335
  className: "w-4 h-4",
313
336
  fill: "none",
314
337
  viewBox: "0 0 24 24",
315
338
  stroke: "currentColor",
316
- children: /* @__PURE__ */ u("path", {
339
+ children: /* @__PURE__ */ h("path", {
317
340
  strokeLinecap: "round",
318
341
  strokeLinejoin: "round",
319
342
  strokeWidth: 2,
320
343
  d: "M5 13l4 4L19 7"
321
344
  })
322
- }), g("auth.login.verificationSent", "Verification email sent! Please check your inbox.")]
323
- }) : /* @__PURE__ */ u("button", {
345
+ }), x("auth.login.verificationSent", "Verification email sent! Please check your inbox.")]
346
+ }) : /* @__PURE__ */ h("button", {
324
347
  type: "button",
325
- onClick: Le,
326
- disabled: I,
348
+ onClick: ze,
349
+ disabled: V,
327
350
  className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl border border-status-warning-border bg-bg-surface text-status-warning-text text-sm font-medium hover:bg-status-warning-bg-subtle hover:border-status-warning-border transition-all shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",
328
- children: I ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(oe, { className: "w-4 h-4 animate-spin" }), g("auth.login.sending", "Sending...")] }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("svg", {
351
+ children: V ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(te, { className: "w-4 h-4 animate-spin" }), x("auth.login.sending", "Sending...")] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("svg", {
329
352
  className: "w-4 h-4",
330
353
  fill: "none",
331
354
  viewBox: "0 0 24 24",
332
355
  stroke: "currentColor",
333
- children: /* @__PURE__ */ u("path", {
356
+ children: /* @__PURE__ */ h("path", {
334
357
  strokeLinecap: "round",
335
358
  strokeLinejoin: "round",
336
359
  strokeWidth: 2,
337
360
  d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
338
361
  })
339
- }), g("auth.login.resendVerification", "Resend verification email")] })
362
+ }), x("auth.login.resendVerification", "Resend verification email")] })
340
363
  })
341
364
  }),
342
- M && /* @__PURE__ */ d("div", {
365
+ L && /* @__PURE__ */ g("div", {
343
366
  className: "mt-3 flex flex-col gap-2",
344
- children: [S("google") && /* @__PURE__ */ d("button", {
367
+ children: [E("google") && /* @__PURE__ */ g("button", {
345
368
  type: "button",
346
- onClick: Ie,
369
+ onClick: $,
347
370
  className: "inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border border-border-default bg-bg-surface text-text-primary text-sm font-medium hover:bg-bg-canvas hover:border-border-default transition-all shadow-sm",
348
- children: [/* @__PURE__ */ u(re, { className: "w-5 h-5" }), g("auth.login.signInWithGoogle", "Sign in with Google")]
349
- }), S("microsoft") && /* @__PURE__ */ d("button", {
371
+ children: [/* @__PURE__ */ h(c, { className: "w-5 h-5" }), x("auth.login.signInWithGoogle", "Sign in with Google")]
372
+ }), E("microsoft") && /* @__PURE__ */ g("button", {
350
373
  type: "button",
351
- onClick: Q,
374
+ onClick: Re,
352
375
  className: "inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border border-border-default bg-bg-surface text-text-primary text-sm font-medium hover:bg-bg-canvas hover:border-border-default transition-all shadow-sm",
353
- children: [/* @__PURE__ */ u(ae, { className: "w-5 h-5" }), g("auth.login.signInWithMicrosoft", "Sign in with Microsoft")]
376
+ children: [/* @__PURE__ */ h(u, { className: "w-5 h-5" }), x("auth.login.signInWithMicrosoft", "Sign in with Microsoft")]
354
377
  })]
355
378
  })
356
379
  ]
357
380
  })]
358
381
  }),
359
- /* @__PURE__ */ d("div", {
382
+ /* @__PURE__ */ g("div", {
360
383
  className: "space-y-2",
361
- children: [/* @__PURE__ */ u("label", {
384
+ children: [/* @__PURE__ */ h("label", {
362
385
  htmlFor: "email",
363
386
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
364
- children: g("auth.login.emailLabel", "Email")
365
- }), /* @__PURE__ */ d("div", {
387
+ children: x("auth.login.emailLabel", "Email")
388
+ }), /* @__PURE__ */ g("div", {
366
389
  className: "relative",
367
- children: [/* @__PURE__ */ u("div", {
390
+ children: [/* @__PURE__ */ h("div", {
368
391
  className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
369
- children: /* @__PURE__ */ u(ee, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
370
- }), /* @__PURE__ */ u("input", {
392
+ children: /* @__PURE__ */ h(o, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
393
+ }), /* @__PURE__ */ h("input", {
371
394
  id: "email",
372
395
  type: "text",
373
396
  autoComplete: "email username",
374
397
  required: !0,
375
- value: U.email,
376
- onChange: (e) => W({
377
- ...U,
398
+ value: G.email,
399
+ onChange: (e) => K({
400
+ ...G,
378
401
  email: e.target.value
379
402
  }),
380
403
  className: "block w-full pl-[3.5rem] pr-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
381
- placeholder: g("auth.login.emailPlaceholder", "you@example.com")
404
+ placeholder: x("auth.login.emailPlaceholder", "you@example.com")
382
405
  })]
383
406
  })]
384
407
  }),
385
- /* @__PURE__ */ d("div", {
408
+ /* @__PURE__ */ g("div", {
386
409
  className: "space-y-2",
387
- children: [/* @__PURE__ */ u("label", {
410
+ children: [/* @__PURE__ */ h("label", {
388
411
  htmlFor: "password",
389
412
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
390
- children: g("auth.login.passwordLabel", "Password")
391
- }), /* @__PURE__ */ d("div", {
413
+ children: x("auth.login.passwordLabel", "Password")
414
+ }), /* @__PURE__ */ g("div", {
392
415
  className: "relative",
393
416
  children: [
394
- /* @__PURE__ */ u("div", {
417
+ /* @__PURE__ */ h("div", {
395
418
  className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
396
- children: /* @__PURE__ */ u(ie, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
419
+ children: /* @__PURE__ */ h(l, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
397
420
  }),
398
- /* @__PURE__ */ u("input", {
421
+ /* @__PURE__ */ h("input", {
399
422
  id: "password",
400
- type: D ? "text" : "password",
423
+ type: M ? "text" : "password",
401
424
  autoComplete: "current-password",
402
425
  required: !0,
403
- value: U.password,
404
- onChange: (e) => W({
405
- ...U,
426
+ value: G.password,
427
+ onChange: (e) => K({
428
+ ...G,
406
429
  password: e.target.value
407
430
  }),
408
431
  className: "block w-full pl-[3.5rem] pr-12 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
409
- placeholder: g("auth.login.passwordPlaceholder", "Enter your password")
432
+ placeholder: x("auth.login.passwordPlaceholder", "Enter your password")
410
433
  }),
411
- /* @__PURE__ */ u("button", {
434
+ /* @__PURE__ */ h("button", {
412
435
  type: "button",
413
- onClick: () => Ae(!D),
414
- "aria-label": D ? "Hide password" : "Show password",
436
+ onClick: () => Oe(!M),
437
+ "aria-label": M ? "Hide password" : "Show password",
415
438
  className: "absolute inset-y-0 right-0 pr-3.5 flex items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors",
416
- children: u(D ? ne : te, { className: "w-5 h-5" })
439
+ children: h(M ? ee : s, { className: "w-5 h-5" })
417
440
  })
418
441
  ]
419
442
  })]
420
443
  }),
421
- /* @__PURE__ */ d("div", {
444
+ /* @__PURE__ */ g("div", {
422
445
  className: "flex items-center justify-between",
423
- children: [/* @__PURE__ */ d("label", {
446
+ children: [/* @__PURE__ */ g("label", {
424
447
  className: "flex items-center gap-2 cursor-pointer group",
425
- children: [/* @__PURE__ */ d("div", {
448
+ children: [/* @__PURE__ */ g("div", {
426
449
  className: "relative",
427
- children: [/* @__PURE__ */ u("input", {
450
+ children: [/* @__PURE__ */ h("input", {
428
451
  type: "checkbox",
429
- checked: U.rememberMe,
452
+ checked: G.rememberMe,
430
453
  onChange: (e) => {
431
454
  let t = e.target.checked;
432
- if (W({
433
- ...U,
455
+ if (K({
456
+ ...G,
434
457
  rememberMe: t
435
458
  }), !t) try {
436
459
  localStorage.removeItem("remembered_email");
@@ -439,98 +462,98 @@ function f() {
439
462
  }
440
463
  },
441
464
  className: "sr-only peer"
442
- }), /* @__PURE__ */ u("div", {
465
+ }), /* @__PURE__ */ h("div", {
443
466
  className: "w-5 h-5 rounded-md border-2 border-[var(--color-border-default)] bg-[var(--color-bg-surface)] peer-checked:bg-status-info-bg-subtle0 peer-checked:border-action-primary-bg transition-all peer-focus:ring-2 peer-focus:ring-action-primary-bg/20",
444
- children: /* @__PURE__ */ u("svg", {
467
+ children: /* @__PURE__ */ h("svg", {
445
468
  className: "w-full h-full text-white opacity-0 peer-checked:opacity-100 transition-opacity p-0.5",
446
469
  fill: "none",
447
470
  viewBox: "0 0 24 24",
448
471
  stroke: "currentColor",
449
472
  strokeWidth: 3,
450
- children: /* @__PURE__ */ u("path", {
473
+ children: /* @__PURE__ */ h("path", {
451
474
  strokeLinecap: "round",
452
475
  strokeLinejoin: "round",
453
476
  d: "M5 13l4 4L19 7"
454
477
  })
455
478
  })
456
479
  })]
457
- }), /* @__PURE__ */ u("span", {
480
+ }), /* @__PURE__ */ h("span", {
458
481
  className: "text-sm text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)] transition-colors",
459
- children: g("auth.login.rememberMe", "Remember me")
482
+ children: x("auth.login.rememberMe", "Remember me")
460
483
  })]
461
- }), /* @__PURE__ */ u("button", {
484
+ }), /* @__PURE__ */ h("button", {
462
485
  type: "button",
463
- onClick: () => f("/auth/reset-password"),
486
+ onClick: () => y("/auth/reset-password"),
464
487
  className: "text-sm font-medium text-text-link hover:text-text-linkHover transition-colors",
465
- children: g("auth.login.forgotPassword", "Forgot password?")
488
+ children: x("auth.login.forgotPassword", "Forgot password?")
466
489
  })]
467
490
  }),
468
- /* @__PURE__ */ u("button", {
491
+ /* @__PURE__ */ h("button", {
469
492
  type: "submit",
470
- disabled: _ || w,
493
+ disabled: be || O,
471
494
  className: "auth-primary-button flex w-full items-center justify-center gap-2 px-4 py-3 font-semibold",
472
- children: _ || w ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(oe, { className: "w-5 h-5 animate-spin" }), /* @__PURE__ */ u("span", { children: w ? g("auth.login.settingUpWorkspace", "Setting up workspace...") : g("auth.login.signingIn", "Signing in...") })] }) : g("auth.login.signIn", "Sign in")
495
+ children: be || O ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(te, { className: "w-5 h-5 animate-spin" }), /* @__PURE__ */ h("span", { children: O ? x("auth.login.settingUpWorkspace", "Setting up workspace...") : x("auth.login.signingIn", "Signing in...") })] }) : x("auth.login.signIn", "Sign in")
473
496
  })
474
497
  ]
475
498
  }),
476
- /* @__PURE__ */ d("div", {
499
+ /* @__PURE__ */ g("div", {
477
500
  className: "relative my-8",
478
- children: [/* @__PURE__ */ u("div", {
501
+ children: [/* @__PURE__ */ h("div", {
479
502
  className: "absolute inset-0 flex items-center",
480
- children: /* @__PURE__ */ u("div", { className: "w-full border-t border-[var(--color-border-default)]" })
481
- }), /* @__PURE__ */ u("div", {
503
+ children: /* @__PURE__ */ h("div", { className: "w-full border-t border-[var(--color-border-default)]" })
504
+ }), /* @__PURE__ */ h("div", {
482
505
  className: "relative flex justify-center",
483
- children: /* @__PURE__ */ u("span", {
506
+ children: /* @__PURE__ */ h("span", {
484
507
  className: "px-4 bg-[var(--color-bg-canvas)] text-sm text-[var(--color-text-tertiary)]",
485
- children: g("auth.login.orContinueWith", "or continue with")
508
+ children: x("auth.login.orContinueWith", "or continue with")
486
509
  })
487
510
  })]
488
511
  }),
489
- z && /* @__PURE__ */ d("div", {
512
+ Me && /* @__PURE__ */ g("div", {
490
513
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-error-bg-subtle border-status-error-border",
491
- children: [/* @__PURE__ */ u(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ u("p", {
514
+ children: [/* @__PURE__ */ h(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ h("p", {
492
515
  className: "text-sm text-status-error-text",
493
- children: z
516
+ children: Me
494
517
  })]
495
518
  }),
496
- /* @__PURE__ */ u("div", {
519
+ /* @__PURE__ */ h("div", {
497
520
  className: "grid grid-cols-3 gap-3",
498
- children: ze.map((e) => /* @__PURE__ */ d("button", {
521
+ children: He.map((e) => /* @__PURE__ */ g("button", {
499
522
  type: "button",
500
523
  onClick: e.onClick,
501
524
  disabled: e.disabled,
502
525
  title: e.tooltip,
503
526
  className: `flex items-center justify-center gap-2 px-4 py-3 rounded-xl border transition-all duration-200 group ${e.disabled ? "border-[var(--color-border-subtle)] bg-[var(--color-bg-disabled)] cursor-not-allowed opacity-50" : "border-[var(--color-border-default)] bg-[var(--color-bg-surface)] hover:bg-[var(--color-bg-sunken)] hover:border-[var(--color-border-strong)]"}`,
504
- children: [/* @__PURE__ */ u(e.icon, { className: `w-5 h-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ u("span", {
527
+ children: [/* @__PURE__ */ h(e.icon, { className: `w-5 h-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ h("span", {
505
528
  className: `sr-only sm:not-sr-only text-sm font-medium transition-colors hidden sm:inline ${e.disabled ? "text-[var(--color-text-disabled)]" : "text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)]"}`,
506
529
  children: e.name
507
530
  })]
508
531
  }, e.name))
509
532
  }),
510
- /* @__PURE__ */ u("div", {
533
+ /* @__PURE__ */ h("div", {
511
534
  className: "mt-4 text-center",
512
- children: /* @__PURE__ */ d("button", {
513
- onClick: () => f("/auth/magic-link"),
535
+ children: /* @__PURE__ */ g("button", {
536
+ onClick: () => y("/auth/magic-link"),
514
537
  className: "text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] transition-colors",
515
538
  children: [
516
- g("auth.login.preferPasswordless", "Prefer passwordless login?"),
539
+ x("auth.login.preferPasswordless", "Prefer passwordless login?"),
517
540
  " ",
518
- /* @__PURE__ */ u("span", {
541
+ /* @__PURE__ */ h("span", {
519
542
  className: "font-semibold text-text-link hover:text-text-linkHover",
520
- children: g("auth.login.signInMagicLink", "Sign in with Magic Link")
543
+ children: x("auth.login.signInMagicLink", "Sign in with Magic Link")
521
544
  })
522
545
  ]
523
546
  })
524
547
  }),
525
- /* @__PURE__ */ d("p", {
548
+ /* @__PURE__ */ g("p", {
526
549
  className: "mt-6 text-center text-sm text-[var(--color-text-secondary)]",
527
550
  children: [
528
- g("auth.login.dontHaveAccount", "Don't have an account?"),
551
+ x("auth.login.dontHaveAccount", "Don't have an account?"),
529
552
  " ",
530
- /* @__PURE__ */ u("button", {
531
- onClick: () => f("/auth/register"),
553
+ /* @__PURE__ */ h("button", {
554
+ onClick: () => y("/auth/register"),
532
555
  className: "font-semibold text-text-link hover:text-text-linkHover transition-colors",
533
- children: g("auth.login.signUp", "Sign up")
556
+ children: x("auth.login.signUp", "Sign up")
534
557
  })
535
558
  ]
536
559
  })
@@ -538,6 +561,6 @@ function f() {
538
561
  });
539
562
  }
540
563
  //#endregion
541
- export { f as LoginPage };
564
+ export { y as LoginPage };
542
565
 
543
566
  //# sourceMappingURL=LoginPage.js.map