@authowl/react 0.21.1 → 0.22.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/dist/{TeamsSection-SHXAL64Q.js → TeamsSection-ZQDNMWV3.js} +1 -1
- package/dist/captcha-loader-VNULARCZ.js +68 -0
- package/dist/captcha-providers-STYFL25P.js +71 -0
- package/dist/{chunk-K67DJJHP.js → chunk-PUJV7S6G.js} +9 -6
- package/dist/index.cjs +1108 -926
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +872 -849
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -236,11 +236,12 @@ function useAccount() {
|
|
|
236
236
|
return useAuthClient().account;
|
|
237
237
|
}
|
|
238
238
|
function usePublicConfig() {
|
|
239
|
-
const { config, configState } = useAuthOwlContext();
|
|
239
|
+
const { config, configState, retryPublicConfig } = useAuthOwlContext();
|
|
240
240
|
return {
|
|
241
241
|
config,
|
|
242
242
|
isLoading: configState === "loading",
|
|
243
|
-
isError: configState === "error"
|
|
243
|
+
isError: configState === "error",
|
|
244
|
+
retry: retryPublicConfig
|
|
244
245
|
};
|
|
245
246
|
}
|
|
246
247
|
function useSession() {
|
|
@@ -748,7 +749,7 @@ function warnPublicConfigFailed(resolved, error) {
|
|
|
748
749
|
warnedConfigProjects.add(key);
|
|
749
750
|
const reason = error instanceof Error ? error.message : String(error);
|
|
750
751
|
console.warn(
|
|
751
|
-
`[AuthOwl] Could not load this project's public config from ${origin} (${reason}).
|
|
752
|
+
`[AuthOwl] Could not load this project's public config from ${origin} (${reason}). Authentication UI is unavailable until the request succeeds. Likely causes: the API is unreachable, \`apiUrl\` is wrong, or the publishable key points at a missing/mismatched project. Check \`apiUrl\` and \`publishableKey\` on <AuthOwlProvider>. (This warning is dev-only.)`
|
|
752
753
|
);
|
|
753
754
|
}
|
|
754
755
|
function detectLocale() {
|
|
@@ -784,6 +785,8 @@ function AuthOwlProvider({
|
|
|
784
785
|
const client = React5.useMemo(() => (0, import_core2.createAuthOwlClient)(resolved), [resolved]);
|
|
785
786
|
const [config, setConfig] = React5.useState(null);
|
|
786
787
|
const [configState, setConfigState] = React5.useState("loading");
|
|
788
|
+
const [configAttempt, setConfigAttempt] = React5.useState(0);
|
|
789
|
+
const retryPublicConfig = React5.useCallback(() => setConfigAttempt((attempt) => attempt + 1), []);
|
|
787
790
|
React5.useEffect(() => {
|
|
788
791
|
let active = true;
|
|
789
792
|
setConfigState("loading");
|
|
@@ -800,7 +803,7 @@ function AuthOwlProvider({
|
|
|
800
803
|
return () => {
|
|
801
804
|
active = false;
|
|
802
805
|
};
|
|
803
|
-
}, [resolved]);
|
|
806
|
+
}, [resolved, configAttempt]);
|
|
804
807
|
const merged = resolveAppearance(appearance, config);
|
|
805
808
|
const [autoLocale, setAutoLocale] = React5.useState(null);
|
|
806
809
|
React5.useEffect(() => {
|
|
@@ -811,8 +814,8 @@ function AuthOwlProvider({
|
|
|
811
814
|
(0, import_core2.captureInvitationClaim)();
|
|
812
815
|
}, []);
|
|
813
816
|
const ctxValue = React5.useMemo(
|
|
814
|
-
() => ({ client, appearance, config, configState, locale }),
|
|
815
|
-
[client, appearance, config, configState, locale]
|
|
817
|
+
() => ({ client, appearance, config, configState, retryPublicConfig, locale }),
|
|
818
|
+
[client, appearance, config, configState, retryPublicConfig, locale]
|
|
816
819
|
);
|
|
817
820
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Context.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
818
821
|
"div",
|
|
@@ -930,6 +933,159 @@ var init_FormError = __esm({
|
|
|
930
933
|
}
|
|
931
934
|
});
|
|
932
935
|
|
|
936
|
+
// src/components/captcha-loader.ts
|
|
937
|
+
var captcha_loader_exports = {};
|
|
938
|
+
__export(captcha_loader_exports, {
|
|
939
|
+
loadCaptcha: () => loadCaptcha
|
|
940
|
+
});
|
|
941
|
+
function providerGlobal(adapter) {
|
|
942
|
+
const api = window[adapter.globalName];
|
|
943
|
+
return typeof api?.render === "function" ? api : void 0;
|
|
944
|
+
}
|
|
945
|
+
function loadCaptcha(adapter) {
|
|
946
|
+
const available = providerGlobal(adapter);
|
|
947
|
+
if (available) return Promise.resolve(available);
|
|
948
|
+
const cached = loaders.get(adapter.scriptUrl);
|
|
949
|
+
if (cached) return cached;
|
|
950
|
+
const loading = new Promise((resolve, reject) => {
|
|
951
|
+
const existing = document.querySelector(
|
|
952
|
+
`script[src="${adapter.scriptUrl}"]`
|
|
953
|
+
);
|
|
954
|
+
const script = existing ?? document.createElement("script");
|
|
955
|
+
let poll;
|
|
956
|
+
const cleanup = () => {
|
|
957
|
+
clearTimeout(timeout);
|
|
958
|
+
if (poll !== void 0) clearInterval(poll);
|
|
959
|
+
script.removeEventListener("load", loaded);
|
|
960
|
+
script.removeEventListener("error", failed);
|
|
961
|
+
};
|
|
962
|
+
const resolveWhenPublished = () => {
|
|
963
|
+
const api = providerGlobal(adapter);
|
|
964
|
+
if (!api) return false;
|
|
965
|
+
cleanup();
|
|
966
|
+
resolve(api);
|
|
967
|
+
return true;
|
|
968
|
+
};
|
|
969
|
+
const loaded = () => {
|
|
970
|
+
if (!resolveWhenPublished() && poll === void 0) {
|
|
971
|
+
poll = setInterval(resolveWhenPublished, GLOBAL_POLL_INTERVAL_MS);
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
const failed = () => {
|
|
975
|
+
cleanup();
|
|
976
|
+
if (!existing) script.remove();
|
|
977
|
+
reject(new Error(`${adapter.label} failed to load`));
|
|
978
|
+
};
|
|
979
|
+
const timeout = setTimeout(failed, SCRIPT_LOAD_TIMEOUT_MS);
|
|
980
|
+
script.addEventListener("load", loaded, { once: true });
|
|
981
|
+
script.addEventListener("error", failed, { once: true });
|
|
982
|
+
if (existing) {
|
|
983
|
+
loaded();
|
|
984
|
+
} else {
|
|
985
|
+
script.src = adapter.scriptUrl;
|
|
986
|
+
script.async = true;
|
|
987
|
+
script.defer = true;
|
|
988
|
+
const nonce = document.querySelector("script[nonce]")?.nonce;
|
|
989
|
+
if (nonce) script.nonce = nonce;
|
|
990
|
+
document.head.appendChild(script);
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
const retryable = loading.catch((error) => {
|
|
994
|
+
loaders.delete(adapter.scriptUrl);
|
|
995
|
+
throw error;
|
|
996
|
+
});
|
|
997
|
+
loaders.set(adapter.scriptUrl, retryable);
|
|
998
|
+
return retryable;
|
|
999
|
+
}
|
|
1000
|
+
var SCRIPT_LOAD_TIMEOUT_MS, GLOBAL_POLL_INTERVAL_MS, loaders;
|
|
1001
|
+
var init_captcha_loader = __esm({
|
|
1002
|
+
"src/components/captcha-loader.ts"() {
|
|
1003
|
+
"use strict";
|
|
1004
|
+
"use client";
|
|
1005
|
+
SCRIPT_LOAD_TIMEOUT_MS = 1e4;
|
|
1006
|
+
GLOBAL_POLL_INTERVAL_MS = 25;
|
|
1007
|
+
loaders = /* @__PURE__ */ new Map();
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
|
|
1011
|
+
// src/components/captcha-providers.ts
|
|
1012
|
+
var captcha_providers_exports = {};
|
|
1013
|
+
__export(captcha_providers_exports, {
|
|
1014
|
+
CAPTCHA_ADAPTERS: () => CAPTCHA_ADAPTERS,
|
|
1015
|
+
captchaAdapterFor: () => captchaAdapterFor
|
|
1016
|
+
});
|
|
1017
|
+
function preferredTheme() {
|
|
1018
|
+
return typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
1019
|
+
}
|
|
1020
|
+
function teardown(api, widgetId) {
|
|
1021
|
+
if (api.remove) {
|
|
1022
|
+
try {
|
|
1023
|
+
api.remove(widgetId);
|
|
1024
|
+
return;
|
|
1025
|
+
} catch {
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
try {
|
|
1029
|
+
api.reset?.(widgetId);
|
|
1030
|
+
} catch {
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
function captchaAdapterFor(provider) {
|
|
1034
|
+
return CAPTCHA_ADAPTERS[provider] ?? null;
|
|
1035
|
+
}
|
|
1036
|
+
var CAPTCHA_ADAPTERS;
|
|
1037
|
+
var init_captcha_providers = __esm({
|
|
1038
|
+
"src/components/captcha-providers.ts"() {
|
|
1039
|
+
"use strict";
|
|
1040
|
+
"use client";
|
|
1041
|
+
CAPTCHA_ADAPTERS = {
|
|
1042
|
+
turnstile: {
|
|
1043
|
+
scriptUrl: "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",
|
|
1044
|
+
globalName: "turnstile",
|
|
1045
|
+
label: "Cloudflare Turnstile",
|
|
1046
|
+
invisibleRenderOptions: ({ siteKey, theme, action, language }) => ({
|
|
1047
|
+
sitekey: siteKey,
|
|
1048
|
+
theme,
|
|
1049
|
+
action,
|
|
1050
|
+
language,
|
|
1051
|
+
execution: "execute",
|
|
1052
|
+
appearance: "interaction-only",
|
|
1053
|
+
size: "flexible"
|
|
1054
|
+
}),
|
|
1055
|
+
teardown
|
|
1056
|
+
},
|
|
1057
|
+
hcaptcha: {
|
|
1058
|
+
scriptUrl: "https://js.hcaptcha.com/1/api.js?render=explicit",
|
|
1059
|
+
globalName: "hcaptcha",
|
|
1060
|
+
label: "hCaptcha",
|
|
1061
|
+
invisibleRenderOptions: ({ siteKey, theme }) => ({
|
|
1062
|
+
sitekey: siteKey,
|
|
1063
|
+
// 'auto' is Turnstile vocabulary. hCaptcha and reCAPTCHA take light|dark
|
|
1064
|
+
// only and silently fall back to light on anything else, which reads badly
|
|
1065
|
+
// in a dark application.
|
|
1066
|
+
theme: theme === "auto" ? preferredTheme() : theme,
|
|
1067
|
+
size: "invisible"
|
|
1068
|
+
}),
|
|
1069
|
+
teardown
|
|
1070
|
+
},
|
|
1071
|
+
"recaptcha-v2": {
|
|
1072
|
+
scriptUrl: "https://www.google.com/recaptcha/api.js?render=explicit",
|
|
1073
|
+
globalName: "grecaptcha",
|
|
1074
|
+
label: "reCAPTCHA",
|
|
1075
|
+
invisibleRenderOptions: ({ siteKey, theme }) => ({
|
|
1076
|
+
sitekey: siteKey,
|
|
1077
|
+
// 'auto' is Turnstile vocabulary. hCaptcha and reCAPTCHA take light|dark
|
|
1078
|
+
// only and silently fall back to light on anything else, which reads badly
|
|
1079
|
+
// in a dark application.
|
|
1080
|
+
theme: theme === "auto" ? preferredTheme() : theme,
|
|
1081
|
+
size: "invisible"
|
|
1082
|
+
}),
|
|
1083
|
+
teardown
|
|
1084
|
+
}
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
|
|
933
1089
|
// ../../node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.mjs
|
|
934
1090
|
var qrcode, QRMode, QRErrorCorrectionLevel, QRMaskPattern, QRUtil, QRMath, qrPolynomial, QRRSBlock, qrBitBuffer, qrNumber, qrAlphaNum, qr8BitByte, qrKanji, byteArrayOutputStream, base64EncodeOutputStream, base64DecodeInputStream, gifImage, createDataURL, qrcode_default, stringToBytes;
|
|
935
1091
|
var init_qrcode = __esm({
|
|
@@ -2836,34 +2992,34 @@ function TeamMembersPanel({
|
|
|
2836
2992
|
}
|
|
2837
2993
|
);
|
|
2838
2994
|
};
|
|
2839
|
-
return /* @__PURE__ */ (0,
|
|
2840
|
-
/* @__PURE__ */ (0,
|
|
2841
|
-
canAdd && availableMembers.length > 0 && members !== null && /* @__PURE__ */ (0,
|
|
2842
|
-
/* @__PURE__ */ (0,
|
|
2995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ba-organization-user-invitations", children: [
|
|
2996
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h4", { children: t("organization.profile.teams.manageMembers") }),
|
|
2997
|
+
canAdd && availableMembers.length > 0 && members !== null && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("form", { method: "post", className: "ba-organization-invite-form", onSubmit: addMember, children: [
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("label", { className: "ba-label", children: [
|
|
2843
2999
|
t("organization.profile.teams.addMember"),
|
|
2844
|
-
/* @__PURE__ */ (0,
|
|
3000
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("select", { className: "ba-input", value: addableUserId, onChange: (event) => setUserId(event.target.value), children: availableMembers.map((member) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("option", { value: member.userId, children: member.user.name || member.user.email || member.userId }, member.userId)) })
|
|
2845
3001
|
] }),
|
|
2846
|
-
/* @__PURE__ */ (0,
|
|
3002
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !addableUserId, children: t("organization.profile.teams.addMember") })
|
|
2847
3003
|
] }),
|
|
2848
|
-
/* @__PURE__ */ (0,
|
|
2849
|
-
error && /* @__PURE__ */ (0,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2851
|
-
/* @__PURE__ */ (0,
|
|
3004
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(FormError, { children: actionError }),
|
|
3005
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ba-inline-error", children: [
|
|
3006
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(FormError, { children: error }),
|
|
3007
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void reload(), children: t("organization.retry") })
|
|
2852
3008
|
] }),
|
|
2853
|
-
members?.length ? /* @__PURE__ */ (0,
|
|
3009
|
+
members?.length ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { className: "ba-organization-list", children: members.map((member) => {
|
|
2854
3010
|
const organizationMember = organization.members.find((entry) => entry.userId === member.userId);
|
|
2855
3011
|
const displayName = organizationMember?.user.name || member.userId;
|
|
2856
|
-
return /* @__PURE__ */ (0,
|
|
2857
|
-
/* @__PURE__ */ (0,
|
|
2858
|
-
/* @__PURE__ */ (0,
|
|
2859
|
-
organizationMember?.user.email && /* @__PURE__ */ (0,
|
|
3012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("li", { className: "ba-organization-member", children: [
|
|
3013
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "ba-organization-member-copy", children: [
|
|
3014
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("strong", { children: displayName }),
|
|
3015
|
+
organizationMember?.user.email && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("small", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Bidi, { children: organizationMember.user.email }) })
|
|
2860
3016
|
] }),
|
|
2861
|
-
canRemove && /* @__PURE__ */ (0,
|
|
3017
|
+
canRemove && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => removeMember(member), children: t("organization.profile.teams.removeMember") })
|
|
2862
3018
|
] }, member.id);
|
|
2863
|
-
}) }) : error ? null : members === null ? /* @__PURE__ */ (0,
|
|
3019
|
+
}) }) : error ? null : members === null ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ba-skeleton", "aria-label": t("common.loading") }) : members.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "ba-muted", children: t("organization.profile.teams.membersEmpty") }) : null
|
|
2864
3020
|
] });
|
|
2865
3021
|
}
|
|
2866
|
-
var React53,
|
|
3022
|
+
var React53, import_jsx_runtime59;
|
|
2867
3023
|
var init_TeamMembersPanel = __esm({
|
|
2868
3024
|
"src/components/organization/TeamMembersPanel.tsx"() {
|
|
2869
3025
|
"use strict";
|
|
@@ -2874,7 +3030,7 @@ var init_TeamMembersPanel = __esm({
|
|
|
2874
3030
|
init_FormError();
|
|
2875
3031
|
init_use_submit_action();
|
|
2876
3032
|
init_use_team_resources();
|
|
2877
|
-
|
|
3033
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2878
3034
|
}
|
|
2879
3035
|
});
|
|
2880
3036
|
|
|
@@ -2953,42 +3109,42 @@ function TeamsSection({
|
|
|
2953
3109
|
);
|
|
2954
3110
|
};
|
|
2955
3111
|
const selectedTeam = teams?.find((team) => team.id === selectedTeamId);
|
|
2956
|
-
return /* @__PURE__ */ (0,
|
|
2957
|
-
/* @__PURE__ */ (0,
|
|
2958
|
-
/* @__PURE__ */ (0,
|
|
2959
|
-
/* @__PURE__ */ (0,
|
|
3112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { className: "ba-organization-section", children: [
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h3", { className: "ba-title", children: t("organization.profile.teams.title") }),
|
|
3115
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "ba-muted", children: t("organization.profile.teams.description") })
|
|
2960
3116
|
] }),
|
|
2961
|
-
capabilities.createTeam ? /* @__PURE__ */ (0,
|
|
2962
|
-
/* @__PURE__ */ (0,
|
|
3117
|
+
capabilities.createTeam ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("form", { method: "post", className: "ba-organization-invite-form", onSubmit: create, children: [
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("label", { className: "ba-label", children: [
|
|
2963
3119
|
t("organization.profile.teams.create"),
|
|
2964
|
-
/* @__PURE__ */ (0,
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { className: "ba-input", value: name, onChange: (event) => setName(event.target.value), required: true })
|
|
2965
3121
|
] }),
|
|
2966
|
-
/* @__PURE__ */ (0,
|
|
3122
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !name.trim(), "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.teams.create") }) })
|
|
2967
3123
|
] }) : null,
|
|
2968
|
-
/* @__PURE__ */ (0,
|
|
2969
|
-
teamsError && /* @__PURE__ */ (0,
|
|
2970
|
-
/* @__PURE__ */ (0,
|
|
2971
|
-
/* @__PURE__ */ (0,
|
|
3124
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormError, { children: actionError }),
|
|
3125
|
+
teamsError && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ba-inline-error", children: [
|
|
3126
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormError, { children: teamsError }),
|
|
3127
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void reload(), children: t("organization.retry") })
|
|
2972
3128
|
] }),
|
|
2973
|
-
teams?.length ? /* @__PURE__ */ (0,
|
|
2974
|
-
/* @__PURE__ */ (0,
|
|
2975
|
-
editingTeamId === team.id ? /* @__PURE__ */ (0,
|
|
2976
|
-
/* @__PURE__ */ (0,
|
|
3129
|
+
teams?.length ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("ul", { className: "ba-organization-list", children: teams.map((team) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("li", { className: "ba-organization-member", children: [
|
|
3130
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: team.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
3131
|
+
editingTeamId === team.id ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("form", { method: "post", className: "ba-organization-invite-form", onSubmit: (event) => rename(event, team), children: [
|
|
3132
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("label", { className: "ba-label", children: [
|
|
2977
3133
|
t("organization.profile.teams.rename"),
|
|
2978
|
-
/* @__PURE__ */ (0,
|
|
3134
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { className: "ba-input", value: editingName, onChange: (event) => setEditingName(event.target.value), required: true, autoFocus: true })
|
|
2979
3135
|
] }),
|
|
2980
|
-
/* @__PURE__ */ (0,
|
|
2981
|
-
/* @__PURE__ */ (0,
|
|
2982
|
-
] }) : /* @__PURE__ */ (0,
|
|
2983
|
-
/* @__PURE__ */ (0,
|
|
2984
|
-
/* @__PURE__ */ (0,
|
|
2985
|
-
/* @__PURE__ */ (0,
|
|
2986
|
-
capabilities.updateTeam && /* @__PURE__ */ (0,
|
|
2987
|
-
capabilities.deleteTeam && /* @__PURE__ */ (0,
|
|
3136
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !editingName.trim(), children: t("organization.profile.teams.rename") }),
|
|
3137
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: () => setEditingTeamId(null), children: t("organization.profile.teams.cancel") })
|
|
3138
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
3139
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "ba-organization-member-copy", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("strong", { children: team.name }) }),
|
|
3140
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "ba-organization-member-actions", children: [
|
|
3141
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, "aria-expanded": selectedTeamId === team.id, onClick: () => setSelectedTeamId(selectedTeamId === team.id ? null : team.id), children: t("organization.profile.teams.manageMembers") }),
|
|
3142
|
+
capabilities.updateTeam && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: () => beginRename(team), children: t("organization.profile.teams.rename") }),
|
|
3143
|
+
capabilities.deleteTeam && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => remove(team), children: t("organization.profile.teams.removeTeam") })
|
|
2988
3144
|
] })
|
|
2989
3145
|
] })
|
|
2990
|
-
] }, team.id)) }) : teamsError ? null : teams === null ? /* @__PURE__ */ (0,
|
|
2991
|
-
selectedTeam && /* @__PURE__ */ (0,
|
|
3146
|
+
] }, team.id)) }) : teamsError ? null : teams === null ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "ba-skeleton", "aria-label": t("common.loading") }) : teams.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "ba-muted", children: t("organization.profile.teams.empty") }) : null,
|
|
3147
|
+
selectedTeam && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2992
3148
|
TeamMembersPanel,
|
|
2993
3149
|
{
|
|
2994
3150
|
organization,
|
|
@@ -2999,7 +3155,7 @@ function TeamsSection({
|
|
|
2999
3155
|
)
|
|
3000
3156
|
] });
|
|
3001
3157
|
}
|
|
3002
|
-
var React54,
|
|
3158
|
+
var React54, import_jsx_runtime60;
|
|
3003
3159
|
var init_TeamsSection = __esm({
|
|
3004
3160
|
"src/components/organization/TeamsSection.tsx"() {
|
|
3005
3161
|
"use strict";
|
|
@@ -3014,7 +3170,7 @@ var init_TeamsSection = __esm({
|
|
|
3014
3170
|
init_model();
|
|
3015
3171
|
init_use_organization_roles();
|
|
3016
3172
|
init_use_team_resources();
|
|
3017
|
-
|
|
3173
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3018
3174
|
}
|
|
3019
3175
|
});
|
|
3020
3176
|
|
|
@@ -3427,110 +3583,26 @@ function PasskeyButton({ redirectTo, onSignedIn }) {
|
|
|
3427
3583
|
}
|
|
3428
3584
|
|
|
3429
3585
|
// src/components/ForgotPassword.tsx
|
|
3430
|
-
var
|
|
3586
|
+
var React10 = __toESM(require("react"), 1);
|
|
3431
3587
|
init_hooks();
|
|
3432
3588
|
init_i18n();
|
|
3433
3589
|
init_use_submit_action();
|
|
3434
3590
|
init_Spinner();
|
|
3435
3591
|
|
|
3436
3592
|
// src/components/AuthChallenge.tsx
|
|
3437
|
-
var
|
|
3593
|
+
var React9 = __toESM(require("react"), 1);
|
|
3438
3594
|
init_hooks();
|
|
3439
3595
|
init_i18n();
|
|
3596
|
+
init_FormError();
|
|
3440
3597
|
|
|
3441
|
-
// src/components/
|
|
3442
|
-
var
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
var SCRIPT_LOAD_TIMEOUT_MS = 1e4;
|
|
3446
|
-
var LOCAL_TURNSTILE_TEST_TOKEN = "XXXX.DUMMY.TOKEN.XXXX";
|
|
3447
|
-
var loader = null;
|
|
3448
|
-
function loadTurnstile() {
|
|
3449
|
-
if (window.turnstile) return Promise.resolve(window.turnstile);
|
|
3450
|
-
if (loader) return loader;
|
|
3451
|
-
loader = new Promise((resolve, reject) => {
|
|
3452
|
-
const existing = document.querySelector(`script[src="${SCRIPT_URL}"]`);
|
|
3453
|
-
const script = existing ?? document.createElement("script");
|
|
3454
|
-
const cleanup = () => {
|
|
3455
|
-
clearTimeout(timeout);
|
|
3456
|
-
script.removeEventListener("load", loaded);
|
|
3457
|
-
script.removeEventListener("error", failed);
|
|
3458
|
-
};
|
|
3459
|
-
const loaded = () => {
|
|
3460
|
-
cleanup();
|
|
3461
|
-
if (window.turnstile) {
|
|
3462
|
-
resolve(window.turnstile);
|
|
3463
|
-
} else {
|
|
3464
|
-
reject(new Error("Turnstile unavailable"));
|
|
3465
|
-
}
|
|
3466
|
-
};
|
|
3467
|
-
const failed = () => {
|
|
3468
|
-
cleanup();
|
|
3469
|
-
if (!existing) script.remove();
|
|
3470
|
-
reject(new Error("Turnstile failed to load"));
|
|
3471
|
-
};
|
|
3472
|
-
const timeout = setTimeout(failed, SCRIPT_LOAD_TIMEOUT_MS);
|
|
3473
|
-
script.addEventListener("load", loaded, { once: true });
|
|
3474
|
-
script.addEventListener("error", failed, { once: true });
|
|
3475
|
-
if (!existing) {
|
|
3476
|
-
script.src = SCRIPT_URL;
|
|
3477
|
-
script.async = true;
|
|
3478
|
-
script.defer = true;
|
|
3479
|
-
const nonce = document.querySelector("script[nonce]")?.nonce;
|
|
3480
|
-
if (nonce) script.nonce = nonce;
|
|
3481
|
-
document.head.appendChild(script);
|
|
3482
|
-
}
|
|
3483
|
-
}).catch((error) => {
|
|
3484
|
-
loader = null;
|
|
3485
|
-
throw error;
|
|
3486
|
-
});
|
|
3487
|
-
return loader;
|
|
3488
|
-
}
|
|
3489
|
-
function Turnstile({
|
|
3490
|
-
siteKey,
|
|
3491
|
-
theme,
|
|
3492
|
-
onToken,
|
|
3493
|
-
onUnavailable
|
|
3494
|
-
}) {
|
|
3495
|
-
const container = React9.useRef(null);
|
|
3496
|
-
const callbacks = React9.useRef({ onToken, onUnavailable });
|
|
3497
|
-
callbacks.current = { onToken, onUnavailable };
|
|
3498
|
-
React9.useEffect(() => {
|
|
3499
|
-
callbacks.current.onToken(null);
|
|
3500
|
-
if (!siteKey) {
|
|
3501
|
-
callbacks.current.onToken(LOCAL_TURNSTILE_TEST_TOKEN);
|
|
3502
|
-
return;
|
|
3503
|
-
}
|
|
3504
|
-
let active = true;
|
|
3505
|
-
let widget = null;
|
|
3506
|
-
void loadTurnstile().then((api) => {
|
|
3507
|
-
if (!active || !container.current) return;
|
|
3508
|
-
const id = api.render(container.current, {
|
|
3509
|
-
sitekey: siteKey,
|
|
3510
|
-
theme: theme === "system" ? "auto" : theme,
|
|
3511
|
-
size: "flexible",
|
|
3512
|
-
callback: (token) => callbacks.current.onToken(token),
|
|
3513
|
-
"expired-callback": () => callbacks.current.onToken(null),
|
|
3514
|
-
"error-callback": () => {
|
|
3515
|
-
callbacks.current.onToken(null);
|
|
3516
|
-
callbacks.current.onUnavailable();
|
|
3517
|
-
}
|
|
3518
|
-
});
|
|
3519
|
-
widget = { api, id };
|
|
3520
|
-
}).catch(() => {
|
|
3521
|
-
if (active) callbacks.current.onUnavailable();
|
|
3522
|
-
});
|
|
3523
|
-
return () => {
|
|
3524
|
-
active = false;
|
|
3525
|
-
if (widget) widget.api.remove(widget.id);
|
|
3526
|
-
};
|
|
3527
|
-
}, [siteKey, theme]);
|
|
3528
|
-
if (!siteKey) return null;
|
|
3529
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ba-turnstile", ref: container, "data-testid": "phoneotp-turnstile" });
|
|
3598
|
+
// src/components/captcha-provider-ids.ts
|
|
3599
|
+
var CAPTCHA_PROVIDER_IDS = ["turnstile", "hcaptcha", "recaptcha-v2"];
|
|
3600
|
+
function isSupportedCaptchaProvider(provider) {
|
|
3601
|
+
return CAPTCHA_PROVIDER_IDS.includes(provider);
|
|
3530
3602
|
}
|
|
3531
3603
|
|
|
3532
3604
|
// src/components/AuthChallenge.tsx
|
|
3533
|
-
var
|
|
3605
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3534
3606
|
var AUTH_CHALLENGE_ACTIONS = {
|
|
3535
3607
|
signUp: "auth_signup",
|
|
3536
3608
|
signIn: "auth_signin",
|
|
@@ -3545,38 +3617,53 @@ var challengeError = {
|
|
|
3545
3617
|
code: "BOT_CHALLENGE_FAILED",
|
|
3546
3618
|
message: "Human verification failed."
|
|
3547
3619
|
};
|
|
3548
|
-
function
|
|
3620
|
+
function captchaTheme(root, fallback) {
|
|
3549
3621
|
const rendered = root?.dataset.authowlTheme;
|
|
3550
3622
|
if (rendered === "light" || rendered === "dark") return rendered;
|
|
3551
3623
|
if (fallback === "light" || fallback === "dark") return fallback;
|
|
3552
3624
|
return "auto";
|
|
3553
3625
|
}
|
|
3554
3626
|
function useAuthChallenge() {
|
|
3555
|
-
const { config, isLoading } = usePublicConfig();
|
|
3627
|
+
const { config, isLoading, retry } = usePublicConfig();
|
|
3556
3628
|
const t = useT();
|
|
3557
|
-
const container =
|
|
3558
|
-
const active =
|
|
3559
|
-
const [status, setStatus] =
|
|
3560
|
-
const
|
|
3561
|
-
const
|
|
3629
|
+
const container = React9.useRef(null);
|
|
3630
|
+
const active = React9.useRef(null);
|
|
3631
|
+
const [status, setStatus] = React9.useState("idle");
|
|
3632
|
+
const captcha = config?.captcha ?? null;
|
|
3633
|
+
const providerSupported = captcha ? isSupportedCaptchaProvider(captcha.provider) : false;
|
|
3634
|
+
const unavailableProvider = captcha && !providerSupported ? captcha.provider : null;
|
|
3635
|
+
const refetched = React9.useRef(null);
|
|
3636
|
+
const refetchIfConfigMayBeStale = React9.useCallback(() => {
|
|
3637
|
+
if (!config || refetched.current === config) return;
|
|
3638
|
+
refetched.current = config;
|
|
3639
|
+
retry();
|
|
3640
|
+
}, [config, retry]);
|
|
3641
|
+
const removeActive = React9.useCallback((reason) => {
|
|
3562
3642
|
const current = active.current;
|
|
3563
3643
|
active.current = null;
|
|
3564
3644
|
if (!current) return;
|
|
3565
|
-
current.
|
|
3645
|
+
current.adapter.teardown(current.api, current.id);
|
|
3566
3646
|
if (reason) current.reject(reason);
|
|
3567
3647
|
}, []);
|
|
3568
|
-
|
|
3569
|
-
() => () => removeActive(new Error("
|
|
3648
|
+
React9.useEffect(
|
|
3649
|
+
() => () => removeActive(new Error("Captcha challenge was cancelled")),
|
|
3570
3650
|
[removeActive]
|
|
3571
3651
|
);
|
|
3572
|
-
const tokenFor =
|
|
3652
|
+
const tokenFor = React9.useCallback(
|
|
3573
3653
|
async (action) => {
|
|
3574
|
-
if (!
|
|
3654
|
+
if (!captcha) return null;
|
|
3655
|
+
if (!providerSupported) throw new Error(`Unsupported captcha provider: ${captcha.provider}`);
|
|
3575
3656
|
setStatus("checking");
|
|
3576
|
-
removeActive(new Error("
|
|
3657
|
+
removeActive(new Error("Captcha challenge was replaced"));
|
|
3577
3658
|
try {
|
|
3578
|
-
const
|
|
3579
|
-
|
|
3659
|
+
const [{ loadCaptcha: loadCaptcha2 }, { captchaAdapterFor: captchaAdapterFor2 }] = await Promise.all([
|
|
3660
|
+
Promise.resolve().then(() => (init_captcha_loader(), captcha_loader_exports)),
|
|
3661
|
+
Promise.resolve().then(() => (init_captcha_providers(), captcha_providers_exports))
|
|
3662
|
+
]);
|
|
3663
|
+
const adapter = captchaAdapterFor2(captcha.provider);
|
|
3664
|
+
if (!adapter) throw new Error(`Unsupported captcha provider: ${captcha.provider}`);
|
|
3665
|
+
const api = await loadCaptcha2(adapter);
|
|
3666
|
+
if (!container.current) throw new Error("Captcha container unavailable");
|
|
3580
3667
|
return await new Promise((resolve, reject) => {
|
|
3581
3668
|
let settled = false;
|
|
3582
3669
|
const finish = (outcome) => {
|
|
@@ -3584,27 +3671,29 @@ function useAuthChallenge() {
|
|
|
3584
3671
|
settled = true;
|
|
3585
3672
|
const current = active.current;
|
|
3586
3673
|
active.current = null;
|
|
3587
|
-
if (current) current.
|
|
3674
|
+
if (current) current.adapter.teardown(current.api, current.id);
|
|
3588
3675
|
if ("token" in outcome) resolve(outcome.token);
|
|
3589
3676
|
else reject(outcome.error);
|
|
3590
3677
|
};
|
|
3591
|
-
const fail = () => finish({ error: new Error("
|
|
3678
|
+
const fail = () => finish({ error: new Error("Captcha challenge failed") });
|
|
3592
3679
|
const root = container.current.closest(".authowl-root");
|
|
3680
|
+
const optionalFailureCallbacks = captcha.provider === "turnstile" ? {
|
|
3681
|
+
"timeout-callback": fail,
|
|
3682
|
+
"unsupported-callback": fail
|
|
3683
|
+
} : {};
|
|
3593
3684
|
const id = api.render(container.current, {
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
language: root?.dataset.authowlLocale ?? config?.locale,
|
|
3685
|
+
...adapter.invisibleRenderOptions({
|
|
3686
|
+
siteKey: captcha.siteKey,
|
|
3687
|
+
theme: captchaTheme(root, config?.branding?.theme),
|
|
3688
|
+
action,
|
|
3689
|
+
language: root?.dataset.authowlLocale ?? config?.locale
|
|
3690
|
+
}),
|
|
3601
3691
|
callback: (token) => finish({ token }),
|
|
3602
3692
|
"expired-callback": fail,
|
|
3603
3693
|
"error-callback": fail,
|
|
3604
|
-
|
|
3605
|
-
"unsupported-callback": fail
|
|
3694
|
+
...optionalFailureCallbacks
|
|
3606
3695
|
});
|
|
3607
|
-
active.current = { api, id, reject };
|
|
3696
|
+
active.current = { adapter, api, id, reject };
|
|
3608
3697
|
try {
|
|
3609
3698
|
api.execute(id);
|
|
3610
3699
|
} catch {
|
|
@@ -3615,9 +3704,9 @@ function useAuthChallenge() {
|
|
|
3615
3704
|
setStatus("idle");
|
|
3616
3705
|
}
|
|
3617
3706
|
},
|
|
3618
|
-
[config?.branding?.theme, config?.locale,
|
|
3707
|
+
[captcha, config?.branding?.theme, config?.locale, providerSupported, removeActive]
|
|
3619
3708
|
);
|
|
3620
|
-
const run =
|
|
3709
|
+
const run = React9.useCallback(
|
|
3621
3710
|
async (action, request) => {
|
|
3622
3711
|
if (isLoading) {
|
|
3623
3712
|
return {
|
|
@@ -3627,41 +3716,44 @@ function useAuthChallenge() {
|
|
|
3627
3716
|
}
|
|
3628
3717
|
try {
|
|
3629
3718
|
const token = await tokenFor(action);
|
|
3630
|
-
|
|
3719
|
+
const result = await request(token ? { authChallengeToken: token } : void 0);
|
|
3720
|
+
if (result?.error?.code === challengeError.code) refetchIfConfigMayBeStale();
|
|
3721
|
+
return result;
|
|
3631
3722
|
} catch {
|
|
3632
3723
|
setStatus("failed");
|
|
3724
|
+
refetchIfConfigMayBeStale();
|
|
3633
3725
|
return {
|
|
3634
3726
|
data: null,
|
|
3635
3727
|
error: challengeError
|
|
3636
3728
|
};
|
|
3637
3729
|
}
|
|
3638
3730
|
},
|
|
3639
|
-
[isLoading, tokenFor]
|
|
3731
|
+
[isLoading, refetchIfConfigMayBeStale, tokenFor]
|
|
3640
3732
|
);
|
|
3641
|
-
const control =
|
|
3642
|
-
/* @__PURE__ */ (0,
|
|
3643
|
-
/* @__PURE__ */ (0,
|
|
3733
|
+
const control = captcha ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "ba-auth-challenge", "data-testid": "auth-challenge", children: [
|
|
3734
|
+
providerSupported ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ba-turnstile", ref: container }) : null,
|
|
3735
|
+
unavailableProvider ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormError, { "data-testid": "auth-challenge-unsupported", children: t("authChallenge.error.unsupportedProvider", { provider: unavailableProvider }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "ba-sr-only", role: "status", "aria-live": "polite", children: status === "checking" ? t("authChallenge.checking") : status === "failed" ? t("authChallenge.error.failed") : "" })
|
|
3644
3736
|
] }) : null;
|
|
3645
3737
|
return { run, control, configPending: isLoading };
|
|
3646
3738
|
}
|
|
3647
3739
|
|
|
3648
3740
|
// src/components/ForgotPassword.tsx
|
|
3649
3741
|
init_FormError();
|
|
3650
|
-
var
|
|
3742
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3651
3743
|
function ForgotPassword({ resetPasswordUrl, onBack }) {
|
|
3652
3744
|
const t = useT();
|
|
3653
3745
|
const { requestPasswordReset } = usePasswordReset();
|
|
3654
3746
|
const { pending, error, run } = useSubmitAction();
|
|
3655
3747
|
const authChallenge = useAuthChallenge();
|
|
3656
|
-
const [email, setEmail] =
|
|
3657
|
-
const [sent, setSent] =
|
|
3748
|
+
const [email, setEmail] = React10.useState("");
|
|
3749
|
+
const [sent, setSent] = React10.useState(false);
|
|
3658
3750
|
if (sent) {
|
|
3659
|
-
return /* @__PURE__ */ (0,
|
|
3660
|
-
/* @__PURE__ */ (0,
|
|
3661
|
-
onBack && /* @__PURE__ */ (0,
|
|
3751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "ba-fields", "data-testid": "forgot-sent", children: [
|
|
3752
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "ba-muted", children: richMessage(t("forgotPassword.sent"), { email: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Bidi, { children: email }) }) }),
|
|
3753
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "ba-link-button", onClick: onBack, children: t("forgotPassword.backToSignIn") })
|
|
3662
3754
|
] });
|
|
3663
3755
|
}
|
|
3664
|
-
return /* @__PURE__ */ (0,
|
|
3756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3665
3757
|
"form",
|
|
3666
3758
|
{
|
|
3667
3759
|
method: "post",
|
|
@@ -3675,9 +3767,9 @@ function ForgotPassword({ resetPasswordUrl, onBack }) {
|
|
|
3675
3767
|
});
|
|
3676
3768
|
},
|
|
3677
3769
|
children: [
|
|
3678
|
-
/* @__PURE__ */ (0,
|
|
3770
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "ba-label", children: [
|
|
3679
3771
|
t("common.emailLabel"),
|
|
3680
|
-
/* @__PURE__ */ (0,
|
|
3772
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3681
3773
|
"input",
|
|
3682
3774
|
{
|
|
3683
3775
|
className: "ba-input",
|
|
@@ -3690,18 +3782,18 @@ function ForgotPassword({ resetPasswordUrl, onBack }) {
|
|
|
3690
3782
|
)
|
|
3691
3783
|
] }),
|
|
3692
3784
|
authChallenge.control,
|
|
3693
|
-
/* @__PURE__ */ (0,
|
|
3694
|
-
/* @__PURE__ */ (0,
|
|
3785
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormError, { children: error }),
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3695
3787
|
"button",
|
|
3696
3788
|
{
|
|
3697
3789
|
className: "ba-button",
|
|
3698
3790
|
type: "submit",
|
|
3699
3791
|
disabled: pending || authChallenge.configPending,
|
|
3700
3792
|
"aria-busy": pending || void 0,
|
|
3701
|
-
children: /* @__PURE__ */ (0,
|
|
3793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("forgotPassword.submit") })
|
|
3702
3794
|
}
|
|
3703
3795
|
),
|
|
3704
|
-
onBack && /* @__PURE__ */ (0,
|
|
3796
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "ba-link-button", onClick: onBack, children: t("forgotPassword.backToSignIn") })
|
|
3705
3797
|
]
|
|
3706
3798
|
}
|
|
3707
3799
|
);
|
|
@@ -3711,7 +3803,7 @@ function ForgotPassword({ resetPasswordUrl, onBack }) {
|
|
|
3711
3803
|
init_i18n();
|
|
3712
3804
|
init_Spinner();
|
|
3713
3805
|
init_FormError();
|
|
3714
|
-
var
|
|
3806
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3715
3807
|
function OtpCodeForm({
|
|
3716
3808
|
email,
|
|
3717
3809
|
code,
|
|
@@ -3722,7 +3814,7 @@ function OtpCodeForm({
|
|
|
3722
3814
|
error
|
|
3723
3815
|
}) {
|
|
3724
3816
|
const t = useT();
|
|
3725
|
-
return /* @__PURE__ */ (0,
|
|
3817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3726
3818
|
"form",
|
|
3727
3819
|
{
|
|
3728
3820
|
method: "post",
|
|
@@ -3733,9 +3825,9 @@ function OtpCodeForm({
|
|
|
3733
3825
|
onSubmit();
|
|
3734
3826
|
},
|
|
3735
3827
|
children: [
|
|
3736
|
-
/* @__PURE__ */ (0,
|
|
3737
|
-
richMessage(t("emailOtp.codeLabel"), { email: /* @__PURE__ */ (0,
|
|
3738
|
-
/* @__PURE__ */ (0,
|
|
3828
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "ba-label", children: [
|
|
3829
|
+
richMessage(t("emailOtp.codeLabel"), { email: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Bidi, { children: email }) }),
|
|
3830
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3739
3831
|
"input",
|
|
3740
3832
|
{
|
|
3741
3833
|
className: "ba-input",
|
|
@@ -3748,29 +3840,29 @@ function OtpCodeForm({
|
|
|
3748
3840
|
}
|
|
3749
3841
|
)
|
|
3750
3842
|
] }),
|
|
3751
|
-
/* @__PURE__ */ (0,
|
|
3752
|
-
/* @__PURE__ */ (0,
|
|
3753
|
-
/* @__PURE__ */ (0,
|
|
3843
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FormError, { children: error }),
|
|
3844
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { className: "ba-button", type: "submit", disabled: pending, "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Busy, { busy: pending, label: t("common.verifying"), children: t("emailOtp.verifySubmit") }) }),
|
|
3845
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "ba-link-button", onClick: onChangeEmail, children: t("emailOtp.changeEmail") })
|
|
3754
3846
|
]
|
|
3755
3847
|
}
|
|
3756
3848
|
);
|
|
3757
3849
|
}
|
|
3758
3850
|
|
|
3759
3851
|
// src/components/MFAChallenge.tsx
|
|
3760
|
-
var
|
|
3852
|
+
var React11 = __toESM(require("react"), 1);
|
|
3761
3853
|
init_hooks();
|
|
3762
3854
|
init_i18n();
|
|
3763
3855
|
init_use_submit_action();
|
|
3764
3856
|
init_Spinner();
|
|
3765
3857
|
init_FormError();
|
|
3766
|
-
var
|
|
3858
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3767
3859
|
function MFAChallenge({ onVerified, allowTrustDevice = true }) {
|
|
3768
3860
|
const t = useT();
|
|
3769
3861
|
const { verifyTotp, verifyBackupCode, sendOtp, verifyOtp } = useMFA();
|
|
3770
3862
|
const { pending, error, setError, run } = useSubmitAction();
|
|
3771
|
-
const [mode, setMode] =
|
|
3772
|
-
const [code, setCode] =
|
|
3773
|
-
const [trustDevice, setTrustDevice] =
|
|
3863
|
+
const [mode, setMode] = React11.useState("totp");
|
|
3864
|
+
const [code, setCode] = React11.useState("");
|
|
3865
|
+
const [trustDevice, setTrustDevice] = React11.useState(false);
|
|
3774
3866
|
const switchMode = (next) => {
|
|
3775
3867
|
setMode(next);
|
|
3776
3868
|
setCode("");
|
|
@@ -3793,12 +3885,12 @@ function MFAChallenge({ onVerified, allowTrustDevice = true }) {
|
|
|
3793
3885
|
};
|
|
3794
3886
|
const hint = mode === "totp" ? t("mfa.challenge.totpHint") : mode === "backup" ? t("mfa.challenge.backupHint") : t("mfa.challenge.otpHint");
|
|
3795
3887
|
const label2 = mode === "totp" ? t("mfa.challenge.totpLabel") : mode === "backup" ? t("mfa.challenge.backupLabel") : t("mfa.challenge.otpLabel");
|
|
3796
|
-
return /* @__PURE__ */ (0,
|
|
3797
|
-
/* @__PURE__ */ (0,
|
|
3798
|
-
/* @__PURE__ */ (0,
|
|
3799
|
-
/* @__PURE__ */ (0,
|
|
3888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("form", { method: "post", className: "ba-fields", "data-testid": "mfa-challenge", onSubmit: submit, children: [
|
|
3889
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { className: "ba-title", children: t("mfa.challenge.title") }),
|
|
3890
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "ba-muted", children: hint }),
|
|
3891
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "ba-label", children: [
|
|
3800
3892
|
label2,
|
|
3801
|
-
/* @__PURE__ */ (0,
|
|
3893
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3802
3894
|
"input",
|
|
3803
3895
|
{
|
|
3804
3896
|
className: "ba-input",
|
|
@@ -3814,28 +3906,28 @@ function MFAChallenge({ onVerified, allowTrustDevice = true }) {
|
|
|
3814
3906
|
}
|
|
3815
3907
|
)
|
|
3816
3908
|
] }),
|
|
3817
|
-
mode !== "backup" && allowTrustDevice && /* @__PURE__ */ (0,
|
|
3818
|
-
/* @__PURE__ */ (0,
|
|
3819
|
-
/* @__PURE__ */ (0,
|
|
3820
|
-
/* @__PURE__ */ (0,
|
|
3909
|
+
mode !== "backup" && allowTrustDevice && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "ba-consent ba-consent-centered", children: [
|
|
3910
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ba-checkbox-control", children: [
|
|
3911
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { className: "ba-checkbox", type: "checkbox", checked: trustDevice, onChange: (e) => setTrustDevice(e.target.checked) }),
|
|
3912
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ba-checkbox-visual", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ba-checkbox-check" }) })
|
|
3821
3913
|
] }),
|
|
3822
|
-
/* @__PURE__ */ (0,
|
|
3914
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: t("mfa.challenge.trustDevice", { days: 30 }) })
|
|
3823
3915
|
] }),
|
|
3824
|
-
/* @__PURE__ */ (0,
|
|
3825
|
-
/* @__PURE__ */ (0,
|
|
3826
|
-
mode !== "totp" && /* @__PURE__ */ (0,
|
|
3827
|
-
mode !== "backup" && /* @__PURE__ */ (0,
|
|
3828
|
-
/* @__PURE__ */ (0,
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormError, { children: error }),
|
|
3917
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !code, "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Busy, { busy: pending, label: t("common.verifying"), children: t("mfa.challenge.submit") }) }),
|
|
3918
|
+
mode !== "totp" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "ba-link-button", onClick: () => switchMode("totp"), children: t("mfa.challenge.useTotp") }),
|
|
3919
|
+
mode !== "backup" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "ba-link-button", onClick: () => switchMode("backup"), children: t("mfa.challenge.useBackup") }),
|
|
3920
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "ba-link-button", disabled: pending, onClick: requestOtp, children: t(mode === "otp" ? "mfa.challenge.resendOtp" : "mfa.challenge.useEmailOtp") })
|
|
3829
3921
|
] });
|
|
3830
3922
|
}
|
|
3831
3923
|
|
|
3832
3924
|
// src/components/mfa-enrollment-step.tsx
|
|
3833
|
-
var
|
|
3925
|
+
var React14 = __toESM(require("react"), 1);
|
|
3834
3926
|
init_hooks();
|
|
3835
3927
|
init_i18n();
|
|
3836
3928
|
|
|
3837
3929
|
// src/components/MFAEnrollment.tsx
|
|
3838
|
-
var
|
|
3930
|
+
var React13 = __toESM(require("react"), 1);
|
|
3839
3931
|
init_hooks();
|
|
3840
3932
|
init_i18n();
|
|
3841
3933
|
init_use_submit_action();
|
|
@@ -3848,13 +3940,13 @@ function shouldDiscardSetup(args) {
|
|
|
3848
3940
|
}
|
|
3849
3941
|
|
|
3850
3942
|
// src/components/QrCode.tsx
|
|
3851
|
-
var
|
|
3943
|
+
var React12 = __toESM(require("react"), 1);
|
|
3852
3944
|
init_i18n();
|
|
3853
|
-
var
|
|
3945
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3854
3946
|
function QrCode({ value, size = 200 }) {
|
|
3855
3947
|
const t = useT();
|
|
3856
|
-
const [path, setPath] =
|
|
3857
|
-
|
|
3948
|
+
const [path, setPath] = React12.useState(null);
|
|
3949
|
+
React12.useEffect(() => {
|
|
3858
3950
|
let active = true;
|
|
3859
3951
|
setPath(null);
|
|
3860
3952
|
void Promise.resolve().then(() => (init_qr(), qr_exports)).then(
|
|
@@ -3872,7 +3964,7 @@ function QrCode({ value, size = 200 }) {
|
|
|
3872
3964
|
if (!path) return null;
|
|
3873
3965
|
const margin = 4;
|
|
3874
3966
|
const dim = path.count + margin * 2;
|
|
3875
|
-
return /* @__PURE__ */ (0,
|
|
3967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3876
3968
|
"svg",
|
|
3877
3969
|
{
|
|
3878
3970
|
width: size,
|
|
@@ -3883,8 +3975,8 @@ function QrCode({ value, size = 200 }) {
|
|
|
3883
3975
|
shapeRendering: "crispEdges",
|
|
3884
3976
|
className: "ba-qr",
|
|
3885
3977
|
children: [
|
|
3886
|
-
/* @__PURE__ */ (0,
|
|
3887
|
-
/* @__PURE__ */ (0,
|
|
3978
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { width: dim, height: dim, fill: "#ffffff" }),
|
|
3979
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { transform: `translate(${margin} ${margin})`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: path.d, fill: "#000000" }) })
|
|
3888
3980
|
]
|
|
3889
3981
|
}
|
|
3890
3982
|
);
|
|
@@ -3892,7 +3984,7 @@ function QrCode({ value, size = 200 }) {
|
|
|
3892
3984
|
|
|
3893
3985
|
// src/components/MFAEnrollment.tsx
|
|
3894
3986
|
init_FormError();
|
|
3895
|
-
var
|
|
3987
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3896
3988
|
function secretFromUri(uri) {
|
|
3897
3989
|
try {
|
|
3898
3990
|
return new URL(uri).searchParams.get("secret");
|
|
@@ -3905,11 +3997,11 @@ function MFAEnrollment({ onEnrolled, title }) {
|
|
|
3905
3997
|
const { enable, verifyTotp } = useMFA();
|
|
3906
3998
|
const { user, isLoaded } = useUser();
|
|
3907
3999
|
const { pending, error, run } = useSubmitAction();
|
|
3908
|
-
const [password, setPassword] =
|
|
3909
|
-
const [setup, setSetup] =
|
|
3910
|
-
const [code, setCode] =
|
|
3911
|
-
const [done, setDone] =
|
|
3912
|
-
const setupOwnerId =
|
|
4000
|
+
const [password, setPassword] = React13.useState("");
|
|
4001
|
+
const [setup, setSetup] = React13.useState(null);
|
|
4002
|
+
const [code, setCode] = React13.useState("");
|
|
4003
|
+
const [done, setDone] = React13.useState(false);
|
|
4004
|
+
const setupOwnerId = React13.useRef(null);
|
|
3913
4005
|
const userId = user?.id ?? null;
|
|
3914
4006
|
const stale = shouldDiscardSetup({
|
|
3915
4007
|
isLoaded,
|
|
@@ -3918,7 +4010,7 @@ function MFAEnrollment({ onEnrolled, title }) {
|
|
|
3918
4010
|
currentUserId: userId
|
|
3919
4011
|
});
|
|
3920
4012
|
const activeSetup = stale ? null : setup;
|
|
3921
|
-
|
|
4013
|
+
React13.useEffect(() => {
|
|
3922
4014
|
if (stale) {
|
|
3923
4015
|
setSetup(null);
|
|
3924
4016
|
setPassword("");
|
|
@@ -3926,22 +4018,22 @@ function MFAEnrollment({ onEnrolled, title }) {
|
|
|
3926
4018
|
}
|
|
3927
4019
|
}, [stale]);
|
|
3928
4020
|
if (done) {
|
|
3929
|
-
return /* @__PURE__ */ (0,
|
|
3930
|
-
/* @__PURE__ */ (0,
|
|
3931
|
-
/* @__PURE__ */ (0,
|
|
4021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "ba-fields", "data-testid": "mfa-enroll-done", children: [
|
|
4022
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "ba-title", children: t("mfa.enroll.doneTitle") }),
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "ba-muted", children: t("mfa.enroll.doneBody") })
|
|
3932
4024
|
] });
|
|
3933
4025
|
}
|
|
3934
4026
|
if (!activeSetup) {
|
|
3935
4027
|
if (!isLoaded) {
|
|
3936
|
-
return /* @__PURE__ */ (0,
|
|
4028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "ba-fields", "data-testid": "mfa-enroll-loading", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "ba-skeleton" }) });
|
|
3937
4029
|
}
|
|
3938
4030
|
if (user?.twoFactorEnabled) {
|
|
3939
|
-
return /* @__PURE__ */ (0,
|
|
3940
|
-
/* @__PURE__ */ (0,
|
|
3941
|
-
/* @__PURE__ */ (0,
|
|
4031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "ba-fields", "data-testid": "mfa-enroll-active", children: [
|
|
4032
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "ba-title", children: t("mfa.enroll.activeTitle") }),
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "ba-muted", children: t("mfa.enroll.activeBody") })
|
|
3942
4034
|
] });
|
|
3943
4035
|
}
|
|
3944
|
-
return /* @__PURE__ */ (0,
|
|
4036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3945
4037
|
"form",
|
|
3946
4038
|
{
|
|
3947
4039
|
method: "post",
|
|
@@ -3958,11 +4050,11 @@ function MFAEnrollment({ onEnrolled, title }) {
|
|
|
3958
4050
|
});
|
|
3959
4051
|
},
|
|
3960
4052
|
children: [
|
|
3961
|
-
title !== null && /* @__PURE__ */ (0,
|
|
3962
|
-
/* @__PURE__ */ (0,
|
|
3963
|
-
/* @__PURE__ */ (0,
|
|
4053
|
+
title !== null && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "ba-title", children: title ?? t("mfa.enroll.title") }),
|
|
4054
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "ba-muted", children: t("mfa.enroll.passwordHint") }),
|
|
4055
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "ba-label", children: [
|
|
3964
4056
|
t("common.passwordLabel"),
|
|
3965
|
-
/* @__PURE__ */ (0,
|
|
4057
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3966
4058
|
"input",
|
|
3967
4059
|
{
|
|
3968
4060
|
className: "ba-input",
|
|
@@ -3974,29 +4066,29 @@ function MFAEnrollment({ onEnrolled, title }) {
|
|
|
3974
4066
|
}
|
|
3975
4067
|
)
|
|
3976
4068
|
] }),
|
|
3977
|
-
/* @__PURE__ */ (0,
|
|
3978
|
-
/* @__PURE__ */ (0,
|
|
4069
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormError, { children: error }),
|
|
4070
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !password, "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Busy, { busy: pending, label: t("mfa.enroll.startPending"), children: t("common.continue") }) })
|
|
3979
4071
|
]
|
|
3980
4072
|
}
|
|
3981
4073
|
);
|
|
3982
4074
|
}
|
|
3983
4075
|
const secret = secretFromUri(activeSetup.totpURI);
|
|
3984
|
-
return /* @__PURE__ */ (0,
|
|
3985
|
-
/* @__PURE__ */ (0,
|
|
3986
|
-
/* @__PURE__ */ (0,
|
|
3987
|
-
/* @__PURE__ */ (0,
|
|
3988
|
-
secret && /* @__PURE__ */ (0,
|
|
3989
|
-
secret: /* @__PURE__ */ (0,
|
|
4076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "ba-fields", "data-testid": "mfa-enroll-verify", children: [
|
|
4077
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "ba-title", children: t("mfa.enroll.scanQrTitle") }),
|
|
4078
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "ba-muted", children: t("mfa.enroll.scanQrHint") }),
|
|
4079
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(QrCode, { value: activeSetup.totpURI }),
|
|
4080
|
+
secret && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "ba-muted", children: richMessage(t("mfa.enroll.manualKey"), {
|
|
4081
|
+
secret: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", { className: "ba-code", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Bidi, { children: secret }) })
|
|
3990
4082
|
}) }),
|
|
3991
|
-
/* @__PURE__ */ (0,
|
|
3992
|
-
/* @__PURE__ */ (0,
|
|
3993
|
-
/* @__PURE__ */ (0,
|
|
4083
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
|
|
4084
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { className: "ba-muted", children: [
|
|
4085
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: t("mfa.enroll.backupCodesWarningStrong") }),
|
|
3994
4086
|
" ",
|
|
3995
4087
|
t("mfa.enroll.backupCodesWarningRest")
|
|
3996
4088
|
] }),
|
|
3997
|
-
/* @__PURE__ */ (0,
|
|
4089
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "ba-backup-codes", "data-testid": "mfa-backup-codes", children: activeSetup.backupCodes.map((c) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", { className: "ba-code", children: c }) }, c)) })
|
|
3998
4090
|
] }),
|
|
3999
|
-
/* @__PURE__ */ (0,
|
|
4091
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
4000
4092
|
"form",
|
|
4001
4093
|
{
|
|
4002
4094
|
method: "post",
|
|
@@ -4014,9 +4106,9 @@ function MFAEnrollment({ onEnrolled, title }) {
|
|
|
4014
4106
|
});
|
|
4015
4107
|
},
|
|
4016
4108
|
children: [
|
|
4017
|
-
/* @__PURE__ */ (0,
|
|
4109
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "ba-label", children: [
|
|
4018
4110
|
t("mfa.enroll.codeLabel"),
|
|
4019
|
-
/* @__PURE__ */ (0,
|
|
4111
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4020
4112
|
"input",
|
|
4021
4113
|
{
|
|
4022
4114
|
className: "ba-input",
|
|
@@ -4028,8 +4120,8 @@ function MFAEnrollment({ onEnrolled, title }) {
|
|
|
4028
4120
|
}
|
|
4029
4121
|
)
|
|
4030
4122
|
] }),
|
|
4031
|
-
/* @__PURE__ */ (0,
|
|
4032
|
-
/* @__PURE__ */ (0,
|
|
4123
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormError, { children: error }),
|
|
4124
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !code, "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Busy, { busy: pending, label: t("common.verifying"), children: t("mfa.enroll.activateSubmit") }) })
|
|
4033
4125
|
]
|
|
4034
4126
|
}
|
|
4035
4127
|
)
|
|
@@ -4037,13 +4129,13 @@ function MFAEnrollment({ onEnrolled, title }) {
|
|
|
4037
4129
|
}
|
|
4038
4130
|
|
|
4039
4131
|
// src/components/mfa-enrollment-step.tsx
|
|
4040
|
-
var
|
|
4132
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
4041
4133
|
function useConfirmedMfaPending(onUnknown = "pending") {
|
|
4042
4134
|
const client = useAuthClient();
|
|
4043
4135
|
const { needsMfaEnrollment } = useUser();
|
|
4044
4136
|
const { refetch } = useSession();
|
|
4045
|
-
const [confirmed, setConfirmed] =
|
|
4046
|
-
|
|
4137
|
+
const [confirmed, setConfirmed] = React14.useState(null);
|
|
4138
|
+
React14.useEffect(() => {
|
|
4047
4139
|
if (!needsMfaEnrollment) {
|
|
4048
4140
|
setConfirmed(null);
|
|
4049
4141
|
return;
|
|
@@ -4067,32 +4159,32 @@ function useConfirmedMfaPending(onUnknown = "pending") {
|
|
|
4067
4159
|
function MfaEnrollmentStep({ title }) {
|
|
4068
4160
|
const t = useT();
|
|
4069
4161
|
const { refetch } = useSession();
|
|
4070
|
-
return /* @__PURE__ */ (0,
|
|
4071
|
-
/* @__PURE__ */ (0,
|
|
4072
|
-
/* @__PURE__ */ (0,
|
|
4073
|
-
/* @__PURE__ */ (0,
|
|
4162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
4163
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { className: "ba-title", children: title ?? t("mfaGate.title") }),
|
|
4164
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "ba-muted", children: t("mfaGate.body") }),
|
|
4165
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MFAEnrollment, { onEnrolled: () => refetch({ query: { disableCookieCache: true } }) })
|
|
4074
4166
|
] });
|
|
4075
4167
|
}
|
|
4076
4168
|
|
|
4077
4169
|
// src/components/AuthOwlBadge.tsx
|
|
4078
4170
|
init_hooks();
|
|
4079
4171
|
init_i18n();
|
|
4080
|
-
var
|
|
4172
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
4081
4173
|
function OwlMark() {
|
|
4082
|
-
return /* @__PURE__ */ (0,
|
|
4083
|
-
/* @__PURE__ */ (0,
|
|
4084
|
-
/* @__PURE__ */ (0,
|
|
4085
|
-
/* @__PURE__ */ (0,
|
|
4086
|
-
/* @__PURE__ */ (0,
|
|
4087
|
-
/* @__PURE__ */ (0,
|
|
4088
|
-
/* @__PURE__ */ (0,
|
|
4174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { className: "ba-badge-mark", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("circle", { cx: "12", cy: "12", r: "11", fill: "#F5B84C" }),
|
|
4176
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("circle", { cx: "8.4", cy: "10", r: "3", fill: "#fff" }),
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("circle", { cx: "15.6", cy: "10", r: "3", fill: "#fff" }),
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("circle", { cx: "8.4", cy: "10", r: "1.4", fill: "#1f1300" }),
|
|
4179
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("circle", { cx: "15.6", cy: "10", r: "1.4", fill: "#1f1300" }),
|
|
4180
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M12 13.1l1.5 2.1h-3z", fill: "#1f1300" })
|
|
4089
4181
|
] });
|
|
4090
4182
|
}
|
|
4091
4183
|
function AuthOwlBadge({ href = "https://authowl.dev", force } = {}) {
|
|
4092
4184
|
const t = useT();
|
|
4093
4185
|
const { config } = usePublicConfig();
|
|
4094
4186
|
if (!force && !config?.badge) return null;
|
|
4095
|
-
return /* @__PURE__ */ (0,
|
|
4187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
4096
4188
|
"a",
|
|
4097
4189
|
{
|
|
4098
4190
|
className: "ba-badge",
|
|
@@ -4101,9 +4193,9 @@ function AuthOwlBadge({ href = "https://authowl.dev", force } = {}) {
|
|
|
4101
4193
|
rel: "noopener noreferrer",
|
|
4102
4194
|
"data-testid": "authowl-badge",
|
|
4103
4195
|
children: [
|
|
4104
|
-
/* @__PURE__ */ (0,
|
|
4105
|
-
/* @__PURE__ */ (0,
|
|
4106
|
-
brand: /* @__PURE__ */ (0,
|
|
4196
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(OwlMark, {}),
|
|
4197
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: richMessage(t("badge.securedBy"), {
|
|
4198
|
+
brand: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ba-badge-brand", children: "AuthOwl" })
|
|
4107
4199
|
}) })
|
|
4108
4200
|
]
|
|
4109
4201
|
}
|
|
@@ -4124,19 +4216,19 @@ init_i18n();
|
|
|
4124
4216
|
|
|
4125
4217
|
// src/components/ConsentDocLinks.tsx
|
|
4126
4218
|
init_i18n();
|
|
4127
|
-
var
|
|
4219
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
4128
4220
|
function ConsentDocLinks({ termsUrl, privacyUrl }) {
|
|
4129
4221
|
const t = useT();
|
|
4130
4222
|
if (!termsUrl && !privacyUrl) return null;
|
|
4131
|
-
return /* @__PURE__ */ (0,
|
|
4132
|
-
termsUrl && /* @__PURE__ */ (0,
|
|
4223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
4224
|
+
termsUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("a", { href: termsUrl, target: "_blank", rel: "noopener noreferrer", children: t("consent.termsOfService") }),
|
|
4133
4225
|
termsUrl && privacyUrl && t("consent.docJoiner"),
|
|
4134
|
-
privacyUrl && /* @__PURE__ */ (0,
|
|
4226
|
+
privacyUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("a", { href: privacyUrl, target: "_blank", rel: "noopener noreferrer", children: t("consent.privacyPolicy") })
|
|
4135
4227
|
] });
|
|
4136
4228
|
}
|
|
4137
4229
|
|
|
4138
4230
|
// src/components/LegalConsentCheckbox.tsx
|
|
4139
|
-
var
|
|
4231
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
4140
4232
|
function LegalConsentCheckbox({
|
|
4141
4233
|
legal,
|
|
4142
4234
|
accepted,
|
|
@@ -4145,9 +4237,9 @@ function LegalConsentCheckbox({
|
|
|
4145
4237
|
}) {
|
|
4146
4238
|
const t = useT();
|
|
4147
4239
|
if (!legal.required) return null;
|
|
4148
|
-
return /* @__PURE__ */ (0,
|
|
4149
|
-
/* @__PURE__ */ (0,
|
|
4150
|
-
/* @__PURE__ */ (0,
|
|
4240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "ba-consent", "data-testid": testId, children: [
|
|
4241
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "ba-checkbox-control", children: [
|
|
4242
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4151
4243
|
"input",
|
|
4152
4244
|
{
|
|
4153
4245
|
className: "ba-checkbox",
|
|
@@ -4156,14 +4248,69 @@ function LegalConsentCheckbox({
|
|
|
4156
4248
|
onChange: (event) => onAcceptedChange(event.target.checked)
|
|
4157
4249
|
}
|
|
4158
4250
|
),
|
|
4159
|
-
/* @__PURE__ */ (0,
|
|
4251
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ba-checkbox-visual", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ba-checkbox-check" }) })
|
|
4160
4252
|
] }),
|
|
4161
|
-
/* @__PURE__ */ (0,
|
|
4162
|
-
links: /* @__PURE__ */ (0,
|
|
4253
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: richMessage(t("signUp.consentLabel"), {
|
|
4254
|
+
links: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ConsentDocLinks, { termsUrl: legal.termsUrl, privacyUrl: legal.privacyUrl })
|
|
4163
4255
|
}) })
|
|
4164
4256
|
] });
|
|
4165
4257
|
}
|
|
4166
4258
|
|
|
4259
|
+
// src/components/Turnstile.tsx
|
|
4260
|
+
var React15 = __toESM(require("react"), 1);
|
|
4261
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4262
|
+
var LOCAL_TURNSTILE_TEST_TOKEN = "XXXX.DUMMY.TOKEN.XXXX";
|
|
4263
|
+
async function loadTurnstile() {
|
|
4264
|
+
const [{ loadCaptcha: loadCaptcha2 }, { CAPTCHA_ADAPTERS: CAPTCHA_ADAPTERS2 }] = await Promise.all([
|
|
4265
|
+
Promise.resolve().then(() => (init_captcha_loader(), captcha_loader_exports)),
|
|
4266
|
+
Promise.resolve().then(() => (init_captcha_providers(), captcha_providers_exports))
|
|
4267
|
+
]);
|
|
4268
|
+
const adapter = CAPTCHA_ADAPTERS2.turnstile;
|
|
4269
|
+
return { api: await loadCaptcha2(adapter), adapter };
|
|
4270
|
+
}
|
|
4271
|
+
function Turnstile({
|
|
4272
|
+
siteKey,
|
|
4273
|
+
theme,
|
|
4274
|
+
onToken,
|
|
4275
|
+
onUnavailable
|
|
4276
|
+
}) {
|
|
4277
|
+
const container = React15.useRef(null);
|
|
4278
|
+
const callbacks = React15.useRef({ onToken, onUnavailable });
|
|
4279
|
+
callbacks.current = { onToken, onUnavailable };
|
|
4280
|
+
React15.useEffect(() => {
|
|
4281
|
+
callbacks.current.onToken(null);
|
|
4282
|
+
if (!siteKey) {
|
|
4283
|
+
callbacks.current.onToken(LOCAL_TURNSTILE_TEST_TOKEN);
|
|
4284
|
+
return;
|
|
4285
|
+
}
|
|
4286
|
+
let active = true;
|
|
4287
|
+
let widget = null;
|
|
4288
|
+
void loadTurnstile().then(({ api, adapter }) => {
|
|
4289
|
+
if (!active || !container.current) return;
|
|
4290
|
+
const id = api.render(container.current, {
|
|
4291
|
+
sitekey: siteKey,
|
|
4292
|
+
theme: theme === "system" ? "auto" : theme,
|
|
4293
|
+
size: "flexible",
|
|
4294
|
+
callback: (token) => callbacks.current.onToken(token),
|
|
4295
|
+
"expired-callback": () => callbacks.current.onToken(null),
|
|
4296
|
+
"error-callback": () => {
|
|
4297
|
+
callbacks.current.onToken(null);
|
|
4298
|
+
callbacks.current.onUnavailable();
|
|
4299
|
+
}
|
|
4300
|
+
});
|
|
4301
|
+
widget = { api, adapter, id };
|
|
4302
|
+
}).catch(() => {
|
|
4303
|
+
if (active) callbacks.current.onUnavailable();
|
|
4304
|
+
});
|
|
4305
|
+
return () => {
|
|
4306
|
+
active = false;
|
|
4307
|
+
if (widget) widget.adapter.teardown(widget.api, widget.id);
|
|
4308
|
+
};
|
|
4309
|
+
}, [siteKey, theme]);
|
|
4310
|
+
if (!siteKey) return null;
|
|
4311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ba-turnstile", ref: container, "data-testid": "phoneotp-turnstile" });
|
|
4312
|
+
}
|
|
4313
|
+
|
|
4167
4314
|
// src/components/PhoneOTP.tsx
|
|
4168
4315
|
init_use_submit_action();
|
|
4169
4316
|
init_Spinner();
|
|
@@ -4485,8 +4632,27 @@ function InvitationBanner() {
|
|
|
4485
4632
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "ba-muted", "data-testid": "authowl-invitation-banner", children: t("organization.invitationBanner") });
|
|
4486
4633
|
}
|
|
4487
4634
|
|
|
4488
|
-
// src/components/
|
|
4635
|
+
// src/components/PublicConfigError.tsx
|
|
4636
|
+
init_hooks();
|
|
4637
|
+
init_i18n();
|
|
4489
4638
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4639
|
+
function PublicConfigError({
|
|
4640
|
+
showBadge,
|
|
4641
|
+
showBranding = true
|
|
4642
|
+
}) {
|
|
4643
|
+
const t = useT();
|
|
4644
|
+
const { retry } = usePublicConfig();
|
|
4645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "ba-form", "data-testid": "authowl-config-error", role: "alert", children: [
|
|
4646
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AuthOwlBranding, {}) : null,
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "ba-title", children: t("publicConfig.error.title") }),
|
|
4648
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "ba-muted", children: t("publicConfig.error.description") }),
|
|
4649
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "ba-button", type: "button", onClick: retry, children: t("publicConfig.retry") }),
|
|
4650
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AuthOwlBadge, { force: showBadge })
|
|
4651
|
+
] });
|
|
4652
|
+
}
|
|
4653
|
+
|
|
4654
|
+
// src/components/SignIn.tsx
|
|
4655
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4490
4656
|
function SignIn({
|
|
4491
4657
|
redirectTo,
|
|
4492
4658
|
onSignedIn,
|
|
@@ -4528,41 +4694,44 @@ function SignIn({
|
|
|
4528
4694
|
redirectTo,
|
|
4529
4695
|
onSignedIn
|
|
4530
4696
|
});
|
|
4531
|
-
const badge = /* @__PURE__ */ (0,
|
|
4532
|
-
const branding = showBranding ? /* @__PURE__ */ (0,
|
|
4697
|
+
const badge = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AuthOwlBadge, { force: showBadge });
|
|
4698
|
+
const branding = showBranding ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AuthOwlBranding, {}) : null;
|
|
4533
4699
|
if (isLoading) {
|
|
4534
|
-
return /* @__PURE__ */ (0,
|
|
4535
|
-
/* @__PURE__ */ (0,
|
|
4536
|
-
/* @__PURE__ */ (0,
|
|
4700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-loading", "aria-busy": "true", children: [
|
|
4701
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ba-skeleton" }),
|
|
4702
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ba-skeleton" })
|
|
4537
4703
|
] });
|
|
4538
4704
|
}
|
|
4705
|
+
if (isError) {
|
|
4706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PublicConfigError, { showBadge, showBranding });
|
|
4707
|
+
}
|
|
4539
4708
|
if (mfaEnrolment !== "clear") {
|
|
4540
|
-
return /* @__PURE__ */ (0,
|
|
4709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-mfa-enrolment", "aria-busy": mfaEnrolment === "confirming", children: [
|
|
4541
4710
|
branding,
|
|
4542
|
-
mfaEnrolment === "pending" ? /* @__PURE__ */ (0,
|
|
4711
|
+
mfaEnrolment === "pending" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MfaEnrollmentStep, {}) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ba-skeleton" }),
|
|
4543
4712
|
badge
|
|
4544
4713
|
] });
|
|
4545
4714
|
}
|
|
4546
4715
|
if (challenge) {
|
|
4547
|
-
return /* @__PURE__ */ (0,
|
|
4716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-mfa", children: [
|
|
4548
4717
|
branding,
|
|
4549
|
-
/* @__PURE__ */ (0,
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MFAChallenge, { onVerified: () => finishSignIn({ sessionStore, redirectTo, onSignedIn }) }),
|
|
4550
4719
|
badge
|
|
4551
4720
|
] });
|
|
4552
4721
|
}
|
|
4553
4722
|
if (view === "forgot" && resetPasswordUrl) {
|
|
4554
|
-
return /* @__PURE__ */ (0,
|
|
4723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-forgot", children: [
|
|
4555
4724
|
branding,
|
|
4556
|
-
/* @__PURE__ */ (0,
|
|
4557
|
-
/* @__PURE__ */ (0,
|
|
4725
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "ba-title", children: t("signIn.forgotTitle") }),
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ForgotPassword, { resetPasswordUrl, onBack: () => setView("sign-in") }),
|
|
4558
4727
|
badge
|
|
4559
4728
|
] });
|
|
4560
4729
|
}
|
|
4561
4730
|
if (view === "otp-code") {
|
|
4562
|
-
return /* @__PURE__ */ (0,
|
|
4731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-otp-code", children: [
|
|
4563
4732
|
branding,
|
|
4564
|
-
/* @__PURE__ */ (0,
|
|
4565
|
-
/* @__PURE__ */ (0,
|
|
4733
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "ba-title", children: t("signIn.title") }),
|
|
4734
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4566
4735
|
OtpCodeForm,
|
|
4567
4736
|
{
|
|
4568
4737
|
email,
|
|
@@ -4588,18 +4757,18 @@ function SignIn({
|
|
|
4588
4757
|
] });
|
|
4589
4758
|
}
|
|
4590
4759
|
if (view === "magic-sent") {
|
|
4591
|
-
return /* @__PURE__ */ (0,
|
|
4760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-magic-sent", children: [
|
|
4592
4761
|
branding,
|
|
4593
|
-
/* @__PURE__ */ (0,
|
|
4594
|
-
/* @__PURE__ */ (0,
|
|
4595
|
-
/* @__PURE__ */ (0,
|
|
4762
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "ba-title", children: t("signIn.title") }),
|
|
4763
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "ba-muted", children: t("magicLink.sent") }),
|
|
4764
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", className: "ba-link-button", onClick: () => setView("sign-in"), children: t("forgotPassword.backToSignIn") }),
|
|
4596
4765
|
badge
|
|
4597
4766
|
] });
|
|
4598
4767
|
}
|
|
4599
4768
|
if (view === "phone") {
|
|
4600
|
-
return /* @__PURE__ */ (0,
|
|
4769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-phone", children: [
|
|
4601
4770
|
branding,
|
|
4602
|
-
/* @__PURE__ */ (0,
|
|
4771
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4603
4772
|
PhoneOTP,
|
|
4604
4773
|
{
|
|
4605
4774
|
redirectTo,
|
|
@@ -4676,14 +4845,13 @@ function SignIn({
|
|
|
4676
4845
|
{ key: "otp", enabled: plan.emailOtp, action: doRequestOtp, label: t("emailOtp.requestSubmit"), pendingLabel: t("common.sending") },
|
|
4677
4846
|
{ key: "sso", enabled: plan.sso, action: doSso, label: t("sso.continueWith"), pendingLabel: t("sso.redirecting") }
|
|
4678
4847
|
];
|
|
4679
|
-
return /* @__PURE__ */ (0,
|
|
4848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-form", children: [
|
|
4680
4849
|
branding,
|
|
4681
|
-
/* @__PURE__ */ (0,
|
|
4682
|
-
/* @__PURE__ */ (0,
|
|
4683
|
-
|
|
4684
|
-
/* @__PURE__ */ (0,
|
|
4685
|
-
|
|
4686
|
-
hasCredentialForm && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4850
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "ba-title", children: t("signIn.title") }),
|
|
4851
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InvitationBanner, {}),
|
|
4852
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SocialButtons, { providers: plan.social, callbackURL: redirectTo }),
|
|
4853
|
+
showDivider && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ba-divider", children: t("common.orDivider") }),
|
|
4854
|
+
hasCredentialForm && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4687
4855
|
"form",
|
|
4688
4856
|
{
|
|
4689
4857
|
method: "post",
|
|
@@ -4694,9 +4862,9 @@ function SignIn({
|
|
|
4694
4862
|
else if (plan.primary) PRIMARY_ACTION[plan.primary]();
|
|
4695
4863
|
},
|
|
4696
4864
|
children: [
|
|
4697
|
-
credentialMode === "email" ? /* @__PURE__ */ (0,
|
|
4865
|
+
credentialMode === "email" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "ba-label", children: [
|
|
4698
4866
|
t("common.emailLabel"),
|
|
4699
|
-
/* @__PURE__ */ (0,
|
|
4867
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4700
4868
|
"input",
|
|
4701
4869
|
{
|
|
4702
4870
|
ref: emailRef,
|
|
@@ -4711,9 +4879,9 @@ function SignIn({
|
|
|
4711
4879
|
required: true
|
|
4712
4880
|
}
|
|
4713
4881
|
)
|
|
4714
|
-
] }) : /* @__PURE__ */ (0,
|
|
4882
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "ba-label", children: [
|
|
4715
4883
|
t("common.usernameLabel"),
|
|
4716
|
-
/* @__PURE__ */ (0,
|
|
4884
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4717
4885
|
"input",
|
|
4718
4886
|
{
|
|
4719
4887
|
className: "ba-input",
|
|
@@ -4728,9 +4896,9 @@ function SignIn({
|
|
|
4728
4896
|
}
|
|
4729
4897
|
)
|
|
4730
4898
|
] }),
|
|
4731
|
-
plan.password && /* @__PURE__ */ (0,
|
|
4899
|
+
plan.password && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "ba-label", children: [
|
|
4732
4900
|
t("common.passwordLabel"),
|
|
4733
|
-
/* @__PURE__ */ (0,
|
|
4901
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4734
4902
|
"input",
|
|
4735
4903
|
{
|
|
4736
4904
|
className: "ba-input",
|
|
@@ -4746,19 +4914,19 @@ function SignIn({
|
|
|
4746
4914
|
)
|
|
4747
4915
|
] }),
|
|
4748
4916
|
authChallenge.control,
|
|
4749
|
-
/* @__PURE__ */ (0,
|
|
4750
|
-
plan.password && /* @__PURE__ */ (0,
|
|
4751
|
-
/* @__PURE__ */ (0,
|
|
4917
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FormError, { children: error }),
|
|
4918
|
+
plan.password && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4919
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4752
4920
|
"button",
|
|
4753
4921
|
{
|
|
4754
4922
|
className: "ba-button",
|
|
4755
4923
|
type: "submit",
|
|
4756
4924
|
disabled: pending || authChallenge.configPending,
|
|
4757
4925
|
"aria-busy": pending && inFlight === "password" || void 0,
|
|
4758
|
-
children: /* @__PURE__ */ (0,
|
|
4926
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Busy, { busy: pending && inFlight === "password", label: t("signIn.submitPending"), children: t("signIn.submit") })
|
|
4759
4927
|
}
|
|
4760
4928
|
),
|
|
4761
|
-
resetPasswordUrl && /* @__PURE__ */ (0,
|
|
4929
|
+
resetPasswordUrl && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4762
4930
|
"button",
|
|
4763
4931
|
{
|
|
4764
4932
|
type: "button",
|
|
@@ -4770,7 +4938,7 @@ function SignIn({
|
|
|
4770
4938
|
] }),
|
|
4771
4939
|
credentialMode === "email" && alternates.filter((a) => a.enabled).map(({ key, action, label: label2, pendingLabel }) => {
|
|
4772
4940
|
const isPrimary = plan.primary === key;
|
|
4773
|
-
return /* @__PURE__ */ (0,
|
|
4941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4774
4942
|
"button",
|
|
4775
4943
|
{
|
|
4776
4944
|
type: isPrimary ? "submit" : "button",
|
|
@@ -4778,12 +4946,12 @@ function SignIn({
|
|
|
4778
4946
|
disabled: pending || authChallenge.configPending,
|
|
4779
4947
|
"aria-busy": pending && inFlight === key || void 0,
|
|
4780
4948
|
onClick: isPrimary ? void 0 : withEmail(action),
|
|
4781
|
-
children: /* @__PURE__ */ (0,
|
|
4949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Busy, { busy: pending && inFlight === key, label: pendingLabel, children: label2 })
|
|
4782
4950
|
},
|
|
4783
4951
|
key
|
|
4784
4952
|
);
|
|
4785
4953
|
}),
|
|
4786
|
-
plan.username && /* @__PURE__ */ (0,
|
|
4954
|
+
plan.username && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4787
4955
|
"button",
|
|
4788
4956
|
{
|
|
4789
4957
|
type: "button",
|
|
@@ -4799,8 +4967,8 @@ function SignIn({
|
|
|
4799
4967
|
]
|
|
4800
4968
|
}
|
|
4801
4969
|
),
|
|
4802
|
-
plan.passkey && /* @__PURE__ */ (0,
|
|
4803
|
-
plan.phoneOtp && /* @__PURE__ */ (0,
|
|
4970
|
+
plan.passkey && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PasskeyButton, { redirectTo, onSignedIn }),
|
|
4971
|
+
plan.phoneOtp && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4804
4972
|
"button",
|
|
4805
4973
|
{
|
|
4806
4974
|
type: "button",
|
|
@@ -4809,7 +4977,7 @@ function SignIn({
|
|
|
4809
4977
|
children: t("phoneOtp.usePhone")
|
|
4810
4978
|
}
|
|
4811
4979
|
),
|
|
4812
|
-
!plan.renderable && /* @__PURE__ */ (0,
|
|
4980
|
+
!plan.renderable && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "ba-muted", children: plan.emptyReason === "unsupported" ? t("signIn.empty.unsupported") : t("signIn.empty.none") }),
|
|
4813
4981
|
badge
|
|
4814
4982
|
] });
|
|
4815
4983
|
}
|
|
@@ -4826,7 +4994,7 @@ init_i18n();
|
|
|
4826
4994
|
init_use_submit_action();
|
|
4827
4995
|
init_Spinner();
|
|
4828
4996
|
init_FormError();
|
|
4829
|
-
var
|
|
4997
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4830
4998
|
function VerificationPending({
|
|
4831
4999
|
email,
|
|
4832
5000
|
callbackURL,
|
|
@@ -4844,10 +5012,10 @@ function VerificationPending({
|
|
|
4844
5012
|
const [code, setCode] = React20.useState("");
|
|
4845
5013
|
const [verified, setVerified] = React20.useState(false);
|
|
4846
5014
|
if (verified) {
|
|
4847
|
-
return /* @__PURE__ */ (0,
|
|
5015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-success", role: "status", "data-testid": "verify-code-success", children: t("verifyEmail.success") });
|
|
4848
5016
|
}
|
|
4849
5017
|
if (method === "code") {
|
|
4850
|
-
return /* @__PURE__ */ (0,
|
|
5018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4851
5019
|
"form",
|
|
4852
5020
|
{
|
|
4853
5021
|
method: "post",
|
|
@@ -4864,12 +5032,12 @@ function VerificationPending({
|
|
|
4864
5032
|
);
|
|
4865
5033
|
},
|
|
4866
5034
|
children: [
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4868
|
-
email: /* @__PURE__ */ (0,
|
|
5035
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-muted", children: richMessage(t("verifyPending.codeBody"), {
|
|
5036
|
+
email: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Bidi, { children: email }) })
|
|
4869
5037
|
}) }),
|
|
4870
|
-
/* @__PURE__ */ (0,
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "ba-label", children: [
|
|
4871
5039
|
t("verifyPending.codeLabel"),
|
|
4872
|
-
/* @__PURE__ */ (0,
|
|
5040
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4873
5041
|
"input",
|
|
4874
5042
|
{
|
|
4875
5043
|
className: "ba-input",
|
|
@@ -4881,20 +5049,20 @@ function VerificationPending({
|
|
|
4881
5049
|
}
|
|
4882
5050
|
)
|
|
4883
5051
|
] }),
|
|
4884
|
-
resent && /* @__PURE__ */ (0,
|
|
5052
|
+
resent && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-muted", children: t("verifyPending.resent") }),
|
|
4885
5053
|
authChallenge.control,
|
|
4886
|
-
/* @__PURE__ */ (0,
|
|
4887
|
-
/* @__PURE__ */ (0,
|
|
5054
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormError, { children: error }),
|
|
5055
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4888
5056
|
"button",
|
|
4889
5057
|
{
|
|
4890
5058
|
className: "ba-button",
|
|
4891
5059
|
type: "submit",
|
|
4892
5060
|
disabled: pending || !code,
|
|
4893
5061
|
"aria-busy": pending || void 0,
|
|
4894
|
-
children: /* @__PURE__ */ (0,
|
|
5062
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Busy, { busy: pending, label: t("common.verifying"), children: t("emailOtp.verifySubmit") })
|
|
4895
5063
|
}
|
|
4896
5064
|
),
|
|
4897
|
-
/* @__PURE__ */ (0,
|
|
5065
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4898
5066
|
"button",
|
|
4899
5067
|
{
|
|
4900
5068
|
type: "button",
|
|
@@ -4920,14 +5088,14 @@ function VerificationPending({
|
|
|
4920
5088
|
}
|
|
4921
5089
|
);
|
|
4922
5090
|
}
|
|
4923
|
-
return /* @__PURE__ */ (0,
|
|
4924
|
-
/* @__PURE__ */ (0,
|
|
4925
|
-
email: /* @__PURE__ */ (0,
|
|
5091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "ba-fields", "data-testid": "verify-pending", children: [
|
|
5092
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-muted", children: richMessage(t("verifyPending.body"), {
|
|
5093
|
+
email: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Bidi, { children: email }) })
|
|
4926
5094
|
}) }),
|
|
4927
|
-
resent && /* @__PURE__ */ (0,
|
|
5095
|
+
resent && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-muted", children: t("verifyPending.resent") }),
|
|
4928
5096
|
authChallenge.control,
|
|
4929
|
-
/* @__PURE__ */ (0,
|
|
4930
|
-
/* @__PURE__ */ (0,
|
|
5097
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormError, { children: error }),
|
|
5098
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4931
5099
|
"button",
|
|
4932
5100
|
{
|
|
4933
5101
|
type: "button",
|
|
@@ -4938,7 +5106,7 @@ function VerificationPending({
|
|
|
4938
5106
|
failure: t("verifyPending.error.resendFailed"),
|
|
4939
5107
|
onSuccess: () => setResent(true)
|
|
4940
5108
|
}),
|
|
4941
|
-
children: /* @__PURE__ */ (0,
|
|
5109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("verifyPending.resendButton") })
|
|
4942
5110
|
}
|
|
4943
5111
|
)
|
|
4944
5112
|
] });
|
|
@@ -4951,7 +5119,7 @@ init_i18n();
|
|
|
4951
5119
|
init_use_submit_action();
|
|
4952
5120
|
init_Spinner();
|
|
4953
5121
|
init_FormError();
|
|
4954
|
-
var
|
|
5122
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4955
5123
|
function PasswordlessSignUp({ onAuthenticated }) {
|
|
4956
5124
|
const t = useT();
|
|
4957
5125
|
const { sendEmailOtp, signInEmailOtp } = useSignIn();
|
|
@@ -4961,7 +5129,7 @@ function PasswordlessSignUp({ onAuthenticated }) {
|
|
|
4961
5129
|
const [code, setCode] = React21.useState("");
|
|
4962
5130
|
const [codeSent, setCodeSent] = React21.useState(false);
|
|
4963
5131
|
if (codeSent) {
|
|
4964
|
-
return /* @__PURE__ */ (0,
|
|
5132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ba-fields", "data-testid": "signup-emailotp-code", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4965
5133
|
OtpCodeForm,
|
|
4966
5134
|
{
|
|
4967
5135
|
email,
|
|
@@ -4981,7 +5149,7 @@ function PasswordlessSignUp({ onAuthenticated }) {
|
|
|
4981
5149
|
}
|
|
4982
5150
|
) });
|
|
4983
5151
|
}
|
|
4984
|
-
return /* @__PURE__ */ (0,
|
|
5152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4985
5153
|
"form",
|
|
4986
5154
|
{
|
|
4987
5155
|
method: "post",
|
|
@@ -4995,9 +5163,9 @@ function PasswordlessSignUp({ onAuthenticated }) {
|
|
|
4995
5163
|
});
|
|
4996
5164
|
},
|
|
4997
5165
|
children: [
|
|
4998
|
-
/* @__PURE__ */ (0,
|
|
5166
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "ba-label", children: [
|
|
4999
5167
|
t("common.emailLabel"),
|
|
5000
|
-
/* @__PURE__ */ (0,
|
|
5168
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5001
5169
|
"input",
|
|
5002
5170
|
{
|
|
5003
5171
|
className: "ba-input",
|
|
@@ -5010,15 +5178,15 @@ function PasswordlessSignUp({ onAuthenticated }) {
|
|
|
5010
5178
|
)
|
|
5011
5179
|
] }),
|
|
5012
5180
|
authChallenge.control,
|
|
5013
|
-
/* @__PURE__ */ (0,
|
|
5014
|
-
/* @__PURE__ */ (0,
|
|
5181
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(FormError, { children: error }),
|
|
5182
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5015
5183
|
"button",
|
|
5016
5184
|
{
|
|
5017
5185
|
className: "ba-button ba-button-secondary",
|
|
5018
5186
|
type: "submit",
|
|
5019
5187
|
disabled: pending || authChallenge.configPending,
|
|
5020
5188
|
"aria-busy": pending || void 0,
|
|
5021
|
-
children: /* @__PURE__ */ (0,
|
|
5189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("signUp.passwordlessSubmit") })
|
|
5022
5190
|
}
|
|
5023
5191
|
)
|
|
5024
5192
|
]
|
|
@@ -5032,16 +5200,16 @@ init_i18n();
|
|
|
5032
5200
|
init_use_submit_action();
|
|
5033
5201
|
init_Spinner();
|
|
5034
5202
|
init_FormError();
|
|
5035
|
-
var
|
|
5203
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5036
5204
|
function PasskeySignUpCompletion({ onComplete }) {
|
|
5037
5205
|
const t = useT();
|
|
5038
5206
|
const { addPasskey } = usePasskeys();
|
|
5039
5207
|
const { pending, error, run } = useSubmitAction();
|
|
5040
|
-
return /* @__PURE__ */ (0,
|
|
5041
|
-
/* @__PURE__ */ (0,
|
|
5042
|
-
/* @__PURE__ */ (0,
|
|
5043
|
-
/* @__PURE__ */ (0,
|
|
5044
|
-
/* @__PURE__ */ (0,
|
|
5208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "ba-fields", "data-testid": "signup-passkey-completion", children: [
|
|
5209
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { className: "ba-title", children: t("signUp.passkeyTitle") }),
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "ba-muted", children: t("signUp.passkeyDescription") }),
|
|
5211
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FormError, { children: error }),
|
|
5212
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5045
5213
|
"button",
|
|
5046
5214
|
{
|
|
5047
5215
|
className: "ba-button",
|
|
@@ -5052,10 +5220,10 @@ function PasskeySignUpCompletion({ onComplete }) {
|
|
|
5052
5220
|
failure: t("signUp.error.passkeyFailed"),
|
|
5053
5221
|
onSuccess: onComplete
|
|
5054
5222
|
}),
|
|
5055
|
-
children: /* @__PURE__ */ (0,
|
|
5223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Busy, { busy: pending, label: t("passkey.waiting"), children: t("signUp.passkeySubmit") })
|
|
5056
5224
|
}
|
|
5057
5225
|
),
|
|
5058
|
-
/* @__PURE__ */ (0,
|
|
5226
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: onComplete, children: t("signUp.passkeySkip") })
|
|
5059
5227
|
] });
|
|
5060
5228
|
}
|
|
5061
5229
|
|
|
@@ -5070,7 +5238,7 @@ init_i18n();
|
|
|
5070
5238
|
init_FormError();
|
|
5071
5239
|
init_Spinner();
|
|
5072
5240
|
init_use_submit_action();
|
|
5073
|
-
var
|
|
5241
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5074
5242
|
function Waitlist({ onJoined, showBadge, showBranding = true } = {}) {
|
|
5075
5243
|
const t = useT();
|
|
5076
5244
|
const { join } = useWaitlist();
|
|
@@ -5079,18 +5247,18 @@ function Waitlist({ onJoined, showBadge, showBranding = true } = {}) {
|
|
|
5079
5247
|
const [email, setEmail] = React22.useState("");
|
|
5080
5248
|
const [joined, setJoined] = React22.useState(false);
|
|
5081
5249
|
if (joined) {
|
|
5082
|
-
return /* @__PURE__ */ (0,
|
|
5083
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5084
|
-
/* @__PURE__ */ (0,
|
|
5085
|
-
/* @__PURE__ */ (0,
|
|
5086
|
-
/* @__PURE__ */ (0,
|
|
5250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ba-form", "data-testid": "waitlist-accepted", children: [
|
|
5251
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AuthOwlBranding, {}) : null,
|
|
5252
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { className: "ba-title", children: t("waitlist.acceptedTitle") }),
|
|
5253
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "ba-muted", children: t("waitlist.acceptedDescription") }),
|
|
5254
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5087
5255
|
] });
|
|
5088
5256
|
}
|
|
5089
|
-
return /* @__PURE__ */ (0,
|
|
5090
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5091
|
-
/* @__PURE__ */ (0,
|
|
5092
|
-
/* @__PURE__ */ (0,
|
|
5093
|
-
/* @__PURE__ */ (0,
|
|
5257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ba-form", "data-testid": "waitlist-form", children: [
|
|
5258
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AuthOwlBranding, {}) : null,
|
|
5259
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { className: "ba-title", children: t("waitlist.title") }),
|
|
5260
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "ba-muted", children: t("waitlist.description") }),
|
|
5261
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5094
5262
|
"form",
|
|
5095
5263
|
{
|
|
5096
5264
|
method: "post",
|
|
@@ -5112,9 +5280,9 @@ function Waitlist({ onJoined, showBadge, showBranding = true } = {}) {
|
|
|
5112
5280
|
);
|
|
5113
5281
|
},
|
|
5114
5282
|
children: [
|
|
5115
|
-
/* @__PURE__ */ (0,
|
|
5283
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "ba-label", children: [
|
|
5116
5284
|
t("common.emailLabel"),
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5285
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5118
5286
|
"input",
|
|
5119
5287
|
{
|
|
5120
5288
|
className: "ba-input",
|
|
@@ -5128,26 +5296,26 @@ function Waitlist({ onJoined, showBadge, showBranding = true } = {}) {
|
|
|
5128
5296
|
)
|
|
5129
5297
|
] }),
|
|
5130
5298
|
authChallenge.control,
|
|
5131
|
-
/* @__PURE__ */ (0,
|
|
5132
|
-
/* @__PURE__ */ (0,
|
|
5299
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormError, { children: error }),
|
|
5300
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5133
5301
|
"button",
|
|
5134
5302
|
{
|
|
5135
5303
|
className: "ba-button",
|
|
5136
5304
|
type: "submit",
|
|
5137
5305
|
disabled: pending || authChallenge.configPending,
|
|
5138
5306
|
"aria-busy": pending || void 0,
|
|
5139
|
-
children: /* @__PURE__ */ (0,
|
|
5307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Busy, { busy: pending, label: t("waitlist.submitPending"), children: t("waitlist.submit") })
|
|
5140
5308
|
}
|
|
5141
5309
|
)
|
|
5142
5310
|
]
|
|
5143
5311
|
}
|
|
5144
5312
|
),
|
|
5145
|
-
/* @__PURE__ */ (0,
|
|
5313
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5146
5314
|
] });
|
|
5147
5315
|
}
|
|
5148
5316
|
|
|
5149
5317
|
// src/components/SignUp.tsx
|
|
5150
|
-
var
|
|
5318
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5151
5319
|
function SignUp({
|
|
5152
5320
|
redirectTo,
|
|
5153
5321
|
onSignedUp,
|
|
@@ -5159,7 +5327,7 @@ function SignUp({
|
|
|
5159
5327
|
const t = useT();
|
|
5160
5328
|
const toServerError = useServerError();
|
|
5161
5329
|
const { signUp } = useSignUp();
|
|
5162
|
-
const { config, isLoading } = usePublicConfig();
|
|
5330
|
+
const { config, isLoading, isError } = usePublicConfig();
|
|
5163
5331
|
const authChallenge = useAuthChallenge();
|
|
5164
5332
|
const [email, setEmail] = React23.useState("");
|
|
5165
5333
|
const [password, setPassword] = React23.useState("");
|
|
@@ -5231,18 +5399,21 @@ function SignUp({
|
|
|
5231
5399
|
}
|
|
5232
5400
|
}
|
|
5233
5401
|
if (isLoading) {
|
|
5234
|
-
return /* @__PURE__ */ (0,
|
|
5235
|
-
/* @__PURE__ */ (0,
|
|
5236
|
-
/* @__PURE__ */ (0,
|
|
5402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ba-form", "data-testid": "signup-loading", "aria-busy": "true", children: [
|
|
5403
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ba-skeleton" }),
|
|
5404
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ba-skeleton" })
|
|
5237
5405
|
] });
|
|
5238
5406
|
}
|
|
5407
|
+
if (isError) {
|
|
5408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PublicConfigError, { showBadge, showBranding });
|
|
5409
|
+
}
|
|
5239
5410
|
if (config?.signUp?.mode === "waitlist") {
|
|
5240
|
-
return /* @__PURE__ */ (0,
|
|
5411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Waitlist, { onJoined: onWaitlisted, showBadge, showBranding });
|
|
5241
5412
|
}
|
|
5242
5413
|
if (pendingEmail) {
|
|
5243
|
-
return /* @__PURE__ */ (0,
|
|
5244
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5245
|
-
/* @__PURE__ */ (0,
|
|
5414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ba-form", "data-testid": "signup-verify-pending", children: [
|
|
5415
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBranding, {}) : null,
|
|
5416
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5246
5417
|
VerificationPending,
|
|
5247
5418
|
{
|
|
5248
5419
|
email: pendingEmail,
|
|
@@ -5250,7 +5421,7 @@ function SignUp({
|
|
|
5250
5421
|
method: capabilities.emailVerificationMethod
|
|
5251
5422
|
}
|
|
5252
5423
|
),
|
|
5253
|
-
/* @__PURE__ */ (0,
|
|
5424
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5254
5425
|
] });
|
|
5255
5426
|
}
|
|
5256
5427
|
const methods = config?.enabledMethods ?? ["password"];
|
|
@@ -5260,22 +5431,22 @@ function SignUp({
|
|
|
5260
5431
|
const showPasswordless = publicSignupAllowed && capabilities.emailOtpSignIn && capabilities.emailSignUp && !consentRequired && !capabilities.mfaRequired;
|
|
5261
5432
|
const renderable = showPassword || showPasswordless || social.length > 0;
|
|
5262
5433
|
if (completeWithPasskey) {
|
|
5263
|
-
return /* @__PURE__ */ (0,
|
|
5264
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5265
|
-
/* @__PURE__ */ (0,
|
|
5266
|
-
/* @__PURE__ */ (0,
|
|
5434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ba-form", "data-testid": "signup-passkey-step", children: [
|
|
5435
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBranding, {}) : null,
|
|
5436
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PasskeySignUpCompletion, { onComplete: finishSignUp }),
|
|
5437
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5267
5438
|
] });
|
|
5268
5439
|
}
|
|
5269
|
-
return /* @__PURE__ */ (0,
|
|
5270
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5271
|
-
/* @__PURE__ */ (0,
|
|
5272
|
-
/* @__PURE__ */ (0,
|
|
5273
|
-
/* @__PURE__ */ (0,
|
|
5274
|
-
showPassword && social.length > 0 && /* @__PURE__ */ (0,
|
|
5275
|
-
showPassword && /* @__PURE__ */ (0,
|
|
5276
|
-
capabilities.legacyNameField && /* @__PURE__ */ (0,
|
|
5440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ba-form", "data-testid": "signup-form", children: [
|
|
5441
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBranding, {}) : null,
|
|
5442
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", { className: "ba-title", children: t("signUp.title") }),
|
|
5443
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InvitationBanner, {}),
|
|
5444
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SocialButtons, { providers: social, callbackURL: redirectTo }),
|
|
5445
|
+
showPassword && social.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ba-divider", children: t("common.orDivider") }),
|
|
5446
|
+
showPassword && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("form", { method: "post", onSubmit, className: "ba-fields", children: [
|
|
5447
|
+
capabilities.legacyNameField && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5277
5448
|
t("signUp.nameLabel"),
|
|
5278
|
-
/* @__PURE__ */ (0,
|
|
5449
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5279
5450
|
"input",
|
|
5280
5451
|
{
|
|
5281
5452
|
className: "ba-input",
|
|
@@ -5289,10 +5460,10 @@ function SignUp({
|
|
|
5289
5460
|
}
|
|
5290
5461
|
)
|
|
5291
5462
|
] }),
|
|
5292
|
-
capabilities.firstLastName && /* @__PURE__ */ (0,
|
|
5293
|
-
/* @__PURE__ */ (0,
|
|
5463
|
+
capabilities.firstLastName && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
5464
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5294
5465
|
t("signUp.firstNameLabel"),
|
|
5295
|
-
/* @__PURE__ */ (0,
|
|
5466
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5296
5467
|
"input",
|
|
5297
5468
|
{
|
|
5298
5469
|
className: "ba-input",
|
|
@@ -5305,9 +5476,9 @@ function SignUp({
|
|
|
5305
5476
|
}
|
|
5306
5477
|
)
|
|
5307
5478
|
] }),
|
|
5308
|
-
/* @__PURE__ */ (0,
|
|
5479
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5309
5480
|
t("signUp.lastNameLabel"),
|
|
5310
|
-
/* @__PURE__ */ (0,
|
|
5481
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5311
5482
|
"input",
|
|
5312
5483
|
{
|
|
5313
5484
|
className: "ba-input",
|
|
@@ -5321,9 +5492,9 @@ function SignUp({
|
|
|
5321
5492
|
)
|
|
5322
5493
|
] })
|
|
5323
5494
|
] }),
|
|
5324
|
-
capabilities.collectUsername && /* @__PURE__ */ (0,
|
|
5495
|
+
capabilities.collectUsername && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5325
5496
|
t("common.usernameLabel"),
|
|
5326
|
-
/* @__PURE__ */ (0,
|
|
5497
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5327
5498
|
"input",
|
|
5328
5499
|
{
|
|
5329
5500
|
className: "ba-input",
|
|
@@ -5337,9 +5508,9 @@ function SignUp({
|
|
|
5337
5508
|
}
|
|
5338
5509
|
)
|
|
5339
5510
|
] }),
|
|
5340
|
-
/* @__PURE__ */ (0,
|
|
5511
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5341
5512
|
t("common.emailLabel"),
|
|
5342
|
-
/* @__PURE__ */ (0,
|
|
5513
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5343
5514
|
"input",
|
|
5344
5515
|
{
|
|
5345
5516
|
className: "ba-input",
|
|
@@ -5354,9 +5525,9 @@ function SignUp({
|
|
|
5354
5525
|
}
|
|
5355
5526
|
)
|
|
5356
5527
|
] }),
|
|
5357
|
-
/* @__PURE__ */ (0,
|
|
5528
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5358
5529
|
t("common.passwordLabel"),
|
|
5359
|
-
/* @__PURE__ */ (0,
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5360
5531
|
"input",
|
|
5361
5532
|
{
|
|
5362
5533
|
className: "ba-input",
|
|
@@ -5374,7 +5545,7 @@ function SignUp({
|
|
|
5374
5545
|
)
|
|
5375
5546
|
] }),
|
|
5376
5547
|
authChallenge.control,
|
|
5377
|
-
legal && /* @__PURE__ */ (0,
|
|
5548
|
+
legal && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5378
5549
|
LegalConsentCheckbox,
|
|
5379
5550
|
{
|
|
5380
5551
|
legal,
|
|
@@ -5383,20 +5554,20 @@ function SignUp({
|
|
|
5383
5554
|
testId: "signup-consent"
|
|
5384
5555
|
}
|
|
5385
5556
|
),
|
|
5386
|
-
/* @__PURE__ */ (0,
|
|
5387
|
-
/* @__PURE__ */ (0,
|
|
5557
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FormError, { children: error }),
|
|
5558
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5388
5559
|
"button",
|
|
5389
5560
|
{
|
|
5390
5561
|
className: "ba-button",
|
|
5391
5562
|
type: "submit",
|
|
5392
5563
|
disabled: submitting || consentBlocked || authChallenge.configPending,
|
|
5393
5564
|
"aria-busy": submitting || void 0,
|
|
5394
|
-
children: /* @__PURE__ */ (0,
|
|
5565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Busy, { busy: submitting, label: t("signUp.submitPending"), children: t("signUp.submit") })
|
|
5395
5566
|
}
|
|
5396
5567
|
)
|
|
5397
5568
|
] }),
|
|
5398
|
-
showPasswordless && (showPassword || social.length > 0) && /* @__PURE__ */ (0,
|
|
5399
|
-
showPasswordless && /* @__PURE__ */ (0,
|
|
5569
|
+
showPasswordless && (showPassword || social.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ba-divider", children: t("common.orDivider") }),
|
|
5570
|
+
showPasswordless && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5400
5571
|
PasswordlessSignUp,
|
|
5401
5572
|
{
|
|
5402
5573
|
onAuthenticated: () => {
|
|
@@ -5405,8 +5576,8 @@ function SignUp({
|
|
|
5405
5576
|
}
|
|
5406
5577
|
}
|
|
5407
5578
|
),
|
|
5408
|
-
!renderable && /* @__PURE__ */ (0,
|
|
5409
|
-
/* @__PURE__ */ (0,
|
|
5579
|
+
!renderable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "ba-muted", children: publicSignupAllowed && methods.length > 0 ? t("signUp.empty.unsupported") : t("signUp.empty.none") }),
|
|
5580
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5410
5581
|
] });
|
|
5411
5582
|
}
|
|
5412
5583
|
|
|
@@ -5416,19 +5587,19 @@ init_i18n();
|
|
|
5416
5587
|
init_use_submit_action();
|
|
5417
5588
|
init_Spinner();
|
|
5418
5589
|
init_FormError();
|
|
5419
|
-
var
|
|
5590
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5420
5591
|
function ConsentGate({ children, title }) {
|
|
5421
5592
|
const t = useT();
|
|
5422
5593
|
const { needsConsent, status, accept } = useConsent();
|
|
5423
5594
|
const { pending, error, run } = useSubmitAction();
|
|
5424
|
-
if (!needsConsent) return /* @__PURE__ */ (0,
|
|
5425
|
-
return /* @__PURE__ */ (0,
|
|
5426
|
-
/* @__PURE__ */ (0,
|
|
5427
|
-
/* @__PURE__ */ (0,
|
|
5428
|
-
links: /* @__PURE__ */ (0,
|
|
5595
|
+
if (!needsConsent) return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children });
|
|
5596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ba-form", "data-testid": "consent-gate", children: [
|
|
5597
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { className: "ba-title", children: title ?? t("consent.gateTitle") }),
|
|
5598
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "ba-muted", children: richMessage(t("consent.gateBody"), {
|
|
5599
|
+
links: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ConsentDocLinks, { termsUrl: status?.termsUrl, privacyUrl: status?.privacyUrl })
|
|
5429
5600
|
}) }),
|
|
5430
|
-
/* @__PURE__ */ (0,
|
|
5431
|
-
/* @__PURE__ */ (0,
|
|
5601
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FormError, { children: error }),
|
|
5602
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5432
5603
|
"button",
|
|
5433
5604
|
{
|
|
5434
5605
|
className: "ba-button",
|
|
@@ -5442,22 +5613,22 @@ function ConsentGate({ children, title }) {
|
|
|
5442
5613
|
},
|
|
5443
5614
|
{ failure: t("consent.error.acceptFailed") }
|
|
5444
5615
|
),
|
|
5445
|
-
children: /* @__PURE__ */ (0,
|
|
5616
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Busy, { busy: pending, label: t("consent.acceptPending"), children: t("consent.acceptSubmit") })
|
|
5446
5617
|
}
|
|
5447
5618
|
),
|
|
5448
|
-
/* @__PURE__ */ (0,
|
|
5619
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AuthOwlBadge, {})
|
|
5449
5620
|
] });
|
|
5450
5621
|
}
|
|
5451
5622
|
|
|
5452
5623
|
// src/components/MFARequiredGate.tsx
|
|
5453
|
-
var
|
|
5624
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5454
5625
|
function MFARequiredGate({ children, title }) {
|
|
5455
5626
|
const state = useConfirmedMfaPending();
|
|
5456
|
-
if (state === "clear") return /* @__PURE__ */ (0,
|
|
5627
|
+
if (state === "clear") return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
|
|
5457
5628
|
if (state === "confirming") return null;
|
|
5458
|
-
return /* @__PURE__ */ (0,
|
|
5459
|
-
/* @__PURE__ */ (0,
|
|
5460
|
-
/* @__PURE__ */ (0,
|
|
5629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "ba-form", "data-testid": "mfa-required-gate", children: [
|
|
5630
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MfaEnrollmentStep, { title }),
|
|
5631
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AuthOwlBadge, {})
|
|
5461
5632
|
] });
|
|
5462
5633
|
}
|
|
5463
5634
|
|
|
@@ -5468,7 +5639,7 @@ init_i18n();
|
|
|
5468
5639
|
init_use_submit_action();
|
|
5469
5640
|
init_Spinner();
|
|
5470
5641
|
init_FormError();
|
|
5471
|
-
var
|
|
5642
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5472
5643
|
function BackupCodesManager({ title }) {
|
|
5473
5644
|
const t = useT();
|
|
5474
5645
|
const { user } = useUser();
|
|
@@ -5487,20 +5658,20 @@ function BackupCodesManager({ title }) {
|
|
|
5487
5658
|
}
|
|
5488
5659
|
});
|
|
5489
5660
|
};
|
|
5490
|
-
return /* @__PURE__ */ (0,
|
|
5491
|
-
title !== null && /* @__PURE__ */ (0,
|
|
5492
|
-
/* @__PURE__ */ (0,
|
|
5493
|
-
codes ? /* @__PURE__ */ (0,
|
|
5494
|
-
/* @__PURE__ */ (0,
|
|
5495
|
-
/* @__PURE__ */ (0,
|
|
5661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ba-form", "data-testid": "backup-codes-manager", children: [
|
|
5662
|
+
title !== null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h2", { className: "ba-title", children: title ?? t("backupCodes.title") }),
|
|
5663
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "ba-muted", children: t("backupCodes.hint") }),
|
|
5664
|
+
codes ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
5665
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("p", { className: "ba-muted", children: [
|
|
5666
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: t("mfa.enroll.backupCodesWarningStrong") }),
|
|
5496
5667
|
" ",
|
|
5497
5668
|
t("mfa.enroll.backupCodesWarningRest")
|
|
5498
5669
|
] }),
|
|
5499
|
-
/* @__PURE__ */ (0,
|
|
5500
|
-
] }) : /* @__PURE__ */ (0,
|
|
5501
|
-
/* @__PURE__ */ (0,
|
|
5670
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "ba-passkey-list", "data-testid": "backup-codes-list", children: codes.map((c) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("li", { className: "ba-passkey-item", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("code", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("bdi", { children: c }) }) }, c)) })
|
|
5671
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
5672
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "ba-label", children: [
|
|
5502
5673
|
t("common.passwordLabel"),
|
|
5503
|
-
/* @__PURE__ */ (0,
|
|
5674
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5504
5675
|
"input",
|
|
5505
5676
|
{
|
|
5506
5677
|
className: "ba-input",
|
|
@@ -5512,8 +5683,8 @@ function BackupCodesManager({ title }) {
|
|
|
5512
5683
|
}
|
|
5513
5684
|
)
|
|
5514
5685
|
] }),
|
|
5515
|
-
/* @__PURE__ */ (0,
|
|
5516
|
-
/* @__PURE__ */ (0,
|
|
5686
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FormError, { children: error }),
|
|
5687
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !password, "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Busy, { busy: pending, label: t("backupCodes.pending"), children: t("backupCodes.submit") }) })
|
|
5517
5688
|
] })
|
|
5518
5689
|
] });
|
|
5519
5690
|
}
|
|
@@ -5525,7 +5696,7 @@ init_i18n();
|
|
|
5525
5696
|
init_use_submit_action();
|
|
5526
5697
|
init_Spinner();
|
|
5527
5698
|
init_FormError();
|
|
5528
|
-
var
|
|
5699
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5529
5700
|
function MagicLinkForm({ callbackURL, webauthnAutofill }) {
|
|
5530
5701
|
const t = useT();
|
|
5531
5702
|
const { signInMagicLink } = useSignIn();
|
|
@@ -5534,9 +5705,9 @@ function MagicLinkForm({ callbackURL, webauthnAutofill }) {
|
|
|
5534
5705
|
const [email, setEmail] = React25.useState("");
|
|
5535
5706
|
const [sent, setSent] = React25.useState(false);
|
|
5536
5707
|
if (sent) {
|
|
5537
|
-
return /* @__PURE__ */ (0,
|
|
5708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "ba-muted", "data-testid": "magiclink-sent", children: t("magicLink.sent") });
|
|
5538
5709
|
}
|
|
5539
|
-
return /* @__PURE__ */ (0,
|
|
5710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
5540
5711
|
"form",
|
|
5541
5712
|
{
|
|
5542
5713
|
method: "post",
|
|
@@ -5550,9 +5721,9 @@ function MagicLinkForm({ callbackURL, webauthnAutofill }) {
|
|
|
5550
5721
|
className: "ba-fields",
|
|
5551
5722
|
"data-testid": "magiclink-form",
|
|
5552
5723
|
children: [
|
|
5553
|
-
/* @__PURE__ */ (0,
|
|
5724
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "ba-label", children: [
|
|
5554
5725
|
t("common.emailLabel"),
|
|
5555
|
-
/* @__PURE__ */ (0,
|
|
5726
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5556
5727
|
"input",
|
|
5557
5728
|
{
|
|
5558
5729
|
className: "ba-input",
|
|
@@ -5565,15 +5736,15 @@ function MagicLinkForm({ callbackURL, webauthnAutofill }) {
|
|
|
5565
5736
|
)
|
|
5566
5737
|
] }),
|
|
5567
5738
|
authChallenge.control,
|
|
5568
|
-
/* @__PURE__ */ (0,
|
|
5569
|
-
/* @__PURE__ */ (0,
|
|
5739
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormError, { children: error }),
|
|
5740
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5570
5741
|
"button",
|
|
5571
5742
|
{
|
|
5572
5743
|
className: "ba-button",
|
|
5573
5744
|
type: "submit",
|
|
5574
5745
|
disabled: pending || authChallenge.configPending,
|
|
5575
5746
|
"aria-busy": pending || void 0,
|
|
5576
|
-
children: /* @__PURE__ */ (0,
|
|
5747
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("magicLink.submit") })
|
|
5577
5748
|
}
|
|
5578
5749
|
)
|
|
5579
5750
|
]
|
|
@@ -5588,7 +5759,7 @@ init_i18n();
|
|
|
5588
5759
|
init_use_submit_action();
|
|
5589
5760
|
init_Spinner();
|
|
5590
5761
|
init_FormError();
|
|
5591
|
-
var
|
|
5762
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5592
5763
|
function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
5593
5764
|
const t = useT();
|
|
5594
5765
|
const { sessionStore } = useAuthClient();
|
|
@@ -5599,7 +5770,7 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
|
5599
5770
|
const [otp, setOtp] = React26.useState("");
|
|
5600
5771
|
const [stage, setStage] = React26.useState("email");
|
|
5601
5772
|
if (stage === "code") {
|
|
5602
|
-
return /* @__PURE__ */ (0,
|
|
5773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5603
5774
|
OtpCodeForm,
|
|
5604
5775
|
{
|
|
5605
5776
|
email,
|
|
@@ -5622,7 +5793,7 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
|
5622
5793
|
}
|
|
5623
5794
|
);
|
|
5624
5795
|
}
|
|
5625
|
-
return /* @__PURE__ */ (0,
|
|
5796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
5626
5797
|
"form",
|
|
5627
5798
|
{
|
|
5628
5799
|
method: "post",
|
|
@@ -5636,9 +5807,9 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
|
5636
5807
|
className: "ba-fields",
|
|
5637
5808
|
"data-testid": "emailotp-email",
|
|
5638
5809
|
children: [
|
|
5639
|
-
/* @__PURE__ */ (0,
|
|
5810
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "ba-label", children: [
|
|
5640
5811
|
t("common.emailLabel"),
|
|
5641
|
-
/* @__PURE__ */ (0,
|
|
5812
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5642
5813
|
"input",
|
|
5643
5814
|
{
|
|
5644
5815
|
className: "ba-input",
|
|
@@ -5654,15 +5825,15 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
|
5654
5825
|
)
|
|
5655
5826
|
] }),
|
|
5656
5827
|
authChallenge.control,
|
|
5657
|
-
/* @__PURE__ */ (0,
|
|
5658
|
-
/* @__PURE__ */ (0,
|
|
5828
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FormError, { children: error }),
|
|
5829
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5659
5830
|
"button",
|
|
5660
5831
|
{
|
|
5661
5832
|
className: "ba-button",
|
|
5662
5833
|
type: "submit",
|
|
5663
5834
|
disabled: pending || authChallenge.configPending,
|
|
5664
5835
|
"aria-busy": pending || void 0,
|
|
5665
|
-
children: /* @__PURE__ */ (0,
|
|
5836
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("emailOtp.requestSubmit") })
|
|
5666
5837
|
}
|
|
5667
5838
|
)
|
|
5668
5839
|
]
|
|
@@ -5677,7 +5848,7 @@ init_i18n();
|
|
|
5677
5848
|
init_use_submit_action();
|
|
5678
5849
|
init_Spinner();
|
|
5679
5850
|
init_FormError();
|
|
5680
|
-
var
|
|
5851
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5681
5852
|
function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
5682
5853
|
const t = useT();
|
|
5683
5854
|
const { resetPassword } = usePasswordReset();
|
|
@@ -5697,15 +5868,15 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
|
5697
5868
|
setReady(true);
|
|
5698
5869
|
}, [tokenProp]);
|
|
5699
5870
|
if (!ready) {
|
|
5700
|
-
return /* @__PURE__ */ (0,
|
|
5871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ba-form", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ba-skeleton" }) });
|
|
5701
5872
|
}
|
|
5702
5873
|
if (!token) {
|
|
5703
|
-
return /* @__PURE__ */ (0,
|
|
5874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormError, { "data-testid": "reset-invalid", children: t("resetPassword.invalidLink") });
|
|
5704
5875
|
}
|
|
5705
5876
|
if (done) {
|
|
5706
|
-
return /* @__PURE__ */ (0,
|
|
5877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "ba-muted", "data-testid": "reset-done", children: t("resetPassword.done") });
|
|
5707
5878
|
}
|
|
5708
|
-
return /* @__PURE__ */ (0,
|
|
5879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
5709
5880
|
"form",
|
|
5710
5881
|
{
|
|
5711
5882
|
method: "post",
|
|
@@ -5731,9 +5902,9 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
|
5731
5902
|
});
|
|
5732
5903
|
},
|
|
5733
5904
|
children: [
|
|
5734
|
-
/* @__PURE__ */ (0,
|
|
5905
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "ba-label", children: [
|
|
5735
5906
|
t("resetPassword.newPasswordLabel"),
|
|
5736
|
-
/* @__PURE__ */ (0,
|
|
5907
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5737
5908
|
"input",
|
|
5738
5909
|
{
|
|
5739
5910
|
className: "ba-input",
|
|
@@ -5750,9 +5921,9 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
|
5750
5921
|
}
|
|
5751
5922
|
)
|
|
5752
5923
|
] }),
|
|
5753
|
-
/* @__PURE__ */ (0,
|
|
5924
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "ba-label", children: [
|
|
5754
5925
|
t("resetPassword.confirmPasswordLabel"),
|
|
5755
|
-
/* @__PURE__ */ (0,
|
|
5926
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5756
5927
|
"input",
|
|
5757
5928
|
{
|
|
5758
5929
|
className: "ba-input",
|
|
@@ -5769,8 +5940,8 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
|
5769
5940
|
}
|
|
5770
5941
|
)
|
|
5771
5942
|
] }),
|
|
5772
|
-
/* @__PURE__ */ (0,
|
|
5773
|
-
/* @__PURE__ */ (0,
|
|
5943
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormError, { children: error }),
|
|
5944
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { className: "ba-button", type: "submit", disabled: pending, "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Busy, { busy: pending, label: t("resetPassword.submitPending"), children: t("resetPassword.submit") }) })
|
|
5774
5945
|
]
|
|
5775
5946
|
}
|
|
5776
5947
|
);
|
|
@@ -5783,7 +5954,7 @@ init_i18n();
|
|
|
5783
5954
|
init_use_submit_action();
|
|
5784
5955
|
init_Spinner();
|
|
5785
5956
|
init_FormError();
|
|
5786
|
-
var
|
|
5957
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
5787
5958
|
function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
|
|
5788
5959
|
const t = useT();
|
|
5789
5960
|
const { sendVerificationEmail } = useEmailVerification();
|
|
@@ -5803,12 +5974,12 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
|
|
|
5803
5974
|
}
|
|
5804
5975
|
}, [onVerified, redirectTo]);
|
|
5805
5976
|
if (!ready) {
|
|
5806
|
-
return /* @__PURE__ */ (0,
|
|
5977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ba-form", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ba-skeleton" }) });
|
|
5807
5978
|
}
|
|
5808
5979
|
if (!failed) {
|
|
5809
|
-
return /* @__PURE__ */ (0,
|
|
5980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ba-muted", "data-testid": "verify-success", children: t("verifyEmail.success") });
|
|
5810
5981
|
}
|
|
5811
|
-
return /* @__PURE__ */ (0,
|
|
5982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5812
5983
|
"form",
|
|
5813
5984
|
{
|
|
5814
5985
|
method: "post",
|
|
@@ -5823,11 +5994,11 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
|
|
|
5823
5994
|
});
|
|
5824
5995
|
},
|
|
5825
5996
|
children: [
|
|
5826
|
-
/* @__PURE__ */ (0,
|
|
5827
|
-
resent ? /* @__PURE__ */ (0,
|
|
5828
|
-
/* @__PURE__ */ (0,
|
|
5997
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FormError, { children: t("verifyEmail.invalidLink") }),
|
|
5998
|
+
resent ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ba-muted", children: richMessage(t("verifyEmail.resent"), { email: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Bidi, { children: email }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5999
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "ba-label", children: [
|
|
5829
6000
|
t("common.emailLabel"),
|
|
5830
|
-
/* @__PURE__ */ (0,
|
|
6001
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5831
6002
|
"input",
|
|
5832
6003
|
{
|
|
5833
6004
|
className: "ba-input",
|
|
@@ -5840,15 +6011,15 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
|
|
|
5840
6011
|
)
|
|
5841
6012
|
] }),
|
|
5842
6013
|
authChallenge.control,
|
|
5843
|
-
/* @__PURE__ */ (0,
|
|
5844
|
-
/* @__PURE__ */ (0,
|
|
6014
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FormError, { children: error }),
|
|
6015
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5845
6016
|
"button",
|
|
5846
6017
|
{
|
|
5847
6018
|
className: "ba-button",
|
|
5848
6019
|
type: "submit",
|
|
5849
6020
|
disabled: pending || authChallenge.configPending,
|
|
5850
6021
|
"aria-busy": pending || void 0,
|
|
5851
|
-
children: /* @__PURE__ */ (0,
|
|
6022
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("verifyEmail.resendSubmit") })
|
|
5852
6023
|
}
|
|
5853
6024
|
)
|
|
5854
6025
|
] })
|
|
@@ -5864,17 +6035,17 @@ init_i18n();
|
|
|
5864
6035
|
init_use_submit_action();
|
|
5865
6036
|
init_Spinner();
|
|
5866
6037
|
init_FormError();
|
|
5867
|
-
var
|
|
6038
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5868
6039
|
function PasskeyManager({ title, allowAdd = true } = {}) {
|
|
5869
6040
|
const t = useT();
|
|
5870
6041
|
const { user, isLoaded, isSignedIn } = useUser();
|
|
5871
6042
|
if (!isLoaded) {
|
|
5872
|
-
return /* @__PURE__ */ (0,
|
|
6043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ba-form", "data-testid": "passkey-manager-loading", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ba-skeleton" }) });
|
|
5873
6044
|
}
|
|
5874
6045
|
if (!isSignedIn || !user) {
|
|
5875
|
-
return /* @__PURE__ */ (0,
|
|
6046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "ba-muted", children: t("passkeys.signedOut") });
|
|
5876
6047
|
}
|
|
5877
|
-
return /* @__PURE__ */ (0,
|
|
6048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PasskeyManagerBody, { title, allowAdd }, user.id);
|
|
5878
6049
|
}
|
|
5879
6050
|
function PasskeyManagerBody({
|
|
5880
6051
|
title,
|
|
@@ -5923,13 +6094,13 @@ function PasskeyManagerBody({
|
|
|
5923
6094
|
onSuccess: load
|
|
5924
6095
|
});
|
|
5925
6096
|
}
|
|
5926
|
-
return /* @__PURE__ */ (0,
|
|
5927
|
-
title !== null && /* @__PURE__ */ (0,
|
|
5928
|
-
passkeys === null ? error ? null : /* @__PURE__ */ (0,
|
|
5929
|
-
(passkeys ?? []).map((pk) => /* @__PURE__ */ (0,
|
|
5930
|
-
/* @__PURE__ */ (0,
|
|
5931
|
-
/* @__PURE__ */ (0,
|
|
5932
|
-
/* @__PURE__ */ (0,
|
|
6097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ba-form", "data-testid": "passkey-manager", children: [
|
|
6098
|
+
title !== null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { className: "ba-title", children: title ?? t("passkeys.title") }),
|
|
6099
|
+
passkeys === null ? error ? null : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ba-skeleton" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("ul", { className: "ba-passkey-list", children: [
|
|
6100
|
+
(passkeys ?? []).map((pk) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("li", { className: "ba-passkey-item", children: [
|
|
6101
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ba-passkey-name", children: pk.name?.trim() || t("passkeys.unnamed") }),
|
|
6102
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "ba-passkey-actions", children: [
|
|
6103
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5933
6104
|
"button",
|
|
5934
6105
|
{
|
|
5935
6106
|
type: "button",
|
|
@@ -5939,7 +6110,7 @@ function PasskeyManagerBody({
|
|
|
5939
6110
|
children: t("passkeys.rename")
|
|
5940
6111
|
}
|
|
5941
6112
|
),
|
|
5942
|
-
/* @__PURE__ */ (0,
|
|
6113
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5943
6114
|
"button",
|
|
5944
6115
|
{
|
|
5945
6116
|
type: "button",
|
|
@@ -5951,13 +6122,13 @@ function PasskeyManagerBody({
|
|
|
5951
6122
|
)
|
|
5952
6123
|
] })
|
|
5953
6124
|
] }, pk.id)),
|
|
5954
|
-
passkeys !== null && passkeys.length === 0 && /* @__PURE__ */ (0,
|
|
6125
|
+
passkeys !== null && passkeys.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { className: "ba-muted", children: t("passkeys.empty") })
|
|
5955
6126
|
] }),
|
|
5956
|
-
error && /* @__PURE__ */ (0,
|
|
5957
|
-
/* @__PURE__ */ (0,
|
|
5958
|
-
passkeys === null && /* @__PURE__ */ (0,
|
|
6127
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ba-inline-error", children: [
|
|
6128
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormError, { children: error }),
|
|
6129
|
+
passkeys === null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void load(), children: t("userProfile.retry") })
|
|
5959
6130
|
] }),
|
|
5960
|
-
passkeys !== null && allowAdd && /* @__PURE__ */ (0,
|
|
6131
|
+
passkeys !== null && allowAdd && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5961
6132
|
"button",
|
|
5962
6133
|
{
|
|
5963
6134
|
className: "ba-button",
|
|
@@ -5968,7 +6139,7 @@ function PasskeyManagerBody({
|
|
|
5968
6139
|
failure: t("passkeys.error.addFailed"),
|
|
5969
6140
|
onSuccess: load
|
|
5970
6141
|
}),
|
|
5971
|
-
children: /* @__PURE__ */ (0,
|
|
6142
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("passkeys.add") })
|
|
5972
6143
|
}
|
|
5973
6144
|
)
|
|
5974
6145
|
] });
|
|
@@ -5979,14 +6150,14 @@ var import_core6 = require("@authowl/core");
|
|
|
5979
6150
|
init_hooks();
|
|
5980
6151
|
init_i18n();
|
|
5981
6152
|
init_Spinner();
|
|
5982
|
-
var
|
|
6153
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5983
6154
|
function SignedIn({ children }) {
|
|
5984
6155
|
const { isLoaded, isSignedIn } = useUser();
|
|
5985
|
-
return isLoaded && isSignedIn ? /* @__PURE__ */ (0,
|
|
6156
|
+
return isLoaded && isSignedIn ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children }) : null;
|
|
5986
6157
|
}
|
|
5987
6158
|
function SignedOut({ children }) {
|
|
5988
6159
|
const { isLoaded, isSignedIn } = useUser();
|
|
5989
|
-
return isLoaded && !isSignedIn ? /* @__PURE__ */ (0,
|
|
6160
|
+
return isLoaded && !isSignedIn ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children }) : null;
|
|
5990
6161
|
}
|
|
5991
6162
|
function Protect({
|
|
5992
6163
|
children,
|
|
@@ -5999,25 +6170,25 @@ function Protect({
|
|
|
5999
6170
|
const { user, isLoaded, isSignedIn } = useUser();
|
|
6000
6171
|
const membership = useSession().data?.session?.membership ?? null;
|
|
6001
6172
|
if (!isLoaded) return null;
|
|
6002
|
-
if (!isSignedIn || !user) return /* @__PURE__ */ (0,
|
|
6173
|
+
if (!isSignedIn || !user) return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: fallback });
|
|
6003
6174
|
if ((role !== void 0 || permission !== void 0 || teamId !== void 0) && !(0, import_core6.membershipHas)(membership, { role, permission, teamId })) {
|
|
6004
|
-
return /* @__PURE__ */ (0,
|
|
6175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: fallback });
|
|
6005
6176
|
}
|
|
6006
|
-
if (condition && !condition(user)) return /* @__PURE__ */ (0,
|
|
6007
|
-
return /* @__PURE__ */ (0,
|
|
6177
|
+
if (condition && !condition(user)) return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: fallback });
|
|
6178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children });
|
|
6008
6179
|
}
|
|
6009
6180
|
function AuthLoading({ children }) {
|
|
6010
6181
|
const t = useT();
|
|
6011
6182
|
const { isLoaded } = useUser();
|
|
6012
6183
|
if (isLoaded) return null;
|
|
6013
|
-
if (children !== void 0) return /* @__PURE__ */ (0,
|
|
6014
|
-
return /* @__PURE__ */ (0,
|
|
6015
|
-
/* @__PURE__ */ (0,
|
|
6016
|
-
/* @__PURE__ */ (0,
|
|
6184
|
+
if (children !== void 0) return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children });
|
|
6185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "ba-auth-loading", role: "status", "aria-busy": "true", "data-testid": "auth-loading", children: [
|
|
6186
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Spinner, {}),
|
|
6187
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "ba-sr-only", children: t("common.loading") })
|
|
6017
6188
|
] });
|
|
6018
6189
|
}
|
|
6019
6190
|
function AuthLoaded({ children }) {
|
|
6020
|
-
return useUser().isLoaded ? /* @__PURE__ */ (0,
|
|
6191
|
+
return useUser().isLoaded ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children }) : null;
|
|
6021
6192
|
}
|
|
6022
6193
|
|
|
6023
6194
|
// src/index.ts
|
|
@@ -6028,13 +6199,13 @@ var React30 = __toESM(require("react"), 1);
|
|
|
6028
6199
|
init_hooks();
|
|
6029
6200
|
init_i18n();
|
|
6030
6201
|
init_Spinner();
|
|
6031
|
-
var
|
|
6202
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6032
6203
|
function SignOutButton({ children, redirectTo, onSignedOut, className }) {
|
|
6033
6204
|
const t = useT();
|
|
6034
6205
|
const { signOut } = useSignOut();
|
|
6035
6206
|
const [pending, setPending] = React30.useState(false);
|
|
6036
6207
|
const content = children ?? t("signOut.button");
|
|
6037
|
-
return /* @__PURE__ */ (0,
|
|
6208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6038
6209
|
"button",
|
|
6039
6210
|
{
|
|
6040
6211
|
type: "button",
|
|
@@ -6052,7 +6223,7 @@ function SignOutButton({ children, redirectTo, onSignedOut, className }) {
|
|
|
6052
6223
|
setPending(false);
|
|
6053
6224
|
}
|
|
6054
6225
|
},
|
|
6055
|
-
children: /* @__PURE__ */ (0,
|
|
6226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Busy, { busy: pending, label: content, children: content })
|
|
6056
6227
|
}
|
|
6057
6228
|
);
|
|
6058
6229
|
}
|
|
@@ -6074,7 +6245,7 @@ init_i18n();
|
|
|
6074
6245
|
init_use_submit_action();
|
|
6075
6246
|
init_Spinner();
|
|
6076
6247
|
init_FormError();
|
|
6077
|
-
var
|
|
6248
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6078
6249
|
function EmailSection({ allowChange }) {
|
|
6079
6250
|
const t = useT();
|
|
6080
6251
|
const account = useAccount();
|
|
@@ -6084,9 +6255,9 @@ function EmailSection({ allowChange }) {
|
|
|
6084
6255
|
const [sent, setSent] = React31.useState(false);
|
|
6085
6256
|
const titleId = React31.useId();
|
|
6086
6257
|
if (!user?.email) {
|
|
6087
|
-
return /* @__PURE__ */ (0,
|
|
6088
|
-
/* @__PURE__ */ (0,
|
|
6089
|
-
/* @__PURE__ */ (0,
|
|
6258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6259
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.email.title") }),
|
|
6260
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "ba-muted", children: t("userProfile.email.unavailable") })
|
|
6090
6261
|
] });
|
|
6091
6262
|
}
|
|
6092
6263
|
const submit = (event) => {
|
|
@@ -6106,19 +6277,19 @@ function EmailSection({ allowChange }) {
|
|
|
6106
6277
|
}
|
|
6107
6278
|
);
|
|
6108
6279
|
};
|
|
6109
|
-
return /* @__PURE__ */ (0,
|
|
6110
|
-
/* @__PURE__ */ (0,
|
|
6111
|
-
/* @__PURE__ */ (0,
|
|
6112
|
-
/* @__PURE__ */ (0,
|
|
6280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6281
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6282
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.email.title") }),
|
|
6283
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "ba-muted", children: t("userProfile.email.description") })
|
|
6113
6284
|
] }),
|
|
6114
|
-
/* @__PURE__ */ (0,
|
|
6115
|
-
/* @__PURE__ */ (0,
|
|
6116
|
-
/* @__PURE__ */ (0,
|
|
6285
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "ba-profile-current", children: [
|
|
6286
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: t("userProfile.email.current") }),
|
|
6287
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Bidi, { children: user.email }) })
|
|
6117
6288
|
] }),
|
|
6118
|
-
!allowChange ? /* @__PURE__ */ (0,
|
|
6119
|
-
/* @__PURE__ */ (0,
|
|
6289
|
+
!allowChange ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "ba-muted", "data-testid": "email-change-disabled", children: t("userProfile.email.changeDisabled") }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6290
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: "ba-label", children: [
|
|
6120
6291
|
t("userProfile.email.newLabel"),
|
|
6121
|
-
/* @__PURE__ */ (0,
|
|
6292
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6122
6293
|
"input",
|
|
6123
6294
|
{
|
|
6124
6295
|
className: "ba-input",
|
|
@@ -6130,16 +6301,16 @@ function EmailSection({ allowChange }) {
|
|
|
6130
6301
|
}
|
|
6131
6302
|
)
|
|
6132
6303
|
] }),
|
|
6133
|
-
/* @__PURE__ */ (0,
|
|
6134
|
-
sent && /* @__PURE__ */ (0,
|
|
6135
|
-
/* @__PURE__ */ (0,
|
|
6304
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(FormError, { children: error }),
|
|
6305
|
+
sent && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "ba-success", role: "status", children: t("userProfile.email.sent") }),
|
|
6306
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6136
6307
|
"button",
|
|
6137
6308
|
{
|
|
6138
6309
|
className: "ba-button ba-profile-submit",
|
|
6139
6310
|
type: "submit",
|
|
6140
6311
|
disabled: pending || !newEmail.trim(),
|
|
6141
6312
|
"aria-busy": pending || void 0,
|
|
6142
|
-
children: /* @__PURE__ */ (0,
|
|
6313
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("userProfile.email.submit") })
|
|
6143
6314
|
}
|
|
6144
6315
|
)
|
|
6145
6316
|
] })
|
|
@@ -6153,7 +6324,7 @@ init_i18n();
|
|
|
6153
6324
|
init_use_submit_action();
|
|
6154
6325
|
init_Spinner();
|
|
6155
6326
|
init_FormError();
|
|
6156
|
-
var
|
|
6327
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6157
6328
|
function DeleteAccountSection({ onDeleted }) {
|
|
6158
6329
|
const t = useT();
|
|
6159
6330
|
const account = useAccount();
|
|
@@ -6178,18 +6349,18 @@ function DeleteAccountSection({ onDeleted }) {
|
|
|
6178
6349
|
}
|
|
6179
6350
|
);
|
|
6180
6351
|
};
|
|
6181
|
-
return /* @__PURE__ */ (0,
|
|
6182
|
-
/* @__PURE__ */ (0,
|
|
6183
|
-
/* @__PURE__ */ (0,
|
|
6184
|
-
/* @__PURE__ */ (0,
|
|
6352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: "ba-profile-section ba-profile-danger-zone", "aria-labelledby": titleId, children: [
|
|
6353
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6354
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.delete.title") }),
|
|
6355
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "ba-muted", children: t("userProfile.delete.description") })
|
|
6185
6356
|
] }),
|
|
6186
|
-
/* @__PURE__ */ (0,
|
|
6187
|
-
/* @__PURE__ */ (0,
|
|
6188
|
-
/* @__PURE__ */ (0,
|
|
6357
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6358
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "ba-profile-delete-warning", children: t("userProfile.delete.warning", { identifier }) }),
|
|
6359
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "ba-label", children: [
|
|
6189
6360
|
t("userProfile.delete.confirmLabel"),
|
|
6190
6361
|
" ",
|
|
6191
|
-
/* @__PURE__ */ (0,
|
|
6192
|
-
/* @__PURE__ */ (0,
|
|
6362
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Bidi, { children: identifier }),
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6193
6364
|
"input",
|
|
6194
6365
|
{
|
|
6195
6366
|
className: "ba-input",
|
|
@@ -6203,15 +6374,15 @@ function DeleteAccountSection({ onDeleted }) {
|
|
|
6203
6374
|
}
|
|
6204
6375
|
)
|
|
6205
6376
|
] }),
|
|
6206
|
-
/* @__PURE__ */ (0,
|
|
6207
|
-
/* @__PURE__ */ (0,
|
|
6377
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormError, { children: error }),
|
|
6378
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6208
6379
|
"button",
|
|
6209
6380
|
{
|
|
6210
6381
|
className: "ba-button ba-danger-button ba-profile-submit",
|
|
6211
6382
|
type: "submit",
|
|
6212
6383
|
disabled: pending || !confirmed,
|
|
6213
6384
|
"aria-busy": pending || void 0,
|
|
6214
|
-
children: /* @__PURE__ */ (0,
|
|
6385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.delete.submit") })
|
|
6215
6386
|
}
|
|
6216
6387
|
)
|
|
6217
6388
|
] })
|
|
@@ -6225,7 +6396,7 @@ init_i18n();
|
|
|
6225
6396
|
init_use_submit_action();
|
|
6226
6397
|
init_Spinner();
|
|
6227
6398
|
init_FormError();
|
|
6228
|
-
var
|
|
6399
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
6229
6400
|
function MfaSection() {
|
|
6230
6401
|
const t = useT();
|
|
6231
6402
|
const { user } = useUser();
|
|
@@ -6238,12 +6409,12 @@ function MfaSection() {
|
|
|
6238
6409
|
const titleId = React33.useId();
|
|
6239
6410
|
const required = (0, import_core3.resolveProjectCapabilities)(config).mfaRequired;
|
|
6240
6411
|
if (!user?.twoFactorEnabled) {
|
|
6241
|
-
return /* @__PURE__ */ (0,
|
|
6242
|
-
/* @__PURE__ */ (0,
|
|
6243
|
-
/* @__PURE__ */ (0,
|
|
6244
|
-
/* @__PURE__ */ (0,
|
|
6412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6413
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6414
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.mfa.title") }),
|
|
6415
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "ba-muted", children: required ? t("userProfile.mfa.requiredDescription") : t("userProfile.mfa.description") })
|
|
6245
6416
|
] }),
|
|
6246
|
-
/* @__PURE__ */ (0,
|
|
6417
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6247
6418
|
MFAEnrollment,
|
|
6248
6419
|
{
|
|
6249
6420
|
title: null,
|
|
@@ -6266,16 +6437,16 @@ function MfaSection() {
|
|
|
6266
6437
|
}
|
|
6267
6438
|
);
|
|
6268
6439
|
};
|
|
6269
|
-
return /* @__PURE__ */ (0,
|
|
6270
|
-
/* @__PURE__ */ (0,
|
|
6271
|
-
/* @__PURE__ */ (0,
|
|
6272
|
-
/* @__PURE__ */ (0,
|
|
6440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6441
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6442
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.mfa.title") }),
|
|
6443
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "ba-muted", children: required ? t("userProfile.mfa.requiredActive") : t("userProfile.mfa.active") })
|
|
6273
6444
|
] }),
|
|
6274
|
-
/* @__PURE__ */ (0,
|
|
6275
|
-
/* @__PURE__ */ (0,
|
|
6276
|
-
/* @__PURE__ */ (0,
|
|
6445
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "ba-profile-status", role: "status", children: [
|
|
6446
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: t("userProfile.mfa.enabled") }),
|
|
6447
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: t("userProfile.mfa.authenticator") })
|
|
6277
6448
|
] }),
|
|
6278
|
-
!showDisable ? /* @__PURE__ */ (0,
|
|
6449
|
+
!showDisable ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6279
6450
|
"button",
|
|
6280
6451
|
{
|
|
6281
6452
|
className: "ba-button ba-button-secondary ba-profile-submit",
|
|
@@ -6283,11 +6454,11 @@ function MfaSection() {
|
|
|
6283
6454
|
onClick: () => setShowDisable(true),
|
|
6284
6455
|
children: required ? t("userProfile.mfa.replace") : t("userProfile.mfa.disable")
|
|
6285
6456
|
}
|
|
6286
|
-
) : /* @__PURE__ */ (0,
|
|
6287
|
-
/* @__PURE__ */ (0,
|
|
6288
|
-
/* @__PURE__ */ (0,
|
|
6457
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("form", { method: "post", className: "ba-fields ba-profile-security-form", onSubmit: submitDisable, children: [
|
|
6458
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "ba-muted", children: required ? t("userProfile.mfa.replaceWarning") : t("userProfile.mfa.disableWarning") }),
|
|
6459
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "ba-label", children: [
|
|
6289
6460
|
t("common.passwordLabel"),
|
|
6290
|
-
/* @__PURE__ */ (0,
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6291
6462
|
"input",
|
|
6292
6463
|
{
|
|
6293
6464
|
className: "ba-input",
|
|
@@ -6299,19 +6470,19 @@ function MfaSection() {
|
|
|
6299
6470
|
}
|
|
6300
6471
|
)
|
|
6301
6472
|
] }),
|
|
6302
|
-
/* @__PURE__ */ (0,
|
|
6303
|
-
/* @__PURE__ */ (0,
|
|
6304
|
-
/* @__PURE__ */ (0,
|
|
6473
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormError, { children: error }),
|
|
6474
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "ba-profile-action-row", children: [
|
|
6475
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6305
6476
|
"button",
|
|
6306
6477
|
{
|
|
6307
6478
|
className: "ba-button ba-danger-button",
|
|
6308
6479
|
type: "submit",
|
|
6309
6480
|
disabled: pending || !password,
|
|
6310
6481
|
"aria-busy": pending || void 0,
|
|
6311
|
-
children: /* @__PURE__ */ (0,
|
|
6482
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Busy, { busy: pending, label: t("common.working"), children: required ? t("userProfile.mfa.replaceConfirm") : t("userProfile.mfa.disableConfirm") })
|
|
6312
6483
|
}
|
|
6313
6484
|
),
|
|
6314
|
-
/* @__PURE__ */ (0,
|
|
6485
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6315
6486
|
"button",
|
|
6316
6487
|
{
|
|
6317
6488
|
className: "ba-button ba-button-secondary",
|
|
@@ -6336,7 +6507,7 @@ init_i18n();
|
|
|
6336
6507
|
init_use_submit_action();
|
|
6337
6508
|
init_Spinner();
|
|
6338
6509
|
init_FormError();
|
|
6339
|
-
var
|
|
6510
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
6340
6511
|
function PasswordSection() {
|
|
6341
6512
|
const t = useT();
|
|
6342
6513
|
const account = useAccount();
|
|
@@ -6372,43 +6543,43 @@ function PasswordSection() {
|
|
|
6372
6543
|
}
|
|
6373
6544
|
);
|
|
6374
6545
|
};
|
|
6375
|
-
return /* @__PURE__ */ (0,
|
|
6376
|
-
/* @__PURE__ */ (0,
|
|
6377
|
-
/* @__PURE__ */ (0,
|
|
6378
|
-
/* @__PURE__ */ (0,
|
|
6546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6547
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6548
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.password.title") }),
|
|
6549
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "ba-muted", children: t("userProfile.password.description") })
|
|
6379
6550
|
] }),
|
|
6380
|
-
/* @__PURE__ */ (0,
|
|
6381
|
-
/* @__PURE__ */ (0,
|
|
6551
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6552
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "ba-label", children: [
|
|
6382
6553
|
t("userProfile.password.currentLabel"),
|
|
6383
|
-
/* @__PURE__ */ (0,
|
|
6554
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { className: "ba-input", type: "password", autoComplete: "current-password", value: currentPassword, onChange: (event) => {
|
|
6384
6555
|
setCurrentPassword(event.target.value);
|
|
6385
6556
|
setError(null);
|
|
6386
6557
|
}, required: true })
|
|
6387
6558
|
] }),
|
|
6388
|
-
/* @__PURE__ */ (0,
|
|
6559
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "ba-label", children: [
|
|
6389
6560
|
t("resetPassword.newPasswordLabel"),
|
|
6390
|
-
/* @__PURE__ */ (0,
|
|
6561
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { className: "ba-input", type: "password", autoComplete: "new-password", value: newPassword, onChange: (event) => {
|
|
6391
6562
|
setNewPassword(event.target.value);
|
|
6392
6563
|
setError(null);
|
|
6393
6564
|
}, minLength: passwordMinLength, maxLength: passwordMaxLength, required: true })
|
|
6394
6565
|
] }),
|
|
6395
|
-
/* @__PURE__ */ (0,
|
|
6566
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "ba-label", children: [
|
|
6396
6567
|
t("resetPassword.confirmPasswordLabel"),
|
|
6397
|
-
/* @__PURE__ */ (0,
|
|
6568
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { className: "ba-input", type: "password", autoComplete: "new-password", value: confirmPassword, onChange: (event) => {
|
|
6398
6569
|
setConfirmPassword(event.target.value);
|
|
6399
6570
|
setError(null);
|
|
6400
6571
|
}, minLength: passwordMinLength, maxLength: passwordMaxLength, required: true })
|
|
6401
6572
|
] }),
|
|
6402
|
-
/* @__PURE__ */ (0,
|
|
6403
|
-
saved && /* @__PURE__ */ (0,
|
|
6404
|
-
/* @__PURE__ */ (0,
|
|
6573
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormError, { children: error }),
|
|
6574
|
+
saved && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "ba-success", role: "status", children: t("userProfile.password.saved") }),
|
|
6575
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
6405
6576
|
"button",
|
|
6406
6577
|
{
|
|
6407
6578
|
className: "ba-button ba-profile-submit",
|
|
6408
6579
|
type: "submit",
|
|
6409
6580
|
disabled: pending || !currentPassword || !newPassword || !confirmPassword,
|
|
6410
6581
|
"aria-busy": pending || void 0,
|
|
6411
|
-
children: /* @__PURE__ */ (0,
|
|
6582
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.password.submit") })
|
|
6412
6583
|
}
|
|
6413
6584
|
)
|
|
6414
6585
|
] })
|
|
@@ -6418,16 +6589,16 @@ function PasswordSection() {
|
|
|
6418
6589
|
// src/components/user-profile/PasskeysSection.tsx
|
|
6419
6590
|
var React35 = __toESM(require("react"), 1);
|
|
6420
6591
|
init_i18n();
|
|
6421
|
-
var
|
|
6592
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
6422
6593
|
function PasskeysSection({ allowAdd }) {
|
|
6423
6594
|
const t = useT();
|
|
6424
6595
|
const titleId = React35.useId();
|
|
6425
|
-
return /* @__PURE__ */ (0,
|
|
6426
|
-
/* @__PURE__ */ (0,
|
|
6427
|
-
/* @__PURE__ */ (0,
|
|
6428
|
-
/* @__PURE__ */ (0,
|
|
6596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6597
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6598
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.passkeys.title") }),
|
|
6599
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "ba-muted", children: t("userProfile.passkeys.description") })
|
|
6429
6600
|
] }),
|
|
6430
|
-
/* @__PURE__ */ (0,
|
|
6601
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PasskeyManager, { title: null, allowAdd })
|
|
6431
6602
|
] });
|
|
6432
6603
|
}
|
|
6433
6604
|
|
|
@@ -6438,7 +6609,7 @@ init_i18n();
|
|
|
6438
6609
|
init_use_submit_action();
|
|
6439
6610
|
init_Spinner();
|
|
6440
6611
|
init_FormError();
|
|
6441
|
-
var
|
|
6612
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6442
6613
|
function ProfileSection({
|
|
6443
6614
|
firstLastName,
|
|
6444
6615
|
usernameEnabled,
|
|
@@ -6480,15 +6651,15 @@ function ProfileSection({
|
|
|
6480
6651
|
}
|
|
6481
6652
|
);
|
|
6482
6653
|
};
|
|
6483
|
-
return /* @__PURE__ */ (0,
|
|
6484
|
-
/* @__PURE__ */ (0,
|
|
6485
|
-
/* @__PURE__ */ (0,
|
|
6486
|
-
/* @__PURE__ */ (0,
|
|
6654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6655
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6656
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.profile.title") }),
|
|
6657
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "ba-muted", children: t("userProfile.profile.description") })
|
|
6487
6658
|
] }),
|
|
6488
|
-
/* @__PURE__ */ (0,
|
|
6489
|
-
legacyNameField && /* @__PURE__ */ (0,
|
|
6659
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6660
|
+
legacyNameField && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6490
6661
|
t("signUp.nameLabel"),
|
|
6491
|
-
/* @__PURE__ */ (0,
|
|
6662
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6492
6663
|
"input",
|
|
6493
6664
|
{
|
|
6494
6665
|
className: "ba-input",
|
|
@@ -6499,10 +6670,10 @@ function ProfileSection({
|
|
|
6499
6670
|
}
|
|
6500
6671
|
)
|
|
6501
6672
|
] }),
|
|
6502
|
-
firstLastName && /* @__PURE__ */ (0,
|
|
6503
|
-
/* @__PURE__ */ (0,
|
|
6673
|
+
firstLastName && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
6674
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6504
6675
|
t("signUp.firstNameLabel"),
|
|
6505
|
-
/* @__PURE__ */ (0,
|
|
6676
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6506
6677
|
"input",
|
|
6507
6678
|
{
|
|
6508
6679
|
className: "ba-input",
|
|
@@ -6512,9 +6683,9 @@ function ProfileSection({
|
|
|
6512
6683
|
}
|
|
6513
6684
|
)
|
|
6514
6685
|
] }),
|
|
6515
|
-
/* @__PURE__ */ (0,
|
|
6686
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6516
6687
|
t("signUp.lastNameLabel"),
|
|
6517
|
-
/* @__PURE__ */ (0,
|
|
6688
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6518
6689
|
"input",
|
|
6519
6690
|
{
|
|
6520
6691
|
className: "ba-input",
|
|
@@ -6525,9 +6696,9 @@ function ProfileSection({
|
|
|
6525
6696
|
)
|
|
6526
6697
|
] })
|
|
6527
6698
|
] }),
|
|
6528
|
-
usernameEnabled && /* @__PURE__ */ (0,
|
|
6699
|
+
usernameEnabled && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6529
6700
|
t("common.usernameLabel"),
|
|
6530
|
-
/* @__PURE__ */ (0,
|
|
6701
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6531
6702
|
"input",
|
|
6532
6703
|
{
|
|
6533
6704
|
className: "ba-input",
|
|
@@ -6537,9 +6708,9 @@ function ProfileSection({
|
|
|
6537
6708
|
}
|
|
6538
6709
|
)
|
|
6539
6710
|
] }),
|
|
6540
|
-
/* @__PURE__ */ (0,
|
|
6711
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6541
6712
|
t("userProfile.profile.imageLabel"),
|
|
6542
|
-
/* @__PURE__ */ (0,
|
|
6713
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6543
6714
|
"input",
|
|
6544
6715
|
{
|
|
6545
6716
|
className: "ba-input",
|
|
@@ -6550,16 +6721,16 @@ function ProfileSection({
|
|
|
6550
6721
|
}
|
|
6551
6722
|
)
|
|
6552
6723
|
] }),
|
|
6553
|
-
/* @__PURE__ */ (0,
|
|
6554
|
-
saved && /* @__PURE__ */ (0,
|
|
6555
|
-
/* @__PURE__ */ (0,
|
|
6724
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormError, { children: error }),
|
|
6725
|
+
saved && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "ba-success", role: "status", children: t("userProfile.profile.saved") }),
|
|
6726
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6556
6727
|
"button",
|
|
6557
6728
|
{
|
|
6558
6729
|
className: "ba-button ba-profile-submit",
|
|
6559
6730
|
type: "submit",
|
|
6560
6731
|
disabled: pending || legacyNameField && !name.trim(),
|
|
6561
6732
|
"aria-busy": pending || void 0,
|
|
6562
|
-
children: /* @__PURE__ */ (0,
|
|
6733
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.save") })
|
|
6563
6734
|
}
|
|
6564
6735
|
)
|
|
6565
6736
|
] })
|
|
@@ -6570,24 +6741,24 @@ function ProfileSection({
|
|
|
6570
6741
|
var React37 = __toESM(require("react"), 1);
|
|
6571
6742
|
init_hooks();
|
|
6572
6743
|
init_i18n();
|
|
6573
|
-
var
|
|
6744
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6574
6745
|
function RecoverySection() {
|
|
6575
6746
|
const t = useT();
|
|
6576
6747
|
const { user } = useUser();
|
|
6577
6748
|
const titleId = React37.useId();
|
|
6578
|
-
return /* @__PURE__ */ (0,
|
|
6579
|
-
/* @__PURE__ */ (0,
|
|
6580
|
-
/* @__PURE__ */ (0,
|
|
6581
|
-
/* @__PURE__ */ (0,
|
|
6749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6750
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6751
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.recovery.title") }),
|
|
6752
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "ba-muted", children: t("userProfile.recovery.description") })
|
|
6582
6753
|
] }),
|
|
6583
|
-
/* @__PURE__ */ (0,
|
|
6584
|
-
/* @__PURE__ */ (0,
|
|
6585
|
-
user?.email && user.emailVerified ? /* @__PURE__ */ (0,
|
|
6586
|
-
/* @__PURE__ */ (0,
|
|
6587
|
-
/* @__PURE__ */ (0,
|
|
6588
|
-
] }) : /* @__PURE__ */ (0,
|
|
6754
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "ba-profile-recovery-card", children: [
|
|
6755
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("strong", { children: t("userProfile.recovery.emailTitle") }),
|
|
6756
|
+
user?.email && user.emailVerified ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
6757
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { children: t("userProfile.recovery.emailDescription") }),
|
|
6758
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Bidi, { children: user.email })
|
|
6759
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { children: t("userProfile.recovery.emailUnavailable") })
|
|
6589
6760
|
] }),
|
|
6590
|
-
/* @__PURE__ */ (0,
|
|
6761
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(BackupCodesManager, { title: null })
|
|
6591
6762
|
] });
|
|
6592
6763
|
}
|
|
6593
6764
|
|
|
@@ -6644,9 +6815,9 @@ function formatSessionTime(date, locale) {
|
|
|
6644
6815
|
// src/components/user-profile/use-account-resource.ts
|
|
6645
6816
|
var React38 = __toESM(require("react"), 1);
|
|
6646
6817
|
init_i18n();
|
|
6647
|
-
function useAccountResource(
|
|
6648
|
-
const loaderRef = React38.useRef(
|
|
6649
|
-
loaderRef.current =
|
|
6818
|
+
function useAccountResource(loader, failure) {
|
|
6819
|
+
const loaderRef = React38.useRef(loader);
|
|
6820
|
+
loaderRef.current = loader;
|
|
6650
6821
|
const failureRef = React38.useRef(failure);
|
|
6651
6822
|
failureRef.current = failure;
|
|
6652
6823
|
const toServerError = useServerError();
|
|
@@ -6684,7 +6855,7 @@ function useAccountResource(loader2, failure) {
|
|
|
6684
6855
|
|
|
6685
6856
|
// src/components/user-profile/SessionsSection.tsx
|
|
6686
6857
|
init_FormError();
|
|
6687
|
-
var
|
|
6858
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
6688
6859
|
function SessionsSection() {
|
|
6689
6860
|
const t = useT();
|
|
6690
6861
|
const locale = useLocale();
|
|
@@ -6713,31 +6884,31 @@ function SessionsSection() {
|
|
|
6713
6884
|
}
|
|
6714
6885
|
);
|
|
6715
6886
|
};
|
|
6716
|
-
return /* @__PURE__ */ (0,
|
|
6717
|
-
/* @__PURE__ */ (0,
|
|
6718
|
-
/* @__PURE__ */ (0,
|
|
6719
|
-
/* @__PURE__ */ (0,
|
|
6887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6888
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6889
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.sessions.title") }),
|
|
6890
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "ba-muted", children: t("userProfile.sessions.description") })
|
|
6720
6891
|
] }),
|
|
6721
|
-
resource.data === null ? resource.loading ? /* @__PURE__ */ (0,
|
|
6722
|
-
/* @__PURE__ */ (0,
|
|
6723
|
-
/* @__PURE__ */ (0,
|
|
6724
|
-
] }) : null : /* @__PURE__ */ (0,
|
|
6892
|
+
resource.data === null ? resource.loading ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "ba-profile-list-skeleton", "aria-busy": "true", children: [
|
|
6893
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ba-skeleton" }),
|
|
6894
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ba-skeleton" })
|
|
6895
|
+
] }) : null : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("ul", { className: "ba-profile-list", children: [
|
|
6725
6896
|
sessions.map((session) => {
|
|
6726
6897
|
const label2 = session.userAgent?.trim() || t("userProfile.sessions.unknownDevice");
|
|
6727
|
-
return /* @__PURE__ */ (0,
|
|
6728
|
-
/* @__PURE__ */ (0,
|
|
6729
|
-
/* @__PURE__ */ (0,
|
|
6730
|
-
/* @__PURE__ */ (0,
|
|
6731
|
-
session.id === currentId && /* @__PURE__ */ (0,
|
|
6898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("li", { className: "ba-profile-list-item", children: [
|
|
6899
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
6900
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: label2 }),
|
|
6901
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("small", { children: [
|
|
6902
|
+
session.id === currentId && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("em", { children: t("userProfile.sessions.current") }),
|
|
6732
6903
|
formatSessionTime(session.updatedAt, locale)
|
|
6733
6904
|
] })
|
|
6734
6905
|
] }),
|
|
6735
|
-
/* @__PURE__ */ (0,
|
|
6906
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: mutation.pending, onClick: () => revoke(session.id, label2), children: t("userProfile.sessions.revoke") })
|
|
6736
6907
|
] }, session.id);
|
|
6737
6908
|
}),
|
|
6738
|
-
sessions.length === 0 && /* @__PURE__ */ (0,
|
|
6909
|
+
sessions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { className: "ba-muted", children: t("userProfile.sessions.empty") })
|
|
6739
6910
|
] }),
|
|
6740
|
-
sessions.some((session) => session.id !== currentId) && /* @__PURE__ */ (0,
|
|
6911
|
+
sessions.some((session) => session.id !== currentId) && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6741
6912
|
"button",
|
|
6742
6913
|
{
|
|
6743
6914
|
className: "ba-button ba-button-secondary ba-profile-submit",
|
|
@@ -6753,11 +6924,11 @@ function SessionsSection() {
|
|
|
6753
6924
|
children: t("userProfile.sessions.revokeOthers")
|
|
6754
6925
|
}
|
|
6755
6926
|
),
|
|
6756
|
-
resource.error && /* @__PURE__ */ (0,
|
|
6757
|
-
/* @__PURE__ */ (0,
|
|
6758
|
-
/* @__PURE__ */ (0,
|
|
6927
|
+
resource.error && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "ba-profile-inline-error", children: [
|
|
6928
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FormError, { children: resource.error }),
|
|
6929
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void resource.load(), children: t("userProfile.retry") })
|
|
6759
6930
|
] }),
|
|
6760
|
-
/* @__PURE__ */ (0,
|
|
6931
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FormError, { children: mutation.error })
|
|
6761
6932
|
] });
|
|
6762
6933
|
}
|
|
6763
6934
|
|
|
@@ -6767,7 +6938,7 @@ init_hooks();
|
|
|
6767
6938
|
init_i18n();
|
|
6768
6939
|
init_use_submit_action();
|
|
6769
6940
|
init_FormError();
|
|
6770
|
-
var
|
|
6941
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6771
6942
|
function providerLabel(provider) {
|
|
6772
6943
|
return provider.charAt(0).toUpperCase() + provider.slice(1);
|
|
6773
6944
|
}
|
|
@@ -6807,18 +6978,18 @@ function SocialSection() {
|
|
|
6807
6978
|
{ failure: t("userProfile.social.unlinkError"), onSuccess: resource.load }
|
|
6808
6979
|
);
|
|
6809
6980
|
};
|
|
6810
|
-
return /* @__PURE__ */ (0,
|
|
6811
|
-
/* @__PURE__ */ (0,
|
|
6812
|
-
/* @__PURE__ */ (0,
|
|
6813
|
-
/* @__PURE__ */ (0,
|
|
6981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6982
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6983
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.social.title") }),
|
|
6984
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "ba-muted", children: t("userProfile.social.description") })
|
|
6814
6985
|
] }),
|
|
6815
|
-
resource.data === null ? resource.loading ? /* @__PURE__ */ (0,
|
|
6816
|
-
linked.map((item) => /* @__PURE__ */ (0,
|
|
6817
|
-
/* @__PURE__ */ (0,
|
|
6818
|
-
/* @__PURE__ */ (0,
|
|
6819
|
-
/* @__PURE__ */ (0,
|
|
6986
|
+
resource.data === null ? resource.loading ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "ba-profile-list-skeleton", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "ba-skeleton" }) }) : null : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("ul", { className: "ba-profile-list", children: [
|
|
6987
|
+
linked.map((item) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("li", { className: "ba-profile-list-item", children: [
|
|
6988
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
|
|
6989
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: providerLabel(item.providerId) }),
|
|
6990
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: item.canUnlink ? t("userProfile.social.connected") : t("userProfile.social.lastMethod") })
|
|
6820
6991
|
] }),
|
|
6821
|
-
/* @__PURE__ */ (0,
|
|
6992
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6822
6993
|
"button",
|
|
6823
6994
|
{
|
|
6824
6995
|
className: "ba-link-button ba-danger",
|
|
@@ -6833,17 +7004,17 @@ function SocialSection() {
|
|
|
6833
7004
|
}
|
|
6834
7005
|
)
|
|
6835
7006
|
] }, item.id)),
|
|
6836
|
-
linked.length === 0 && /* @__PURE__ */ (0,
|
|
7007
|
+
linked.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { className: "ba-muted", children: t("userProfile.social.empty") })
|
|
6837
7008
|
] }),
|
|
6838
|
-
available.length > 0 && /* @__PURE__ */ (0,
|
|
6839
|
-
/* @__PURE__ */ (0,
|
|
6840
|
-
available.map((provider) => /* @__PURE__ */ (0,
|
|
7009
|
+
available.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "ba-profile-provider-actions", children: [
|
|
7010
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "ba-profile-subtitle", children: t("userProfile.social.add") }),
|
|
7011
|
+
available.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", className: "ba-button ba-button-secondary", disabled: mutation.pending, onClick: () => link(provider), children: t("userProfile.social.connectProvider", { provider: providerLabel(provider) }) }, provider))
|
|
6841
7012
|
] }),
|
|
6842
|
-
resource.error && /* @__PURE__ */ (0,
|
|
6843
|
-
/* @__PURE__ */ (0,
|
|
6844
|
-
/* @__PURE__ */ (0,
|
|
7013
|
+
resource.error && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "ba-profile-inline-error", children: [
|
|
7014
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormError, { children: resource.error }),
|
|
7015
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void resource.load(), children: t("userProfile.retry") })
|
|
6845
7016
|
] }),
|
|
6846
|
-
/* @__PURE__ */ (0,
|
|
7017
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormError, { children: mutation.error })
|
|
6847
7018
|
] });
|
|
6848
7019
|
}
|
|
6849
7020
|
|
|
@@ -6851,7 +7022,7 @@ function SocialSection() {
|
|
|
6851
7022
|
var React41 = __toESM(require("react"), 1);
|
|
6852
7023
|
init_i18n();
|
|
6853
7024
|
init_ModalSurface();
|
|
6854
|
-
var
|
|
7025
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6855
7026
|
function UserProfileModal({
|
|
6856
7027
|
children,
|
|
6857
7028
|
onClose,
|
|
@@ -6859,7 +7030,7 @@ function UserProfileModal({
|
|
|
6859
7030
|
}) {
|
|
6860
7031
|
const t = useT();
|
|
6861
7032
|
const titleId = React41.useId();
|
|
6862
|
-
return /* @__PURE__ */ (0,
|
|
7033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6863
7034
|
ModalSurface,
|
|
6864
7035
|
{
|
|
6865
7036
|
overlayClassName: "ba-profile-overlay",
|
|
@@ -6868,13 +7039,13 @@ function UserProfileModal({
|
|
|
6868
7039
|
testId: "user-profile-modal",
|
|
6869
7040
|
onClose,
|
|
6870
7041
|
children: [
|
|
6871
|
-
/* @__PURE__ */ (0,
|
|
6872
|
-
/* @__PURE__ */ (0,
|
|
7042
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "ba-profile-modal-header", children: [
|
|
7043
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { children: [
|
|
6873
7044
|
branding,
|
|
6874
|
-
/* @__PURE__ */ (0,
|
|
6875
|
-
/* @__PURE__ */ (0,
|
|
7045
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h1", { id: titleId, children: t("userProfile.title") }),
|
|
7046
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { children: t("userProfile.description") })
|
|
6876
7047
|
] }),
|
|
6877
|
-
/* @__PURE__ */ (0,
|
|
7048
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6878
7049
|
"button",
|
|
6879
7050
|
{
|
|
6880
7051
|
type: "button",
|
|
@@ -6882,7 +7053,7 @@ function UserProfileModal({
|
|
|
6882
7053
|
"aria-label": t("userProfile.close"),
|
|
6883
7054
|
onClick: onClose,
|
|
6884
7055
|
autoFocus: true,
|
|
6885
|
-
children: /* @__PURE__ */ (0,
|
|
7056
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6886
7057
|
"path",
|
|
6887
7058
|
{
|
|
6888
7059
|
d: "M6 6l12 12M18 6L6 18",
|
|
@@ -6895,14 +7066,14 @@ function UserProfileModal({
|
|
|
6895
7066
|
)
|
|
6896
7067
|
] }),
|
|
6897
7068
|
children,
|
|
6898
|
-
/* @__PURE__ */ (0,
|
|
7069
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("footer", { className: "ba-profile-modal-footer", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AuthOwlBadge, {}) })
|
|
6899
7070
|
]
|
|
6900
7071
|
}
|
|
6901
7072
|
);
|
|
6902
7073
|
}
|
|
6903
7074
|
|
|
6904
7075
|
// src/components/UserProfile.tsx
|
|
6905
|
-
var
|
|
7076
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6906
7077
|
var SECTION_KEYS = {
|
|
6907
7078
|
profile: "userProfile.nav.profile",
|
|
6908
7079
|
email: "userProfile.nav.email",
|
|
@@ -6968,11 +7139,11 @@ function UserProfile(props = {}) {
|
|
|
6968
7139
|
window.history.replaceState(null, "", userProfileSectionHash(next));
|
|
6969
7140
|
}
|
|
6970
7141
|
};
|
|
6971
|
-
const content = !isLoaded ? /* @__PURE__ */ (0,
|
|
6972
|
-
/* @__PURE__ */ (0,
|
|
6973
|
-
/* @__PURE__ */ (0,
|
|
6974
|
-
/* @__PURE__ */ (0,
|
|
6975
|
-
] }) : !isSignedIn || !user ? /* @__PURE__ */ (0,
|
|
7142
|
+
const content = !isLoaded ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "ba-profile-loading", "aria-busy": "true", children: [
|
|
7143
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "ba-skeleton" }),
|
|
7144
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "ba-skeleton" }),
|
|
7145
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "ba-skeleton" })
|
|
7146
|
+
] }) : !isSignedIn || !user ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "ba-muted", children: t("userProfile.signedOut") }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6976
7147
|
UserProfileBody,
|
|
6977
7148
|
{
|
|
6978
7149
|
active: visibleActive,
|
|
@@ -6984,23 +7155,23 @@ function UserProfile(props = {}) {
|
|
|
6984
7155
|
user.id
|
|
6985
7156
|
);
|
|
6986
7157
|
if (props.mode === "modal") {
|
|
6987
|
-
return /* @__PURE__ */ (0,
|
|
7158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6988
7159
|
UserProfileModal,
|
|
6989
7160
|
{
|
|
6990
7161
|
onClose: props.onClose,
|
|
6991
|
-
branding: showBranding ? /* @__PURE__ */ (0,
|
|
7162
|
+
branding: showBranding ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AuthOwlBranding, {}) : null,
|
|
6992
7163
|
children: content
|
|
6993
7164
|
}
|
|
6994
7165
|
);
|
|
6995
7166
|
}
|
|
6996
|
-
return /* @__PURE__ */ (0,
|
|
6997
|
-
/* @__PURE__ */ (0,
|
|
6998
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
6999
|
-
/* @__PURE__ */ (0,
|
|
7000
|
-
/* @__PURE__ */ (0,
|
|
7167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("article", { className: "ba-profile ba-profile-page", "data-testid": "user-profile", children: [
|
|
7168
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("header", { className: "ba-profile-heading", children: [
|
|
7169
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AuthOwlBranding, {}) : null,
|
|
7170
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h1", { children: t("userProfile.title") }),
|
|
7171
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { children: t("userProfile.description") })
|
|
7001
7172
|
] }),
|
|
7002
7173
|
content,
|
|
7003
|
-
/* @__PURE__ */ (0,
|
|
7174
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("footer", { className: "ba-profile-modal-footer", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AuthOwlBadge, {}) })
|
|
7004
7175
|
] });
|
|
7005
7176
|
}
|
|
7006
7177
|
function UserProfileBody({
|
|
@@ -7011,8 +7182,8 @@ function UserProfileBody({
|
|
|
7011
7182
|
capabilities
|
|
7012
7183
|
}) {
|
|
7013
7184
|
const t = useT();
|
|
7014
|
-
return /* @__PURE__ */ (0,
|
|
7015
|
-
/* @__PURE__ */ (0,
|
|
7185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "ba-profile-layout", children: [
|
|
7186
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("nav", { className: "ba-profile-nav", "aria-label": t("userProfile.nav.aria"), children: sections.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7016
7187
|
"button",
|
|
7017
7188
|
{
|
|
7018
7189
|
type: "button",
|
|
@@ -7023,8 +7194,8 @@ function UserProfileBody({
|
|
|
7023
7194
|
},
|
|
7024
7195
|
item
|
|
7025
7196
|
)) }),
|
|
7026
|
-
/* @__PURE__ */ (0,
|
|
7027
|
-
active === "profile" && /* @__PURE__ */ (0,
|
|
7197
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "ba-profile-content", "data-section": active, children: [
|
|
7198
|
+
active === "profile" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7028
7199
|
ProfileSection,
|
|
7029
7200
|
{
|
|
7030
7201
|
firstLastName: capabilities.firstLastName,
|
|
@@ -7032,43 +7203,54 @@ function UserProfileBody({
|
|
|
7032
7203
|
legacyNameField: capabilities.legacyNameField
|
|
7033
7204
|
}
|
|
7034
7205
|
),
|
|
7035
|
-
active === "email" && /* @__PURE__ */ (0,
|
|
7036
|
-
active === "password" && /* @__PURE__ */ (0,
|
|
7037
|
-
active === "social" && /* @__PURE__ */ (0,
|
|
7038
|
-
active === "sessions" && /* @__PURE__ */ (0,
|
|
7039
|
-
active === "passkeys" && /* @__PURE__ */ (0,
|
|
7040
|
-
active === "mfa" && /* @__PURE__ */ (0,
|
|
7041
|
-
active === "recovery" && /* @__PURE__ */ (0,
|
|
7042
|
-
active === "danger" && /* @__PURE__ */ (0,
|
|
7206
|
+
active === "email" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(EmailSection, { allowChange: capabilities.emailChange }),
|
|
7207
|
+
active === "password" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PasswordSection, {}),
|
|
7208
|
+
active === "social" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SocialSection, {}),
|
|
7209
|
+
active === "sessions" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SessionsSection, {}),
|
|
7210
|
+
active === "passkeys" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PasskeysSection, { allowAdd: capabilities.passkeyAdd }),
|
|
7211
|
+
active === "mfa" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(MfaSection, {}),
|
|
7212
|
+
active === "recovery" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RecoverySection, {}),
|
|
7213
|
+
active === "danger" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DeleteAccountSection, { onDeleted })
|
|
7043
7214
|
] })
|
|
7044
7215
|
] });
|
|
7045
7216
|
}
|
|
7046
7217
|
|
|
7047
7218
|
// src/components/UserButton.tsx
|
|
7048
|
-
var
|
|
7219
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
7049
7220
|
function UserButton() {
|
|
7050
7221
|
const t = useT();
|
|
7051
7222
|
const { user, isLoaded } = useUser();
|
|
7052
7223
|
const { signOut } = useSignOut();
|
|
7053
7224
|
const [open, setOpen] = React43.useState(false);
|
|
7054
7225
|
const [profileOpen, setProfileOpen] = React43.useState(false);
|
|
7226
|
+
const [failedImage, setFailedImage] = React43.useState(null);
|
|
7055
7227
|
const triggerRef = React43.useRef(null);
|
|
7056
7228
|
if (!isLoaded || !user) return null;
|
|
7057
7229
|
const identity = user.email ?? user.phoneNumber ?? user.name ?? "?";
|
|
7058
|
-
|
|
7059
|
-
|
|
7230
|
+
const image = user.image ?? null;
|
|
7231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "ba-user-button", "data-testid": "user-button", children: [
|
|
7232
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7060
7233
|
"button",
|
|
7061
7234
|
{
|
|
7062
7235
|
ref: triggerRef,
|
|
7063
7236
|
className: "ba-user-button-trigger",
|
|
7064
7237
|
"aria-label": t("userButton.openMenuAria"),
|
|
7065
7238
|
onClick: () => setOpen((v) => !v),
|
|
7066
|
-
children:
|
|
7239
|
+
children: image && failedImage !== image ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7240
|
+
"img",
|
|
7241
|
+
{
|
|
7242
|
+
className: "ba-avatar",
|
|
7243
|
+
src: image,
|
|
7244
|
+
alt: "",
|
|
7245
|
+
referrerPolicy: "no-referrer",
|
|
7246
|
+
onError: () => setFailedImage(image)
|
|
7247
|
+
}
|
|
7248
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "ba-avatar ba-avatar-fallback", children: identity[0]?.toUpperCase() })
|
|
7067
7249
|
}
|
|
7068
7250
|
),
|
|
7069
|
-
open && /* @__PURE__ */ (0,
|
|
7070
|
-
/* @__PURE__ */ (0,
|
|
7071
|
-
/* @__PURE__ */ (0,
|
|
7251
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "ba-menu", children: [
|
|
7252
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "ba-menu-label", children: identity }),
|
|
7253
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7072
7254
|
"button",
|
|
7073
7255
|
{
|
|
7074
7256
|
className: "ba-menu-item",
|
|
@@ -7079,10 +7261,10 @@ function UserButton() {
|
|
|
7079
7261
|
children: t("userButton.manageAccount")
|
|
7080
7262
|
}
|
|
7081
7263
|
),
|
|
7082
|
-
/* @__PURE__ */ (0,
|
|
7083
|
-
/* @__PURE__ */ (0,
|
|
7264
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { className: "ba-menu-item", onClick: () => signOut(), children: t("userButton.signOut") }),
|
|
7265
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "ba-menu-badge", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AuthOwlBadge, {}) })
|
|
7084
7266
|
] }),
|
|
7085
|
-
profileOpen && /* @__PURE__ */ (0,
|
|
7267
|
+
profileOpen && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7086
7268
|
UserProfile,
|
|
7087
7269
|
{
|
|
7088
7270
|
mode: "modal",
|
|
@@ -7110,7 +7292,7 @@ init_model();
|
|
|
7110
7292
|
init_use_submit_action();
|
|
7111
7293
|
init_Spinner();
|
|
7112
7294
|
init_FormError();
|
|
7113
|
-
var
|
|
7295
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
7114
7296
|
function CreateOrganization({ onCreated, title } = {}) {
|
|
7115
7297
|
const t = useT();
|
|
7116
7298
|
const { config, isLoading: configLoading } = usePublicConfig();
|
|
@@ -7122,10 +7304,10 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7122
7304
|
const [logo, setLogo] = React44.useState("");
|
|
7123
7305
|
const [slugTouched, setSlugTouched] = React44.useState(false);
|
|
7124
7306
|
if (configLoading || !isLoaded) {
|
|
7125
|
-
return /* @__PURE__ */ (0,
|
|
7307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
|
|
7126
7308
|
}
|
|
7127
7309
|
if (config?.organizations !== true) return null;
|
|
7128
|
-
if (!isSignedIn) return /* @__PURE__ */ (0,
|
|
7310
|
+
if (!isSignedIn) return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "ba-muted", children: t("organization.signedOut") });
|
|
7129
7311
|
const submit = (event) => {
|
|
7130
7312
|
event.preventDefault();
|
|
7131
7313
|
const normalizedName = name.trim();
|
|
@@ -7150,15 +7332,15 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7150
7332
|
}
|
|
7151
7333
|
);
|
|
7152
7334
|
};
|
|
7153
|
-
return /* @__PURE__ */ (0,
|
|
7154
|
-
title !== null && /* @__PURE__ */ (0,
|
|
7155
|
-
/* @__PURE__ */ (0,
|
|
7156
|
-
/* @__PURE__ */ (0,
|
|
7335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("section", { className: "ba-organization-create", children: [
|
|
7336
|
+
title !== null && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7337
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h2", { className: "ba-title", children: title ?? t("organization.create.title") }),
|
|
7338
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "ba-muted", children: t("organization.create.description") })
|
|
7157
7339
|
] }),
|
|
7158
|
-
/* @__PURE__ */ (0,
|
|
7159
|
-
/* @__PURE__ */ (0,
|
|
7340
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
7341
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "ba-label", children: [
|
|
7160
7342
|
t("organization.create.name"),
|
|
7161
|
-
/* @__PURE__ */ (0,
|
|
7343
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7162
7344
|
"input",
|
|
7163
7345
|
{
|
|
7164
7346
|
className: "ba-input",
|
|
@@ -7173,9 +7355,9 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7173
7355
|
}
|
|
7174
7356
|
)
|
|
7175
7357
|
] }),
|
|
7176
|
-
/* @__PURE__ */ (0,
|
|
7358
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "ba-label", children: [
|
|
7177
7359
|
t("organization.create.slug"),
|
|
7178
|
-
/* @__PURE__ */ (0,
|
|
7360
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7179
7361
|
"input",
|
|
7180
7362
|
{
|
|
7181
7363
|
className: "ba-input",
|
|
@@ -7190,9 +7372,9 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7190
7372
|
}
|
|
7191
7373
|
)
|
|
7192
7374
|
] }),
|
|
7193
|
-
/* @__PURE__ */ (0,
|
|
7375
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "ba-label", children: [
|
|
7194
7376
|
t("organization.create.logo"),
|
|
7195
|
-
/* @__PURE__ */ (0,
|
|
7377
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7196
7378
|
"input",
|
|
7197
7379
|
{
|
|
7198
7380
|
className: "ba-input",
|
|
@@ -7204,15 +7386,15 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7204
7386
|
}
|
|
7205
7387
|
)
|
|
7206
7388
|
] }),
|
|
7207
|
-
/* @__PURE__ */ (0,
|
|
7208
|
-
/* @__PURE__ */ (0,
|
|
7389
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FormError, { children: error }),
|
|
7390
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7209
7391
|
"button",
|
|
7210
7392
|
{
|
|
7211
7393
|
className: "ba-button ba-profile-submit",
|
|
7212
7394
|
type: "submit",
|
|
7213
7395
|
disabled: pending || !name.trim() || !slug.trim(),
|
|
7214
7396
|
"aria-busy": pending || void 0,
|
|
7215
|
-
children: /* @__PURE__ */ (0,
|
|
7397
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.create.submit") })
|
|
7216
7398
|
}
|
|
7217
7399
|
)
|
|
7218
7400
|
] })
|
|
@@ -7223,7 +7405,7 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7223
7405
|
var React45 = __toESM(require("react"), 1);
|
|
7224
7406
|
init_i18n();
|
|
7225
7407
|
init_ModalSurface();
|
|
7226
|
-
var
|
|
7408
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
7227
7409
|
function OrganizationModal({
|
|
7228
7410
|
title,
|
|
7229
7411
|
onClose,
|
|
@@ -7232,7 +7414,7 @@ function OrganizationModal({
|
|
|
7232
7414
|
}) {
|
|
7233
7415
|
const t = useT();
|
|
7234
7416
|
const titleId = React45.useId();
|
|
7235
|
-
return /* @__PURE__ */ (0,
|
|
7417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
7236
7418
|
ModalSurface,
|
|
7237
7419
|
{
|
|
7238
7420
|
overlayClassName: "ba-organization-overlay",
|
|
@@ -7241,9 +7423,9 @@ function OrganizationModal({
|
|
|
7241
7423
|
returnFocusRef,
|
|
7242
7424
|
onClose,
|
|
7243
7425
|
children: [
|
|
7244
|
-
/* @__PURE__ */ (0,
|
|
7245
|
-
/* @__PURE__ */ (0,
|
|
7246
|
-
/* @__PURE__ */ (0,
|
|
7426
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "ba-organization-modal-header", children: [
|
|
7427
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h2", { id: titleId, className: "ba-title", children: title }),
|
|
7428
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7247
7429
|
"button",
|
|
7248
7430
|
{
|
|
7249
7431
|
className: "ba-profile-close",
|
|
@@ -7255,7 +7437,7 @@ function OrganizationModal({
|
|
|
7255
7437
|
}
|
|
7256
7438
|
)
|
|
7257
7439
|
] }),
|
|
7258
|
-
/* @__PURE__ */ (0,
|
|
7440
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "ba-organization-modal-body", children })
|
|
7259
7441
|
]
|
|
7260
7442
|
}
|
|
7261
7443
|
);
|
|
@@ -7330,7 +7512,7 @@ init_use_submit_action();
|
|
|
7330
7512
|
init_Spinner();
|
|
7331
7513
|
init_model();
|
|
7332
7514
|
init_FormError();
|
|
7333
|
-
var
|
|
7515
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7334
7516
|
function DangerSection({
|
|
7335
7517
|
organization,
|
|
7336
7518
|
membership,
|
|
@@ -7371,37 +7553,37 @@ function DangerSection({
|
|
|
7371
7553
|
}
|
|
7372
7554
|
);
|
|
7373
7555
|
};
|
|
7374
|
-
return /* @__PURE__ */ (0,
|
|
7375
|
-
/* @__PURE__ */ (0,
|
|
7376
|
-
/* @__PURE__ */ (0,
|
|
7377
|
-
/* @__PURE__ */ (0,
|
|
7556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { className: "ba-organization-section ba-organization-danger", children: [
|
|
7557
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7558
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h3", { className: "ba-title", children: t("organization.profile.danger.title") }),
|
|
7559
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "ba-muted", children: t("organization.profile.danger.description") })
|
|
7378
7560
|
] }),
|
|
7379
|
-
/* @__PURE__ */ (0,
|
|
7380
|
-
/* @__PURE__ */ (0,
|
|
7381
|
-
/* @__PURE__ */ (0,
|
|
7382
|
-
/* @__PURE__ */ (0,
|
|
7561
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ba-organization-danger-action", children: [
|
|
7562
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: t("organization.profile.danger.leaveTitle") }),
|
|
7563
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "ba-muted", children: isOwner ? t("organization.profile.danger.ownerLeaveHint") : t("organization.profile.danger.leaveHint") }),
|
|
7564
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: leave, children: t("organization.profile.danger.leave") })
|
|
7383
7565
|
] }),
|
|
7384
|
-
isOwner && /* @__PURE__ */ (0,
|
|
7385
|
-
/* @__PURE__ */ (0,
|
|
7386
|
-
/* @__PURE__ */ (0,
|
|
7387
|
-
/* @__PURE__ */ (0,
|
|
7566
|
+
isOwner && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("form", { method: "post", className: "ba-organization-danger-action ba-organization-delete", onSubmit: remove, children: [
|
|
7567
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: t("organization.profile.danger.deleteTitle") }),
|
|
7568
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "ba-muted", children: t("organization.profile.danger.deleteHint") }),
|
|
7569
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("label", { className: "ba-label", children: [
|
|
7388
7570
|
t("organization.profile.danger.deleteConfirm"),
|
|
7389
7571
|
" ",
|
|
7390
|
-
/* @__PURE__ */ (0,
|
|
7391
|
-
/* @__PURE__ */ (0,
|
|
7572
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Bidi, { children: organization.slug }),
|
|
7573
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("input", { className: "ba-input", dir: "ltr", value: confirmation, onChange: (event) => setConfirmation(event.target.value), autoComplete: "off", required: true })
|
|
7392
7574
|
] }),
|
|
7393
|
-
/* @__PURE__ */ (0,
|
|
7575
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7394
7576
|
"button",
|
|
7395
7577
|
{
|
|
7396
7578
|
className: "ba-button ba-danger-button",
|
|
7397
7579
|
type: "submit",
|
|
7398
7580
|
disabled: pending || !confirmed,
|
|
7399
7581
|
"aria-busy": pending || void 0,
|
|
7400
|
-
children: /* @__PURE__ */ (0,
|
|
7582
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.danger.delete") })
|
|
7401
7583
|
}
|
|
7402
7584
|
)
|
|
7403
7585
|
] }),
|
|
7404
|
-
/* @__PURE__ */ (0,
|
|
7586
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FormError, { children: error })
|
|
7405
7587
|
] });
|
|
7406
7588
|
}
|
|
7407
7589
|
|
|
@@ -7413,7 +7595,7 @@ init_use_submit_action();
|
|
|
7413
7595
|
init_Spinner();
|
|
7414
7596
|
init_model();
|
|
7415
7597
|
init_FormError();
|
|
7416
|
-
var
|
|
7598
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7417
7599
|
function GeneralSection({
|
|
7418
7600
|
organization,
|
|
7419
7601
|
canManage,
|
|
@@ -7431,16 +7613,16 @@ function GeneralSection({
|
|
|
7431
7613
|
setLogo(organization.logo ?? "");
|
|
7432
7614
|
}, [organization.id, organization.logo, organization.name, organization.slug]);
|
|
7433
7615
|
if (!canManage) {
|
|
7434
|
-
return /* @__PURE__ */ (0,
|
|
7435
|
-
/* @__PURE__ */ (0,
|
|
7436
|
-
/* @__PURE__ */ (0,
|
|
7437
|
-
/* @__PURE__ */ (0,
|
|
7438
|
-
/* @__PURE__ */ (0,
|
|
7439
|
-
/* @__PURE__ */ (0,
|
|
7616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("section", { className: "ba-organization-section", children: [
|
|
7617
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "ba-muted", children: t("organization.profile.general.readOnly") }),
|
|
7618
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("dl", { className: "ba-organization-facts", children: [
|
|
7619
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
7620
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("dt", { children: t("organization.create.name") }),
|
|
7621
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("dd", { children: organization.name })
|
|
7440
7622
|
] }),
|
|
7441
|
-
/* @__PURE__ */ (0,
|
|
7442
|
-
/* @__PURE__ */ (0,
|
|
7443
|
-
/* @__PURE__ */ (0,
|
|
7623
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
7624
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("dt", { children: t("organization.create.slug") }),
|
|
7625
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Bidi, { children: organization.slug }) })
|
|
7444
7626
|
] })
|
|
7445
7627
|
] })
|
|
7446
7628
|
] });
|
|
@@ -7458,19 +7640,19 @@ function GeneralSection({
|
|
|
7458
7640
|
}
|
|
7459
7641
|
);
|
|
7460
7642
|
};
|
|
7461
|
-
return /* @__PURE__ */ (0,
|
|
7462
|
-
/* @__PURE__ */ (0,
|
|
7463
|
-
/* @__PURE__ */ (0,
|
|
7464
|
-
/* @__PURE__ */ (0,
|
|
7643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("section", { className: "ba-organization-section", children: [
|
|
7644
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7645
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h3", { className: "ba-title", children: t("organization.profile.general.title") }),
|
|
7646
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "ba-muted", children: t("organization.profile.general.description") })
|
|
7465
7647
|
] }),
|
|
7466
|
-
/* @__PURE__ */ (0,
|
|
7467
|
-
/* @__PURE__ */ (0,
|
|
7648
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
7649
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("label", { className: "ba-label", children: [
|
|
7468
7650
|
t("organization.create.name"),
|
|
7469
|
-
/* @__PURE__ */ (0,
|
|
7651
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("input", { className: "ba-input", value: name, onChange: (event) => setName(event.target.value), required: true })
|
|
7470
7652
|
] }),
|
|
7471
|
-
/* @__PURE__ */ (0,
|
|
7653
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("label", { className: "ba-label", children: [
|
|
7472
7654
|
t("organization.create.slug"),
|
|
7473
|
-
/* @__PURE__ */ (0,
|
|
7655
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7474
7656
|
"input",
|
|
7475
7657
|
{
|
|
7476
7658
|
className: "ba-input",
|
|
@@ -7482,19 +7664,19 @@ function GeneralSection({
|
|
|
7482
7664
|
}
|
|
7483
7665
|
)
|
|
7484
7666
|
] }),
|
|
7485
|
-
/* @__PURE__ */ (0,
|
|
7667
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("label", { className: "ba-label", children: [
|
|
7486
7668
|
t("organization.create.logo"),
|
|
7487
|
-
/* @__PURE__ */ (0,
|
|
7669
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("input", { className: "ba-input", type: "url", dir: "ltr", value: logo, onChange: (event) => setLogo(event.target.value), placeholder: "https://" })
|
|
7488
7670
|
] }),
|
|
7489
|
-
/* @__PURE__ */ (0,
|
|
7490
|
-
/* @__PURE__ */ (0,
|
|
7671
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormError, { children: error }),
|
|
7672
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7491
7673
|
"button",
|
|
7492
7674
|
{
|
|
7493
7675
|
className: "ba-button ba-profile-submit",
|
|
7494
7676
|
type: "submit",
|
|
7495
7677
|
disabled: pending || !name.trim() || !slug.trim(),
|
|
7496
7678
|
"aria-busy": pending || void 0,
|
|
7497
|
-
children: /* @__PURE__ */ (0,
|
|
7679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.general.save") })
|
|
7498
7680
|
}
|
|
7499
7681
|
)
|
|
7500
7682
|
] })
|
|
@@ -7524,7 +7706,7 @@ function organizationRoleLabel(role, t) {
|
|
|
7524
7706
|
// src/components/organization/InvitationsSection.tsx
|
|
7525
7707
|
init_use_organization_roles();
|
|
7526
7708
|
init_FormError();
|
|
7527
|
-
var
|
|
7709
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7528
7710
|
function InvitationsSection({
|
|
7529
7711
|
organization,
|
|
7530
7712
|
onChanged
|
|
@@ -7556,38 +7738,38 @@ function InvitationsSection({
|
|
|
7556
7738
|
{ failure: t("organization.profile.invitations.cancelError"), onSuccess: onChanged }
|
|
7557
7739
|
);
|
|
7558
7740
|
};
|
|
7559
|
-
return /* @__PURE__ */ (0,
|
|
7560
|
-
/* @__PURE__ */ (0,
|
|
7561
|
-
/* @__PURE__ */ (0,
|
|
7562
|
-
/* @__PURE__ */ (0,
|
|
7741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("section", { className: "ba-organization-section", children: [
|
|
7742
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7743
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("h3", { className: "ba-title", children: t("organization.profile.invitations.title") }),
|
|
7744
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "ba-muted", children: t("organization.profile.invitations.description") })
|
|
7563
7745
|
] }),
|
|
7564
|
-
/* @__PURE__ */ (0,
|
|
7565
|
-
/* @__PURE__ */ (0,
|
|
7746
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("form", { method: "post", className: "ba-organization-invite-form", onSubmit: invite, children: [
|
|
7747
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("label", { className: "ba-label", children: [
|
|
7566
7748
|
t("organization.profile.invitations.email"),
|
|
7567
|
-
/* @__PURE__ */ (0,
|
|
7749
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { className: "ba-input", type: "email", dir: "ltr", value: email, onChange: (event) => setEmail(event.target.value), required: true })
|
|
7568
7750
|
] }),
|
|
7569
|
-
/* @__PURE__ */ (0,
|
|
7751
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("label", { className: "ba-label", children: [
|
|
7570
7752
|
t("organization.profile.members.role"),
|
|
7571
|
-
/* @__PURE__ */ (0,
|
|
7753
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("select", { className: "ba-input", value: role, onChange: (event) => setRole(event.target.value), children: roles.map((option) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("option", { value: option, children: organizationRoleLabel(option, t) }, option)) })
|
|
7572
7754
|
] }),
|
|
7573
|
-
/* @__PURE__ */ (0,
|
|
7755
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7574
7756
|
"button",
|
|
7575
7757
|
{
|
|
7576
7758
|
className: "ba-button",
|
|
7577
7759
|
type: "submit",
|
|
7578
7760
|
disabled: pending || !email.trim(),
|
|
7579
7761
|
"aria-busy": pending || void 0,
|
|
7580
|
-
children: /* @__PURE__ */ (0,
|
|
7762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.invitations.invite") })
|
|
7581
7763
|
}
|
|
7582
7764
|
)
|
|
7583
7765
|
] }),
|
|
7584
|
-
/* @__PURE__ */ (0,
|
|
7585
|
-
invitations.length === 0 ? /* @__PURE__ */ (0,
|
|
7586
|
-
/* @__PURE__ */ (0,
|
|
7587
|
-
/* @__PURE__ */ (0,
|
|
7588
|
-
/* @__PURE__ */ (0,
|
|
7766
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FormError, { children: error }),
|
|
7767
|
+
invitations.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "ba-muted", children: t("organization.profile.invitations.empty") }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("li", { className: "ba-organization-invitation", children: [
|
|
7768
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { children: [
|
|
7769
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Bidi, { children: invitation.email }) }),
|
|
7770
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("small", { children: organizationRoleLabel(invitation.role, t) })
|
|
7589
7771
|
] }),
|
|
7590
|
-
/* @__PURE__ */ (0,
|
|
7772
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => cancel(invitation), children: t("organization.profile.invitations.cancel") })
|
|
7591
7773
|
] }, invitation.id)) })
|
|
7592
7774
|
] });
|
|
7593
7775
|
}
|
|
@@ -7599,7 +7781,7 @@ init_use_submit_action();
|
|
|
7599
7781
|
init_model();
|
|
7600
7782
|
init_use_organization_roles();
|
|
7601
7783
|
init_FormError();
|
|
7602
|
-
var
|
|
7784
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7603
7785
|
function MembersSection({
|
|
7604
7786
|
organization,
|
|
7605
7787
|
userId,
|
|
@@ -7626,27 +7808,27 @@ function MembersSection({
|
|
|
7626
7808
|
{ failure: t("organization.profile.members.removeError"), onSuccess: onChanged }
|
|
7627
7809
|
);
|
|
7628
7810
|
};
|
|
7629
|
-
return /* @__PURE__ */ (0,
|
|
7630
|
-
/* @__PURE__ */ (0,
|
|
7631
|
-
/* @__PURE__ */ (0,
|
|
7632
|
-
/* @__PURE__ */ (0,
|
|
7811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { className: "ba-organization-section", children: [
|
|
7812
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7813
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h3", { className: "ba-title", children: t("organization.profile.members.title") }),
|
|
7814
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "ba-muted", children: t("organization.profile.members.description") })
|
|
7633
7815
|
] }),
|
|
7634
|
-
/* @__PURE__ */ (0,
|
|
7635
|
-
/* @__PURE__ */ (0,
|
|
7816
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormError, { children: error }),
|
|
7817
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: "ba-organization-list", children: organization.members.map((member) => {
|
|
7636
7818
|
const primaryRole = organizationRoles(member.role)[0] ?? member.role;
|
|
7637
7819
|
const isCurrent = member.userId === userId;
|
|
7638
|
-
return /* @__PURE__ */ (0,
|
|
7639
|
-
/* @__PURE__ */ (0,
|
|
7640
|
-
/* @__PURE__ */ (0,
|
|
7641
|
-
/* @__PURE__ */ (0,
|
|
7820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("li", { className: "ba-organization-member", children: [
|
|
7821
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: member.user.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
7822
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "ba-organization-member-copy", children: [
|
|
7823
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("strong", { children: [
|
|
7642
7824
|
member.user.name,
|
|
7643
7825
|
isCurrent ? ` ${t("organization.profile.members.you")}` : ""
|
|
7644
7826
|
] }),
|
|
7645
|
-
/* @__PURE__ */ (0,
|
|
7827
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("small", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Bidi, { children: member.user.email }) })
|
|
7646
7828
|
] }),
|
|
7647
|
-
canManage && !isCurrent ? /* @__PURE__ */ (0,
|
|
7648
|
-
/* @__PURE__ */ (0,
|
|
7649
|
-
/* @__PURE__ */ (0,
|
|
7829
|
+
canManage && !isCurrent ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "ba-organization-member-actions", children: [
|
|
7830
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "ba-sr-only", htmlFor: `organization-role-${member.id}`, children: t("organization.profile.members.role") }),
|
|
7831
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7650
7832
|
"select",
|
|
7651
7833
|
{
|
|
7652
7834
|
id: `organization-role-${member.id}`,
|
|
@@ -7654,11 +7836,11 @@ function MembersSection({
|
|
|
7654
7836
|
value: primaryRole,
|
|
7655
7837
|
disabled: pending,
|
|
7656
7838
|
onChange: (event) => updateRole(member, event.target.value),
|
|
7657
|
-
children: (roles.includes(primaryRole) ? roles : [primaryRole, ...roles]).map((role) => /* @__PURE__ */ (0,
|
|
7839
|
+
children: (roles.includes(primaryRole) ? roles : [primaryRole, ...roles]).map((role) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("option", { value: role, children: organizationRoleLabel(role, t) }, role))
|
|
7658
7840
|
}
|
|
7659
7841
|
),
|
|
7660
|
-
/* @__PURE__ */ (0,
|
|
7661
|
-
] }) : /* @__PURE__ */ (0,
|
|
7842
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => remove(member), children: t("organization.profile.members.remove") })
|
|
7843
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ba-organization-role-label", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Bidi, { children: organizationRoleLabel(member.role, t) }) })
|
|
7662
7844
|
] }, member.id);
|
|
7663
7845
|
}) })
|
|
7664
7846
|
] });
|
|
@@ -7667,7 +7849,7 @@ function MembersSection({
|
|
|
7667
7849
|
// src/components/OrganizationProfile.tsx
|
|
7668
7850
|
init_model();
|
|
7669
7851
|
init_FormError();
|
|
7670
|
-
var
|
|
7852
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
7671
7853
|
var SECTION_KEYS2 = {
|
|
7672
7854
|
general: "organization.profile.nav.general",
|
|
7673
7855
|
members: "organization.profile.nav.members",
|
|
@@ -7722,20 +7904,20 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
7722
7904
|
requestRef.current += 1;
|
|
7723
7905
|
};
|
|
7724
7906
|
}, [load]);
|
|
7725
|
-
if (configLoading || !isLoaded) return /* @__PURE__ */ (0,
|
|
7907
|
+
if (configLoading || !isLoaded) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
|
|
7726
7908
|
if (config?.organizations !== true) return null;
|
|
7727
|
-
if (!isSignedIn || !user) return /* @__PURE__ */ (0,
|
|
7728
|
-
if (wasRemoved) return /* @__PURE__ */ (0,
|
|
7729
|
-
if (!requestedId) return /* @__PURE__ */ (0,
|
|
7909
|
+
if (!isSignedIn || !user) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: t("organization.signedOut") });
|
|
7910
|
+
if (wasRemoved) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: t("organization.profile.noActive") });
|
|
7911
|
+
if (!requestedId) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: t("organization.profile.noActive") });
|
|
7730
7912
|
if (error) {
|
|
7731
|
-
return /* @__PURE__ */ (0,
|
|
7732
|
-
/* @__PURE__ */ (0,
|
|
7733
|
-
/* @__PURE__ */ (0,
|
|
7913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ba-inline-error", children: [
|
|
7914
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FormError, { children: error }),
|
|
7915
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void load(), children: t("organization.retry") })
|
|
7734
7916
|
] });
|
|
7735
7917
|
}
|
|
7736
|
-
if (!organization) return /* @__PURE__ */ (0,
|
|
7918
|
+
if (!organization) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
|
|
7737
7919
|
const membership = organization.members.find((member) => member.userId === user.id);
|
|
7738
|
-
if (!membership) return /* @__PURE__ */ (0,
|
|
7920
|
+
if (!membership) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: t("organization.profile.notMember") });
|
|
7739
7921
|
const canManage = canManageOrganization(membership);
|
|
7740
7922
|
const visibleSections = canManage ? ["general", "members", "teams", "invitations", "danger"] : ["general", "members", "teams", "danger"];
|
|
7741
7923
|
const activeSection = visibleSections.includes(section) ? section : "general";
|
|
@@ -7744,16 +7926,16 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
7744
7926
|
setOrganization(null);
|
|
7745
7927
|
callback?.(removedOrganization);
|
|
7746
7928
|
};
|
|
7747
|
-
return /* @__PURE__ */ (0,
|
|
7748
|
-
/* @__PURE__ */ (0,
|
|
7749
|
-
/* @__PURE__ */ (0,
|
|
7750
|
-
/* @__PURE__ */ (0,
|
|
7751
|
-
/* @__PURE__ */ (0,
|
|
7752
|
-
/* @__PURE__ */ (0,
|
|
7929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("article", { className: "ba-organization-profile", children: [
|
|
7930
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("header", { className: "ba-organization-profile-heading", children: [
|
|
7931
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
7932
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { children: [
|
|
7933
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "ba-title", children: organization.name }),
|
|
7934
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: organization.slug })
|
|
7753
7935
|
] })
|
|
7754
7936
|
] }),
|
|
7755
|
-
/* @__PURE__ */ (0,
|
|
7756
|
-
/* @__PURE__ */ (0,
|
|
7937
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ba-organization-profile-layout", children: [
|
|
7938
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("nav", { className: "ba-organization-profile-nav", "aria-label": t("organization.profile.nav.label"), children: visibleSections.map((item) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7757
7939
|
"button",
|
|
7758
7940
|
{
|
|
7759
7941
|
className: "ba-profile-nav-item",
|
|
@@ -7764,12 +7946,12 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
7764
7946
|
},
|
|
7765
7947
|
item
|
|
7766
7948
|
)) }),
|
|
7767
|
-
/* @__PURE__ */ (0,
|
|
7768
|
-
activeSection === "general" && /* @__PURE__ */ (0,
|
|
7769
|
-
activeSection === "members" && /* @__PURE__ */ (0,
|
|
7770
|
-
activeSection === "teams" && /* @__PURE__ */ (0,
|
|
7771
|
-
activeSection === "invitations" && /* @__PURE__ */ (0,
|
|
7772
|
-
activeSection === "danger" && /* @__PURE__ */ (0,
|
|
7949
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ba-organization-profile-content", children: [
|
|
7950
|
+
activeSection === "general" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GeneralSection, { organization, canManage, onChanged: load }),
|
|
7951
|
+
activeSection === "members" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(MembersSection, { organization, userId: user.id, canManage, onChanged: load }),
|
|
7952
|
+
activeSection === "teams" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(React55.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TeamsSection2, { organization, membership }) }),
|
|
7953
|
+
activeSection === "invitations" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(InvitationsSection, { organization, onChanged: load }),
|
|
7954
|
+
activeSection === "danger" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7773
7955
|
DangerSection,
|
|
7774
7956
|
{
|
|
7775
7957
|
organization,
|
|
@@ -7786,7 +7968,7 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
7786
7968
|
// src/components/OrganizationSwitcher.tsx
|
|
7787
7969
|
init_use_submit_action();
|
|
7788
7970
|
init_FormError();
|
|
7789
|
-
var
|
|
7971
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
7790
7972
|
function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChange } = {}) {
|
|
7791
7973
|
const t = useT();
|
|
7792
7974
|
const { config, isLoading: configLoading } = usePublicConfig();
|
|
@@ -7819,9 +8001,9 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
7819
8001
|
document.removeEventListener("keydown", onKeyDown);
|
|
7820
8002
|
};
|
|
7821
8003
|
}, [open]);
|
|
7822
|
-
if (configLoading || !isLoaded) return /* @__PURE__ */ (0,
|
|
8004
|
+
if (configLoading || !isLoaded) return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ba-skeleton ba-organization-switcher-skeleton", "aria-label": t("organization.loading") });
|
|
7823
8005
|
if (config?.organizations !== true) return null;
|
|
7824
|
-
if (!isSignedIn) return /* @__PURE__ */ (0,
|
|
8006
|
+
if (!isSignedIn) return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "ba-muted", children: t("organization.signedOut") });
|
|
7825
8007
|
const select = (organization) => {
|
|
7826
8008
|
void run(
|
|
7827
8009
|
() => api.setActive({ organizationId: organization?.id ?? null }),
|
|
@@ -7864,9 +8046,9 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
7864
8046
|
else if (event.key === "ArrowDown") items[(current + 1 + items.length) % items.length]?.focus();
|
|
7865
8047
|
else items[(current - 1 + items.length) % items.length]?.focus();
|
|
7866
8048
|
};
|
|
7867
|
-
return /* @__PURE__ */ (0,
|
|
7868
|
-
/* @__PURE__ */ (0,
|
|
7869
|
-
/* @__PURE__ */ (0,
|
|
8049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
8050
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { ref: rootRef, className: "ba-organization-switcher", children: [
|
|
8051
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
7870
8052
|
"button",
|
|
7871
8053
|
{
|
|
7872
8054
|
ref: triggerRef,
|
|
@@ -7883,43 +8065,43 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
7883
8065
|
focusMenuItem(event.key === "ArrowDown" ? "first" : "last");
|
|
7884
8066
|
},
|
|
7885
8067
|
children: [
|
|
7886
|
-
/* @__PURE__ */ (0,
|
|
7887
|
-
/* @__PURE__ */ (0,
|
|
7888
|
-
/* @__PURE__ */ (0,
|
|
8068
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: active?.name.trim().charAt(0).toUpperCase() || "P" }),
|
|
8069
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children: active?.name ?? t("organization.personal") }),
|
|
8070
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { "aria-hidden": "true", children: "\u2304" })
|
|
7889
8071
|
]
|
|
7890
8072
|
}
|
|
7891
8073
|
),
|
|
7892
|
-
open && /* @__PURE__ */ (0,
|
|
7893
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
7894
|
-
showPersonalWorkspace && /* @__PURE__ */ (0,
|
|
7895
|
-
/* @__PURE__ */ (0,
|
|
7896
|
-
/* @__PURE__ */ (0,
|
|
8074
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { ref: menuRef, id: menuId, className: "ba-organization-menu", role: "menu", "aria-label": t("organization.switcher.label"), onKeyDown: onMenuKeyDown, children: [
|
|
8075
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ba-skeleton" }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
8076
|
+
showPersonalWorkspace && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === null ? "true" : void 0, disabled: pending, onClick: () => select(null), children: [
|
|
8077
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: "P" }),
|
|
8078
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children: t("organization.personal") })
|
|
7897
8079
|
] }),
|
|
7898
|
-
organizations?.map((organization) => /* @__PURE__ */ (0,
|
|
7899
|
-
/* @__PURE__ */ (0,
|
|
7900
|
-
/* @__PURE__ */ (0,
|
|
8080
|
+
organizations?.map((organization) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === organization.id ? "true" : void 0, disabled: pending, onClick: () => select(organization), children: [
|
|
8081
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
8082
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { children: [
|
|
7901
8083
|
organization.name,
|
|
7902
|
-
/* @__PURE__ */ (0,
|
|
8084
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("small", { children: organization.slug })
|
|
7903
8085
|
] })
|
|
7904
8086
|
] }, organization.id))
|
|
7905
8087
|
] }),
|
|
7906
|
-
(loadError || error) && /* @__PURE__ */ (0,
|
|
7907
|
-
/* @__PURE__ */ (0,
|
|
7908
|
-
loadError && /* @__PURE__ */ (0,
|
|
8088
|
+
(loadError || error) && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ba-inline-error", children: [
|
|
8089
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(FormError, { children: loadError ?? error }),
|
|
8090
|
+
loadError && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
|
|
7909
8091
|
] }),
|
|
7910
|
-
/* @__PURE__ */ (0,
|
|
7911
|
-
active && /* @__PURE__ */ (0,
|
|
8092
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ba-organization-menu-actions", children: [
|
|
8093
|
+
active && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("button", { className: "ba-menu-item", type: "button", role: "menuitem", onClick: () => {
|
|
7912
8094
|
setOpen(false);
|
|
7913
8095
|
setDialog("profile");
|
|
7914
8096
|
}, children: t("organization.switcher.manage") }),
|
|
7915
|
-
/* @__PURE__ */ (0,
|
|
8097
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("button", { className: "ba-menu-item", type: "button", role: "menuitem", onClick: () => {
|
|
7916
8098
|
setOpen(false);
|
|
7917
8099
|
setDialog("create");
|
|
7918
8100
|
}, children: t("organization.switcher.create") })
|
|
7919
8101
|
] })
|
|
7920
8102
|
] })
|
|
7921
8103
|
] }),
|
|
7922
|
-
dialog === "create" && /* @__PURE__ */ (0,
|
|
8104
|
+
dialog === "create" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OrganizationModal, { title: t("organization.create.title"), returnFocusRef: triggerRef, onClose: () => setDialog(null), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
7923
8105
|
CreateOrganization,
|
|
7924
8106
|
{
|
|
7925
8107
|
title: null,
|
|
@@ -7933,7 +8115,7 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
7933
8115
|
}
|
|
7934
8116
|
}
|
|
7935
8117
|
) }),
|
|
7936
|
-
dialog === "profile" && active && /* @__PURE__ */ (0,
|
|
8118
|
+
dialog === "profile" && active && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OrganizationModal, { title: t("organization.profile.title"), returnFocusRef: triggerRef, onClose: () => setDialog(null), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OrganizationProfile, { organizationId: active.id, onDeleted: () => void afterProfileRemoval(), onLeft: () => void afterProfileRemoval() }) })
|
|
7937
8119
|
] });
|
|
7938
8120
|
}
|
|
7939
8121
|
|
|
@@ -7946,7 +8128,7 @@ init_hooks();
|
|
|
7946
8128
|
init_i18n();
|
|
7947
8129
|
init_use_submit_action();
|
|
7948
8130
|
init_FormError();
|
|
7949
|
-
var
|
|
8131
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
7950
8132
|
function OrganizationList({ onOrganizationChange } = {}) {
|
|
7951
8133
|
const t = useT();
|
|
7952
8134
|
const toServerError = useServerError();
|
|
@@ -7995,9 +8177,9 @@ function OrganizationList({ onOrganizationChange } = {}) {
|
|
|
7995
8177
|
invitationRequestRef.current += 1;
|
|
7996
8178
|
};
|
|
7997
8179
|
}, [isLoaded, loadInvitations, user?.id]);
|
|
7998
|
-
if (configLoading || !isLoaded) return /* @__PURE__ */ (0,
|
|
8180
|
+
if (configLoading || !isLoaded) return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
|
|
7999
8181
|
if (config?.organizations !== true) return null;
|
|
8000
|
-
if (!isSignedIn) return /* @__PURE__ */ (0,
|
|
8182
|
+
if (!isSignedIn) return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.signedOut") });
|
|
8001
8183
|
const setActive = (organization) => {
|
|
8002
8184
|
void run(
|
|
8003
8185
|
() => api.setActive({ organizationId: organization.id }),
|
|
@@ -8038,66 +8220,66 @@ function OrganizationList({ onOrganizationChange } = {}) {
|
|
|
8038
8220
|
setDialog(null);
|
|
8039
8221
|
setProfileId(null);
|
|
8040
8222
|
};
|
|
8041
|
-
return /* @__PURE__ */ (0,
|
|
8042
|
-
/* @__PURE__ */ (0,
|
|
8043
|
-
/* @__PURE__ */ (0,
|
|
8044
|
-
/* @__PURE__ */ (0,
|
|
8045
|
-
/* @__PURE__ */ (0,
|
|
8046
|
-
/* @__PURE__ */ (0,
|
|
8223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
8224
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("section", { className: "ba-organization-directory", children: [
|
|
8225
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("header", { className: "ba-organization-directory-header", children: [
|
|
8226
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { children: [
|
|
8227
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h2", { className: "ba-title", children: t("organization.list.title") }),
|
|
8228
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.list.description") })
|
|
8047
8229
|
] }),
|
|
8048
|
-
/* @__PURE__ */ (0,
|
|
8230
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-button", type: "button", onClick: (event) => {
|
|
8049
8231
|
dialogReturnFocusRef.current = event.currentTarget;
|
|
8050
8232
|
setDialog("create");
|
|
8051
8233
|
}, children: t("organization.switcher.create") })
|
|
8052
8234
|
] }),
|
|
8053
|
-
(organizationError || error) && /* @__PURE__ */ (0,
|
|
8054
|
-
/* @__PURE__ */ (0,
|
|
8055
|
-
organizationError && /* @__PURE__ */ (0,
|
|
8235
|
+
(organizationError || error) && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ba-inline-error", children: [
|
|
8236
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormError, { children: organizationError ?? error }),
|
|
8237
|
+
organizationError && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
|
|
8056
8238
|
] }),
|
|
8057
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
8058
|
-
/* @__PURE__ */ (0,
|
|
8059
|
-
/* @__PURE__ */ (0,
|
|
8060
|
-
] }) : organizations?.length ? /* @__PURE__ */ (0,
|
|
8061
|
-
/* @__PURE__ */ (0,
|
|
8062
|
-
/* @__PURE__ */ (0,
|
|
8063
|
-
/* @__PURE__ */ (0,
|
|
8064
|
-
/* @__PURE__ */ (0,
|
|
8239
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ba-organization-card-grid", children: [
|
|
8240
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ba-skeleton" }),
|
|
8241
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ba-skeleton" })
|
|
8242
|
+
] }) : organizations?.length ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("ul", { className: "ba-organization-card-grid", children: organizations.map((organization) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("li", { className: "ba-organization-card", children: [
|
|
8243
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
8244
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "ba-organization-card-copy", children: [
|
|
8245
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("strong", { children: organization.name }),
|
|
8246
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("small", { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Bidi, { children: organization.slug }) })
|
|
8065
8247
|
] }),
|
|
8066
|
-
activeId === organization.id && /* @__PURE__ */ (0,
|
|
8067
|
-
/* @__PURE__ */ (0,
|
|
8068
|
-
activeId !== organization.id && /* @__PURE__ */ (0,
|
|
8069
|
-
/* @__PURE__ */ (0,
|
|
8248
|
+
activeId === organization.id && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ba-organization-active", children: t("organization.list.active") }),
|
|
8249
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "ba-organization-card-actions", children: [
|
|
8250
|
+
activeId !== organization.id && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: () => setActive(organization), children: t("organization.list.switch") }),
|
|
8251
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-link-button", type: "button", onClick: (event) => openProfile(organization, event.currentTarget), children: t("organization.list.manage") })
|
|
8070
8252
|
] })
|
|
8071
|
-
] }, organization.id)) }) : organizationError ? null : /* @__PURE__ */ (0,
|
|
8072
|
-
/* @__PURE__ */ (0,
|
|
8073
|
-
/* @__PURE__ */ (0,
|
|
8074
|
-
/* @__PURE__ */ (0,
|
|
8075
|
-
/* @__PURE__ */ (0,
|
|
8253
|
+
] }, organization.id)) }) : organizationError ? null : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.list.empty") }),
|
|
8254
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("section", { className: "ba-organization-user-invitations", children: [
|
|
8255
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
8256
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h3", { className: "ba-title", children: t("organization.list.invitationsTitle") }),
|
|
8257
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.list.invitationsDescription") })
|
|
8076
8258
|
] }),
|
|
8077
|
-
invitationError && /* @__PURE__ */ (0,
|
|
8078
|
-
/* @__PURE__ */ (0,
|
|
8079
|
-
/* @__PURE__ */ (0,
|
|
8259
|
+
invitationError && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ba-inline-error", children: [
|
|
8260
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormError, { children: invitationError }),
|
|
8261
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void loadInvitations(), children: t("organization.retry") })
|
|
8080
8262
|
] }),
|
|
8081
|
-
invitations?.length ? /* @__PURE__ */ (0,
|
|
8082
|
-
/* @__PURE__ */ (0,
|
|
8083
|
-
/* @__PURE__ */ (0,
|
|
8084
|
-
/* @__PURE__ */ (0,
|
|
8263
|
+
invitations?.length ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("li", { className: "ba-organization-invitation", children: [
|
|
8264
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { children: [
|
|
8265
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("strong", { children: invitation.organizationName }),
|
|
8266
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("small", { children: organizationRoleLabel(invitation.role, t) })
|
|
8085
8267
|
] }),
|
|
8086
|
-
/* @__PURE__ */ (0,
|
|
8087
|
-
/* @__PURE__ */ (0,
|
|
8088
|
-
/* @__PURE__ */ (0,
|
|
8268
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "ba-organization-card-actions", children: [
|
|
8269
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "accept"), children: t("organization.list.accept") }),
|
|
8270
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "reject"), children: t("organization.list.reject") })
|
|
8089
8271
|
] })
|
|
8090
|
-
] }, invitation.id)) }) : invitationError ? null : invitations === null ? /* @__PURE__ */ (0,
|
|
8272
|
+
] }, invitation.id)) }) : invitationError ? null : invitations === null ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ba-skeleton" }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.list.noInvitations") })
|
|
8091
8273
|
] })
|
|
8092
8274
|
] }),
|
|
8093
|
-
dialog === "create" && /* @__PURE__ */ (0,
|
|
8275
|
+
dialog === "create" && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(OrganizationModal, { title: t("organization.create.title"), returnFocusRef: dialogReturnFocusRef, onClose: () => setDialog(null), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CreateOrganization, { title: null, onCreated: () => {
|
|
8094
8276
|
void (async () => {
|
|
8095
8277
|
await refresh();
|
|
8096
8278
|
await session.refetch({ query: { disableCookieCache: true } });
|
|
8097
8279
|
setDialog(null);
|
|
8098
8280
|
})();
|
|
8099
8281
|
} }) }),
|
|
8100
|
-
dialog === "profile" && profileId && /* @__PURE__ */ (0,
|
|
8282
|
+
dialog === "profile" && profileId && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(OrganizationModal, { title: t("organization.profile.title"), returnFocusRef: dialogReturnFocusRef, onClose: () => setDialog(null), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(OrganizationProfile, { organizationId: profileId, onDeleted: () => void afterProfileRemoval(), onLeft: () => void afterProfileRemoval() }) })
|
|
8101
8283
|
] });
|
|
8102
8284
|
}
|
|
8103
8285
|
|