hazo_auth 10.15.1 → 10.18.0
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.
- package/cli-src/lib/auth/auth_types.ts +3 -0
- package/cli-src/lib/auth/hazo_get_auth.server.ts +1 -0
- package/cli-src/lib/services/oauth_service.ts +17 -2
- package/cli-src/lib/services/user_update_service.ts +9 -0
- package/cli-src/lib/user_signup_stats.ts +118 -0
- package/config/hazo_auth_config.example.ini +22 -0
- package/dist/components/layouts/my_settings/components/language_picker_section.d.ts +23 -0
- package/dist/components/layouts/my_settings/components/language_picker_section.d.ts.map +1 -0
- package/dist/components/layouts/my_settings/components/language_picker_section.js +40 -0
- package/dist/components/layouts/my_settings/hooks/use_my_settings.d.ts +2 -0
- package/dist/components/layouts/my_settings/hooks/use_my_settings.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/hooks/use_my_settings.js +31 -0
- package/dist/components/layouts/my_settings/index.d.ts +9 -1
- package/dist/components/layouts/my_settings/index.d.ts.map +1 -1
- package/dist/components/layouts/my_settings/index.js +3 -2
- package/dist/components/layouts/shared/hooks/use_auth_status.d.ts +1 -0
- package/dist/components/layouts/shared/hooks/use_auth_status.d.ts.map +1 -1
- package/dist/components/layouts/shared/hooks/use_auth_status.js +3 -2
- package/dist/components/layouts/user_management/components/user_signup_stats_cards.d.ts +16 -0
- package/dist/components/layouts/user_management/components/user_signup_stats_cards.d.ts.map +1 -0
- package/dist/components/layouts/user_management/components/user_signup_stats_cards.js +47 -0
- package/dist/components/layouts/user_management/index.d.ts.map +1 -1
- package/dist/components/layouts/user_management/index.js +26 -25
- package/dist/components/ui/sheet.d.ts +1 -1
- package/dist/lib/auth/auth_types.d.ts +1 -0
- package/dist/lib/auth/auth_types.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_auth.server.js +1 -0
- package/dist/lib/services/oauth_service.d.ts.map +1 -1
- package/dist/lib/services/oauth_service.js +13 -6
- package/dist/lib/services/user_update_service.d.ts +1 -0
- package/dist/lib/services/user_update_service.d.ts.map +1 -1
- package/dist/lib/services/user_update_service.js +4 -0
- package/dist/lib/user_signup_stats.d.ts +37 -0
- package/dist/lib/user_signup_stats.d.ts.map +1 -0
- package/dist/lib/user_signup_stats.js +79 -0
- package/dist/server/routes/library_photos.d.ts +2 -2
- package/dist/server/routes/me.d.ts.map +1 -1
- package/dist/server/routes/me.js +3 -1
- package/dist/server/routes/update_user.d.ts.map +1 -1
- package/dist/server/routes/update_user.js +33 -3
- package/legal/privacy.md +63 -0
- package/legal/tos.md +65 -0
- package/package.json +18 -17
|
@@ -16,6 +16,9 @@ export type HazoAuthUser = {
|
|
|
16
16
|
app_user_data: Record<string, unknown> | null;
|
|
17
17
|
// Legal document acceptance map (JSON object stored in database)
|
|
18
18
|
legal_acceptance: LegalAcceptanceMap | null;
|
|
19
|
+
// User's explicit locale preference (BCP 47 tag, e.g. "en", "pt-BR"). NULL means
|
|
20
|
+
// no preference set — callers fall back to detection (Accept-Language, app default).
|
|
21
|
+
preferred_locale: string | null;
|
|
19
22
|
};
|
|
20
23
|
|
|
21
24
|
/**
|
|
@@ -206,6 +206,7 @@ async function fetch_user_data_from_db(user_id: string): Promise<{
|
|
|
206
206
|
managed_by_user_id: (user_db.managed_by_user_id as string | undefined) || null,
|
|
207
207
|
app_user_data: parse_app_user_data(user_db.app_user_data),
|
|
208
208
|
legal_acceptance: parse_legal_acceptance(user_db.legal_acceptance),
|
|
209
|
+
preferred_locale: (user_db.preferred_locale as string | null | undefined) || null,
|
|
209
210
|
};
|
|
210
211
|
|
|
211
212
|
// v5.x: Fetch user's roles from hazo_user_scopes (scope-based role assignments)
|
|
@@ -87,10 +87,16 @@ export async function handle_google_oauth_login(
|
|
|
87
87
|
if (Array.isArray(users_by_google_id) && users_by_google_id.length > 0) {
|
|
88
88
|
const user = users_by_google_id[0];
|
|
89
89
|
|
|
90
|
-
// Update last_logon timestamp
|
|
90
|
+
// Update last_logon timestamp. Google is the source of truth for this
|
|
91
|
+
// user's avatar on this path (they just authenticated via Google, and
|
|
92
|
+
// google_id already matches), so refresh profile_picture_url whenever
|
|
93
|
+
// Google provides a truthy value — regardless of what's already stored.
|
|
94
|
+
// This handles CDN URL rotation, unlike Step 2/3's first-time-population
|
|
95
|
+
// guard (`!user.profile_picture_url && profile_picture_url`).
|
|
91
96
|
await users_service.updateById(user.id, {
|
|
92
97
|
last_logon: now,
|
|
93
98
|
changed_at: now,
|
|
99
|
+
...(profile_picture_url ? { profile_picture_url, profile_source: "custom" } : {}),
|
|
94
100
|
});
|
|
95
101
|
|
|
96
102
|
logger.info("oauth_service_google_login_existing_google_user", {
|
|
@@ -270,7 +276,16 @@ export async function handle_facebook_oauth_login(
|
|
|
270
276
|
const users_by_fb_id = await users_service.findBy({ facebook_id });
|
|
271
277
|
if (Array.isArray(users_by_fb_id) && users_by_fb_id.length > 0) {
|
|
272
278
|
const user = users_by_fb_id[0];
|
|
273
|
-
|
|
279
|
+
// Facebook is the source of truth for this user's avatar on this path
|
|
280
|
+
// (they just authenticated via Facebook, and facebook_id already
|
|
281
|
+
// matches), so refresh profile_picture_url whenever Facebook provides a
|
|
282
|
+
// truthy value — regardless of what's already stored. This handles CDN
|
|
283
|
+
// URL rotation, unlike Step 2/3's first-time-population guard.
|
|
284
|
+
await users_service.updateById(user.id, {
|
|
285
|
+
last_logon: now,
|
|
286
|
+
changed_at: now,
|
|
287
|
+
...(profile_picture_url ? { profile_picture_url, profile_source: "custom" } : {}),
|
|
288
|
+
});
|
|
274
289
|
logger.info("oauth_service_facebook_login_existing_fb_user", {
|
|
275
290
|
filename: "oauth_service.ts",
|
|
276
291
|
user_id: user.id,
|
|
@@ -13,6 +13,10 @@ export type UserUpdateData = {
|
|
|
13
13
|
email?: string;
|
|
14
14
|
profile_picture_url?: string;
|
|
15
15
|
profile_source?: ProfilePictureSourceUI;
|
|
16
|
+
// BCP 47 locale tag (e.g. "en", "pt-BR"), or null to explicitly clear the preference.
|
|
17
|
+
// Undefined means "leave unchanged" — the caller is expected to have already validated
|
|
18
|
+
// the value (see src/server/routes/update_user.ts).
|
|
19
|
+
preferred_locale?: string | null;
|
|
16
20
|
};
|
|
17
21
|
|
|
18
22
|
export type UserUpdateResult = {
|
|
@@ -106,6 +110,11 @@ export async function update_user_profile(
|
|
|
106
110
|
update_data.profile_source = map_ui_source_to_db(data.profile_source);
|
|
107
111
|
}
|
|
108
112
|
|
|
113
|
+
if (data.preferred_locale !== undefined) {
|
|
114
|
+
// null explicitly clears the preference (falls back to detection elsewhere)
|
|
115
|
+
update_data.preferred_locale = data.preferred_locale;
|
|
116
|
+
}
|
|
117
|
+
|
|
109
118
|
// If email changed, set email_verified to false
|
|
110
119
|
if (email_changed) {
|
|
111
120
|
update_data.email_verified = false;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// file_description: Pure, dependency-free helpers to compute user-signup stats
|
|
2
|
+
// (rolling-window counts + % change vs the prior equal period, plus a YTD
|
|
3
|
+
// monthly series) from a list of users' created_at timestamps. Client-safe.
|
|
4
|
+
|
|
5
|
+
export interface SignupWindow {
|
|
6
|
+
/** stable key: 'all' | '7d' | '30d' | '90d' | '180d' | 'ytd' */
|
|
7
|
+
key: string;
|
|
8
|
+
/** short display label for the card */
|
|
9
|
+
label: string;
|
|
10
|
+
/** signups within the window ('all' = total users) */
|
|
11
|
+
count: number;
|
|
12
|
+
/** signups in the immediately-preceding equal-length period; null for 'all' */
|
|
13
|
+
prevCount: number | null;
|
|
14
|
+
/** rounded % change vs prevCount; null when prevCount is null or 0 */
|
|
15
|
+
pctChange: number | null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface MonthlyPoint {
|
|
19
|
+
/** short month label, e.g. 'Jan' */
|
|
20
|
+
label: string;
|
|
21
|
+
/** signups created in that calendar month of the current year */
|
|
22
|
+
count: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface UserSignupStats {
|
|
26
|
+
total: number;
|
|
27
|
+
windows: SignupWindow[];
|
|
28
|
+
ytdMonthly: MonthlyPoint[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const DAY_MS = 86_400_000;
|
|
32
|
+
const MONTHS = [
|
|
33
|
+
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
|
34
|
+
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
function pctOf(count: number, prev: number | null): number | null {
|
|
38
|
+
if (prev === null || prev === 0) return null;
|
|
39
|
+
return Math.round(((count - prev) / prev) * 100);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Compute signup stats from users' created_at values.
|
|
44
|
+
*
|
|
45
|
+
* Rolling windows (7/30/90/180 days) compare against the immediately-preceding
|
|
46
|
+
* equal-length period. YTD compares against the prior year's same-length
|
|
47
|
+
* period (year-to-date last year). Rows with missing/invalid created_at are
|
|
48
|
+
* ignored for window/YTD math but still counted in `total` via the raw length?
|
|
49
|
+
* — No: total counts only parseable timestamps so windows and total stay
|
|
50
|
+
* consistent. (Unparseable created_at should not happen for real users.)
|
|
51
|
+
*/
|
|
52
|
+
export function computeUserSignupStats(
|
|
53
|
+
users: ReadonlyArray<{ created_at?: string | null }>,
|
|
54
|
+
now: Date = new Date(),
|
|
55
|
+
): UserSignupStats {
|
|
56
|
+
const nowMs = now.getTime();
|
|
57
|
+
|
|
58
|
+
const times: number[] = [];
|
|
59
|
+
for (const u of users) {
|
|
60
|
+
if (!u || !u.created_at) continue;
|
|
61
|
+
const t = new Date(u.created_at).getTime();
|
|
62
|
+
if (!Number.isNaN(t)) times.push(t);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const countBetween = (startMs: number, endMs: number): number =>
|
|
66
|
+
times.reduce((n, t) => (t >= startMs && t < endMs ? n + 1 : n), 0);
|
|
67
|
+
|
|
68
|
+
const total = times.length;
|
|
69
|
+
|
|
70
|
+
const rolling: { key: string; label: string; days: number }[] = [
|
|
71
|
+
{ key: "7d", label: "7 days", days: 7 },
|
|
72
|
+
{ key: "30d", label: "30 days", days: 30 },
|
|
73
|
+
{ key: "90d", label: "3 months", days: 90 },
|
|
74
|
+
{ key: "180d", label: "6 months", days: 180 },
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
const windows: SignupWindow[] = [
|
|
78
|
+
{ key: "all", label: "All time", count: total, prevCount: null, pctChange: null },
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
for (const w of rolling) {
|
|
82
|
+
const span = w.days * DAY_MS;
|
|
83
|
+
const count = countBetween(nowMs - span, nowMs);
|
|
84
|
+
const prevCount = countBetween(nowMs - 2 * span, nowMs - span);
|
|
85
|
+
windows.push({
|
|
86
|
+
key: w.key,
|
|
87
|
+
label: w.label,
|
|
88
|
+
count,
|
|
89
|
+
prevCount,
|
|
90
|
+
pctChange: pctOf(count, prevCount),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// YTD vs prior-year YTD (same elapsed span in the previous year).
|
|
95
|
+
const ytdStart = new Date(now.getFullYear(), 0, 1).getTime();
|
|
96
|
+
const elapsed = nowMs - ytdStart;
|
|
97
|
+
const ytdCount = countBetween(ytdStart, nowMs);
|
|
98
|
+
const prevYtdStart = new Date(now.getFullYear() - 1, 0, 1).getTime();
|
|
99
|
+
const prevYtdCount = countBetween(prevYtdStart, prevYtdStart + elapsed);
|
|
100
|
+
windows.push({
|
|
101
|
+
key: "ytd",
|
|
102
|
+
label: "YTD",
|
|
103
|
+
count: ytdCount,
|
|
104
|
+
prevCount: prevYtdCount,
|
|
105
|
+
pctChange: pctOf(ytdCount, prevYtdCount),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Monthly YTD series (Jan .. current month).
|
|
109
|
+
const ytdMonthly: MonthlyPoint[] = [];
|
|
110
|
+
const year = now.getFullYear();
|
|
111
|
+
for (let m = 0; m <= now.getMonth(); m++) {
|
|
112
|
+
const monthStart = new Date(year, m, 1).getTime();
|
|
113
|
+
const monthEnd = new Date(year, m + 1, 1).getTime();
|
|
114
|
+
ytdMonthly.push({ label: MONTHS[m], count: countBetween(monthStart, monthEnd) });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return { total, windows, ytdMonthly };
|
|
118
|
+
}
|
|
@@ -611,6 +611,28 @@ application_permission_list_defaults = admin_user_management,admin_role_manageme
|
|
|
611
611
|
# Redirect when skip_invitation_check=true and user has no scope
|
|
612
612
|
# no_scope_redirect = /
|
|
613
613
|
|
|
614
|
+
[hazo_auth__legal_docs]
|
|
615
|
+
# Legal document acceptance system (admin Users > Legal Docs tab, and the
|
|
616
|
+
# registration/login acceptance gate). Absent section = feature disabled.
|
|
617
|
+
#
|
|
618
|
+
# display_mode: "separate" shows each doc as its own tab/step; "combined"
|
|
619
|
+
# concatenates them into a single acceptance screen.
|
|
620
|
+
# display_mode = separate
|
|
621
|
+
#
|
|
622
|
+
# Each doc is declared with a numbered doc_N_key / doc_N_title / doc_N_path
|
|
623
|
+
# triplet (N starts at 1, no gaps). doc_N_path is resolved relative to
|
|
624
|
+
# process.cwd() (same base as this INI file) unless given as an absolute
|
|
625
|
+
# path. hazo_auth ships generic starter templates at legal/tos.md and
|
|
626
|
+
# legal/privacy.md inside its own package — point at them via your app's
|
|
627
|
+
# node_modules, or copy them into your own project and edit freely:
|
|
628
|
+
#
|
|
629
|
+
# doc_1_key = terms
|
|
630
|
+
# doc_1_title = Terms of Service
|
|
631
|
+
# doc_1_path = node_modules/hazo_auth/legal/tos.md
|
|
632
|
+
# doc_2_key = privacy
|
|
633
|
+
# doc_2_title = Privacy Policy
|
|
634
|
+
# doc_2_path = node_modules/hazo_auth/legal/privacy.md
|
|
635
|
+
|
|
614
636
|
[hazo_auth__multi_tenancy]
|
|
615
637
|
# Multi-tenancy configuration for organization hierarchy
|
|
616
638
|
# Enables hierarchical organization structures for company-wide access control
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type AvailableLocale = {
|
|
2
|
+
code: string;
|
|
3
|
+
label: string;
|
|
4
|
+
};
|
|
5
|
+
export type LanguagePickerSectionProps = {
|
|
6
|
+
/** List of locales the consuming app supports. Field is hidden unless length >= 2. */
|
|
7
|
+
availableLocales?: AvailableLocale[];
|
|
8
|
+
/** User's current preferred_locale value (may be null/undefined if unset). */
|
|
9
|
+
currentLocale?: string | null;
|
|
10
|
+
/** Called with the new locale code when the user picks a different value. */
|
|
11
|
+
onLocaleChange: (localeCode: string) => Promise<void>;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
label?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Renders a Select for choosing a preferred locale.
|
|
18
|
+
* Returns null when fewer than 2 locales are available (single-locale apps see no change).
|
|
19
|
+
* @param props - Component props
|
|
20
|
+
* @returns Language picker field, or null when not applicable
|
|
21
|
+
*/
|
|
22
|
+
export declare function LanguagePickerSection({ availableLocales, currentLocale, onLocaleChange, disabled, label, placeholder, }: LanguagePickerSectionProps): import("react").JSX.Element | null;
|
|
23
|
+
//# sourceMappingURL=language_picker_section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language_picker_section.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/components/language_picker_section.tsx"],"names":[],"mappings":"AAkBA,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,0BAA0B,GAAG;IACvC,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,6EAA6E;IAC7E,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,QAAgB,EAChB,KAAkB,EAClB,WAAiC,GAClC,EAAE,0BAA0B,sCAmD5B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// file_description: language picker field for My Settings — Profile Information section.
|
|
2
|
+
// i18n prerequisite (FR-028). Renders nothing unless the consuming app supplies 2+
|
|
3
|
+
// available locales; single-locale consumers see no change from current behavior.
|
|
4
|
+
// section: client_directive
|
|
5
|
+
"use client";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
// section: imports
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../../../ui/select.js";
|
|
10
|
+
import { FormFieldWrapper } from "../../shared/components/form_field_wrapper.js";
|
|
11
|
+
// section: component
|
|
12
|
+
/**
|
|
13
|
+
* Renders a Select for choosing a preferred locale.
|
|
14
|
+
* Returns null when fewer than 2 locales are available (single-locale apps see no change).
|
|
15
|
+
* @param props - Component props
|
|
16
|
+
* @returns Language picker field, or null when not applicable
|
|
17
|
+
*/
|
|
18
|
+
export function LanguagePickerSection({ availableLocales, currentLocale, onLocaleChange, disabled = false, label = "Language", placeholder = "Select a language", }) {
|
|
19
|
+
const [saving, setSaving] = useState(false);
|
|
20
|
+
if (!availableLocales || availableLocales.length < 2) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const handleValueChange = async (value) => {
|
|
24
|
+
if (value === currentLocale)
|
|
25
|
+
return;
|
|
26
|
+
setSaving(true);
|
|
27
|
+
try {
|
|
28
|
+
await onLocaleChange(value);
|
|
29
|
+
}
|
|
30
|
+
catch (_a) {
|
|
31
|
+
// onLocaleChange already surfaces the error (toast); nothing further to do here.
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
setSaving(false);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return (_jsx("div", { className: "cls_language_picker_section", children: _jsx(FormFieldWrapper, { fieldId: "preferred-locale", label: label, input: _jsxs(Select, { value: currentLocale !== null && currentLocale !== void 0 ? currentLocale : undefined, onValueChange: (value) => {
|
|
38
|
+
void handleValueChange(value);
|
|
39
|
+
}, disabled: disabled || saving, children: [_jsx(SelectTrigger, { id: "preferred-locale", className: "cls_language_picker_section_trigger", "aria-label": label, children: _jsx(SelectValue, { placeholder: placeholder }) }), _jsx(SelectContent, { children: availableLocales.map((locale) => (_jsx(SelectItem, { value: locale.code, children: locale.label }, locale.code))) })] }) }) }));
|
|
40
|
+
}
|
|
@@ -17,6 +17,7 @@ export type UseMySettingsResult = {
|
|
|
17
17
|
email: string;
|
|
18
18
|
profilePictureUrl?: string;
|
|
19
19
|
profileSource?: "upload" | "library" | "gravatar" | "custom";
|
|
20
|
+
preferredLocale?: string | null;
|
|
20
21
|
lastLogon?: string;
|
|
21
22
|
loading: boolean;
|
|
22
23
|
authProviders?: string;
|
|
@@ -34,6 +35,7 @@ export type UseMySettingsResult = {
|
|
|
34
35
|
handleProfilePictureRemove: () => Promise<void>;
|
|
35
36
|
handleNameSave: (value: string) => Promise<void>;
|
|
36
37
|
handleEmailSave: (value: string) => Promise<void>;
|
|
38
|
+
handlePreferredLocaleSave: (localeCode: string) => Promise<void>;
|
|
37
39
|
refreshUserData: () => Promise<void>;
|
|
38
40
|
};
|
|
39
41
|
export type UseMySettingsParams = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_my_settings.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/hooks/use_my_settings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAI3F,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,OAAO,CAAC;IAChC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sBAAsB,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE;QACN,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAChC,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAEhC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IAGjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAG1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,yBAAyB,EAAE,CAAC,KAAK,EAAE,iBAAiB,GAAG,aAAa,GAAG,iBAAiB,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjH,wBAAwB,EAAE,CAAC,KAAK,EAAE,iBAAiB,GAAG,aAAa,GAAG,iBAAiB,KAAK,IAAI,CAAC;IACjG,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,sBAAsB,EAAE,OAAO,CAAC;IAGhC,wBAAwB,EAAE,OAAO,CAAC;IAClC,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC,+BAA+B,EAAE,MAAM,IAAI,CAAC;IAC5C,wBAAwB,EAAE,CAAC,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzH,0BAA0B,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAGhD,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"use_my_settings.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/hooks/use_my_settings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAI3F,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,OAAO,CAAC;IAChC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sBAAsB,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE;QACN,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAChC,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAEhC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC7D,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IAGjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAG1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,yBAAyB,EAAE,CAAC,KAAK,EAAE,iBAAiB,GAAG,aAAa,GAAG,iBAAiB,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjH,wBAAwB,EAAE,CAAC,KAAK,EAAE,iBAAiB,GAAG,aAAa,GAAG,iBAAiB,KAAK,IAAI,CAAC;IACjG,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,sBAAsB,EAAE,OAAO,CAAC;IAGhC,wBAAwB,EAAE,OAAO,CAAC;IAClC,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC,+BAA+B,EAAE,MAAM,IAAI,CAAC;IAC5C,wBAAwB,EAAE,CAAC,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzH,0BAA0B,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAGhD,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,yBAAyB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAGjE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,oBAAoB,EAAE,0BAA0B,CAAC;CAClD,CAAC;AA4BF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,oBAAoB,GACrB,EAAE,mBAAmB,GAAG,mBAAmB,CAuZ3C"}
|
|
@@ -54,6 +54,7 @@ export function use_my_settings({ passwordRequirements, }) {
|
|
|
54
54
|
const email = authStatus.email || "";
|
|
55
55
|
const profilePictureUrl = authStatus.profile_picture_url;
|
|
56
56
|
const profileSource = authStatus.profile_source;
|
|
57
|
+
const preferredLocale = authStatus.preferred_locale;
|
|
57
58
|
const lastLogon = authStatus.last_logon;
|
|
58
59
|
const loading = authStatus.loading;
|
|
59
60
|
// OAuth-related data
|
|
@@ -139,6 +140,34 @@ export function use_my_settings({ passwordRequirements, }) {
|
|
|
139
140
|
throw error;
|
|
140
141
|
}
|
|
141
142
|
}, [refreshUserData]);
|
|
143
|
+
/**
|
|
144
|
+
* Updates the user's preferred locale (BCP 47 tag, e.g. "en", "pt-BR")
|
|
145
|
+
*/
|
|
146
|
+
const handlePreferredLocaleSave = useCallback(async (localeCode) => {
|
|
147
|
+
try {
|
|
148
|
+
const response = await fetch(`${apiBasePath}/update_user`, {
|
|
149
|
+
method: "PATCH",
|
|
150
|
+
headers: {
|
|
151
|
+
"Content-Type": "application/json",
|
|
152
|
+
},
|
|
153
|
+
credentials: "include",
|
|
154
|
+
body: JSON.stringify({ preferred_locale: localeCode }),
|
|
155
|
+
});
|
|
156
|
+
const data = await response.json();
|
|
157
|
+
if (!response.ok || !data.success) {
|
|
158
|
+
const errorMessage = data.error || "Failed to update language preference";
|
|
159
|
+
toast.error(errorMessage);
|
|
160
|
+
throw new Error(errorMessage);
|
|
161
|
+
}
|
|
162
|
+
toast.success("Language preference updated");
|
|
163
|
+
await refreshUserData();
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
const errorMessage = error instanceof Error ? error.message : "Failed to update language preference";
|
|
167
|
+
toast.error(errorMessage);
|
|
168
|
+
throw error;
|
|
169
|
+
}
|
|
170
|
+
}, [apiBasePath, refreshUserData]);
|
|
142
171
|
/**
|
|
143
172
|
* Validates password requirements
|
|
144
173
|
*/
|
|
@@ -341,6 +370,7 @@ export function use_my_settings({ passwordRequirements, }) {
|
|
|
341
370
|
email,
|
|
342
371
|
profilePictureUrl,
|
|
343
372
|
profileSource,
|
|
373
|
+
preferredLocale,
|
|
344
374
|
lastLogon,
|
|
345
375
|
loading,
|
|
346
376
|
// OAuth-related data
|
|
@@ -360,6 +390,7 @@ export function use_my_settings({ passwordRequirements, }) {
|
|
|
360
390
|
handleProfilePictureRemove,
|
|
361
391
|
handleNameSave,
|
|
362
392
|
handleEmailSave,
|
|
393
|
+
handlePreferredLocaleSave,
|
|
363
394
|
refreshUserData,
|
|
364
395
|
};
|
|
365
396
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AvailableLocale } from "./components/language_picker_section.js";
|
|
1
2
|
import { type MySettingsLabelOverrides } from "./config/my_settings_field_config.js";
|
|
2
3
|
import type { PasswordRequirementOptions, ButtonPaletteOverrides } from "../shared/config/layout_customization";
|
|
3
4
|
export type MySettingsLayoutProps = {
|
|
@@ -22,6 +23,13 @@ export type MySettingsLayoutProps = {
|
|
|
22
23
|
unauthorizedMessage?: string;
|
|
23
24
|
loginButtonLabel?: string;
|
|
24
25
|
loginPath?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Locales the consuming app supports, e.g. [{ code: "en", label: "English" },
|
|
28
|
+
* { code: "pt-BR", label: "Português (Brasil)" }]. The language picker only
|
|
29
|
+
* renders when 2 or more entries are supplied — single-locale consumers are
|
|
30
|
+
* unaffected (no field, no behavior change).
|
|
31
|
+
*/
|
|
32
|
+
availableLocales?: AvailableLocale[];
|
|
25
33
|
/**
|
|
26
34
|
* Whether the Danger Zone (account deletion) section is shown.
|
|
27
35
|
* Mirrors the `enable_account_deletion` config flag; defaults to off (opt-in).
|
|
@@ -66,5 +74,5 @@ export type MySettingsLayoutProps = {
|
|
|
66
74
|
* @param props - Component props including labels, button colors, password requirements, etc.
|
|
67
75
|
* @returns My settings layout component
|
|
68
76
|
*/
|
|
69
|
-
export default function my_settings_layout({ className, labels, button_colors, password_requirements, profilePicture, userFields, unauthorizedMessage, loginButtonLabel, loginPath, enableAccountDeletion, heading, subHeading, profilePhotoLabel, profilePhotoRecommendation, uploadPhotoButtonLabel, removePhotoButtonLabel, profileInformationLabel, passwordLabel, currentPasswordLabel, newPasswordLabel, confirmPasswordLabel, messages, uiSizes, fileTypes, }: MySettingsLayoutProps): import("react").JSX.Element;
|
|
77
|
+
export default function my_settings_layout({ className, labels, button_colors, password_requirements, profilePicture, userFields, unauthorizedMessage, loginButtonLabel, loginPath, availableLocales, enableAccountDeletion, heading, subHeading, profilePhotoLabel, profilePhotoRecommendation, uploadPhotoButtonLabel, removePhotoButtonLabel, profileInformationLabel, passwordLabel, currentPasswordLabel, newPasswordLabel, confirmPasswordLabel, messages, uiSizes, fileTypes, }: MySettingsLayoutProps): import("react").JSX.Element;
|
|
70
78
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/my_settings/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/my_settings/index.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAGnG,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,uCAAuC,CAAC;AAQ/C,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,qBAAqB,EAAE,0BAA0B,CAAC;IAClD,cAAc,EAAE;QACd,kBAAkB,EAAE,OAAO,CAAC;QAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,cAAc,EAAE,MAAM,CAAC;QACvB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,4BAA4B,EAAE,UAAU,GAAG,SAAS,CAAC;QACrD,4BAA4B,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;QACtD,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,UAAU,EAAE;QACV,eAAe,EAAE,OAAO,CAAC;QACzB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,mBAAmB,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE;QACR,6BAA6B,EAAE,MAAM,CAAC;QACtC,sBAAsB,EAAE,MAAM,CAAC;QAC/B,2BAA2B,EAAE,MAAM,CAAC;QACpC,uBAAuB,EAAE,MAAM,CAAC;KACjC,CAAC;IACF,OAAO,EAAE;QACP,aAAa,EAAE,MAAM,CAAC;QACtB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,yBAAyB,EAAE,MAAM,CAAC;QAClC,uBAAuB,EAAE,MAAM,CAAC;QAChC,0BAA0B,EAAE,MAAM,CAAC;QACnC,0BAA0B,EAAE,MAAM,CAAC;QACnC,+BAA+B,EAAE,MAAM,CAAC;QACxC,4BAA4B,EAAE,MAAM,CAAC;KACtC,CAAC;IACF,SAAS,EAAE;QACT,wBAAwB,EAAE,MAAM,EAAE,CAAC;QACnC,wBAAwB,EAAE,MAAM,EAAE,CAAC;KACpC,CAAC;CACH,CAAC;AAGF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,SAAS,EACT,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,mBAAkE,EAClE,gBAAgC,EAChC,SAA8B,EAC9B,gBAAgB,EAChB,qBAA6B,EAC7B,OAA4B,EAC5B,UAAoE,EACpE,iBAAmC,EACnC,0BAAqE,EACrE,sBAA2C,EAC3C,sBAAiC,EACjC,uBAA+C,EAC/C,aAA0B,EAC1B,oBAAyC,EACzC,gBAAiC,EACjC,oBAAyC,EACzC,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE,qBAAqB,+BAmPvB"}
|
|
@@ -10,6 +10,7 @@ import { ProfilePictureDialog } from "./components/profile_picture_dialog.js";
|
|
|
10
10
|
import { ConnectedAccountsSection } from "./components/connected_accounts_section.js";
|
|
11
11
|
import { SetPasswordSection } from "./components/set_password_section.js";
|
|
12
12
|
import { DangerZoneSection } from "./components/danger_zone_section.js";
|
|
13
|
+
import { LanguagePickerSection } from "./components/language_picker_section.js";
|
|
13
14
|
import { UnauthorizedGuard } from "../shared/components/unauthorized_guard.js";
|
|
14
15
|
import { use_my_settings } from "./hooks/use_my_settings.js";
|
|
15
16
|
import { resolveMySettingsLabels, resolveMySettingsButtonPalette, } from "./config/my_settings_field_config.js";
|
|
@@ -25,14 +26,14 @@ import { cn } from "../../../lib/utils.js";
|
|
|
25
26
|
* @param props - Component props including labels, button colors, password requirements, etc.
|
|
26
27
|
* @returns My settings layout component
|
|
27
28
|
*/
|
|
28
|
-
export default function my_settings_layout({ className, labels, button_colors, password_requirements, profilePicture, userFields, unauthorizedMessage = "You must be logged in to access this page.", loginButtonLabel = "Go to login", loginPath = "/hazo_auth/login", enableAccountDeletion = false, heading = "Account Settings", subHeading = "Manage your profile, password, and email preferences.", profilePhotoLabel = "Profile Photo", profilePhotoRecommendation = "Recommended size: 200x200px. JPG, PNG.", uploadPhotoButtonLabel = "Upload New Photo", removePhotoButtonLabel = "Remove", profileInformationLabel = "Profile Information", passwordLabel = "Password", currentPasswordLabel = "Current Password", newPasswordLabel = "New Password", confirmPasswordLabel = "Confirm Password", messages, uiSizes, fileTypes, }) {
|
|
29
|
+
export default function my_settings_layout({ className, labels, button_colors, password_requirements, profilePicture, userFields, unauthorizedMessage = "You must be logged in to access this page.", loginButtonLabel = "Go to login", loginPath = "/hazo_auth/login", availableLocales, enableAccountDeletion = false, heading = "Account Settings", subHeading = "Manage your profile, password, and email preferences.", profilePhotoLabel = "Profile Photo", profilePhotoRecommendation = "Recommended size: 200x200px. JPG, PNG.", uploadPhotoButtonLabel = "Upload New Photo", removePhotoButtonLabel = "Remove", profileInformationLabel = "Profile Information", passwordLabel = "Password", currentPasswordLabel = "Current Password", newPasswordLabel = "New Password", confirmPasswordLabel = "Confirm Password", messages, uiSizes, fileTypes, }) {
|
|
29
30
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
30
31
|
const resolvedLabels = resolveMySettingsLabels(labels);
|
|
31
32
|
const resolvedButtonPalette = resolveMySettingsButtonPalette(button_colors);
|
|
32
33
|
const settings = use_my_settings({
|
|
33
34
|
passwordRequirements: password_requirements,
|
|
34
35
|
});
|
|
35
|
-
return (_jsx(UnauthorizedGuard, { message: unauthorizedMessage, loginButtonLabel: loginButtonLabel, loginPath: loginPath, children: _jsxs("div", { className: cn("cls_my_settings_layout flex flex-col gap-6 p-6 w-full", className), children: [_jsxs("div", { className: "cls_my_settings_layout_header flex flex-col gap-2", children: [_jsx("h1", { className: "cls_my_settings_layout_heading text-3xl font-bold text-[var(--hazo-text-primary)]", children: heading }), _jsx("p", { className: "cls_my_settings_layout_subheading text-[var(--hazo-text-muted)]", children: subHeading })] }), _jsxs("div", { className: "cls_my_settings_layout_profile_photo_section bg-white rounded-lg border border-[var(--hazo-border)] p-6", children: [_jsx("h2", { className: "cls_my_settings_layout_section_heading text-lg font-semibold text-[var(--hazo-text-primary)] mb-4", children: profilePhotoLabel }), _jsx("div", { className: "cls_my_settings_layout_profile_photo_content flex flex-col items-center", children: _jsxs("div", { className: "cls_my_settings_layout_profile_photo_display relative", children: [_jsx(ProfilePictureDisplay, { profilePictureUrl: settings.profilePictureUrl, name: settings.name, email: settings.email, onEdit: settings.handleProfilePictureEdit }), _jsxs("div", { className: "cls_my_settings_layout_profile_photo_actions absolute left-0 right-0 flex items-center justify-between px-2", style: { bottom: '-20px' }, children: [_jsx(Button, { type: "button", onClick: settings.handleProfilePictureEdit, disabled: settings.loading, variant: "ghost", size: "icon", className: "cls_my_settings_layout_upload_photo_button", "aria-label": uploadPhotoButtonLabel, children: _jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), _jsx(Button, { type: "button", onClick: settings.handleProfilePictureRemove, disabled: settings.loading || !settings.profilePictureUrl, variant: "ghost", size: "icon", className: "cls_my_settings_layout_remove_photo_button text-red-600 hover:text-red-700 hover:bg-red-50", "aria-label": removePhotoButtonLabel, children: _jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" }) })] })] }) })] }), _jsxs("div", { className: "cls_my_settings_layout_profile_information_section bg-white rounded-lg border border-[var(--hazo-border)] p-6", children: [_jsx("h2", { className: "cls_my_settings_layout_section_heading text-lg font-semibold text-[var(--hazo-text-primary)] mb-4", children: profileInformationLabel }), _jsxs("div", { className: "cls_my_settings_layout_profile_information_fields grid grid-cols-1 md:grid-cols-2 gap-6", children: [userFields.show_name_field && (_jsx(EditableField, { label: "Full Name", value: settings.name, type: "text", placeholder: "Enter your full name", onSave: settings.handleNameSave, validation: validateName, disabled: settings.loading, ariaLabel: "Full name input field" })), userFields.show_email_field && (_jsx(EditableField, { label: "Email Address", value: settings.email, type: "email", placeholder: "Enter your email address", onSave: settings.handleEmailSave, validation: validateEmail, disabled: settings.loading, ariaLabel: "Email address input field" }))] })] }), userFields.show_password_field && settings.hasPassword && (_jsxs("div", { className: "cls_my_settings_layout_password_section bg-white rounded-lg border border-[var(--hazo-border)] p-6", children: [_jsx("h2", { className: "cls_my_settings_layout_section_heading text-lg font-semibold text-[var(--hazo-text-primary)] mb-4", children: passwordLabel }), _jsxs("div", { className: "cls_my_settings_layout_password_fields flex flex-col gap-6", children: [_jsx(FormFieldWrapper, { fieldId: "current-password", label: currentPasswordLabel, input: _jsx(PasswordField, { inputId: "current-password", ariaLabel: currentPasswordLabel, value: ((_a = settings.passwordFields) === null || _a === void 0 ? void 0 : _a.currentPassword) || "", placeholder: "Enter your current password", autoComplete: "current-password", isVisible: ((_b = settings.passwordFields) === null || _b === void 0 ? void 0 : _b.currentPasswordVisible) || false, onChange: (value) => settings.handlePasswordFieldChange("currentPassword", value), onToggleVisibility: () => settings.togglePasswordVisibility("currentPassword"), errorMessage: (_d = (_c = settings.passwordFields) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d.currentPassword }) }), _jsxs("div", { className: "cls_my_settings_layout_password_fields_row grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsx(FormFieldWrapper, { fieldId: "new-password", label: newPasswordLabel, input: _jsx(PasswordField, { inputId: "new-password", ariaLabel: newPasswordLabel, value: ((_e = settings.passwordFields) === null || _e === void 0 ? void 0 : _e.newPassword) || "", placeholder: "Enter your new password", autoComplete: "new-password", isVisible: ((_f = settings.passwordFields) === null || _f === void 0 ? void 0 : _f.newPasswordVisible) || false, onChange: (value) => settings.handlePasswordFieldChange("newPassword", value), onToggleVisibility: () => settings.togglePasswordVisibility("newPassword"), errorMessage: (_h = (_g = settings.passwordFields) === null || _g === void 0 ? void 0 : _g.errors) === null || _h === void 0 ? void 0 : _h.newPassword }) }), _jsx(FormFieldWrapper, { fieldId: "confirm-password", label: confirmPasswordLabel, input: _jsx(PasswordField, { inputId: "confirm-password", ariaLabel: confirmPasswordLabel, value: ((_j = settings.passwordFields) === null || _j === void 0 ? void 0 : _j.confirmPassword) || "", placeholder: "Confirm your new password", autoComplete: "new-password", isVisible: ((_k = settings.passwordFields) === null || _k === void 0 ? void 0 : _k.confirmPasswordVisible) || false, onChange: (value) => settings.handlePasswordFieldChange("confirmPassword", value), onToggleVisibility: () => settings.togglePasswordVisibility("confirmPassword"), errorMessage: (_m = (_l = settings.passwordFields) === null || _l === void 0 ? void 0 : _l.errors) === null || _m === void 0 ? void 0 : _m.confirmPassword }) })] })] }), _jsx("div", { className: "cls_my_settings_layout_password_actions flex justify-end mt-4", children: _jsx(Button, { type: "button", onClick: settings.handlePasswordSave, disabled: settings.loading || settings.isPasswordSaveDisabled, className: "cls_my_settings_layout_save_password_button", style: {
|
|
36
|
+
return (_jsx(UnauthorizedGuard, { message: unauthorizedMessage, loginButtonLabel: loginButtonLabel, loginPath: loginPath, children: _jsxs("div", { className: cn("cls_my_settings_layout flex flex-col gap-6 p-6 w-full", className), children: [_jsxs("div", { className: "cls_my_settings_layout_header flex flex-col gap-2", children: [_jsx("h1", { className: "cls_my_settings_layout_heading text-3xl font-bold text-[var(--hazo-text-primary)]", children: heading }), _jsx("p", { className: "cls_my_settings_layout_subheading text-[var(--hazo-text-muted)]", children: subHeading })] }), _jsxs("div", { className: "cls_my_settings_layout_profile_photo_section bg-white rounded-lg border border-[var(--hazo-border)] p-6", children: [_jsx("h2", { className: "cls_my_settings_layout_section_heading text-lg font-semibold text-[var(--hazo-text-primary)] mb-4", children: profilePhotoLabel }), _jsx("div", { className: "cls_my_settings_layout_profile_photo_content flex flex-col items-center", children: _jsxs("div", { className: "cls_my_settings_layout_profile_photo_display relative", children: [_jsx(ProfilePictureDisplay, { profilePictureUrl: settings.profilePictureUrl, name: settings.name, email: settings.email, onEdit: settings.handleProfilePictureEdit }), _jsxs("div", { className: "cls_my_settings_layout_profile_photo_actions absolute left-0 right-0 flex items-center justify-between px-2", style: { bottom: '-20px' }, children: [_jsx(Button, { type: "button", onClick: settings.handleProfilePictureEdit, disabled: settings.loading, variant: "ghost", size: "icon", className: "cls_my_settings_layout_upload_photo_button", "aria-label": uploadPhotoButtonLabel, children: _jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), _jsx(Button, { type: "button", onClick: settings.handleProfilePictureRemove, disabled: settings.loading || !settings.profilePictureUrl, variant: "ghost", size: "icon", className: "cls_my_settings_layout_remove_photo_button text-red-600 hover:text-red-700 hover:bg-red-50", "aria-label": removePhotoButtonLabel, children: _jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" }) })] })] }) })] }), _jsxs("div", { className: "cls_my_settings_layout_profile_information_section bg-white rounded-lg border border-[var(--hazo-border)] p-6", children: [_jsx("h2", { className: "cls_my_settings_layout_section_heading text-lg font-semibold text-[var(--hazo-text-primary)] mb-4", children: profileInformationLabel }), _jsxs("div", { className: "cls_my_settings_layout_profile_information_fields grid grid-cols-1 md:grid-cols-2 gap-6", children: [userFields.show_name_field && (_jsx(EditableField, { label: "Full Name", value: settings.name, type: "text", placeholder: "Enter your full name", onSave: settings.handleNameSave, validation: validateName, disabled: settings.loading, ariaLabel: "Full name input field" })), userFields.show_email_field && (_jsx(EditableField, { label: "Email Address", value: settings.email, type: "email", placeholder: "Enter your email address", onSave: settings.handleEmailSave, validation: validateEmail, disabled: settings.loading, ariaLabel: "Email address input field" })), _jsx(LanguagePickerSection, { availableLocales: availableLocales, currentLocale: settings.preferredLocale, onLocaleChange: settings.handlePreferredLocaleSave, disabled: settings.loading })] })] }), userFields.show_password_field && settings.hasPassword && (_jsxs("div", { className: "cls_my_settings_layout_password_section bg-white rounded-lg border border-[var(--hazo-border)] p-6", children: [_jsx("h2", { className: "cls_my_settings_layout_section_heading text-lg font-semibold text-[var(--hazo-text-primary)] mb-4", children: passwordLabel }), _jsxs("div", { className: "cls_my_settings_layout_password_fields flex flex-col gap-6", children: [_jsx(FormFieldWrapper, { fieldId: "current-password", label: currentPasswordLabel, input: _jsx(PasswordField, { inputId: "current-password", ariaLabel: currentPasswordLabel, value: ((_a = settings.passwordFields) === null || _a === void 0 ? void 0 : _a.currentPassword) || "", placeholder: "Enter your current password", autoComplete: "current-password", isVisible: ((_b = settings.passwordFields) === null || _b === void 0 ? void 0 : _b.currentPasswordVisible) || false, onChange: (value) => settings.handlePasswordFieldChange("currentPassword", value), onToggleVisibility: () => settings.togglePasswordVisibility("currentPassword"), errorMessage: (_d = (_c = settings.passwordFields) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d.currentPassword }) }), _jsxs("div", { className: "cls_my_settings_layout_password_fields_row grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsx(FormFieldWrapper, { fieldId: "new-password", label: newPasswordLabel, input: _jsx(PasswordField, { inputId: "new-password", ariaLabel: newPasswordLabel, value: ((_e = settings.passwordFields) === null || _e === void 0 ? void 0 : _e.newPassword) || "", placeholder: "Enter your new password", autoComplete: "new-password", isVisible: ((_f = settings.passwordFields) === null || _f === void 0 ? void 0 : _f.newPasswordVisible) || false, onChange: (value) => settings.handlePasswordFieldChange("newPassword", value), onToggleVisibility: () => settings.togglePasswordVisibility("newPassword"), errorMessage: (_h = (_g = settings.passwordFields) === null || _g === void 0 ? void 0 : _g.errors) === null || _h === void 0 ? void 0 : _h.newPassword }) }), _jsx(FormFieldWrapper, { fieldId: "confirm-password", label: confirmPasswordLabel, input: _jsx(PasswordField, { inputId: "confirm-password", ariaLabel: confirmPasswordLabel, value: ((_j = settings.passwordFields) === null || _j === void 0 ? void 0 : _j.confirmPassword) || "", placeholder: "Confirm your new password", autoComplete: "new-password", isVisible: ((_k = settings.passwordFields) === null || _k === void 0 ? void 0 : _k.confirmPasswordVisible) || false, onChange: (value) => settings.handlePasswordFieldChange("confirmPassword", value), onToggleVisibility: () => settings.togglePasswordVisibility("confirmPassword"), errorMessage: (_m = (_l = settings.passwordFields) === null || _l === void 0 ? void 0 : _l.errors) === null || _m === void 0 ? void 0 : _m.confirmPassword }) })] })] }), _jsx("div", { className: "cls_my_settings_layout_password_actions flex justify-end mt-4", children: _jsx(Button, { type: "button", onClick: settings.handlePasswordSave, disabled: settings.loading || settings.isPasswordSaveDisabled, className: "cls_my_settings_layout_save_password_button", style: {
|
|
36
37
|
backgroundColor: resolvedButtonPalette.submitBackground,
|
|
37
38
|
color: resolvedButtonPalette.submitText,
|
|
38
39
|
}, "aria-label": "Save password", children: "Save Password" }) })] })), !settings.hasPassword && settings.googleConnected && (_jsx(SetPasswordSection, { passwordRequirements: password_requirements, onPasswordSet: settings.refreshUserData, parentLoading: settings.loading })), _jsx(ConnectedAccountsSection, { googleConnected: settings.googleConnected || false, email: settings.email, loading: settings.loading }), _jsx(DangerZoneSection, { enabled: enableAccountDeletion, email: settings.email }), _jsx(ProfilePictureDialog, { open: settings.profilePictureDialogOpen, onOpenChange: (open) => {
|
|
@@ -10,6 +10,7 @@ export type AuthStatusData = {
|
|
|
10
10
|
avatar_url?: string;
|
|
11
11
|
image?: string;
|
|
12
12
|
profile_source?: "upload" | "library" | "gravatar" | "custom";
|
|
13
|
+
preferred_locale?: string | null;
|
|
13
14
|
permissions?: string[];
|
|
14
15
|
permission_ok?: boolean;
|
|
15
16
|
missing_permissions?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_auth_status.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/hooks/use_auth_status.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,cAAc,GAAG;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"use_auth_status.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/hooks/use_auth_status.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,cAAc,GAAG;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAE9D,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG;IACxC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAMF;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAIlD;AAGD,wBAAgB,eAAe,IAAI,UAAU,CA4E5C"}
|
|
@@ -23,7 +23,7 @@ export function use_auth_status() {
|
|
|
23
23
|
loading: true,
|
|
24
24
|
});
|
|
25
25
|
const checkAuth = useCallback(async () => {
|
|
26
|
-
var _a;
|
|
26
|
+
var _a, _b;
|
|
27
27
|
setAuthStatus((prev) => (Object.assign(Object.assign({}, prev), { loading: true })));
|
|
28
28
|
try {
|
|
29
29
|
const response = await fetch(`${apiBasePath}/me`, {
|
|
@@ -45,8 +45,9 @@ export function use_auth_status() {
|
|
|
45
45
|
avatar_url: data.avatar_url,
|
|
46
46
|
image: data.image,
|
|
47
47
|
profile_source: data.profile_source,
|
|
48
|
+
preferred_locale: (_a = data.preferred_locale) !== null && _a !== void 0 ? _a : null,
|
|
48
49
|
permissions: data.permissions || [],
|
|
49
|
-
permission_ok: (
|
|
50
|
+
permission_ok: (_b = data.permission_ok) !== null && _b !== void 0 ? _b : true,
|
|
50
51
|
missing_permissions: data.missing_permissions,
|
|
51
52
|
// OAuth-related fields
|
|
52
53
|
auth_providers: data.auth_providers,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface UserSignupStatsCardsProps {
|
|
3
|
+
users: ReadonlyArray<{
|
|
4
|
+
created_at?: string | null;
|
|
5
|
+
}>;
|
|
6
|
+
/** Injectable for tests / stable stories. Defaults to now. */
|
|
7
|
+
now?: Date;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Total + rolling-window signup cards (All time, 7d, 30d, 3mo, 6mo, YTD) each
|
|
12
|
+
* with % change vs the prior equal period, plus a mini YTD monthly bar chart.
|
|
13
|
+
* Computes everything client-side from the already-loaded users list.
|
|
14
|
+
*/
|
|
15
|
+
export declare function UserSignupStatsCards({ users, now, className }: UserSignupStatsCardsProps): React.JSX.Element;
|
|
16
|
+
//# sourceMappingURL=user_signup_stats_cards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user_signup_stats_cards.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/user_management/components/user_signup_stats_cards.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,aAAa,CAAC;QAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACrD,8DAA8D;IAC9D,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwFD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,yBAAyB,qBAaxF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// file_description: Mini stat cards (total + rolling windows with % change vs the
|
|
2
|
+
// prior equal period) plus a small YTD monthly signups bar chart, for the top of
|
|
3
|
+
// the Manage Users tab. Pure/dependency-free (inline SVG chart).
|
|
4
|
+
"use client";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useMemo } from "react";
|
|
7
|
+
import { computeUserSignupStats, } from "../../../../lib/user_signup_stats.js";
|
|
8
|
+
function DeltaBadge({ pct }) {
|
|
9
|
+
if (pct === null) {
|
|
10
|
+
return _jsx("span", { className: "text-xs text-muted-foreground", children: "\u2014" });
|
|
11
|
+
}
|
|
12
|
+
const up = pct >= 0;
|
|
13
|
+
const cls = up ? "text-emerald-600" : "text-red-600";
|
|
14
|
+
const arrow = up ? "▲" : "▼";
|
|
15
|
+
return (_jsxs("span", { className: `text-xs font-medium ${cls}`, title: "vs. previous equal period", children: [arrow, " ", up ? "+" : "", pct, "%"] }));
|
|
16
|
+
}
|
|
17
|
+
function StatCard({ w }) {
|
|
18
|
+
return (_jsxs("div", { className: "cls_user_signup_stat_card rounded-lg border bg-card p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: w.label }), _jsxs("div", { className: "mt-1 flex items-baseline justify-between gap-2", children: [_jsx("span", { className: "text-2xl font-bold tabular-nums", children: w.count.toLocaleString() }), w.key !== "all" && _jsx(DeltaBadge, { pct: w.pctChange })] }), w.key !== "all" && w.prevCount !== null && (_jsxs("div", { className: "mt-0.5 text-[11px] text-muted-foreground", children: ["prev ", w.prevCount.toLocaleString()] })), w.key === "all" && (_jsx("div", { className: "mt-0.5 text-[11px] text-muted-foreground", children: "total users" }))] }));
|
|
19
|
+
}
|
|
20
|
+
function YtdMiniChart({ data }) {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
|
+
const total = data.reduce((n, d) => n + d.count, 0);
|
|
23
|
+
const max = Math.max(1, ...data.map((d) => d.count));
|
|
24
|
+
// Inline SVG bar chart — no chart library dependency.
|
|
25
|
+
const W = 220;
|
|
26
|
+
const H = 56;
|
|
27
|
+
const gap = 3;
|
|
28
|
+
const n = Math.max(1, data.length);
|
|
29
|
+
const bw = (W - gap * (n - 1)) / n;
|
|
30
|
+
return (_jsxs("div", { className: "cls_user_signup_ytd_chart rounded-lg border bg-card p-3 sm:col-span-2", children: [_jsxs("div", { className: "flex items-baseline justify-between", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Signups by month (YTD)" }), _jsx("div", { className: "text-sm font-semibold tabular-nums", children: total.toLocaleString() })] }), _jsx("svg", { role: "img", "aria-label": `Year-to-date signups by month: ${data
|
|
31
|
+
.map((d) => `${d.label} ${d.count}`)
|
|
32
|
+
.join(", ")}`, viewBox: `0 0 ${W} ${H}`, className: "mt-2 w-full", preserveAspectRatio: "none", children: data.map((d, i) => {
|
|
33
|
+
const h = Math.round((d.count / max) * (H - 2));
|
|
34
|
+
const x = i * (bw + gap);
|
|
35
|
+
const y = H - h;
|
|
36
|
+
return (_jsx("rect", { x: x, y: y, width: bw, height: h, rx: 1.5, className: "fill-primary", children: _jsx("title", { children: `${d.label}: ${d.count}` }) }, d.label));
|
|
37
|
+
}) }), _jsxs("div", { className: "mt-1 flex justify-between text-[10px] text-muted-foreground", children: [_jsx("span", { children: (_b = (_a = data[0]) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : "" }), _jsx("span", { children: (_d = (_c = data[data.length - 1]) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : "" })] })] }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Total + rolling-window signup cards (All time, 7d, 30d, 3mo, 6mo, YTD) each
|
|
41
|
+
* with % change vs the prior equal period, plus a mini YTD monthly bar chart.
|
|
42
|
+
* Computes everything client-side from the already-loaded users list.
|
|
43
|
+
*/
|
|
44
|
+
export function UserSignupStatsCards({ users, now, className }) {
|
|
45
|
+
const stats = useMemo(() => computeUserSignupStats(users, now), [users, now]);
|
|
46
|
+
return (_jsxs("div", { className: `cls_user_signup_stats_cards mb-4 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-8 ${className !== null && className !== void 0 ? className : ""}`, children: [stats.windows.map((w) => (_jsx(StatCard, { w: w }, w.key))), _jsx(YtdMiniChart, { data: stats.ytdMonthly })] }));
|
|
47
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/user_management/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/user_management/index.tsx"],"names":[],"mappings":"AA0DA,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAC;CACvC,CAAC;AAwJF;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,EAAE,YAAoB,EAAE,gBAAwB,EAAE,kBAAuB,EAAE,EAAE,yBAAyB,+BAikDrJ"}
|