@burdenoff/microfe-auth 2026.624.3 → 2026.626.1

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.
Files changed (36) hide show
  1. package/dist/auth/pages/AuditLogPage.js +73 -72
  2. package/dist/auth/pages/AuditLogPage.js.map +1 -1
  3. package/dist/auth/pages/EmailVerifyPage.js +58 -53
  4. package/dist/auth/pages/EmailVerifyPage.js.map +1 -1
  5. package/dist/auth/pages/LoginPage.js +222 -214
  6. package/dist/auth/pages/LoginPage.js.map +1 -1
  7. package/dist/auth/pages/MagicLinkPage.js +75 -68
  8. package/dist/auth/pages/MagicLinkPage.js.map +1 -1
  9. package/dist/auth/pages/MfaSetupPage.js +176 -138
  10. package/dist/auth/pages/MfaSetupPage.js.map +1 -1
  11. package/dist/auth/pages/MfaVerifyPage.js +60 -52
  12. package/dist/auth/pages/MfaVerifyPage.js.map +1 -1
  13. package/dist/auth/pages/PasswordResetPage.js +277 -262
  14. package/dist/auth/pages/PasswordResetPage.js.map +1 -1
  15. package/dist/auth/pages/ReactivatePage.js +54 -46
  16. package/dist/auth/pages/ReactivatePage.js.map +1 -1
  17. package/dist/auth/pages/RegisterPage.js +223 -213
  18. package/dist/auth/pages/RegisterPage.js.map +1 -1
  19. package/dist/auth/pages/SecurityPage.js +298 -267
  20. package/dist/auth/pages/SecurityPage.js.map +1 -1
  21. package/dist/auth/pages/SessionsPage.js +169 -160
  22. package/dist/auth/pages/SessionsPage.js.map +1 -1
  23. package/dist/auth/pages/SsoCallbackPage.js +53 -50
  24. package/dist/auth/pages/SsoCallbackPage.js.map +1 -1
  25. package/dist/auth/pages/SsoConfigPage.js +466 -444
  26. package/dist/auth/pages/SsoConfigPage.js.map +1 -1
  27. package/dist/auth/pages/SsoLoginPage.js +67 -59
  28. package/dist/auth/pages/SsoLoginPage.js.map +1 -1
  29. package/dist/auth/pages/UserDetailsPage.js +154 -144
  30. package/dist/auth/pages/UserDetailsPage.js.map +1 -1
  31. package/dist/auth/pages/UserProfilePage.js +211 -170
  32. package/dist/auth/pages/UserProfilePage.js.map +1 -1
  33. package/dist/auth/pages/UsersPage.js +572 -576
  34. package/dist/auth/pages/UsersPage.js.map +1 -1
  35. package/dist/microfe-auth.css +2 -2
  36. package/package.json +2 -2
@@ -5,14 +5,16 @@ import { ConfirmActionDialog as i } from "../components/ConfirmActionDialog.js";
5
5
  import { nativeCopyText as a, nativeImpact as o, nativeNotify as s } from "../../utils/nativeBridge.js";
6
6
  import { useCallback as c, useEffect as l, useRef as ee, useState as u } from "react";
7
7
  import { useNavigate as te, useSearchParams as ne } from "react-router-dom";
8
- import { useI18n as d } from "@burdenoff/fe-libs/shared/providers/shell";
9
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
10
- import { useFeatureFlagDetails as re } from "@burdenoff/fe-libs/shared/feature-flags";
8
+ import { useI18n as re } from "@burdenoff/fe-libs/shared/providers/shell";
9
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
10
+ import { useFeatureFlagDetails as ie } from "@burdenoff/fe-libs/shared/feature-flags";
11
+ import { Button as m } from "@burdenoff/fe-libs/button";
12
+ import { EmphasisPanel as ae, IllustratedEmptyState as h, NextSteps as oe, PagePurpose as se } from "@burdenoff/fe-libs/ui";
11
13
  //#region src/auth/pages/SsoConfigPage.tsx
12
- var h = async (e) => {
14
+ var g = async (e) => {
13
15
  o("light"), s(await a(e) ? "success" : "error");
14
16
  };
15
- function g(e) {
17
+ function _(e) {
16
18
  try {
17
19
  let t = new DOMParser().parseFromString(e, "text/xml"), n = t.querySelector("parsererror");
18
20
  if (n) return console.error("XML parse error:", n.textContent), null;
@@ -45,170 +47,279 @@ function g(e) {
45
47
  return console.error("Failed to parse SAML metadata:", e), null;
46
48
  }
47
49
  }
48
- function _({ bypassEnterprisePlanGate: a = !1 }) {
49
- let _ = te(), [v] = ne(), { canManageSsoConfig: ie, isLoading: ae } = r(), oe = re("workspace.auth.enterprise-sso"), se = a || oe?.value === !0, y = ee(null), b = v.get("tenant"), x = v.get("org"), S = v.get("workspace"), { ssoConfig: C, oidcConfig: w, isLoading: T, isSaving: E, isDeleting: D, saveSsoConfig: O, deleteSsoConfig: k } = n(b ?? "burdenoff.com"), { t: A } = d(), j = c((e, t) => {
50
+ function v({ bypassEnterprisePlanGate: a = !1 }) {
51
+ let v = te(), [y] = ne(), { canManageSsoConfig: ce, isLoading: le } = r(), ue = ie("workspace.auth.enterprise-sso"), de = a || ue?.value === !0, b = ee(null), x = y.get("tenant"), S = y.get("org"), C = y.get("workspace"), { ssoConfig: w, oidcConfig: T, isLoading: E, isSaving: D, isDeleting: O, saveSsoConfig: k, deleteSsoConfig: fe } = n(x ?? "burdenoff.com"), { t: A } = re(), j = c((e, t) => {
50
52
  let n = A(e);
51
53
  return n === e ? t : n;
52
- }, [A]), [M, ce] = u("saml"), [N, P] = u(!1), [le, F] = u(!1), [I, L] = u(null), [R, z] = u(null), [B, V] = u(""), [H, U] = u(!1), [W, G] = u(!1), [K, q] = u({
54
+ }, [A]), [M, pe] = u("saml"), [N, P] = u(!1), [me, F] = u(!1), [I, L] = u(null), [R, z] = u(null), [B, V] = u(""), [H, U] = u(!1), [W, G] = u(!1), [K, q] = u({
53
55
  client_name: "",
54
56
  redirect_uris: "",
55
57
  grant_types: ["authorization_code", "refresh_token"],
56
58
  token_endpoint_auth_method: "none"
57
- }), [J, Y] = u(!1), [X, Z] = u(null), [Q, $] = u({
59
+ }), [J, Y] = u(!1), [X, he] = u(null), [Z, Q] = u({
58
60
  entityId: "",
59
61
  ssoUrl: "",
60
62
  sloUrl: "",
61
63
  certificate: "",
62
64
  enabled: !1
63
- });
64
- return l(() => {
65
- C && $({
66
- entityId: C.entityId || "",
67
- ssoUrl: C.ssoUrl || "",
68
- sloUrl: C.sloUrl || "",
69
- certificate: C.certificate || "",
70
- enabled: C.enabled || !1
65
+ }), ge = async (e) => {
66
+ let t = e.target.files?.[0];
67
+ if (t) {
68
+ L(null), U(!0);
69
+ try {
70
+ let e = _(await t.text());
71
+ e ? (Q({
72
+ ...Z,
73
+ entityId: e.entityId,
74
+ ssoUrl: e.ssoUrl,
75
+ sloUrl: e.sloUrl || "",
76
+ certificate: e.certificate
77
+ }), z(j("auth.sso.importSuccess", "SAML metadata imported successfully! Review and save the configuration.")), P(!0)) : L(j("auth.sso.parseError", "Failed to parse SAML metadata. Make sure the file contains valid IdP metadata XML."));
78
+ } catch {
79
+ L(j("auth.sso.readError", "Failed to read metadata file"));
80
+ } finally {
81
+ U(!1), b.current && (b.current.value = "");
82
+ }
83
+ }
84
+ }, _e = async () => {
85
+ if (!B) {
86
+ L(j("auth.sso.enterUrl", "Please enter a metadata URL"));
87
+ return;
88
+ }
89
+ L(null), U(!0);
90
+ try {
91
+ let e = await fetch(B);
92
+ if (!e.ok) throw Error(`Failed to fetch: ${e.statusText}`);
93
+ let t = _(await e.text());
94
+ t ? (Q({
95
+ ...Z,
96
+ entityId: t.entityId,
97
+ ssoUrl: t.ssoUrl,
98
+ sloUrl: t.sloUrl || "",
99
+ certificate: t.certificate
100
+ }), z(j("auth.sso.importSuccessFromUrl", "SAML metadata imported successfully! Review and save the configuration.")), P(!0), V("")) : L(j("auth.sso.parseUrlError", "Failed to parse SAML metadata from URL."));
101
+ } catch (e) {
102
+ L(e instanceof Error ? e.message : j("auth.sso.fetchError", "Failed to fetch metadata from URL"));
103
+ } finally {
104
+ U(!1);
105
+ }
106
+ }, ve = async () => {
107
+ if (!K.client_name || !K.redirect_uris) {
108
+ L(j("auth.sso.clientRequired", "Client name and redirect URI are required"));
109
+ return;
110
+ }
111
+ Y(!0), L(null);
112
+ try {
113
+ let e = T?.registrationEndpoint;
114
+ if (!e) throw Error(j("auth.sso.oidcNotConfigured", "OIDC dynamic client registration is not configured for this environment."));
115
+ let t = await fetch(e, {
116
+ method: "POST",
117
+ headers: { "Content-Type": "application/json" },
118
+ body: JSON.stringify({
119
+ client_name: K.client_name,
120
+ redirect_uris: K.redirect_uris.split(",").map((e) => e.trim()),
121
+ grant_types: K.grant_types,
122
+ response_types: ["code"],
123
+ token_endpoint_auth_method: K.token_endpoint_auth_method
124
+ })
125
+ });
126
+ if (!t.ok) {
127
+ let e = await t.json();
128
+ throw Error(e.error_description || e.error || "Registration failed");
129
+ }
130
+ he(await t.json()), z(j("auth.sso.clientRegistered", "OIDC client registered successfully! Save the client credentials.")), G(!1), q({
131
+ client_name: "",
132
+ redirect_uris: "",
133
+ grant_types: ["authorization_code", "refresh_token"],
134
+ token_endpoint_auth_method: "none"
135
+ });
136
+ } catch (e) {
137
+ L(e instanceof Error ? e.message : j("auth.sso.registerFailed", "Failed to register client"));
138
+ } finally {
139
+ Y(!1);
140
+ }
141
+ };
142
+ l(() => {
143
+ w && Q({
144
+ entityId: w.entityId || "",
145
+ ssoUrl: w.ssoUrl || "",
146
+ sloUrl: w.sloUrl || "",
147
+ certificate: w.certificate || "",
148
+ enabled: w.enabled || !1
71
149
  });
72
- }, [C]), ae ? /* @__PURE__ */ p("div", {
150
+ }, [w]);
151
+ let ye = async (e) => {
152
+ e.preventDefault(), L(null), z(null);
153
+ try {
154
+ await k(Z), z(j("auth.sso.saveSuccess", "SSO configuration saved successfully!")), P(!1);
155
+ } catch (e) {
156
+ L(e instanceof Error ? e.message : j("auth.sso.saveFailed", "Failed to save configuration"));
157
+ }
158
+ }, be = async () => {
159
+ L(null), z(null), o("medium");
160
+ try {
161
+ await fe(), s("success"), z(j("auth.sso.deleteSuccess", "SSO configuration deleted successfully.")), F(!1), Q({
162
+ entityId: "",
163
+ ssoUrl: "",
164
+ sloUrl: "",
165
+ certificate: "",
166
+ enabled: !1
167
+ });
168
+ } catch (e) {
169
+ s("error"), L(e instanceof Error ? e.message : j("auth.sso.deleteFailed", "Failed to delete configuration"));
170
+ }
171
+ }, $ = async () => {
172
+ L(null);
173
+ try {
174
+ await k({
175
+ ...Z,
176
+ enabled: !Z.enabled
177
+ }), z(Z.enabled ? j("auth.sso.ssoDisabled", "SSO disabled") : j("auth.sso.ssoEnabled", "SSO enabled"));
178
+ } catch (e) {
179
+ L(e instanceof Error ? e.message : j("auth.sso.statusUpdateFailed", "Failed to update status"));
180
+ }
181
+ };
182
+ return le ? /* @__PURE__ */ f("div", {
73
183
  className: "max-w-5xl mx-auto p-6",
74
- children: /* @__PURE__ */ m("div", {
184
+ children: /* @__PURE__ */ p("div", {
75
185
  className: "text-center py-16",
76
- children: [/* @__PURE__ */ p(t, { className: "size-8 mx-auto text-text-secondary animate-spin" }), /* @__PURE__ */ p("p", {
186
+ children: [/* @__PURE__ */ f(t, { className: "size-8 mx-auto text-text-secondary animate-spin" }), /* @__PURE__ */ f("p", {
77
187
  className: "mt-4 text-text-secondary",
78
188
  children: j("auth.sso.loadingPermissions", "Loading permissions...")
79
189
  })]
80
190
  })
81
- }) : ie ? se ? /* @__PURE__ */ m("div", {
191
+ }) : ce ? de ? /* @__PURE__ */ p("div", {
82
192
  className: "max-w-5xl mx-auto p-6",
83
193
  children: [
84
- /* @__PURE__ */ p(i, {
85
- open: le,
194
+ /* @__PURE__ */ f(i, {
195
+ open: me,
86
196
  onOpenChange: F,
87
197
  title: j("auth.sso.deleteConfirmTitle", "Delete SSO configuration?"),
88
198
  description: j("auth.sso.deleteConfirmDesc", "Users will immediately lose the ability to sign in with this SSO setup until a new configuration is saved."),
89
199
  confirmText: j("auth.sso.deleteConfirmButton", "Delete configuration"),
90
200
  variant: "danger",
91
- isPending: D,
92
- onConfirm: async () => {
93
- L(null), z(null), o("medium");
94
- try {
95
- await k(), s("success"), z(j("auth.sso.deleteSuccess", "SSO configuration deleted successfully.")), F(!1), $({
96
- entityId: "",
97
- ssoUrl: "",
98
- sloUrl: "",
99
- certificate: "",
100
- enabled: !1
101
- });
102
- } catch (e) {
103
- s("error"), L(e instanceof Error ? e.message : j("auth.sso.deleteFailed", "Failed to delete configuration"));
104
- }
105
- }
201
+ isPending: O,
202
+ onConfirm: be
106
203
  }),
107
- /* @__PURE__ */ m("div", {
204
+ /* @__PURE__ */ p("div", {
108
205
  className: "flex items-center justify-between mb-8",
109
- children: [/* @__PURE__ */ m("div", {
206
+ children: [/* @__PURE__ */ p("div", {
110
207
  className: "flex items-center gap-4",
111
- children: [/* @__PURE__ */ p("button", {
208
+ children: [/* @__PURE__ */ f("button", {
112
209
  type: "button",
113
- onClick: () => _("/auth/security"),
210
+ onClick: () => v("/auth/security"),
114
211
  "aria-label": j("auth.sso.backToSecurity", "Back to Security"),
115
212
  className: "p-2 rounded-lg hover:bg-bg-sunken transition-colors",
116
- children: /* @__PURE__ */ p("svg", {
213
+ children: /* @__PURE__ */ f("svg", {
117
214
  className: "size-5 text-text-secondary",
118
215
  fill: "none",
119
216
  viewBox: "0 0 24 24",
120
217
  stroke: "currentColor",
121
218
  "aria-hidden": "true",
122
- children: /* @__PURE__ */ p("path", {
219
+ children: /* @__PURE__ */ f("path", {
123
220
  strokeLinecap: "round",
124
221
  strokeLinejoin: "round",
125
222
  strokeWidth: 2,
126
223
  d: "M10 19l-7-7m0 0l7-7m-7 7h18"
127
224
  })
128
225
  })
129
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
226
+ }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
130
227
  className: "text-2xl font-semibold text-text-primary",
131
228
  children: j("auth.sso.title", "Single Sign-On (SSO)")
132
- }), /* @__PURE__ */ p("p", {
229
+ }), /* @__PURE__ */ f("p", {
133
230
  className: "text-text-secondary mt-1",
134
231
  children: j("auth.sso.description", "Configure enterprise SSO with SAML 2.0 or OIDC")
135
232
  })] })]
136
- }), C && /* @__PURE__ */ m("div", {
233
+ }), w && /* @__PURE__ */ p("div", {
137
234
  className: "flex items-center gap-3",
138
- children: [/* @__PURE__ */ p("span", {
139
- className: `px-3 py-1 rounded-full text-sm font-medium ${Q.enabled ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-sunken text-text-secondary"}`,
140
- children: Q.enabled ? j("auth.sso.enabled", "Enabled") : j("auth.sso.disabled", "Disabled")
141
- }), /* @__PURE__ */ p("button", {
235
+ children: [/* @__PURE__ */ f("span", {
236
+ className: `px-3 py-1 rounded-full text-sm font-medium ${Z.enabled ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-sunken text-text-secondary"}`,
237
+ children: Z.enabled ? j("auth.sso.enabled", "Enabled") : j("auth.sso.disabled", "Disabled")
238
+ }), /* @__PURE__ */ f("button", {
142
239
  type: "button",
143
- onClick: async () => {
144
- L(null);
145
- try {
146
- await O({
147
- ...Q,
148
- enabled: !Q.enabled
149
- }), z(Q.enabled ? j("auth.sso.ssoDisabled", "SSO disabled") : j("auth.sso.ssoEnabled", "SSO enabled"));
150
- } catch (e) {
151
- L(e instanceof Error ? e.message : j("auth.sso.statusUpdateFailed", "Failed to update status"));
152
- }
153
- },
154
- disabled: E,
240
+ onClick: $,
241
+ disabled: D,
155
242
  className: "px-4 py-2 rounded-lg border border-border-default text-text-primary hover:bg-bg-sunken transition-colors text-sm font-medium",
156
- children: Q.enabled ? j("auth.sso.disable", "Disable") : j("auth.sso.enable", "Enable")
243
+ children: Z.enabled ? j("auth.sso.disable", "Disable") : j("auth.sso.enable", "Enable")
157
244
  })]
158
245
  })]
159
246
  }),
160
- a && (b ?? x ?? S) && /* @__PURE__ */ m("div", {
247
+ /* @__PURE__ */ f(se, {
248
+ className: "mb-6",
249
+ children: j("auth.sso.purpose", "Connect your organization's identity provider so your team signs in with their existing corporate credentials. Configure SAML 2.0 or OIDC here, then register the client apps that should accept these logins.")
250
+ }),
251
+ /* @__PURE__ */ f(ae, {
252
+ className: "mb-8",
253
+ children: /* @__PURE__ */ f("div", {
254
+ className: "flex items-center justify-between gap-4",
255
+ children: /* @__PURE__ */ p("div", { children: [
256
+ /* @__PURE__ */ f("p", {
257
+ className: "text-sm font-medium text-text-secondary",
258
+ children: j("auth.sso.statusLabel", "SSO connection")
259
+ }),
260
+ /* @__PURE__ */ f("p", {
261
+ className: "mt-1 text-lg font-semibold text-text-primary",
262
+ children: w ? Z.enabled ? j("auth.sso.statusActive", "Active — users can sign in via SSO") : j("auth.sso.statusConfiguredDisabled", "Configured but disabled") : j("auth.sso.statusNotConfigured", "Not configured yet")
263
+ }),
264
+ /* @__PURE__ */ f("p", {
265
+ className: "mt-1 text-sm text-text-secondary",
266
+ children: j("auth.sso.statusHint", "Save a SAML or OIDC configuration below, then enable it to go live.")
267
+ })
268
+ ] })
269
+ })
270
+ }),
271
+ a && (x ?? S ?? C) && /* @__PURE__ */ p("div", {
161
272
  className: "mb-6 p-4 rounded-xl bg-status-info-bg-subtle border border-status-info-border",
162
- children: [/* @__PURE__ */ p("p", {
273
+ children: [/* @__PURE__ */ f("p", {
163
274
  className: "text-sm font-medium text-status-info-text mb-1",
164
275
  children: j("auth.sso.adminContext", "Configuring SSO for")
165
- }), /* @__PURE__ */ m("div", {
276
+ }), /* @__PURE__ */ p("div", {
166
277
  className: "flex flex-wrap gap-4 text-xs text-status-info-text",
167
278
  children: [
168
- b && /* @__PURE__ */ m("span", { children: [
169
- /* @__PURE__ */ p("span", {
279
+ x && /* @__PURE__ */ p("span", { children: [
280
+ /* @__PURE__ */ f("span", {
170
281
  className: "font-medium",
171
282
  children: j("auth.sso.tenant", "Tenant:")
172
283
  }),
173
284
  " ",
174
- /* @__PURE__ */ p("code", {
285
+ /* @__PURE__ */ f("code", {
175
286
  className: "font-mono",
176
- children: b
287
+ children: x
177
288
  })
178
289
  ] }),
179
- x && /* @__PURE__ */ m("span", { children: [
180
- /* @__PURE__ */ p("span", {
290
+ S && /* @__PURE__ */ p("span", { children: [
291
+ /* @__PURE__ */ f("span", {
181
292
  className: "font-medium",
182
293
  children: j("auth.sso.organization", "Organization:")
183
294
  }),
184
295
  " ",
185
- /* @__PURE__ */ p("code", {
296
+ /* @__PURE__ */ f("code", {
186
297
  className: "font-mono",
187
- children: x
298
+ children: S
188
299
  })
189
300
  ] }),
190
- S && /* @__PURE__ */ m("span", { children: [
191
- /* @__PURE__ */ p("span", {
301
+ C && /* @__PURE__ */ p("span", { children: [
302
+ /* @__PURE__ */ f("span", {
192
303
  className: "font-medium",
193
304
  children: j("auth.sso.workspace", "Workspace:")
194
305
  }),
195
306
  " ",
196
- /* @__PURE__ */ p("code", {
307
+ /* @__PURE__ */ f("code", {
197
308
  className: "font-mono",
198
- children: S
309
+ children: C
199
310
  })
200
311
  ] })
201
312
  ]
202
313
  })]
203
314
  }),
204
- I && /* @__PURE__ */ m("div", {
315
+ I && /* @__PURE__ */ p("div", {
205
316
  className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border",
206
- children: [/* @__PURE__ */ p(e, { className: "size-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ m("div", {
317
+ children: [/* @__PURE__ */ f(e, { className: "size-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ p("div", {
207
318
  className: "flex-1",
208
- children: [/* @__PURE__ */ p("p", {
319
+ children: [/* @__PURE__ */ f("p", {
209
320
  className: "text-sm text-status-error-text",
210
321
  children: I
211
- }), /* @__PURE__ */ p("button", {
322
+ }), /* @__PURE__ */ f("button", {
212
323
  type: "button",
213
324
  onClick: () => L(null),
214
325
  className: "mt-2 text-sm text-status-error-text hover:underline",
@@ -216,23 +327,23 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
216
327
  })]
217
328
  })]
218
329
  }),
219
- R && /* @__PURE__ */ m("div", {
330
+ R && /* @__PURE__ */ p("div", {
220
331
  className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-status-success-bg-subtle border border-status-success-border",
221
- children: [/* @__PURE__ */ p("svg", {
332
+ children: [/* @__PURE__ */ f("svg", {
222
333
  className: "size-5 text-status-success-text flex-shrink-0 mt-0.5",
223
334
  fill: "currentColor",
224
335
  viewBox: "0 0 20 20",
225
- children: /* @__PURE__ */ p("path", {
336
+ children: /* @__PURE__ */ f("path", {
226
337
  fillRule: "evenodd",
227
338
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
228
339
  clipRule: "evenodd"
229
340
  })
230
- }), /* @__PURE__ */ m("div", {
341
+ }), /* @__PURE__ */ p("div", {
231
342
  className: "flex-1",
232
- children: [/* @__PURE__ */ p("p", {
343
+ children: [/* @__PURE__ */ f("p", {
233
344
  className: "text-sm text-status-success-text",
234
345
  children: R
235
- }), /* @__PURE__ */ p("button", {
346
+ }), /* @__PURE__ */ f("button", {
236
347
  type: "button",
237
348
  onClick: () => z(null),
238
349
  className: "mt-2 text-sm text-status-success-text hover:underline",
@@ -240,9 +351,9 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
240
351
  })]
241
352
  })]
242
353
  }),
243
- /* @__PURE__ */ p("div", {
354
+ /* @__PURE__ */ f("div", {
244
355
  className: "mb-6 border-b border-border-subtle",
245
- children: /* @__PURE__ */ p("nav", {
356
+ children: /* @__PURE__ */ f("nav", {
246
357
  className: "flex gap-6",
247
358
  children: [
248
359
  {
@@ -265,124 +376,105 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
265
376
  label: j("auth.sso.testTab", "Test SSO"),
266
377
  icon: "🧪"
267
378
  }
268
- ].map((e) => /* @__PURE__ */ m("button", {
379
+ ].map((e) => /* @__PURE__ */ p("button", {
269
380
  type: "button",
270
- onClick: () => ce(e.id),
381
+ onClick: () => pe(e.id),
271
382
  className: `pb-3 text-sm font-medium transition-colors relative ${M === e.id ? "text-text-link" : "text-text-secondary hover:text-text-primary"}`,
272
- children: [/* @__PURE__ */ m("span", {
383
+ children: [/* @__PURE__ */ p("span", {
273
384
  className: "flex items-center gap-2",
274
- children: [/* @__PURE__ */ p("span", { children: e.icon }), e.label]
275
- }), M === e.id && /* @__PURE__ */ p("span", { className: "absolute bottom-0 left-0 right-0 h-0.5 bg-action-primary-bg" })]
385
+ children: [/* @__PURE__ */ f("span", { children: e.icon }), e.label]
386
+ }), M === e.id && /* @__PURE__ */ f("span", { className: "absolute bottom-0 left-0 right-0 h-0.5 bg-action-primary-bg" })]
276
387
  }, e.id))
277
388
  })
278
389
  }),
279
- T && /* @__PURE__ */ m("div", {
390
+ E && /* @__PURE__ */ p("div", {
280
391
  className: "flex items-center justify-center py-12",
281
- children: [/* @__PURE__ */ p(t, { className: "size-8 text-text-link animate-spin" }), /* @__PURE__ */ p("span", {
392
+ children: [/* @__PURE__ */ f(t, { className: "size-8 text-text-link animate-spin" }), /* @__PURE__ */ f("span", {
282
393
  className: "ml-3 text-text-secondary",
283
394
  children: j("auth.sso.loadingConfig", "Loading configuration...")
284
395
  })]
285
396
  }),
286
- !T && M === "saml" && /* @__PURE__ */ m("div", {
397
+ !E && M === "saml" && /* @__PURE__ */ p("div", {
287
398
  className: "space-y-6",
288
399
  children: [
289
- /* @__PURE__ */ m("div", {
400
+ /* @__PURE__ */ p("div", {
290
401
  className: "p-4 rounded-xl bg-status-info-bg-subtle border border-status-info-border",
291
402
  children: [
292
- /* @__PURE__ */ p("h3", {
403
+ /* @__PURE__ */ f("h3", {
293
404
  className: "font-medium text-status-info-text mb-2",
294
405
  children: j("auth.sso.samlConfigTitle", "SAML 2.0 Configuration")
295
406
  }),
296
- /* @__PURE__ */ p("p", {
407
+ /* @__PURE__ */ f("p", {
297
408
  className: "text-sm text-status-info-text",
298
409
  children: j("auth.sso.samlConfigDesc", "Configure your Identity Provider (IdP) to enable enterprise SSO. You'll need to get the following information from your IdP (Okta, Azure AD, OneLogin, etc.):")
299
410
  }),
300
- /* @__PURE__ */ m("ul", {
411
+ /* @__PURE__ */ p("ul", {
301
412
  className: "mt-2 text-sm text-status-info-text list-disc list-inside",
302
413
  children: [
303
- /* @__PURE__ */ p("li", { children: j("auth.sso.entityIdItem", "Entity ID (Issuer URL)") }),
304
- /* @__PURE__ */ p("li", { children: j("auth.sso.ssoUrlItem", "SSO URL (Login URL)") }),
305
- /* @__PURE__ */ p("li", { children: j("auth.sso.certificateItem", "X.509 Certificate") })
414
+ /* @__PURE__ */ f("li", { children: j("auth.sso.entityIdItem", "Entity ID (Issuer URL)") }),
415
+ /* @__PURE__ */ f("li", { children: j("auth.sso.ssoUrlItem", "SSO URL (Login URL)") }),
416
+ /* @__PURE__ */ f("li", { children: j("auth.sso.certificateItem", "X.509 Certificate") })
306
417
  ]
307
418
  })
308
419
  ]
309
420
  }),
310
- /* @__PURE__ */ m("div", {
421
+ /* @__PURE__ */ p("div", {
311
422
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
312
423
  children: [
313
- /* @__PURE__ */ p("h3", {
424
+ /* @__PURE__ */ f("h3", {
314
425
  className: "text-lg font-medium text-text-primary mb-4",
315
426
  children: j("auth.sso.importMetadata", "Import IdP Metadata")
316
427
  }),
317
- /* @__PURE__ */ p("p", {
428
+ /* @__PURE__ */ f("p", {
318
429
  className: "text-sm text-text-secondary mb-4",
319
430
  children: j("auth.sso.importMetadataDesc", "Automatically configure SSO by importing your IdP's metadata XML file or URL.")
320
431
  }),
321
- /* @__PURE__ */ m("div", {
432
+ /* @__PURE__ */ p("div", {
322
433
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
323
- children: [/* @__PURE__ */ m("div", {
434
+ children: [/* @__PURE__ */ p("div", {
324
435
  className: "space-y-3",
325
436
  children: [
326
- /* @__PURE__ */ p("label", {
437
+ /* @__PURE__ */ f("label", {
327
438
  className: "block text-sm font-medium text-text-primary",
328
439
  children: j("auth.sso.uploadFile", "Upload Metadata File")
329
440
  }),
330
- /* @__PURE__ */ p("input", {
331
- ref: y,
441
+ /* @__PURE__ */ f("input", {
442
+ ref: b,
332
443
  type: "file",
333
444
  accept: ".xml,application/xml,text/xml",
334
- onChange: async (e) => {
335
- let t = e.target.files?.[0];
336
- if (t) {
337
- L(null), U(!0);
338
- try {
339
- let e = g(await t.text());
340
- e ? ($({
341
- ...Q,
342
- entityId: e.entityId,
343
- ssoUrl: e.ssoUrl,
344
- sloUrl: e.sloUrl || "",
345
- certificate: e.certificate
346
- }), z(j("auth.sso.importSuccess", "SAML metadata imported successfully! Review and save the configuration.")), P(!0)) : L(j("auth.sso.parseError", "Failed to parse SAML metadata. Make sure the file contains valid IdP metadata XML."));
347
- } catch {
348
- L(j("auth.sso.readError", "Failed to read metadata file"));
349
- } finally {
350
- U(!1), y.current && (y.current.value = "");
351
- }
352
- }
353
- },
445
+ onChange: ge,
354
446
  className: "hidden",
355
447
  id: "metadata-file",
356
448
  "aria-label": j("auth.sso.uploadFile", "Upload Metadata File")
357
449
  }),
358
- /* @__PURE__ */ m("label", {
450
+ /* @__PURE__ */ p("label", {
359
451
  htmlFor: "metadata-file",
360
452
  className: "flex items-center justify-center gap-2 w-full px-4 py-3 border-2 border-dashed border-border-default rounded-xl cursor-pointer hover:border-action-primary-bg transition-colors",
361
- children: [H ? /* @__PURE__ */ p(t, { className: "size-5 animate-spin text-text-link" }) : /* @__PURE__ */ p("svg", {
453
+ children: [H ? /* @__PURE__ */ f(t, { className: "size-5 animate-spin text-text-link" }) : /* @__PURE__ */ f("svg", {
362
454
  className: "size-5 text-text-tertiary",
363
455
  fill: "none",
364
456
  viewBox: "0 0 24 24",
365
457
  stroke: "currentColor",
366
- children: /* @__PURE__ */ p("path", {
458
+ children: /* @__PURE__ */ f("path", {
367
459
  strokeLinecap: "round",
368
460
  strokeLinejoin: "round",
369
461
  strokeWidth: 2,
370
462
  d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
371
463
  })
372
- }), /* @__PURE__ */ p("span", {
464
+ }), /* @__PURE__ */ f("span", {
373
465
  className: "text-sm text-text-secondary",
374
466
  children: H ? j("auth.sso.importing", "Importing...") : j("auth.sso.chooseFile", "Choose XML file")
375
467
  })]
376
468
  })
377
469
  ]
378
- }), /* @__PURE__ */ m("div", {
470
+ }), /* @__PURE__ */ p("div", {
379
471
  className: "space-y-3",
380
- children: [/* @__PURE__ */ p("label", {
472
+ children: [/* @__PURE__ */ f("label", {
381
473
  className: "block text-sm font-medium text-text-primary",
382
474
  children: j("auth.sso.fetchFromUrl", "Fetch from URL")
383
- }), /* @__PURE__ */ m("div", {
475
+ }), /* @__PURE__ */ p("div", {
384
476
  className: "flex gap-2",
385
- children: [/* @__PURE__ */ p("input", {
477
+ children: [/* @__PURE__ */ f("input", {
386
478
  id: "sso-metadata-url",
387
479
  type: "url",
388
480
  value: B,
@@ -390,39 +482,17 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
390
482
  placeholder: "https://idp.example.com/metadata.xml",
391
483
  "aria-label": j("auth.sso.fetchFromUrl", "Fetch from URL"),
392
484
  className: "flex-1 px-4 py-2.5 border border-border-default rounded-xl bg-bg-surface text-text-primary placeholder-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all text-sm"
393
- }), /* @__PURE__ */ m("button", {
485
+ }), /* @__PURE__ */ p("button", {
394
486
  type: "button",
395
- onClick: async () => {
396
- if (!B) {
397
- L(j("auth.sso.enterUrl", "Please enter a metadata URL"));
398
- return;
399
- }
400
- L(null), U(!0);
401
- try {
402
- let e = await fetch(B);
403
- if (!e.ok) throw Error(`Failed to fetch: ${e.statusText}`);
404
- let t = g(await e.text());
405
- t ? ($({
406
- ...Q,
407
- entityId: t.entityId,
408
- ssoUrl: t.ssoUrl,
409
- sloUrl: t.sloUrl || "",
410
- certificate: t.certificate
411
- }), z(j("auth.sso.importSuccessFromUrl", "SAML metadata imported successfully! Review and save the configuration.")), P(!0), V("")) : L(j("auth.sso.parseUrlError", "Failed to parse SAML metadata from URL."));
412
- } catch (e) {
413
- L(e instanceof Error ? e.message : j("auth.sso.fetchError", "Failed to fetch metadata from URL"));
414
- } finally {
415
- U(!1);
416
- }
417
- },
487
+ onClick: _e,
418
488
  disabled: H || !B,
419
489
  className: "px-4 py-2.5 rounded-xl bg-action-primary-bg text-white font-medium hover:bg-action-primary-bg-hover disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-2",
420
- children: [H ? /* @__PURE__ */ p(t, { className: "size-4 animate-spin" }) : /* @__PURE__ */ p("svg", {
490
+ children: [H ? /* @__PURE__ */ f(t, { className: "size-4 animate-spin" }) : /* @__PURE__ */ f("svg", {
421
491
  className: "size-4",
422
492
  fill: "none",
423
493
  viewBox: "0 0 24 24",
424
494
  stroke: "currentColor",
425
- children: /* @__PURE__ */ p("path", {
495
+ children: /* @__PURE__ */ f("path", {
426
496
  strokeLinecap: "round",
427
497
  strokeLinejoin: "round",
428
498
  strokeWidth: 2,
@@ -435,44 +505,44 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
435
505
  })
436
506
  ]
437
507
  }),
438
- /* @__PURE__ */ m("div", {
508
+ /* @__PURE__ */ p("div", {
439
509
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
440
510
  children: [
441
- /* @__PURE__ */ p("h3", {
511
+ /* @__PURE__ */ f("h3", {
442
512
  className: "text-lg font-medium text-text-primary mb-4",
443
513
  children: j("auth.sso.spMetadata", "Service Provider (SP) Metadata")
444
514
  }),
445
- /* @__PURE__ */ p("p", {
515
+ /* @__PURE__ */ f("p", {
446
516
  className: "text-sm text-text-secondary mb-4",
447
517
  children: j("auth.sso.spMetadataDesc", "Provide these values to your Identity Provider when setting up the SAML integration:")
448
518
  }),
449
- /* @__PURE__ */ m("div", {
519
+ /* @__PURE__ */ p("div", {
450
520
  className: "space-y-4",
451
- children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
521
+ children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
452
522
  className: "block text-sm font-medium text-text-primary mb-1",
453
523
  children: j("auth.sso.spEntityId", "SP Entity ID / Audience URI")
454
- }), /* @__PURE__ */ m("div", {
524
+ }), /* @__PURE__ */ p("div", {
455
525
  className: "flex items-center gap-2",
456
- children: [/* @__PURE__ */ m("code", {
526
+ children: [/* @__PURE__ */ p("code", {
457
527
  className: "flex-1 px-3 py-2 rounded-lg bg-bg-sunken text-sm text-text-primary font-mono",
458
528
  children: [window.location.origin, "/auth/saml/metadata"]
459
- }), /* @__PURE__ */ p("button", {
529
+ }), /* @__PURE__ */ f("button", {
460
530
  type: "button",
461
- onClick: () => void h(`${window.location.origin}/auth/saml/metadata`),
531
+ onClick: () => void g(`${window.location.origin}/auth/saml/metadata`),
462
532
  className: "px-3 py-2 rounded-lg border border-border-default text-text-secondary hover:bg-bg-sunken",
463
533
  children: j("auth.sso.copy", "Copy")
464
534
  })]
465
- })] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
535
+ })] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
466
536
  className: "block text-sm font-medium text-text-primary mb-1",
467
537
  children: j("auth.sso.acsUrl", "Assertion Consumer Service (ACS) URL")
468
- }), /* @__PURE__ */ m("div", {
538
+ }), /* @__PURE__ */ p("div", {
469
539
  className: "flex items-center gap-2",
470
- children: [/* @__PURE__ */ m("code", {
540
+ children: [/* @__PURE__ */ p("code", {
471
541
  className: "flex-1 px-3 py-2 rounded-lg bg-bg-sunken text-sm text-text-primary font-mono",
472
542
  children: [window.location.origin, "/auth/sso/callback"]
473
- }), /* @__PURE__ */ p("button", {
543
+ }), /* @__PURE__ */ f("button", {
474
544
  type: "button",
475
- onClick: () => void h(`${window.location.origin}/auth/sso/callback`),
545
+ onClick: () => void g(`${window.location.origin}/auth/sso/callback`),
476
546
  className: "px-3 py-2 rounded-lg border border-border-default text-text-secondary hover:bg-bg-sunken",
477
547
  children: j("auth.sso.copy", "Copy")
478
548
  })]
@@ -480,127 +550,120 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
480
550
  })
481
551
  ]
482
552
  }),
483
- /* @__PURE__ */ m("form", {
484
- onSubmit: async (e) => {
485
- e.preventDefault(), L(null), z(null);
486
- try {
487
- await O(Q), z(j("auth.sso.saveSuccess", "SSO configuration saved successfully!")), P(!1);
488
- } catch (e) {
489
- L(e instanceof Error ? e.message : j("auth.sso.saveFailed", "Failed to save configuration"));
490
- }
491
- },
553
+ /* @__PURE__ */ p("form", {
554
+ onSubmit: ye,
492
555
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
493
556
  children: [
494
- /* @__PURE__ */ m("div", {
557
+ /* @__PURE__ */ p("div", {
495
558
  className: "flex items-center justify-between mb-6",
496
- children: [/* @__PURE__ */ p("h3", {
559
+ children: [/* @__PURE__ */ f("h3", {
497
560
  className: "text-lg font-medium text-text-primary",
498
561
  children: j("auth.sso.idpSettings", "Identity Provider (IdP) Settings")
499
- }), !N && C && /* @__PURE__ */ p("button", {
562
+ }), !N && w && /* @__PURE__ */ f("button", {
500
563
  type: "button",
501
564
  onClick: () => P(!0),
502
565
  className: "px-4 py-2 rounded-lg border border-status-info-border text-text-link hover:bg-status-info-bg-subtle text-sm font-medium transition-colors",
503
566
  children: j("auth.sso.editConfig", "Edit Configuration")
504
567
  })]
505
568
  }),
506
- /* @__PURE__ */ m("div", {
569
+ /* @__PURE__ */ p("div", {
507
570
  className: "space-y-5",
508
571
  children: [
509
- /* @__PURE__ */ m("div", { children: [
510
- /* @__PURE__ */ m("label", {
572
+ /* @__PURE__ */ p("div", { children: [
573
+ /* @__PURE__ */ p("label", {
511
574
  htmlFor: "sso-entity-id",
512
575
  className: "block text-sm font-medium text-text-primary mb-2",
513
576
  children: [
514
577
  j("auth.sso.idpEntityId", "IdP Entity ID / Issuer URL"),
515
578
  " ",
516
- /* @__PURE__ */ p("span", {
579
+ /* @__PURE__ */ f("span", {
517
580
  className: "text-status-error-text",
518
581
  "aria-hidden": "true",
519
582
  children: "*"
520
583
  })
521
584
  ]
522
585
  }),
523
- /* @__PURE__ */ p("input", {
586
+ /* @__PURE__ */ f("input", {
524
587
  id: "sso-entity-id",
525
588
  type: "url",
526
589
  "aria-label": j("auth.sso.idpEntityId", "IdP Entity ID"),
527
- value: Q.entityId,
528
- onChange: (e) => $({
529
- ...Q,
590
+ value: Z.entityId,
591
+ onChange: (e) => Q({
592
+ ...Z,
530
593
  entityId: e.target.value
531
594
  }),
532
- disabled: !N && !!C,
595
+ disabled: !N && !!w,
533
596
  placeholder: j("auth.sso.idpEntityIdPlaceholder", "https://your-idp.example.com/saml/metadata"),
534
597
  required: !0,
535
598
  "aria-required": "true",
536
599
  "aria-describedby": "sso-entity-id-hint",
537
600
  className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary placeholder-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg disabled:opacity-60 disabled:cursor-not-allowed transition-all"
538
601
  }),
539
- /* @__PURE__ */ p("p", {
602
+ /* @__PURE__ */ f("p", {
540
603
  id: "sso-entity-id-hint",
541
604
  className: "mt-1 text-xs text-text-secondary",
542
605
  children: j("auth.sso.idpEntityIdHelper", "The unique identifier of your Identity Provider")
543
606
  })
544
607
  ] }),
545
- /* @__PURE__ */ m("div", { children: [
546
- /* @__PURE__ */ m("label", {
608
+ /* @__PURE__ */ p("div", { children: [
609
+ /* @__PURE__ */ p("label", {
547
610
  htmlFor: "sso-sso-url",
548
611
  className: "block text-sm font-medium text-text-primary mb-2",
549
612
  children: [
550
613
  j("auth.sso.ssoUrl", "SSO URL (Login URL)"),
551
614
  " ",
552
- /* @__PURE__ */ p("span", {
615
+ /* @__PURE__ */ f("span", {
553
616
  className: "text-status-error-text",
554
617
  "aria-hidden": "true",
555
618
  children: "*"
556
619
  })
557
620
  ]
558
621
  }),
559
- /* @__PURE__ */ p("input", {
622
+ /* @__PURE__ */ f("input", {
560
623
  id: "sso-sso-url",
561
624
  type: "url",
562
625
  "aria-label": j("auth.sso.ssoUrl", "SSO URL"),
563
- value: Q.ssoUrl,
564
- onChange: (e) => $({
565
- ...Q,
626
+ value: Z.ssoUrl,
627
+ onChange: (e) => Q({
628
+ ...Z,
566
629
  ssoUrl: e.target.value
567
630
  }),
568
- disabled: !N && !!C,
631
+ disabled: !N && !!w,
569
632
  placeholder: j("auth.sso.ssoUrlPlaceholder", "https://your-idp.example.com/saml/sso"),
570
633
  required: !0,
571
634
  "aria-required": "true",
572
635
  "aria-describedby": "sso-sso-url-hint",
573
636
  className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary placeholder-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg disabled:opacity-60 disabled:cursor-not-allowed transition-all"
574
637
  }),
575
- /* @__PURE__ */ p("p", {
638
+ /* @__PURE__ */ f("p", {
576
639
  id: "sso-sso-url-hint",
577
640
  className: "mt-1 text-xs text-text-secondary",
578
641
  children: j("auth.sso.ssoUrlHelper", "The URL where users are redirected to authenticate")
579
642
  })
580
643
  ] }),
581
- /* @__PURE__ */ m("div", { children: [
582
- /* @__PURE__ */ m("label", {
644
+ /* @__PURE__ */ p("div", { children: [
645
+ /* @__PURE__ */ p("label", {
583
646
  htmlFor: "sso-certificate",
584
647
  className: "block text-sm font-medium text-text-primary mb-2",
585
648
  children: [
586
649
  j("auth.sso.certificate", "X.509 Certificate"),
587
650
  " ",
588
- /* @__PURE__ */ p("span", {
651
+ /* @__PURE__ */ f("span", {
589
652
  className: "text-status-error-text",
590
653
  "aria-hidden": "true",
591
654
  children: "*"
592
655
  })
593
656
  ]
594
657
  }),
595
- /* @__PURE__ */ p("textarea", {
658
+ /* @__PURE__ */ f("textarea", {
596
659
  id: "sso-certificate",
597
660
  "aria-label": j("auth.sso.certificate", "X.509 Certificate"),
598
- value: Q.certificate,
599
- onChange: (e) => $({
600
- ...Q,
661
+ value: Z.certificate,
662
+ onChange: (e) => Q({
663
+ ...Z,
601
664
  certificate: e.target.value
602
665
  }),
603
- disabled: !N && !!C,
666
+ disabled: !N && !!w,
604
667
  placeholder: j("auth.sso.certificatePlaceholder", "-----BEGIN CERTIFICATE-----\nMIIDpDCCAoygAwIBAgIGAX...\n-----END CERTIFICATE-----"),
605
668
  required: !0,
606
669
  "aria-required": "true",
@@ -608,7 +671,7 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
608
671
  rows: 6,
609
672
  className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary placeholder-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg disabled:opacity-60 disabled:cursor-not-allowed transition-all font-mono text-sm"
610
673
  }),
611
- /* @__PURE__ */ p("p", {
674
+ /* @__PURE__ */ f("p", {
612
675
  id: "sso-certificate-hint",
613
676
  className: "mt-1 text-xs text-text-secondary",
614
677
  children: j("auth.sso.certificateHelper", "The public X.509 certificate from your IdP for signature verification")
@@ -616,22 +679,24 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
616
679
  ] })
617
680
  ]
618
681
  }),
619
- (N || !C) && /* @__PURE__ */ m("div", {
682
+ (N || !w) && /* @__PURE__ */ p("div", {
620
683
  className: "mt-6 flex items-center gap-3",
621
- children: [/* @__PURE__ */ p("button", {
684
+ children: [/* @__PURE__ */ f(m, {
622
685
  type: "submit",
623
- disabled: E,
624
- className: "auth-primary-button flex items-center gap-2 px-6 py-3 font-medium",
625
- children: E ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(t, { className: "size-4 animate-spin" }), j("auth.sso.saving", "Saving...")] }) : j("auth.sso.saveConfig", "Save Configuration")
626
- }), N && /* @__PURE__ */ p("button", {
686
+ disabled: D,
687
+ variant: "default",
688
+ size: "lg",
689
+ className: "font-semibold",
690
+ children: D ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(t, { className: "size-4 animate-spin" }), j("auth.sso.saving", "Saving...")] }) : j("auth.sso.saveConfig", "Save Configuration")
691
+ }), N && /* @__PURE__ */ f("button", {
627
692
  type: "button",
628
693
  onClick: () => {
629
- P(!1), C && $({
630
- entityId: C.entityId || "",
631
- ssoUrl: C.ssoUrl || "",
632
- sloUrl: C.sloUrl || "",
633
- certificate: C.certificate || "",
634
- enabled: C.enabled || !1
694
+ P(!1), w && Q({
695
+ entityId: w.entityId || "",
696
+ ssoUrl: w.ssoUrl || "",
697
+ sloUrl: w.sloUrl || "",
698
+ certificate: w.certificate || "",
699
+ enabled: w.enabled || !1
635
700
  });
636
701
  },
637
702
  className: "px-6 py-3 rounded-xl border border-border-default text-text-primary font-medium hover:bg-bg-sunken transition-colors",
@@ -640,116 +705,116 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
640
705
  })
641
706
  ]
642
707
  }),
643
- C && /* @__PURE__ */ m("div", {
708
+ w && /* @__PURE__ */ p("div", {
644
709
  className: "p-6 rounded-xl border border-status-error-border bg-status-error-bg-subtle",
645
710
  children: [
646
- /* @__PURE__ */ p("h3", {
711
+ /* @__PURE__ */ f("h3", {
647
712
  className: "text-lg font-medium text-status-error-text mb-2",
648
713
  children: j("auth.sso.dangerZone", "Danger Zone")
649
714
  }),
650
- /* @__PURE__ */ p("p", {
715
+ /* @__PURE__ */ f("p", {
651
716
  className: "text-sm text-status-error-text mb-4",
652
717
  children: j("auth.sso.dangerZoneDesc", "Deleting the SSO configuration will prevent users from signing in with their enterprise credentials. This action cannot be undone.")
653
718
  }),
654
- /* @__PURE__ */ p("button", {
719
+ /* @__PURE__ */ f("button", {
655
720
  type: "button",
656
721
  onClick: () => F(!0),
657
- disabled: D,
722
+ disabled: O,
658
723
  className: "px-4 py-2 rounded-lg bg-status-error-bg text-white font-medium hover:bg-status-error-bg-hover disabled:opacity-50 transition-colors flex items-center gap-2",
659
- children: D ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(t, { className: "size-4 animate-spin" }), j("auth.sso.deleting", "Deleting...")] }) : j("auth.sso.deleteConfig", "Delete SSO Configuration")
724
+ children: O ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(t, { className: "size-4 animate-spin" }), j("auth.sso.deleting", "Deleting...")] }) : j("auth.sso.deleteConfig", "Delete SSO Configuration")
660
725
  })
661
726
  ]
662
727
  })
663
728
  ]
664
729
  }),
665
- !T && M === "oidc" && /* @__PURE__ */ m("div", {
730
+ !E && M === "oidc" && /* @__PURE__ */ p("div", {
666
731
  className: "space-y-6",
667
732
  children: [
668
- /* @__PURE__ */ m("div", {
733
+ /* @__PURE__ */ p("div", {
669
734
  className: "p-4 rounded-xl bg-accent-purple-subtle border border-accent-purple-subtle",
670
- children: [/* @__PURE__ */ p("h3", {
735
+ children: [/* @__PURE__ */ f("h3", {
671
736
  className: "font-medium text-accent-purple mb-2",
672
737
  children: j("auth.sso.oidcProviderInfo", "OIDC Provider Information")
673
- }), /* @__PURE__ */ p("p", {
738
+ }), /* @__PURE__ */ f("p", {
674
739
  className: "text-sm text-accent-purple",
675
740
  children: j("auth.sso.oidcProviderInfoDesc", "Your auth service acts as an OpenID Connect Provider. This allows other applications to authenticate users through your system using standard OAuth 2.0/OIDC flows.")
676
741
  })]
677
742
  }),
678
- /* @__PURE__ */ m("div", {
743
+ /* @__PURE__ */ p("div", {
679
744
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
680
745
  children: [
681
- /* @__PURE__ */ p("h3", {
746
+ /* @__PURE__ */ f("h3", {
682
747
  className: "text-lg font-medium text-text-primary mb-4",
683
748
  children: j("auth.sso.discoveryEndpoint", "Discovery Endpoint")
684
749
  }),
685
- /* @__PURE__ */ p("p", {
750
+ /* @__PURE__ */ f("p", {
686
751
  className: "text-sm text-text-secondary mb-4",
687
752
  children: j("auth.sso.discoveryEndpointDesc", "Applications can auto-configure by fetching the OpenID Connect Discovery document:")
688
753
  }),
689
- /* @__PURE__ */ m("div", {
754
+ /* @__PURE__ */ p("div", {
690
755
  className: "flex items-center gap-2",
691
- children: [/* @__PURE__ */ p("code", {
756
+ children: [/* @__PURE__ */ f("code", {
692
757
  className: "flex-1 px-3 py-2 rounded-lg bg-bg-sunken text-sm text-text-primary font-mono break-all",
693
- children: w?.issuer ? `${w.issuer}/.well-known/openid-configuration` : "Discovery endpoint unavailable until OIDC is configured"
694
- }), /* @__PURE__ */ p("button", {
758
+ children: T?.issuer ? `${T.issuer}/.well-known/openid-configuration` : "Discovery endpoint unavailable until OIDC is configured"
759
+ }), /* @__PURE__ */ f("button", {
695
760
  type: "button",
696
761
  onClick: () => {
697
- let e = w?.issuer ? `${w.issuer}/.well-known/openid-configuration` : "";
698
- e && h(e);
762
+ let e = T?.issuer ? `${T.issuer}/.well-known/openid-configuration` : "";
763
+ e && g(e);
699
764
  },
700
- disabled: !w?.issuer,
765
+ disabled: !T?.issuer,
701
766
  className: "px-3 py-2 rounded-lg border border-border-default text-text-secondary hover:bg-bg-sunken flex-shrink-0",
702
767
  children: j("auth.sso.copy", "Copy")
703
768
  })]
704
769
  })
705
770
  ]
706
771
  }),
707
- w && /* @__PURE__ */ m("div", {
772
+ T && /* @__PURE__ */ p("div", {
708
773
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
709
- children: [/* @__PURE__ */ p("h3", {
774
+ children: [/* @__PURE__ */ f("h3", {
710
775
  className: "text-lg font-medium text-text-primary mb-4",
711
776
  children: j("auth.sso.oidcEndpoints", "OIDC Endpoints")
712
- }), /* @__PURE__ */ p("div", {
777
+ }), /* @__PURE__ */ f("div", {
713
778
  className: "space-y-4",
714
779
  children: [
715
780
  {
716
781
  label: j("auth.sso.issuer", "Issuer"),
717
- value: w.issuer
782
+ value: T.issuer
718
783
  },
719
784
  {
720
785
  label: j("auth.sso.authorizationEndpoint", "Authorization Endpoint"),
721
- value: w.authorizationEndpoint
786
+ value: T.authorizationEndpoint
722
787
  },
723
788
  {
724
789
  label: j("auth.sso.tokenEndpoint", "Token Endpoint"),
725
- value: w.tokenEndpoint
790
+ value: T.tokenEndpoint
726
791
  },
727
792
  {
728
793
  label: j("auth.sso.userinfoEndpoint", "UserInfo Endpoint"),
729
- value: w.userinfoEndpoint
794
+ value: T.userinfoEndpoint
730
795
  },
731
796
  {
732
797
  label: j("auth.sso.jwksUri", "JWKS URI"),
733
- value: w.jwksUri
798
+ value: T.jwksUri
734
799
  }
735
- ].map((e) => /* @__PURE__ */ m("div", {
800
+ ].map((e) => /* @__PURE__ */ p("div", {
736
801
  className: "flex items-start gap-4",
737
- children: [/* @__PURE__ */ p("span", {
802
+ children: [/* @__PURE__ */ f("span", {
738
803
  className: "w-48 text-sm font-medium text-text-primary flex-shrink-0",
739
804
  children: e.label
740
- }), /* @__PURE__ */ p("code", {
805
+ }), /* @__PURE__ */ f("code", {
741
806
  className: "text-sm text-text-secondary font-mono break-all",
742
807
  children: e.value
743
808
  })]
744
809
  }, e.label))
745
810
  })]
746
811
  }),
747
- /* @__PURE__ */ m("div", {
812
+ /* @__PURE__ */ p("div", {
748
813
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
749
- children: [/* @__PURE__ */ p("h3", {
814
+ children: [/* @__PURE__ */ f("h3", {
750
815
  className: "text-lg font-medium text-text-primary mb-4",
751
816
  children: j("auth.sso.supportedFeatures", "Supported Features")
752
- }), /* @__PURE__ */ p("div", {
817
+ }), /* @__PURE__ */ f("div", {
753
818
  className: "grid grid-cols-2 gap-4",
754
819
  children: [
755
820
  {
@@ -776,9 +841,9 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
776
841
  name: j("auth.sso.featTokenRevocation", "Token Revocation"),
777
842
  status: !0
778
843
  }
779
- ].map((e) => /* @__PURE__ */ m("div", {
844
+ ].map((e) => /* @__PURE__ */ p("div", {
780
845
  className: "flex items-center gap-2",
781
- children: [/* @__PURE__ */ p("span", { className: `size-2 rounded-full ${e.status ? "bg-status-success-text" : "bg-bg-sunken"}` }), /* @__PURE__ */ p("span", {
846
+ children: [/* @__PURE__ */ f("span", { className: `size-2 rounded-full ${e.status ? "bg-status-success-text" : "bg-bg-sunken"}` }), /* @__PURE__ */ f("span", {
782
847
  className: "text-sm text-text-primary",
783
848
  children: e.name
784
849
  })]
@@ -787,40 +852,40 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
787
852
  })
788
853
  ]
789
854
  }),
790
- !T && M === "clients" && /* @__PURE__ */ m("div", {
855
+ !E && M === "clients" && /* @__PURE__ */ p("div", {
791
856
  className: "space-y-6",
792
857
  children: [
793
- /* @__PURE__ */ m("div", {
858
+ /* @__PURE__ */ p("div", {
794
859
  className: "p-4 rounded-xl bg-status-warning-bg-subtle border border-status-warning-border",
795
- children: [/* @__PURE__ */ p("h3", {
860
+ children: [/* @__PURE__ */ f("h3", {
796
861
  className: "font-medium text-status-warning-text mb-2",
797
862
  children: j("auth.sso.clientManagement", "OIDC Client Management")
798
- }), /* @__PURE__ */ p("p", {
863
+ }), /* @__PURE__ */ f("p", {
799
864
  className: "text-sm text-status-warning-text",
800
865
  children: j("auth.sso.clientManagementDesc", "Register applications that can authenticate users through your OIDC provider. Each client gets unique credentials to use in the OAuth 2.0 / OIDC flow.")
801
866
  })]
802
867
  }),
803
- X && /* @__PURE__ */ m("div", {
868
+ X && /* @__PURE__ */ p("div", {
804
869
  className: "p-6 rounded-xl border-2 border-status-success-border bg-status-success-bg-subtle",
805
- children: [/* @__PURE__ */ m("div", {
870
+ children: [/* @__PURE__ */ p("div", {
806
871
  className: "flex items-start justify-between mb-4",
807
- children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h3", {
872
+ children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h3", {
808
873
  className: "text-lg font-medium text-status-success-text",
809
874
  children: j("auth.sso.clientCreatedTitle", "Client Created Successfully!")
810
- }), /* @__PURE__ */ p("p", {
875
+ }), /* @__PURE__ */ f("p", {
811
876
  className: "text-sm text-status-success-text mt-1",
812
877
  children: j("auth.sso.clientCreatedDesc", "Save these credentials securely. The client secret will not be shown again.")
813
- })] }), /* @__PURE__ */ p("button", {
878
+ })] }), /* @__PURE__ */ f("button", {
814
879
  type: "button",
815
- onClick: () => Z(null),
880
+ onClick: () => he(null),
816
881
  "aria-label": j("auth.sso.dismissClientCredentials", "Dismiss"),
817
882
  className: "text-status-success-text hover:text-status-success-text",
818
- children: /* @__PURE__ */ p("svg", {
883
+ children: /* @__PURE__ */ f("svg", {
819
884
  className: "size-5",
820
885
  fill: "none",
821
886
  viewBox: "0 0 24 24",
822
887
  stroke: "currentColor",
823
- children: /* @__PURE__ */ p("path", {
888
+ children: /* @__PURE__ */ f("path", {
824
889
  strokeLinecap: "round",
825
890
  strokeLinejoin: "round",
826
891
  strokeWidth: 2,
@@ -828,66 +893,66 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
828
893
  })
829
894
  })
830
895
  })]
831
- }), /* @__PURE__ */ m("div", {
896
+ }), /* @__PURE__ */ p("div", {
832
897
  className: "space-y-3",
833
898
  children: [
834
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
899
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
835
900
  className: "block text-xs font-medium text-status-success-text mb-1",
836
901
  children: j("auth.sso.clientId", "Client ID")
837
- }), /* @__PURE__ */ m("div", {
902
+ }), /* @__PURE__ */ p("div", {
838
903
  className: "flex gap-2",
839
- children: [/* @__PURE__ */ p("code", {
904
+ children: [/* @__PURE__ */ f("code", {
840
905
  className: "flex-1 px-3 py-2 rounded-lg bg-bg-surface text-sm font-mono border border-status-success-border",
841
906
  children: X.client_id
842
- }), /* @__PURE__ */ p("button", {
907
+ }), /* @__PURE__ */ f("button", {
843
908
  type: "button",
844
- onClick: () => void h(X.client_id),
909
+ onClick: () => void g(X.client_id),
845
910
  className: "px-3 py-2 rounded-lg bg-status-success-bg text-white text-sm hover:bg-status-success-bg",
846
911
  children: j("auth.sso.copy", "Copy")
847
912
  })]
848
913
  })] }),
849
- X.client_secret && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
914
+ X.client_secret && /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
850
915
  className: "block text-xs font-medium text-status-success-text mb-1",
851
916
  children: j("auth.sso.clientSecret", "Client Secret (save now!)")
852
- }), /* @__PURE__ */ m("div", {
917
+ }), /* @__PURE__ */ p("div", {
853
918
  className: "flex gap-2",
854
- children: [/* @__PURE__ */ p("code", {
919
+ children: [/* @__PURE__ */ f("code", {
855
920
  className: "flex-1 px-3 py-2 rounded-lg bg-bg-surface text-sm font-mono border border-status-success-border",
856
921
  children: X.client_secret
857
- }), /* @__PURE__ */ p("button", {
922
+ }), /* @__PURE__ */ f("button", {
858
923
  type: "button",
859
- onClick: () => void h(X.client_secret || ""),
924
+ onClick: () => void g(X.client_secret || ""),
860
925
  className: "px-3 py-2 rounded-lg bg-status-success-bg text-white text-sm hover:bg-status-success-bg",
861
926
  children: j("auth.sso.copy", "Copy")
862
927
  })]
863
928
  })] }),
864
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
929
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
865
930
  className: "block text-xs font-medium text-status-success-text mb-1",
866
931
  children: j("auth.sso.redirectUris", "Redirect URIs")
867
- }), /* @__PURE__ */ p("code", {
932
+ }), /* @__PURE__ */ f("code", {
868
933
  className: "block px-3 py-2 rounded-lg bg-bg-surface text-sm font-mono border border-status-success-border",
869
934
  children: X.redirect_uris.join(", ")
870
935
  })] })
871
936
  ]
872
937
  })]
873
938
  }),
874
- /* @__PURE__ */ m("div", {
939
+ /* @__PURE__ */ p("div", {
875
940
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
876
- children: [/* @__PURE__ */ m("div", {
941
+ children: [/* @__PURE__ */ p("div", {
877
942
  className: "flex items-center justify-between mb-6",
878
- children: [/* @__PURE__ */ p("h3", {
943
+ children: [/* @__PURE__ */ f("h3", {
879
944
  className: "text-lg font-medium text-text-primary",
880
945
  children: j("auth.sso.registerClient", "Register New Client")
881
- }), !W && /* @__PURE__ */ m("button", {
946
+ }), !W && /* @__PURE__ */ p("button", {
882
947
  type: "button",
883
948
  onClick: () => G(!0),
884
949
  className: "px-4 py-2 rounded-lg bg-action-primary-bg text-white font-medium hover:bg-action-primary-bg-hover transition-colors flex items-center gap-2",
885
- children: [/* @__PURE__ */ p("svg", {
950
+ children: [/* @__PURE__ */ f("svg", {
886
951
  className: "size-4",
887
952
  fill: "none",
888
953
  viewBox: "0 0 24 24",
889
954
  stroke: "currentColor",
890
- children: /* @__PURE__ */ p("path", {
955
+ children: /* @__PURE__ */ f("path", {
891
956
  strokeLinecap: "round",
892
957
  strokeLinejoin: "round",
893
958
  strokeWidth: 2,
@@ -895,22 +960,22 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
895
960
  })
896
961
  }), j("auth.sso.newClient", "New Client")]
897
962
  })]
898
- }), W ? /* @__PURE__ */ m("div", {
963
+ }), W ? /* @__PURE__ */ p("div", {
899
964
  className: "space-y-5",
900
965
  children: [
901
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
966
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
902
967
  htmlFor: "oidc-client-name",
903
968
  className: "block text-sm font-medium text-text-primary mb-2",
904
969
  children: [
905
970
  j("auth.sso.clientName", "Client Name"),
906
971
  " ",
907
- /* @__PURE__ */ p("span", {
972
+ /* @__PURE__ */ f("span", {
908
973
  className: "text-status-error-text",
909
974
  "aria-hidden": "true",
910
975
  children: "*"
911
976
  })
912
977
  ]
913
- }), /* @__PURE__ */ p("input", {
978
+ }), /* @__PURE__ */ f("input", {
914
979
  id: "oidc-client-name",
915
980
  type: "text",
916
981
  "aria-label": j("auth.sso.oidcClientName", "Client Name"),
@@ -923,21 +988,21 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
923
988
  "aria-required": "true",
924
989
  className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary placeholder-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
925
990
  })] }),
926
- /* @__PURE__ */ m("div", { children: [
927
- /* @__PURE__ */ m("label", {
991
+ /* @__PURE__ */ p("div", { children: [
992
+ /* @__PURE__ */ p("label", {
928
993
  htmlFor: "oidc-redirect-uris",
929
994
  className: "block text-sm font-medium text-text-primary mb-2",
930
995
  children: [
931
996
  j("auth.sso.redirectUris", "Redirect URIs"),
932
997
  " ",
933
- /* @__PURE__ */ p("span", {
998
+ /* @__PURE__ */ f("span", {
934
999
  className: "text-status-error-text",
935
1000
  "aria-hidden": "true",
936
1001
  children: "*"
937
1002
  })
938
1003
  ]
939
1004
  }),
940
- /* @__PURE__ */ p("input", {
1005
+ /* @__PURE__ */ f("input", {
941
1006
  id: "oidc-redirect-uris",
942
1007
  type: "text",
943
1008
  "aria-label": j("auth.sso.oidcRedirectUris", "Redirect URIs"),
@@ -951,24 +1016,24 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
951
1016
  "aria-describedby": "oidc-redirect-uris-hint",
952
1017
  className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary placeholder-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
953
1018
  }),
954
- /* @__PURE__ */ p("p", {
1019
+ /* @__PURE__ */ f("p", {
955
1020
  id: "oidc-redirect-uris-hint",
956
1021
  className: "mt-1 text-xs text-text-secondary",
957
1022
  children: j("auth.sso.redirectUrisHelper", "Separate multiple URIs with commas")
958
1023
  })
959
1024
  ] }),
960
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
1025
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
961
1026
  className: "block text-sm font-medium text-text-primary mb-2",
962
1027
  children: j("auth.sso.grantTypes", "Grant Types")
963
- }), /* @__PURE__ */ p("div", {
1028
+ }), /* @__PURE__ */ f("div", {
964
1029
  className: "flex flex-wrap gap-3",
965
1030
  children: [
966
1031
  "authorization_code",
967
1032
  "refresh_token",
968
1033
  "client_credentials"
969
- ].map((e) => /* @__PURE__ */ m("label", {
1034
+ ].map((e) => /* @__PURE__ */ p("label", {
970
1035
  className: "flex items-center gap-2 cursor-pointer",
971
- children: [/* @__PURE__ */ p("input", {
1036
+ children: [/* @__PURE__ */ f("input", {
972
1037
  type: "checkbox",
973
1038
  "aria-label": e,
974
1039
  checked: K.grant_types.includes(e),
@@ -982,17 +1047,17 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
982
1047
  });
983
1048
  },
984
1049
  className: "size-4 rounded border-border-default text-text-link focus:ring-action-primary-bg"
985
- }), /* @__PURE__ */ p("span", {
1050
+ }), /* @__PURE__ */ f("span", {
986
1051
  className: "text-sm text-text-primary",
987
1052
  children: e.replace(/_/g, " ")
988
1053
  })]
989
1054
  }, e))
990
1055
  })] }),
991
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
1056
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
992
1057
  htmlFor: "oidc-token-auth-method",
993
1058
  className: "block text-sm font-medium text-text-primary mb-2",
994
1059
  children: j("auth.sso.tokenEndpointAuth", "Token Endpoint Auth Method")
995
- }), /* @__PURE__ */ m("select", {
1060
+ }), /* @__PURE__ */ p("select", {
996
1061
  id: "oidc-token-auth-method",
997
1062
  value: K.token_endpoint_auth_method,
998
1063
  onChange: (e) => q({
@@ -1001,64 +1066,31 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
1001
1066
  }),
1002
1067
  className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
1003
1068
  children: [
1004
- /* @__PURE__ */ p("option", {
1069
+ /* @__PURE__ */ f("option", {
1005
1070
  value: "none",
1006
1071
  children: j("auth.sso.tokenAuthNone", "None (Public Client - SPAs, Mobile Apps)")
1007
1072
  }),
1008
- /* @__PURE__ */ p("option", {
1073
+ /* @__PURE__ */ f("option", {
1009
1074
  value: "client_secret_basic",
1010
1075
  children: j("auth.sso.tokenAuthBasic", "Client Secret Basic")
1011
1076
  }),
1012
- /* @__PURE__ */ p("option", {
1077
+ /* @__PURE__ */ f("option", {
1013
1078
  value: "client_secret_post",
1014
1079
  children: j("auth.sso.tokenAuthPost", "Client Secret Post")
1015
1080
  })
1016
1081
  ]
1017
1082
  })] }),
1018
- /* @__PURE__ */ m("div", {
1083
+ /* @__PURE__ */ p("div", {
1019
1084
  className: "flex items-center gap-3 pt-2",
1020
- children: [/* @__PURE__ */ p("button", {
1085
+ children: [/* @__PURE__ */ f(m, {
1021
1086
  type: "button",
1022
- onClick: async () => {
1023
- if (!K.client_name || !K.redirect_uris) {
1024
- L(j("auth.sso.clientRequired", "Client name and redirect URI are required"));
1025
- return;
1026
- }
1027
- Y(!0), L(null);
1028
- try {
1029
- let e = w?.registrationEndpoint;
1030
- if (!e) throw Error(j("auth.sso.oidcNotConfigured", "OIDC dynamic client registration is not configured for this environment."));
1031
- let t = await fetch(e, {
1032
- method: "POST",
1033
- headers: { "Content-Type": "application/json" },
1034
- body: JSON.stringify({
1035
- client_name: K.client_name,
1036
- redirect_uris: K.redirect_uris.split(",").map((e) => e.trim()),
1037
- grant_types: K.grant_types,
1038
- response_types: ["code"],
1039
- token_endpoint_auth_method: K.token_endpoint_auth_method
1040
- })
1041
- });
1042
- if (!t.ok) {
1043
- let e = await t.json();
1044
- throw Error(e.error_description || e.error || "Registration failed");
1045
- }
1046
- Z(await t.json()), z(j("auth.sso.clientRegistered", "OIDC client registered successfully! Save the client credentials.")), G(!1), q({
1047
- client_name: "",
1048
- redirect_uris: "",
1049
- grant_types: ["authorization_code", "refresh_token"],
1050
- token_endpoint_auth_method: "none"
1051
- });
1052
- } catch (e) {
1053
- L(e instanceof Error ? e.message : j("auth.sso.registerFailed", "Failed to register client"));
1054
- } finally {
1055
- Y(!1);
1056
- }
1057
- },
1087
+ onClick: ve,
1058
1088
  disabled: J,
1059
- className: "auth-primary-button flex items-center gap-2 px-6 py-3 font-medium",
1060
- children: J ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(t, { className: "size-4 animate-spin" }), j("auth.sso.registering", "Registering...")] }) : j("auth.sso.registerClientButton", "Register Client")
1061
- }), /* @__PURE__ */ p("button", {
1089
+ variant: "default",
1090
+ size: "lg",
1091
+ className: "font-semibold",
1092
+ children: J ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(t, { className: "size-4 animate-spin" }), j("auth.sso.registering", "Registering...")] }) : j("auth.sso.registerClientButton", "Register Client")
1093
+ }), /* @__PURE__ */ f("button", {
1062
1094
  type: "button",
1063
1095
  onClick: () => {
1064
1096
  G(!1), q({
@@ -1073,61 +1105,48 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
1073
1105
  })]
1074
1106
  })
1075
1107
  ]
1076
- }) : /* @__PURE__ */ m("div", {
1077
- className: "text-center py-8 text-text-secondary",
1078
- children: [/* @__PURE__ */ p("svg", {
1079
- className: "size-12 mx-auto mb-3 text-text-muted",
1080
- fill: "none",
1081
- viewBox: "0 0 24 24",
1082
- stroke: "currentColor",
1083
- children: /* @__PURE__ */ p("path", {
1084
- strokeLinecap: "round",
1085
- strokeLinejoin: "round",
1086
- strokeWidth: 1.5,
1087
- d: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"
1088
- })
1089
- }), /* @__PURE__ */ p("p", {
1090
- className: "text-sm",
1091
- children: j("auth.sso.emptyClients", "Click \"New Client\" to register an OAuth 2.0 / OIDC client application.")
1092
- })]
1108
+ }) : /* @__PURE__ */ f(h, {
1109
+ illustration: "empty-generic",
1110
+ title: j("auth.sso.emptyClientsTitle", "No client apps yet"),
1111
+ description: j("auth.sso.emptyClients", "Click \"New Client\" to register an OAuth 2.0 / OIDC client application.")
1093
1112
  })]
1094
1113
  }),
1095
- /* @__PURE__ */ m("div", {
1114
+ /* @__PURE__ */ p("div", {
1096
1115
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
1097
- children: [/* @__PURE__ */ p("h3", {
1116
+ children: [/* @__PURE__ */ f("h3", {
1098
1117
  className: "text-lg font-medium text-text-primary mb-4",
1099
1118
  children: j("auth.sso.preconfiguredClients", "Pre-configured Clients")
1100
- }), /* @__PURE__ */ p("div", {
1119
+ }), /* @__PURE__ */ f("div", {
1101
1120
  className: "space-y-4",
1102
- children: /* @__PURE__ */ m("div", {
1121
+ children: /* @__PURE__ */ p("div", {
1103
1122
  className: "p-4 rounded-lg bg-bg-canvas/50 border border-border-default",
1104
1123
  children: [
1105
- /* @__PURE__ */ m("div", {
1124
+ /* @__PURE__ */ p("div", {
1106
1125
  className: "flex items-center justify-between mb-2",
1107
- children: [/* @__PURE__ */ p("span", {
1126
+ children: [/* @__PURE__ */ f("span", {
1108
1127
  className: "font-medium text-text-primary",
1109
1128
  children: "tenant-frontend"
1110
- }), /* @__PURE__ */ p("span", {
1129
+ }), /* @__PURE__ */ f("span", {
1111
1130
  className: "px-2 py-1 rounded-full text-xs bg-status-success-bg-subtle text-status-success-text",
1112
1131
  children: j("auth.sso.active", "Active")
1113
1132
  })]
1114
1133
  }),
1115
- /* @__PURE__ */ p("p", {
1134
+ /* @__PURE__ */ f("p", {
1116
1135
  className: "text-sm text-text-secondary",
1117
1136
  children: j("auth.sso.preconfigClientDesc", "Default frontend client for tenant authentication")
1118
1137
  }),
1119
- /* @__PURE__ */ m("div", {
1138
+ /* @__PURE__ */ p("div", {
1120
1139
  className: "mt-2 flex flex-wrap gap-2",
1121
1140
  children: [
1122
- /* @__PURE__ */ p("span", {
1141
+ /* @__PURE__ */ f("span", {
1123
1142
  className: "px-2 py-0.5 rounded bg-bg-sunken text-xs text-text-primary",
1124
1143
  children: "authorization_code"
1125
1144
  }),
1126
- /* @__PURE__ */ p("span", {
1145
+ /* @__PURE__ */ f("span", {
1127
1146
  className: "px-2 py-0.5 rounded bg-bg-sunken text-xs text-text-primary",
1128
1147
  children: "refresh_token"
1129
1148
  }),
1130
- /* @__PURE__ */ p("span", {
1149
+ /* @__PURE__ */ f("span", {
1131
1150
  className: "px-2 py-0.5 rounded bg-bg-sunken text-xs text-text-primary",
1132
1151
  children: j("auth.sso.pkceRequired", "PKCE required")
1133
1152
  })
@@ -1139,109 +1158,112 @@ function _({ bypassEnterprisePlanGate: a = !1 }) {
1139
1158
  })
1140
1159
  ]
1141
1160
  }),
1142
- !T && M === "test" && /* @__PURE__ */ m("div", {
1161
+ !E && M === "test" && /* @__PURE__ */ p("div", {
1143
1162
  className: "space-y-6",
1144
1163
  children: [
1145
- /* @__PURE__ */ m("div", {
1164
+ /* @__PURE__ */ p("div", {
1146
1165
  className: "p-4 rounded-xl bg-status-warning-bg-subtle border border-status-warning-border",
1147
- children: [/* @__PURE__ */ p("h3", {
1166
+ children: [/* @__PURE__ */ f("h3", {
1148
1167
  className: "font-medium text-status-warning-text mb-2",
1149
1168
  children: j("auth.sso.testLoginTitle", "Test SSO Login")
1150
- }), /* @__PURE__ */ p("p", {
1169
+ }), /* @__PURE__ */ f("p", {
1151
1170
  className: "text-sm text-status-warning-text",
1152
1171
  children: j("auth.sso.testLoginDesc", "Use this section to test your SSO configuration before rolling it out to users. Make sure your IdP is properly configured with the SP metadata above.")
1153
1172
  })]
1154
1173
  }),
1155
- /* @__PURE__ */ m("div", {
1174
+ /* @__PURE__ */ p("div", {
1156
1175
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
1157
1176
  children: [
1158
- /* @__PURE__ */ p("h3", {
1177
+ /* @__PURE__ */ f("h3", {
1159
1178
  className: "text-lg font-medium text-text-primary mb-4",
1160
1179
  children: j("auth.sso.spInitiatedTest", "SP-Initiated Login Test")
1161
1180
  }),
1162
- /* @__PURE__ */ p("p", {
1181
+ /* @__PURE__ */ f("p", {
1163
1182
  className: "text-sm text-text-secondary mb-4",
1164
1183
  children: j("auth.sso.spInitiatedTestDesc", "Click the button below to initiate an SSO login flow. You will be redirected to your IdP to authenticate.")
1165
1184
  }),
1166
- C && C.enabled ? /* @__PURE__ */ m("a", {
1185
+ w && w.enabled ? /* @__PURE__ */ p("a", {
1167
1186
  href: `${window.location.origin}/auth/sso/login`,
1168
1187
  className: "inline-flex items-center gap-2 px-6 py-3 rounded-xl bg-status-success-bg text-white font-medium shadow-sm hover:opacity-90 transition-all duration-200",
1169
- children: [/* @__PURE__ */ p("svg", {
1188
+ children: [/* @__PURE__ */ f("svg", {
1170
1189
  className: "size-5",
1171
1190
  fill: "none",
1172
1191
  viewBox: "0 0 24 24",
1173
1192
  stroke: "currentColor",
1174
- children: /* @__PURE__ */ p("path", {
1193
+ children: /* @__PURE__ */ f("path", {
1175
1194
  strokeLinecap: "round",
1176
1195
  strokeLinejoin: "round",
1177
1196
  strokeWidth: 2,
1178
1197
  d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"
1179
1198
  })
1180
1199
  }), j("auth.sso.testSsoLoginButton", "Test SSO Login")]
1181
- }) : /* @__PURE__ */ p("div", {
1200
+ }) : /* @__PURE__ */ f("div", {
1182
1201
  className: "p-4 rounded-xl bg-bg-sunken/50 text-text-secondary text-sm",
1183
- children: C ? j("auth.sso.disabledTest", "SSO is disabled. Enable it to test the login flow.") : j("auth.sso.notConfigured", "SSO is not configured. Please configure your IdP settings first.")
1202
+ children: w ? j("auth.sso.disabledTest", "SSO is disabled. Enable it to test the login flow.") : j("auth.sso.notConfigured", "SSO is not configured. Please configure your IdP settings first.")
1184
1203
  })
1185
1204
  ]
1186
1205
  }),
1187
- /* @__PURE__ */ m("div", {
1206
+ /* @__PURE__ */ p("div", {
1188
1207
  className: "p-6 rounded-xl border border-border-subtle bg-bg-surface",
1189
- children: [/* @__PURE__ */ p("h3", {
1208
+ children: [/* @__PURE__ */ f("h3", {
1190
1209
  className: "text-lg font-medium text-text-primary mb-4",
1191
1210
  children: j("auth.sso.testResults", "Test Results")
1192
- }), /* @__PURE__ */ p("p", {
1211
+ }), /* @__PURE__ */ f("p", {
1193
1212
  className: "text-sm text-text-secondary",
1194
1213
  children: j("auth.sso.testResultsDesc", "After testing, results will appear here. Check the browser console for detailed logs.")
1195
1214
  })]
1196
1215
  })
1197
1216
  ]
1217
+ }),
1218
+ /* @__PURE__ */ f(oe, {
1219
+ className: "mt-8",
1220
+ storageKey: "auth-sso-config",
1221
+ steps: [
1222
+ {
1223
+ id: "save-config",
1224
+ label: j("auth.sso.nextSave", "Save your IdP configuration"),
1225
+ description: j("auth.sso.nextSaveDesc", "Enter your SAML or OIDC details, then save so the connection exists."),
1226
+ done: !!w
1227
+ },
1228
+ {
1229
+ id: "enable-sso",
1230
+ label: j("auth.sso.nextEnable", "Enable SSO for sign-in"),
1231
+ description: j("auth.sso.nextEnableDesc", "Flip the connection on once you've confirmed the settings."),
1232
+ done: !!(w && Z.enabled),
1233
+ onClick: () => {
1234
+ w && !Z.enabled && $();
1235
+ }
1236
+ },
1237
+ {
1238
+ id: "test-login",
1239
+ label: j("auth.sso.nextTest", "Test the login flow"),
1240
+ description: j("auth.sso.nextTestDesc", "Run a test sign-in before rolling SSO out to your whole team."),
1241
+ href: w && w.enabled ? `${window.location.origin}/auth/sso/login` : void 0
1242
+ }
1243
+ ]
1198
1244
  })
1199
1245
  ]
1200
- }) : /* @__PURE__ */ p("div", {
1246
+ }) : /* @__PURE__ */ f("div", {
1201
1247
  className: "max-w-5xl mx-auto p-6",
1202
- children: /* @__PURE__ */ m("div", {
1203
- className: "text-center py-16 border-2 border-dashed border-border-subtle rounded-xl",
1204
- children: [
1205
- /* @__PURE__ */ p("div", {
1206
- className: "size-16 mx-auto mb-4 rounded-full bg-status-warning-bg-subtle flex items-center justify-center",
1207
- children: /* @__PURE__ */ p(e, { className: "size-8 text-status-warning-text" })
1208
- }),
1209
- /* @__PURE__ */ p("h2", {
1210
- className: "text-xl font-semibold text-text-primary mb-2",
1211
- children: j("auth.sso.enterprisePlanRequired", "Enterprise Plan Required")
1212
- }),
1213
- /* @__PURE__ */ p("p", {
1214
- className: "text-text-secondary mb-2",
1215
- children: j("auth.sso.enterprisePlanRequiredDesc", "Single Sign-On (SAML / OIDC) configuration is available on the Enterprise plan.")
1216
- }),
1217
- /* @__PURE__ */ p("p", {
1218
- className: "text-sm text-text-secondary",
1219
- children: j("auth.sso.contactSales", "Contact sales to upgrade your workspace to the Enterprise plan.")
1220
- })
1221
- ]
1248
+ children: /* @__PURE__ */ f(h, {
1249
+ illustration: "onboarding",
1250
+ title: j("auth.sso.enterprisePlanRequired", "Enterprise Plan Required"),
1251
+ description: /* @__PURE__ */ p(d, { children: [
1252
+ j("auth.sso.enterprisePlanRequiredDesc", "Single Sign-On (SAML / OIDC) configuration is available on the Enterprise plan."),
1253
+ " ",
1254
+ j("auth.sso.contactSales", "Contact sales to upgrade your workspace to the Enterprise plan.")
1255
+ ] })
1222
1256
  })
1223
- }) : /* @__PURE__ */ p("div", {
1257
+ }) : /* @__PURE__ */ f("div", {
1224
1258
  className: "max-w-5xl mx-auto p-6",
1225
- children: /* @__PURE__ */ m("div", {
1226
- className: "text-center py-16 border-2 border-dashed border-border-subtle rounded-xl",
1227
- children: [
1228
- /* @__PURE__ */ p("div", {
1229
- className: "size-16 mx-auto mb-4 rounded-full bg-status-error-bg-subtle flex items-center justify-center",
1230
- children: /* @__PURE__ */ p(e, { className: "size-8 text-status-error-text" })
1231
- }),
1232
- /* @__PURE__ */ p("h2", {
1233
- className: "text-xl font-semibold text-text-primary mb-2",
1234
- children: j("auth.sso.adminRequired", "Admin Access Required")
1235
- }),
1236
- /* @__PURE__ */ p("p", {
1237
- className: "text-text-secondary",
1238
- children: j("auth.sso.adminRequiredDesc", "You need administrator privileges to configure SSO settings.")
1239
- })
1240
- ]
1259
+ children: /* @__PURE__ */ f(h, {
1260
+ illustration: "empty-generic",
1261
+ title: j("auth.sso.adminRequired", "Admin Access Required"),
1262
+ description: j("auth.sso.adminRequiredDesc", "You need administrator privileges to configure SSO settings.")
1241
1263
  })
1242
1264
  });
1243
1265
  }
1244
1266
  //#endregion
1245
- export { _ as SsoConfigPage };
1267
+ export { v as SsoConfigPage };
1246
1268
 
1247
1269
  //# sourceMappingURL=SsoConfigPage.js.map