@rebasepro/core 0.2.1 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/components/LoginView/LoginView.d.ts +17 -1
  2. package/dist/components/common/types.d.ts +10 -7
  3. package/dist/components/common/useDebouncedData.d.ts +1 -1
  4. package/dist/core/RebaseProps.d.ts +13 -2
  5. package/dist/core/RebaseRouter.d.ts +1 -1
  6. package/dist/hooks/index.d.ts +0 -1
  7. package/dist/index.es.js +499 -418
  8. package/dist/index.es.js.map +1 -1
  9. package/dist/index.umd.js +499 -418
  10. package/dist/index.umd.js.map +1 -1
  11. package/dist/util/entity_cache.d.ts +0 -5
  12. package/dist/util/index.d.ts +0 -2
  13. package/dist/util/useStorageUploadController.d.ts +2 -2
  14. package/package.json +7 -6
  15. package/src/components/BootstrapAdminBanner.tsx +12 -3
  16. package/src/components/LoginView/LoginView.tsx +151 -6
  17. package/src/components/UserSettingsView.tsx +95 -2
  18. package/src/components/common/types.tsx +7 -7
  19. package/src/components/common/useDebouncedData.ts +2 -2
  20. package/src/core/Rebase.tsx +3 -2
  21. package/src/core/RebaseProps.tsx +15 -2
  22. package/src/core/RebaseRouter.tsx +1 -1
  23. package/src/hooks/index.tsx +0 -1
  24. package/src/hooks/useResolvedComponent.tsx +4 -3
  25. package/src/locales/en.ts +13 -0
  26. package/src/locales/es.ts +11 -1
  27. package/src/util/entity_cache.ts +1 -27
  28. package/src/util/icon_list.ts +2 -2
  29. package/src/util/index.ts +2 -2
  30. package/src/util/useStorageUploadController.tsx +4 -4
  31. package/dist/hooks/useValidateAuthenticator.d.ts +0 -21
  32. package/dist/util/icon_synonyms.d.ts +0 -1
  33. package/dist/util/useTraceUpdate.d.ts +0 -2
  34. package/src/hooks/useValidateAuthenticator.tsx +0 -116
  35. package/src/util/icon_synonyms.ts +0 -1
  36. package/src/util/useTraceUpdate.tsx +0 -24
package/dist/index.es.js CHANGED
@@ -7,8 +7,8 @@ import { EntityRelation, isLazyComponentRef, EntityReference, Vector, GeoPoint }
7
7
  import { useBlocker, useLocation, Link, createBrowserRouter, RouterProvider, Routes } from "react-router-dom";
8
8
  import { stripCollectionPath, canCreateEntity, canEditEntity, canDeleteEntity, canReadCollection, getSubcollections, buildRebaseData, removeInitialAndTrailingSlashes, resolveStorageFilenameString, resolveStoragePathString, isPropertyBuilder, getLabelOrConfigFrom } from "@rebasepro/common";
9
9
  import { mergeDeep, slugify, hashString, isObject, isPlainObject, randomString } from "@rebasepro/utils";
10
- import { deepEqual } from "fast-equals";
11
10
  import { useTranslation as useTranslation$1, initReactI18next, I18nextProvider } from "react-i18next";
11
+ import { deepEqual } from "fast-equals";
12
12
  import i18next from "i18next";
13
13
  import Fuse from "fuse.js";
14
14
  import Compressor from "compressorjs";
@@ -1753,128 +1753,6 @@ function useBuildModeController() {
1753
1753
  setMode: setModeInternal
1754
1754
  }), [mode, setModeInternal]);
1755
1755
  }
1756
- function useValidateAuthenticator(t0) {
1757
- const $ = c(17);
1758
- const {
1759
- disabled,
1760
- authController,
1761
- authenticator,
1762
- storageSource,
1763
- data
1764
- } = t0;
1765
- const authenticationEnabled = Boolean(authenticator);
1766
- const [authLoading, setAuthLoading] = useState(authenticationEnabled);
1767
- const [notAllowedError, setNotAllowedError] = useState(false);
1768
- const [authVerified, setAuthVerified] = useState(!authenticationEnabled || Boolean(authController.loginSkipped));
1769
- const canAccessMainView = authVerified && (!authenticationEnabled || Boolean(authController.user) || Boolean(authController.loginSkipped)) && !notAllowedError;
1770
- let t1;
1771
- let t2;
1772
- if ($[0] !== authController.loginSkipped) {
1773
- t1 = () => {
1774
- if (authController.loginSkipped) {
1775
- setAuthVerified(true);
1776
- }
1777
- };
1778
- t2 = [authController.loginSkipped];
1779
- $[0] = authController.loginSkipped;
1780
- $[1] = t1;
1781
- $[2] = t2;
1782
- } else {
1783
- t1 = $[1];
1784
- t2 = $[2];
1785
- }
1786
- useEffect(t1, t2);
1787
- const checkedUserRef = useRef(void 0);
1788
- let t3;
1789
- if ($[3] !== authController || $[4] !== authenticator || $[5] !== data || $[6] !== disabled || $[7] !== storageSource) {
1790
- t3 = async () => {
1791
- if (disabled) {
1792
- return;
1793
- }
1794
- if (authController.initialLoading) {
1795
- return;
1796
- }
1797
- if (!authController.user && !authController.loginSkipped) {
1798
- checkedUserRef.current = void 0;
1799
- setAuthLoading(false);
1800
- setAuthVerified(false);
1801
- return;
1802
- }
1803
- const delegateUser = authController.user;
1804
- if (authenticator instanceof Function && delegateUser && !deepEqual(checkedUserRef.current?.uid, delegateUser.uid)) {
1805
- setAuthLoading(true);
1806
- try {
1807
- const allowed = await authenticator({
1808
- user: delegateUser,
1809
- authController,
1810
- data,
1811
- storageSource
1812
- });
1813
- if (!allowed) {
1814
- authController.signOut();
1815
- setNotAllowedError(true);
1816
- }
1817
- } catch (t42) {
1818
- const e = t42;
1819
- setNotAllowedError(e);
1820
- authController.signOut();
1821
- }
1822
- setAuthLoading(false);
1823
- setAuthVerified(true);
1824
- checkedUserRef.current = delegateUser;
1825
- } else {
1826
- setAuthLoading(false);
1827
- }
1828
- if (!authController.initialLoading && !delegateUser) {
1829
- setAuthVerified(true);
1830
- }
1831
- };
1832
- $[3] = authController;
1833
- $[4] = authenticator;
1834
- $[5] = data;
1835
- $[6] = disabled;
1836
- $[7] = storageSource;
1837
- $[8] = t3;
1838
- } else {
1839
- t3 = $[8];
1840
- }
1841
- const checkAuthentication = t3;
1842
- let t4;
1843
- let t5;
1844
- if ($[9] !== checkAuthentication) {
1845
- t4 = () => {
1846
- checkAuthentication();
1847
- };
1848
- t5 = [checkAuthentication];
1849
- $[9] = checkAuthentication;
1850
- $[10] = t4;
1851
- $[11] = t5;
1852
- } else {
1853
- t4 = $[10];
1854
- t5 = $[11];
1855
- }
1856
- useEffect(t4, t5);
1857
- let t6;
1858
- const t7 = authenticationEnabled && authLoading;
1859
- let t8;
1860
- if ($[12] !== authVerified || $[13] !== canAccessMainView || $[14] !== notAllowedError || $[15] !== t7) {
1861
- t8 = {
1862
- canAccessMainView,
1863
- authLoading: t7,
1864
- notAllowedError,
1865
- authVerified
1866
- };
1867
- $[12] = authVerified;
1868
- $[13] = canAccessMainView;
1869
- $[14] = notAllowedError;
1870
- $[15] = t7;
1871
- $[16] = t8;
1872
- } else {
1873
- t8 = $[16];
1874
- }
1875
- t6 = t8;
1876
- return t6;
1877
- }
1878
1756
  const RegistryDispatchContext = createContext(void 0);
1879
1757
  const RegistryStateContext = createContext({
1880
1758
  cmsConfig: null,
@@ -5638,11 +5516,18 @@ function UserSettingsView() {
5638
5516
  const {
5639
5517
  t
5640
5518
  } = useTranslation();
5519
+ const hasPasswordChange = !!authController.changePassword;
5641
5520
  const [activeTab, setActiveTab] = useState("profile");
5642
5521
  const [displayName, setDisplayName] = useState(user?.displayName || "");
5643
5522
  const [photoURL, setPhotoURL] = useState(user?.photoURL || "");
5644
5523
  const [savingProfile, setSavingProfile] = useState(false);
5645
5524
  const [profileError, setProfileError] = useState(null);
5525
+ const [currentPassword, setCurrentPassword] = useState("");
5526
+ const [newPassword, setNewPassword] = useState("");
5527
+ const [confirmPassword, setConfirmPassword] = useState("");
5528
+ const [changingPassword, setChangingPassword] = useState(false);
5529
+ const [passwordError, setPasswordError] = useState(null);
5530
+ const [passwordSuccess, setPasswordSuccess] = useState(null);
5646
5531
  const [sessions, setSessions] = useState([]);
5647
5532
  const [loadingSessions, setLoadingSessions] = useState(false);
5648
5533
  const [sessionsError, setSessionsError] = useState(null);
@@ -5670,6 +5555,35 @@ function UserSettingsView() {
5670
5555
  setSavingProfile(false);
5671
5556
  }
5672
5557
  };
5558
+ const handleChangePassword = async () => {
5559
+ setPasswordError(null);
5560
+ setPasswordSuccess(null);
5561
+ if (newPassword.length < 8) {
5562
+ setPasswordError(t("password_too_short"));
5563
+ return;
5564
+ }
5565
+ if (newPassword !== confirmPassword) {
5566
+ setPasswordError(t("passwords_dont_match"));
5567
+ return;
5568
+ }
5569
+ setChangingPassword(true);
5570
+ try {
5571
+ if (authController.changePassword) {
5572
+ await authController.changePassword(currentPassword, newPassword);
5573
+ setPasswordSuccess(t("password_changed"));
5574
+ setCurrentPassword("");
5575
+ setNewPassword("");
5576
+ setConfirmPassword("");
5577
+ setTimeout(() => {
5578
+ authController.signOut();
5579
+ }, 2e3);
5580
+ }
5581
+ } catch (e_0) {
5582
+ setPasswordError(e_0 instanceof Error ? e_0.message : String(e_0));
5583
+ } finally {
5584
+ setChangingPassword(false);
5585
+ }
5586
+ };
5673
5587
  const loadSessions = async () => {
5674
5588
  setLoadingSessions(true);
5675
5589
  setSessionsError(null);
@@ -5681,8 +5595,8 @@ function UserSettingsView() {
5681
5595
  } else {
5682
5596
  throw new Error("fetchSessions not implemented in this auth controller.");
5683
5597
  }
5684
- } catch (e_0) {
5685
- setSessionsError(e_0 instanceof Error ? e_0.message : String(e_0));
5598
+ } catch (e_1) {
5599
+ setSessionsError(e_1 instanceof Error ? e_1.message : String(e_1));
5686
5600
  } finally {
5687
5601
  setLoadingSessions(false);
5688
5602
  }
@@ -5699,8 +5613,8 @@ function UserSettingsView() {
5699
5613
  } else {
5700
5614
  throw new Error("revokeSession not implemented in this auth controller.");
5701
5615
  }
5702
- } catch (e_1) {
5703
- setSessionsError(e_1 instanceof Error ? e_1.message : String(e_1));
5616
+ } catch (e_2) {
5617
+ setSessionsError(e_2 instanceof Error ? e_2.message : String(e_2));
5704
5618
  } finally {
5705
5619
  setRevokingSessionId(null);
5706
5620
  }
@@ -5713,8 +5627,8 @@ function UserSettingsView() {
5713
5627
  } else {
5714
5628
  throw new Error("revokeAllSessions not implemented in this auth controller.");
5715
5629
  }
5716
- } catch (e_2) {
5717
- setSessionsError(e_2 instanceof Error ? e_2.message : String(e_2));
5630
+ } catch (e_3) {
5631
+ setSessionsError(e_3 instanceof Error ? e_3.message : String(e_3));
5718
5632
  } finally {
5719
5633
  setRevokingAll(false);
5720
5634
  }
@@ -5724,15 +5638,25 @@ function UserSettingsView() {
5724
5638
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "mb-8", children: t("account_settings") }),
5725
5639
  /* @__PURE__ */ jsxs(Tabs, { value: activeTab, onValueChange: (v) => setActiveTab(v), className: "mb-8", children: [
5726
5640
  /* @__PURE__ */ jsx(Tab, { value: "profile", children: t("profile") }),
5641
+ hasPasswordChange && /* @__PURE__ */ jsx(Tab, { value: "security", children: t("security") }),
5727
5642
  /* @__PURE__ */ jsx(Tab, { value: "sessions", children: t("sessions") })
5728
5643
  ] }),
5729
5644
  activeTab === "profile" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 max-w-xl", children: [
5730
5645
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-6 mb-2", children: /* @__PURE__ */ jsx(Avatar, { src: photoURL || void 0, className: "w-24 h-24 text-3xl", children: displayName ? displayName[0].toUpperCase() : user.email ? user.email[0].toUpperCase() : "A" }) }),
5731
- /* @__PURE__ */ jsx(TextField, { label: t("display_name"), value: displayName, onChange: (e_3) => setDisplayName(e_3.target.value) }),
5732
- /* @__PURE__ */ jsx(TextField, { label: t("photo_url"), value: photoURL, onChange: (e_4) => setPhotoURL(e_4.target.value) }),
5646
+ /* @__PURE__ */ jsx(TextField, { label: t("display_name"), value: displayName, onChange: (e_4) => setDisplayName(e_4.target.value) }),
5647
+ /* @__PURE__ */ jsx(TextField, { label: t("photo_url"), value: photoURL, onChange: (e_5) => setPhotoURL(e_5.target.value) }),
5733
5648
  profileError && /* @__PURE__ */ jsx(Typography, { color: "error", children: profileError }),
5734
5649
  /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsx(Button, { variant: "filled", onClick: handleSaveProfile, disabled: savingProfile, children: savingProfile ? t("saving") : t("save_profile") }) })
5735
5650
  ] }),
5651
+ activeTab === "security" && hasPasswordChange && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 max-w-xl", children: [
5652
+ /* @__PURE__ */ jsx(Typography, { variant: "h6", className: "mb-2", children: t("change_password") }),
5653
+ /* @__PURE__ */ jsx(TextField, { label: t("current_password"), type: "password", value: currentPassword, onChange: (e_6) => setCurrentPassword(e_6.target.value), autoComplete: "current-password" }),
5654
+ /* @__PURE__ */ jsx(TextField, { label: t("new_password"), type: "password", value: newPassword, onChange: (e_7) => setNewPassword(e_7.target.value), autoComplete: "new-password" }),
5655
+ /* @__PURE__ */ jsx(TextField, { label: t("confirm_password"), type: "password", value: confirmPassword, onChange: (e_8) => setConfirmPassword(e_8.target.value), autoComplete: "new-password" }),
5656
+ passwordError && /* @__PURE__ */ jsx(Typography, { color: "error", children: passwordError }),
5657
+ passwordSuccess && /* @__PURE__ */ jsx(Typography, { className: "text-emerald-600 dark:text-emerald-400", children: passwordSuccess }),
5658
+ /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsx(Button, { variant: "filled", onClick: handleChangePassword, disabled: changingPassword || !currentPassword || !newPassword || !confirmPassword, children: changingPassword ? t("changing_password") : t("change_password") }) })
5659
+ ] }),
5736
5660
  activeTab === "sessions" && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 max-w-3xl", children: loadingSessions ? /* @__PURE__ */ jsx("div", { className: "flex justify-center p-8", children: /* @__PURE__ */ jsx(CircularProgress, {}) }) : sessionsError ? /* @__PURE__ */ jsx(Typography, { color: "error", children: sessionsError }) : sessions.length === 0 ? /* @__PURE__ */ jsx(Typography, { children: t("no_active_sessions") }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
5737
5661
  /* @__PURE__ */ jsx("div", { className: "flex justify-end mb-2", children: /* @__PURE__ */ jsx(Button, { variant: "text", color: "error", onClick: handleRevokeAll, disabled: revokingAll, children: revokingAll ? t("revoking") : t("revoke_all_sessions") }) }),
5738
5662
  sessions.map((session) => /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center p-4 bg-white dark:bg-surface-950 border rounded-lg dark:border-surface-700 shadow-sm", children: [
@@ -6431,7 +6355,7 @@ function UserDisplay(t0) {
6431
6355
  return t8;
6432
6356
  }
6433
6357
  function LoginView(t0) {
6434
- const $ = c(87);
6358
+ const $ = c(107);
6435
6359
  const {
6436
6360
  logo,
6437
6361
  authController,
@@ -6440,8 +6364,13 @@ function LoginView(t0) {
6440
6364
  disabled: t2,
6441
6365
  notAllowedError,
6442
6366
  googleClientId,
6367
+ githubClientId,
6368
+ linkedinClientId,
6369
+ title,
6370
+ subtitle,
6443
6371
  needsSetup,
6444
- registrationEnabled
6372
+ registrationEnabled,
6373
+ additionalComponent
6445
6374
  } = t0;
6446
6375
  const disableSignupScreen = t1 === void 0 ? false : t1;
6447
6376
  const disabled = t2 === void 0 ? false : t2;
@@ -6492,26 +6421,76 @@ function LoginView(t0) {
6492
6421
  t5 = $[6];
6493
6422
  }
6494
6423
  const hasGoogleLogin = t5;
6495
- const hasPasswordReset = caps.passwordReset ?? !!authController.forgotPassword;
6496
- const showRegistration = !disableSignupScreen && canRegister;
6497
6424
  let t6;
6425
+ if ($[7] !== caps.enabledProviders || $[8] !== githubClientId) {
6426
+ t6 = githubClientId && (caps.enabledProviders?.includes("github") ?? false);
6427
+ $[7] = caps.enabledProviders;
6428
+ $[8] = githubClientId;
6429
+ $[9] = t6;
6430
+ } else {
6431
+ t6 = $[9];
6432
+ }
6433
+ const hasGitHubLogin = t6;
6498
6434
  let t7;
6499
- if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6500
- t6 = () => {
6435
+ if ($[10] !== caps.enabledProviders || $[11] !== linkedinClientId) {
6436
+ t7 = linkedinClientId && (caps.enabledProviders?.includes("linkedin") ?? false);
6437
+ $[10] = caps.enabledProviders;
6438
+ $[11] = linkedinClientId;
6439
+ $[12] = t7;
6440
+ } else {
6441
+ t7 = $[12];
6442
+ }
6443
+ const hasLinkedinLogin = t7;
6444
+ const hasPasswordReset = caps.passwordReset ?? !!authController.forgotPassword;
6445
+ const showRegistration = !disableSignupScreen && canRegister;
6446
+ let t8;
6447
+ let t9;
6448
+ if ($[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6449
+ t8 = () => {
6501
6450
  const timer = setTimeout(() => setFadeIn(true), 50);
6502
6451
  return () => clearTimeout(timer);
6503
6452
  };
6504
- t7 = [];
6505
- $[7] = t6;
6506
- $[8] = t7;
6453
+ t9 = [];
6454
+ $[13] = t8;
6455
+ $[14] = t9;
6507
6456
  } else {
6508
- t6 = $[7];
6509
- t7 = $[8];
6457
+ t8 = $[13];
6458
+ t9 = $[14];
6510
6459
  }
6511
- useEffect(t6, t7);
6512
- let t8;
6513
- if ($[9] !== authController.authProviderError || $[10] !== authController.user) {
6514
- t8 = function buildErrorView2() {
6460
+ useEffect(t8, t9);
6461
+ let t10;
6462
+ let t11;
6463
+ if ($[15] !== authController) {
6464
+ t10 = () => {
6465
+ const params = new URLSearchParams(window.location.search);
6466
+ const code = params.get("code");
6467
+ const provider = localStorage.getItem("rebase_oauth_provider");
6468
+ if (code && provider) {
6469
+ localStorage.removeItem("rebase_oauth_provider");
6470
+ const cleanUrl = window.location.origin + window.location.pathname;
6471
+ window.history.replaceState({}, document.title, cleanUrl);
6472
+ if (authController.oauthLogin) {
6473
+ authController.oauthLogin(provider, {
6474
+ code,
6475
+ redirectUri: cleanUrl
6476
+ }).catch((err) => {
6477
+ console.error(`${provider} login failed:`, err);
6478
+ });
6479
+ }
6480
+ }
6481
+ };
6482
+ t11 = [authController];
6483
+ $[15] = authController;
6484
+ $[16] = t10;
6485
+ $[17] = t11;
6486
+ } else {
6487
+ t10 = $[16];
6488
+ t11 = $[17];
6489
+ }
6490
+ useEffect(t10, t11);
6491
+ let t12;
6492
+ if ($[18] !== authController.authProviderError || $[19] !== authController.user) {
6493
+ t12 = function buildErrorView2() {
6515
6494
  if (!authController.authProviderError) {
6516
6495
  return null;
6517
6496
  }
@@ -6521,44 +6500,44 @@ function LoginView(t0) {
6521
6500
  const errorMsg = authController.authProviderError instanceof Error ? authController.authProviderError.message : String(authController.authProviderError);
6522
6501
  return /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsx(ErrorView, { error: errorMsg }) });
6523
6502
  };
6524
- $[9] = authController.authProviderError;
6525
- $[10] = authController.user;
6526
- $[11] = t8;
6503
+ $[18] = authController.authProviderError;
6504
+ $[19] = authController.user;
6505
+ $[20] = t12;
6527
6506
  } else {
6528
- t8 = $[11];
6507
+ t12 = $[20];
6529
6508
  }
6530
- const buildErrorView = t8;
6509
+ const buildErrorView = t12;
6531
6510
  let logoComponent;
6532
6511
  if (logo) {
6533
- let t92;
6534
- if ($[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6535
- t92 = {
6512
+ let t132;
6513
+ if ($[21] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6514
+ t132 = {
6536
6515
  height: "100%",
6537
6516
  width: "100%",
6538
6517
  objectFit: "cover"
6539
6518
  };
6540
- $[12] = t92;
6519
+ $[21] = t132;
6541
6520
  } else {
6542
- t92 = $[12];
6521
+ t132 = $[21];
6543
6522
  }
6544
- let t102;
6545
- if ($[13] !== logo) {
6546
- t102 = /* @__PURE__ */ jsx("img", { src: logo, style: t92, alt: "Logo" });
6547
- $[13] = logo;
6548
- $[14] = t102;
6523
+ let t142;
6524
+ if ($[22] !== logo) {
6525
+ t142 = /* @__PURE__ */ jsx("img", { src: logo, style: t132, alt: "Logo" });
6526
+ $[22] = logo;
6527
+ $[23] = t142;
6549
6528
  } else {
6550
- t102 = $[14];
6529
+ t142 = $[23];
6551
6530
  }
6552
- logoComponent = t102;
6531
+ logoComponent = t142;
6553
6532
  } else {
6554
- let t92;
6555
- if ($[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6556
- t92 = /* @__PURE__ */ jsx(RebaseLogo, {});
6557
- $[15] = t92;
6533
+ let t132;
6534
+ if ($[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6535
+ t132 = /* @__PURE__ */ jsx(RebaseLogo, {});
6536
+ $[24] = t132;
6558
6537
  } else {
6559
- t92 = $[15];
6538
+ t132 = $[24];
6560
6539
  }
6561
- logoComponent = t92;
6540
+ logoComponent = t132;
6562
6541
  }
6563
6542
  let notAllowedMessage;
6564
6543
  if (notAllowedError) {
@@ -6568,210 +6547,227 @@ function LoginView(t0) {
6568
6547
  if (notAllowedError instanceof Error) {
6569
6548
  notAllowedMessage = notAllowedError.message;
6570
6549
  } else {
6571
- notAllowedMessage = "It looks like you don't have access, based on the specified Authenticator configuration";
6550
+ notAllowedMessage = "It looks like you don't have access, based on the specified access configuration";
6572
6551
  }
6573
6552
  }
6574
6553
  }
6575
- const t9 = fadeIn ? "opacity-100" : "opacity-0";
6576
- let t10;
6577
- if ($[16] !== t9) {
6578
- t10 = cls("relative flex items-center justify-center h-screen w-screen p-4 transition-opacity duration-500 bg-surface-50 dark:bg-surface-800", t9);
6579
- $[16] = t9;
6580
- $[17] = t10;
6581
- } else {
6582
- t10 = $[17];
6583
- }
6584
- let t11;
6585
- if ($[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6586
- t11 = /* @__PURE__ */ jsx(LanguageToggle, {});
6587
- $[18] = t11;
6588
- } else {
6589
- t11 = $[18];
6590
- }
6591
- let t12;
6592
- if ($[19] !== colorMode) {
6593
- t12 = /* @__PURE__ */ jsx(IconButton, { color: "inherit", "aria-label": "Toggle theme", children: colorMode === "dark" ? /* @__PURE__ */ jsx(MoonIcon, { size: iconSize.small }) : /* @__PURE__ */ jsx(SunIcon, { size: iconSize.small }) });
6594
- $[19] = colorMode;
6595
- $[20] = t12;
6596
- } else {
6597
- t12 = $[20];
6598
- }
6599
- let t13;
6600
- if ($[21] !== setColorMode) {
6601
- t13 = () => setColorMode("dark");
6602
- $[21] = setColorMode;
6603
- $[22] = t13;
6604
- } else {
6605
- t13 = $[22];
6606
- }
6554
+ const t13 = fadeIn ? "opacity-100" : "opacity-0";
6607
6555
  let t14;
6608
- if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6609
- t14 = /* @__PURE__ */ jsx(MoonIcon, { size: iconSize.smallest });
6610
- $[23] = t14;
6556
+ if ($[25] !== t13) {
6557
+ t14 = cls("relative flex items-center justify-center h-screen w-screen p-4 transition-opacity duration-500 bg-surface-50 dark:bg-surface-950 overflow-hidden", t13);
6558
+ $[25] = t13;
6559
+ $[26] = t14;
6611
6560
  } else {
6612
- t14 = $[23];
6561
+ t14 = $[26];
6613
6562
  }
6614
6563
  let t15;
6615
- if ($[24] !== t) {
6616
- t15 = t("dark_mode");
6617
- $[24] = t;
6618
- $[25] = t15;
6619
- } else {
6620
- t15 = $[25];
6621
- }
6622
6564
  let t16;
6623
- if ($[26] !== t13 || $[27] !== t15) {
6624
- t16 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t13, children: [
6625
- t14,
6626
- " ",
6627
- t15
6628
- ] });
6629
- $[26] = t13;
6565
+ if ($[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6566
+ t15 = /* @__PURE__ */ jsx("div", { className: "absolute top-[-10%] left-[-10%] w-[50%] h-[50%] rounded-full bg-primary-500/10 blur-[120px] pointer-events-none" });
6567
+ t16 = /* @__PURE__ */ jsx("div", { className: "absolute bottom-[-10%] right-[-10%] w-[50%] h-[50%] rounded-full bg-indigo-500/10 blur-[120px] pointer-events-none" });
6630
6568
  $[27] = t15;
6631
6569
  $[28] = t16;
6632
6570
  } else {
6571
+ t15 = $[27];
6633
6572
  t16 = $[28];
6634
6573
  }
6635
6574
  let t17;
6636
- if ($[29] !== setColorMode) {
6637
- t17 = () => setColorMode("light");
6638
- $[29] = setColorMode;
6639
- $[30] = t17;
6575
+ if ($[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6576
+ t17 = /* @__PURE__ */ jsx(LanguageToggle, {});
6577
+ $[29] = t17;
6640
6578
  } else {
6641
- t17 = $[30];
6579
+ t17 = $[29];
6642
6580
  }
6643
6581
  let t18;
6644
- if ($[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6645
- t18 = /* @__PURE__ */ jsx(SunIcon, { size: iconSize.smallest });
6582
+ if ($[30] !== colorMode) {
6583
+ t18 = /* @__PURE__ */ jsx(IconButton, { color: "inherit", "aria-label": "Toggle theme", children: colorMode === "dark" ? /* @__PURE__ */ jsx(MoonIcon, { size: iconSize.small }) : /* @__PURE__ */ jsx(SunIcon, { size: iconSize.small }) });
6584
+ $[30] = colorMode;
6646
6585
  $[31] = t18;
6647
6586
  } else {
6648
6587
  t18 = $[31];
6649
6588
  }
6650
6589
  let t19;
6651
- if ($[32] !== t) {
6652
- t19 = t("light_mode");
6653
- $[32] = t;
6590
+ if ($[32] !== setColorMode) {
6591
+ t19 = () => setColorMode("dark");
6592
+ $[32] = setColorMode;
6654
6593
  $[33] = t19;
6655
6594
  } else {
6656
6595
  t19 = $[33];
6657
6596
  }
6658
6597
  let t20;
6659
- if ($[34] !== t17 || $[35] !== t19) {
6660
- t20 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t17, children: [
6661
- t18,
6662
- " ",
6663
- t19
6664
- ] });
6665
- $[34] = t17;
6666
- $[35] = t19;
6667
- $[36] = t20;
6598
+ if ($[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6599
+ t20 = /* @__PURE__ */ jsx(MoonIcon, { size: iconSize.smallest });
6600
+ $[34] = t20;
6668
6601
  } else {
6669
- t20 = $[36];
6602
+ t20 = $[34];
6670
6603
  }
6671
6604
  let t21;
6672
- if ($[37] !== setColorMode) {
6673
- t21 = () => setColorMode("system");
6674
- $[37] = setColorMode;
6675
- $[38] = t21;
6605
+ if ($[35] !== t) {
6606
+ t21 = t("dark_mode");
6607
+ $[35] = t;
6608
+ $[36] = t21;
6676
6609
  } else {
6677
- t21 = $[38];
6610
+ t21 = $[36];
6678
6611
  }
6679
6612
  let t22;
6680
- if ($[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6681
- t22 = /* @__PURE__ */ jsx(SunMoonIcon, { size: iconSize.smallest });
6613
+ if ($[37] !== t19 || $[38] !== t21) {
6614
+ t22 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t19, children: [
6615
+ t20,
6616
+ " ",
6617
+ t21
6618
+ ] });
6619
+ $[37] = t19;
6620
+ $[38] = t21;
6682
6621
  $[39] = t22;
6683
6622
  } else {
6684
6623
  t22 = $[39];
6685
6624
  }
6686
6625
  let t23;
6687
- if ($[40] !== t) {
6688
- t23 = t("system_mode");
6689
- $[40] = t;
6626
+ if ($[40] !== setColorMode) {
6627
+ t23 = () => setColorMode("light");
6628
+ $[40] = setColorMode;
6690
6629
  $[41] = t23;
6691
6630
  } else {
6692
6631
  t23 = $[41];
6693
6632
  }
6694
6633
  let t24;
6695
- if ($[42] !== t21 || $[43] !== t23) {
6696
- t24 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t21, children: [
6697
- t22,
6698
- " ",
6699
- t23
6700
- ] });
6701
- $[42] = t21;
6702
- $[43] = t23;
6703
- $[44] = t24;
6634
+ if ($[42] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6635
+ t24 = /* @__PURE__ */ jsx(SunIcon, { size: iconSize.smallest });
6636
+ $[42] = t24;
6704
6637
  } else {
6705
- t24 = $[44];
6638
+ t24 = $[42];
6706
6639
  }
6707
6640
  let t25;
6708
- if ($[45] !== t12 || $[46] !== t16 || $[47] !== t20 || $[48] !== t24) {
6709
- t25 = /* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 flex items-center gap-1 z-10", children: [
6710
- t11,
6711
- /* @__PURE__ */ jsxs(Menu, { trigger: t12, children: [
6712
- t16,
6713
- t20,
6714
- t24
6715
- ] })
6716
- ] });
6717
- $[45] = t12;
6718
- $[46] = t16;
6719
- $[47] = t20;
6720
- $[48] = t24;
6721
- $[49] = t25;
6641
+ if ($[43] !== t) {
6642
+ t25 = t("light_mode");
6643
+ $[43] = t;
6644
+ $[44] = t25;
6722
6645
  } else {
6723
- t25 = $[49];
6646
+ t25 = $[44];
6724
6647
  }
6725
6648
  let t26;
6726
- if ($[50] !== logoComponent) {
6727
- t26 = /* @__PURE__ */ jsx("div", { className: "w-32 h-32 m-2 mb-6", children: logoComponent });
6728
- $[50] = logoComponent;
6729
- $[51] = t26;
6649
+ if ($[45] !== t23 || $[46] !== t25) {
6650
+ t26 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t23, children: [
6651
+ t24,
6652
+ " ",
6653
+ t25
6654
+ ] });
6655
+ $[45] = t23;
6656
+ $[46] = t25;
6657
+ $[47] = t26;
6730
6658
  } else {
6731
- t26 = $[51];
6659
+ t26 = $[47];
6732
6660
  }
6733
6661
  let t27;
6734
- if ($[52] !== notAllowedMessage) {
6735
- t27 = notAllowedMessage && /* @__PURE__ */ jsx("div", { className: "p-4 w-full", children: /* @__PURE__ */ jsx(ErrorView, { error: notAllowedMessage }) });
6736
- $[52] = notAllowedMessage;
6737
- $[53] = t27;
6662
+ if ($[48] !== setColorMode) {
6663
+ t27 = () => setColorMode("system");
6664
+ $[48] = setColorMode;
6665
+ $[49] = t27;
6738
6666
  } else {
6739
- t27 = $[53];
6667
+ t27 = $[49];
6740
6668
  }
6741
6669
  let t28;
6742
- if ($[54] !== buildErrorView || $[55] !== mode) {
6743
- t28 = mode !== "forgot" && buildErrorView();
6744
- $[54] = buildErrorView;
6745
- $[55] = mode;
6746
- $[56] = t28;
6670
+ if ($[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6671
+ t28 = /* @__PURE__ */ jsx(SunMoonIcon, { size: iconSize.smallest });
6672
+ $[50] = t28;
6673
+ } else {
6674
+ t28 = $[50];
6675
+ }
6676
+ let t29;
6677
+ if ($[51] !== t) {
6678
+ t29 = t("system_mode");
6679
+ $[51] = t;
6680
+ $[52] = t29;
6747
6681
  } else {
6748
- t28 = $[56];
6682
+ t29 = $[52];
6749
6683
  }
6750
- const t29 = viewVisible ? "opacity-100" : "opacity-0";
6751
6684
  let t30;
6752
- if ($[57] !== t29) {
6753
- t30 = cls("w-full transition-opacity duration-150", t29);
6754
- $[57] = t29;
6755
- $[58] = t30;
6685
+ if ($[53] !== t27 || $[54] !== t29) {
6686
+ t30 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t27, children: [
6687
+ t28,
6688
+ " ",
6689
+ t29
6690
+ ] });
6691
+ $[53] = t27;
6692
+ $[54] = t29;
6693
+ $[55] = t30;
6756
6694
  } else {
6757
- t30 = $[58];
6695
+ t30 = $[55];
6758
6696
  }
6759
6697
  let t31;
6760
- if ($[59] !== authController || $[60] !== isBootstrapMode || $[61] !== noUserComponent) {
6761
- t31 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true });
6762
- $[59] = authController;
6763
- $[60] = isBootstrapMode;
6764
- $[61] = noUserComponent;
6765
- $[62] = t31;
6698
+ if ($[56] !== t18 || $[57] !== t22 || $[58] !== t26 || $[59] !== t30) {
6699
+ t31 = /* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 flex items-center gap-1 z-10", children: [
6700
+ t17,
6701
+ /* @__PURE__ */ jsxs(Menu, { trigger: t18, children: [
6702
+ t22,
6703
+ t26,
6704
+ t30
6705
+ ] })
6706
+ ] });
6707
+ $[56] = t18;
6708
+ $[57] = t22;
6709
+ $[58] = t26;
6710
+ $[59] = t30;
6711
+ $[60] = t31;
6766
6712
  } else {
6767
- t31 = $[62];
6713
+ t31 = $[60];
6768
6714
  }
6769
6715
  let t32;
6770
- if ($[63] !== authController || $[64] !== disableSignupScreen || $[65] !== disabled || $[66] !== googleClientId || $[67] !== hasGoogleLogin || $[68] !== hasPasswordReset || $[69] !== isBootstrapMode || $[70] !== mode || $[71] !== noUserComponent || $[72] !== showRegistration) {
6771
- t32 = !isBootstrapMode && /* @__PURE__ */ jsxs(Fragment, { children: [
6716
+ if ($[61] !== logoComponent) {
6717
+ t32 = /* @__PURE__ */ jsx("div", { className: "w-24 h-24 m-2 mb-4 drop-shadow-md", children: logoComponent });
6718
+ $[61] = logoComponent;
6719
+ $[62] = t32;
6720
+ } else {
6721
+ t32 = $[62];
6722
+ }
6723
+ let t33;
6724
+ if ($[63] !== notAllowedMessage) {
6725
+ t33 = notAllowedMessage && /* @__PURE__ */ jsx("div", { className: "p-4 w-full", children: /* @__PURE__ */ jsx(ErrorView, { error: notAllowedMessage }) });
6726
+ $[63] = notAllowedMessage;
6727
+ $[64] = t33;
6728
+ } else {
6729
+ t33 = $[64];
6730
+ }
6731
+ let t34;
6732
+ if ($[65] !== buildErrorView || $[66] !== mode) {
6733
+ t34 = mode !== "forgot" && buildErrorView();
6734
+ $[65] = buildErrorView;
6735
+ $[66] = mode;
6736
+ $[67] = t34;
6737
+ } else {
6738
+ t34 = $[67];
6739
+ }
6740
+ const t35 = viewVisible ? "opacity-100" : "opacity-0";
6741
+ let t36;
6742
+ if ($[68] !== t35) {
6743
+ t36 = cls("w-full transition-opacity duration-150", t35);
6744
+ $[68] = t35;
6745
+ $[69] = t36;
6746
+ } else {
6747
+ t36 = $[69];
6748
+ }
6749
+ let t37;
6750
+ if ($[70] !== authController || $[71] !== isBootstrapMode || $[72] !== noUserComponent) {
6751
+ t37 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true });
6752
+ $[70] = authController;
6753
+ $[71] = isBootstrapMode;
6754
+ $[72] = noUserComponent;
6755
+ $[73] = t37;
6756
+ } else {
6757
+ t37 = $[73];
6758
+ }
6759
+ let t38;
6760
+ if ($[74] !== authController || $[75] !== disableSignupScreen || $[76] !== disabled || $[77] !== githubClientId || $[78] !== googleClientId || $[79] !== hasGitHubLogin || $[80] !== hasGoogleLogin || $[81] !== hasLinkedinLogin || $[82] !== hasPasswordReset || $[83] !== isBootstrapMode || $[84] !== linkedinClientId || $[85] !== mode || $[86] !== noUserComponent || $[87] !== showRegistration || $[88] !== subtitle || $[89] !== title) {
6761
+ t38 = !isBootstrapMode && /* @__PURE__ */ jsxs(Fragment, { children: [
6772
6762
  mode === "buttons" && /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col gap-3 mt-2", children: [
6763
+ (title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "text-center mb-2", children: [
6764
+ title && /* @__PURE__ */ jsx(Typography, { variant: "h6", className: "mb-0.5 font-bold", children: title }),
6765
+ subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "secondary", className: "mb-4", children: subtitle })
6766
+ ] }),
6773
6767
  /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Sign in with email", icon: /* @__PURE__ */ jsx(MailIcon, {}), onClick: () => switchMode("login") }),
6774
6768
  hasGoogleLogin && googleClientId && /* @__PURE__ */ jsx(GoogleLoginButton, { disabled, googleClientId, authController }),
6769
+ hasGitHubLogin && githubClientId && /* @__PURE__ */ jsx(GitHubLoginButton, { disabled, githubClientId }),
6770
+ hasLinkedinLogin && linkedinClientId && /* @__PURE__ */ jsx(LinkedInLoginButton, { disabled, linkedinClientId }),
6775
6771
  showRegistration && /* @__PURE__ */ jsx("div", { className: "mt-2 text-center", children: /* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "secondary", children: [
6776
6772
  "Don't have an account?",
6777
6773
  " ",
@@ -6782,63 +6778,81 @@ function LoginView(t0) {
6782
6778
  mode === "register" && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToLogin: () => switchMode("login") }),
6783
6779
  mode === "forgot" && authController.forgotPassword && /* @__PURE__ */ jsx(ForgotPasswordForm, { authController, onClose: () => switchMode("login") })
6784
6780
  ] });
6785
- $[63] = authController;
6786
- $[64] = disableSignupScreen;
6787
- $[65] = disabled;
6788
- $[66] = googleClientId;
6789
- $[67] = hasGoogleLogin;
6790
- $[68] = hasPasswordReset;
6791
- $[69] = isBootstrapMode;
6792
- $[70] = mode;
6793
- $[71] = noUserComponent;
6794
- $[72] = showRegistration;
6795
- $[73] = t32;
6796
- } else {
6797
- t32 = $[73];
6781
+ $[74] = authController;
6782
+ $[75] = disableSignupScreen;
6783
+ $[76] = disabled;
6784
+ $[77] = githubClientId;
6785
+ $[78] = googleClientId;
6786
+ $[79] = hasGitHubLogin;
6787
+ $[80] = hasGoogleLogin;
6788
+ $[81] = hasLinkedinLogin;
6789
+ $[82] = hasPasswordReset;
6790
+ $[83] = isBootstrapMode;
6791
+ $[84] = linkedinClientId;
6792
+ $[85] = mode;
6793
+ $[86] = noUserComponent;
6794
+ $[87] = showRegistration;
6795
+ $[88] = subtitle;
6796
+ $[89] = title;
6797
+ $[90] = t38;
6798
+ } else {
6799
+ t38 = $[90];
6798
6800
  }
6799
- let t33;
6800
- if ($[74] !== t30 || $[75] !== t31 || $[76] !== t32) {
6801
- t33 = /* @__PURE__ */ jsxs("div", { className: t30, children: [
6802
- t31,
6803
- t32
6801
+ let t39;
6802
+ if ($[91] !== t36 || $[92] !== t37 || $[93] !== t38) {
6803
+ t39 = /* @__PURE__ */ jsxs("div", { className: t36, children: [
6804
+ t37,
6805
+ t38
6804
6806
  ] });
6805
- $[74] = t30;
6806
- $[75] = t31;
6807
- $[76] = t32;
6808
- $[77] = t33;
6807
+ $[91] = t36;
6808
+ $[92] = t37;
6809
+ $[93] = t38;
6810
+ $[94] = t39;
6809
6811
  } else {
6810
- t33 = $[77];
6812
+ t39 = $[94];
6811
6813
  }
6812
- let t34;
6813
- if ($[78] !== t26 || $[79] !== t27 || $[80] !== t28 || $[81] !== t33) {
6814
- t34 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center w-[480px] max-w-full p-8 sm:p-10", children: [
6815
- t26,
6816
- t27,
6817
- t28,
6818
- t33
6814
+ let t40;
6815
+ if ($[95] !== additionalComponent) {
6816
+ t40 = additionalComponent && /* @__PURE__ */ jsx("div", { className: "w-full", children: additionalComponent });
6817
+ $[95] = additionalComponent;
6818
+ $[96] = t40;
6819
+ } else {
6820
+ t40 = $[96];
6821
+ }
6822
+ let t41;
6823
+ if ($[97] !== t32 || $[98] !== t33 || $[99] !== t34 || $[100] !== t39 || $[101] !== t40) {
6824
+ t41 = /* @__PURE__ */ jsxs("div", { className: "relative flex flex-col items-center w-[440px] max-w-full p-8 sm:p-10 bg-white/70 dark:bg-surface-900/60 backdrop-blur-xl border border-surface-200/50 dark:border-surface-800/50 rounded-2xl shadow-2xl z-10 transition-all duration-300 hover:shadow-primary-500/5", children: [
6825
+ t32,
6826
+ t33,
6827
+ t34,
6828
+ t39,
6829
+ t40
6819
6830
  ] });
6820
- $[78] = t26;
6821
- $[79] = t27;
6822
- $[80] = t28;
6823
- $[81] = t33;
6824
- $[82] = t34;
6831
+ $[97] = t32;
6832
+ $[98] = t33;
6833
+ $[99] = t34;
6834
+ $[100] = t39;
6835
+ $[101] = t40;
6836
+ $[102] = t41;
6825
6837
  } else {
6826
- t34 = $[82];
6838
+ t41 = $[102];
6827
6839
  }
6828
- let t35;
6829
- if ($[83] !== t10 || $[84] !== t25 || $[85] !== t34) {
6830
- t35 = /* @__PURE__ */ jsxs("div", { className: t10, children: [
6831
- t25,
6832
- t34
6840
+ let t42;
6841
+ if ($[103] !== t14 || $[104] !== t31 || $[105] !== t41) {
6842
+ t42 = /* @__PURE__ */ jsxs("div", { className: t14, children: [
6843
+ t15,
6844
+ t16,
6845
+ t31,
6846
+ t41
6833
6847
  ] });
6834
- $[83] = t10;
6835
- $[84] = t25;
6836
- $[85] = t34;
6837
- $[86] = t35;
6848
+ $[103] = t14;
6849
+ $[104] = t31;
6850
+ $[105] = t41;
6851
+ $[106] = t42;
6838
6852
  } else {
6839
- t35 = $[86];
6853
+ t42 = $[106];
6840
6854
  }
6841
- return t35;
6855
+ return t42;
6842
6856
  }
6843
6857
  function _temp2() {
6844
6858
  }
@@ -6882,7 +6896,7 @@ function LoginButton(t0) {
6882
6896
  }
6883
6897
  let t4;
6884
6898
  if ($[7] !== disabled || $[8] !== onClick || $[9] !== t3) {
6885
- t4 = /* @__PURE__ */ jsx(Button, { disabled, className: "w-full", variant: "outlined", size: "large", onClick, children: t3 });
6899
+ t4 = /* @__PURE__ */ jsx(Button, { disabled, className: "w-full transition-transform duration-200 active:scale-[0.98]", variant: "outlined", size: "large", onClick, children: t3 });
6886
6900
  $[7] = disabled;
6887
6901
  $[8] = onClick;
6888
6902
  $[9] = t3;
@@ -6994,6 +7008,102 @@ function GoogleLoginButton(t0) {
6994
7008
  }
6995
7009
  return t5;
6996
7010
  }
7011
+ const GitHubIcon = () => {
7012
+ const $ = c(1);
7013
+ let t0;
7014
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7015
+ t0 = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.579.688.481C19.137 20.162 22 16.418 22 12c0-5.523-4.477-10-10-10z" }) });
7016
+ $[0] = t0;
7017
+ } else {
7018
+ t0 = $[0];
7019
+ }
7020
+ return t0;
7021
+ };
7022
+ function GitHubLoginButton(t0) {
7023
+ const $ = c(6);
7024
+ const {
7025
+ disabled,
7026
+ githubClientId
7027
+ } = t0;
7028
+ let t1;
7029
+ if ($[0] !== githubClientId) {
7030
+ t1 = () => {
7031
+ localStorage.setItem("rebase_oauth_provider", "github");
7032
+ const redirectUri = encodeURIComponent(window.location.origin + window.location.pathname);
7033
+ window.location.href = `https://github.com/login/oauth/authorize?client_id=${githubClientId}&redirect_uri=${redirectUri}&scope=${"read:user,user:email"}`;
7034
+ };
7035
+ $[0] = githubClientId;
7036
+ $[1] = t1;
7037
+ } else {
7038
+ t1 = $[1];
7039
+ }
7040
+ const handleClick = t1;
7041
+ let t2;
7042
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7043
+ t2 = /* @__PURE__ */ jsx(GitHubIcon, {});
7044
+ $[2] = t2;
7045
+ } else {
7046
+ t2 = $[2];
7047
+ }
7048
+ let t3;
7049
+ if ($[3] !== disabled || $[4] !== handleClick) {
7050
+ t3 = /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Sign in with GitHub", icon: t2, onClick: handleClick });
7051
+ $[3] = disabled;
7052
+ $[4] = handleClick;
7053
+ $[5] = t3;
7054
+ } else {
7055
+ t3 = $[5];
7056
+ }
7057
+ return t3;
7058
+ }
7059
+ const LinkedInIcon = () => {
7060
+ const $ = c(1);
7061
+ let t0;
7062
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7063
+ t0 = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z" }) });
7064
+ $[0] = t0;
7065
+ } else {
7066
+ t0 = $[0];
7067
+ }
7068
+ return t0;
7069
+ };
7070
+ function LinkedInLoginButton(t0) {
7071
+ const $ = c(6);
7072
+ const {
7073
+ disabled,
7074
+ linkedinClientId
7075
+ } = t0;
7076
+ let t1;
7077
+ if ($[0] !== linkedinClientId) {
7078
+ t1 = () => {
7079
+ localStorage.setItem("rebase_oauth_provider", "linkedin");
7080
+ const redirectUri = encodeURIComponent(window.location.origin + window.location.pathname);
7081
+ window.location.href = `https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=${linkedinClientId}&redirect_uri=${redirectUri}&scope=${"openid profile email"}`;
7082
+ };
7083
+ $[0] = linkedinClientId;
7084
+ $[1] = t1;
7085
+ } else {
7086
+ t1 = $[1];
7087
+ }
7088
+ const handleClick = t1;
7089
+ let t2;
7090
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7091
+ t2 = /* @__PURE__ */ jsx(LinkedInIcon, {});
7092
+ $[2] = t2;
7093
+ } else {
7094
+ t2 = $[2];
7095
+ }
7096
+ let t3;
7097
+ if ($[3] !== disabled || $[4] !== handleClick) {
7098
+ t3 = /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Sign in with LinkedIn", icon: t2, onClick: handleClick });
7099
+ $[3] = disabled;
7100
+ $[4] = handleClick;
7101
+ $[5] = t3;
7102
+ } else {
7103
+ t3 = $[5];
7104
+ }
7105
+ return t3;
7106
+ }
6997
7107
  function LoginForm(t0) {
6998
7108
  const $ = c(67);
6999
7109
  const {
@@ -7551,14 +7661,18 @@ function BootstrapAdminBanner({
7551
7661
  if (!userManagement || !loggedInUser) {
7552
7662
  return null;
7553
7663
  }
7664
+ const loggedInUserRoles = loggedInUser.roles ?? [];
7665
+ const isLoggedInUserAdmin = loggedInUserRoles.length === 0 || loggedInUserRoles.some((r) => r === "admin");
7666
+ if (!isLoggedInUserAdmin) {
7667
+ return null;
7668
+ }
7554
7669
  const {
7555
- users,
7670
+ hasAdminUsers,
7556
7671
  loading: delegateLoading,
7557
7672
  bootstrapAdmin,
7558
7673
  usersError
7559
7674
  } = userManagement;
7560
- const hasAdmin = users.some((u) => u.roles?.includes("admin"));
7561
- if (delegateLoading || hasAdmin || usersError || !bootstrapAdmin) {
7675
+ if (delegateLoading || hasAdminUsers || usersError || !bootstrapAdmin) {
7562
7676
  return null;
7563
7677
  }
7564
7678
  const handleBootstrap = async () => {
@@ -7732,6 +7846,9 @@ const en = {
7732
7846
  navigation_drawer: "Navigation drawer",
7733
7847
  collapse: "Collapse",
7734
7848
  expand: "Expand",
7849
+ change_language: "Change language",
7850
+ toggle_theme: "Toggle theme",
7851
+ user_menu: "User menu",
7735
7852
  // ─── Error states ─────────────────────────────────────────────
7736
7853
  error: "Error",
7737
7854
  error_uploading_file: "Error uploading file",
@@ -7993,7 +8110,17 @@ const en = {
7993
8110
  select_references: "Select references",
7994
8111
  account_settings: "Account Settings",
7995
8112
  profile: "Profile",
8113
+ security: "Security",
7996
8114
  sessions: "Sessions",
8115
+ change_password: "Change Password",
8116
+ current_password: "Current Password",
8117
+ new_password: "New Password",
8118
+ confirm_password: "Confirm New Password",
8119
+ password_changed: "Password changed successfully. You will be logged out.",
8120
+ passwords_dont_match: "Passwords don't match",
8121
+ password_too_short: "Password must be at least 8 characters",
8122
+ password_change_not_available: "Password change is not available for accounts using external sign-in providers.",
8123
+ changing_password: "Changing...",
7997
8124
  display_name: "Display Name",
7998
8125
  photo_url: "Photo URL",
7999
8126
  save_profile: "Save Profile",
@@ -9060,7 +9187,17 @@ const es = {
9060
9187
  select_references: "Select references",
9061
9188
  account_settings: "Account Settings",
9062
9189
  profile: "Profile",
9063
- sessions: "Sessions",
9190
+ sessions: "Sesiones",
9191
+ security: "Seguridad",
9192
+ change_password: "Cambiar Contraseña",
9193
+ current_password: "Contraseña Actual",
9194
+ new_password: "Nueva Contraseña",
9195
+ confirm_password: "Confirmar Nueva Contraseña",
9196
+ password_changed: "Contraseña cambiada con éxito. Se cerrará tu sesión.",
9197
+ passwords_dont_match: "Las contraseñas no coinciden",
9198
+ password_too_short: "La contraseña debe tener al menos 8 caracteres",
9199
+ password_change_not_available: "El cambio de contraseña no está disponible para cuentas que usan proveedores de inicio de sesión externos.",
9200
+ changing_password: "Cambiando...",
9064
9201
  display_name: "Display Name",
9065
9202
  photo_url: "Photo URL",
9066
9203
  save_profile: "Save Profile",
@@ -13676,7 +13813,8 @@ function Rebase(props) {
13676
13813
  apiKey,
13677
13814
  userManagement: _userManagement,
13678
13815
  effectiveRoleController,
13679
- apiUrl
13816
+ apiUrl,
13817
+ translations
13680
13818
  } = props;
13681
13819
  const plugins = pluginsProp;
13682
13820
  if (plugins) {
@@ -13751,7 +13889,7 @@ function Rebase(props) {
13751
13889
  if (authController.authError) {
13752
13890
  return /* @__PURE__ */ jsx(CenteredView, { maxWidth: "md", children: /* @__PURE__ */ jsx(ErrorView, { title: "Error loading auth", error: authController.authError }) });
13753
13891
  }
13754
- const content = /* @__PURE__ */ jsx(RebaseI18nProvider, { locale, children: /* @__PURE__ */ jsx(SnackbarProvider, { children: /* @__PURE__ */ jsx(ModeControllerProvider, { value: modeController, children: /* @__PURE__ */ jsx(AdminModeControllerProvider, { value: adminModeController, children: /* @__PURE__ */ jsx(RebaseClientInstanceContext.Provider, { value: client, children: /* @__PURE__ */ jsx(AnalyticsContext.Provider, { value: analyticsController, children: /* @__PURE__ */ jsx(CustomizationControllerContext.Provider, { value: customizationController, children: /* @__PURE__ */ jsx(UserConfigurationPersistenceContext.Provider, { value: userConfigPersistence, children: /* @__PURE__ */ jsx(StorageSourceContext.Provider, { value: resolvedStorage, children: /* @__PURE__ */ jsx(RebaseDataContext.Provider, { value: resolvedData, children: /* @__PURE__ */ jsx(DatabaseAdminContext.Provider, { value: resolvedDatabaseAdmin, children: /* @__PURE__ */ jsx(AuthControllerContext.Provider, { value: authController, children: /* @__PURE__ */ jsx(InternalUserManagementContext.Provider, { value: userManagement, children: /* @__PURE__ */ jsx(EffectiveRoleControllerContext.Provider, { value: activeEffectiveRoleController, children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(RebaseRegistryProvider, { children: /* @__PURE__ */ jsx(RebaseInternal, { loading, children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
13892
+ const content = /* @__PURE__ */ jsx(RebaseI18nProvider, { locale, translations, children: /* @__PURE__ */ jsx(SnackbarProvider, { children: /* @__PURE__ */ jsx(ModeControllerProvider, { value: modeController, children: /* @__PURE__ */ jsx(AdminModeControllerProvider, { value: adminModeController, children: /* @__PURE__ */ jsx(RebaseClientInstanceContext.Provider, { value: client, children: /* @__PURE__ */ jsx(AnalyticsContext.Provider, { value: analyticsController, children: /* @__PURE__ */ jsx(CustomizationControllerContext.Provider, { value: customizationController, children: /* @__PURE__ */ jsx(UserConfigurationPersistenceContext.Provider, { value: userConfigPersistence, children: /* @__PURE__ */ jsx(StorageSourceContext.Provider, { value: resolvedStorage, children: /* @__PURE__ */ jsx(RebaseDataContext.Provider, { value: resolvedData, children: /* @__PURE__ */ jsx(DatabaseAdminContext.Provider, { value: resolvedDatabaseAdmin, children: /* @__PURE__ */ jsx(AuthControllerContext.Provider, { value: authController, children: /* @__PURE__ */ jsx(InternalUserManagementContext.Provider, { value: userManagement, children: /* @__PURE__ */ jsx(EffectiveRoleControllerContext.Provider, { value: activeEffectiveRoleController, children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(RebaseRegistryProvider, { children: /* @__PURE__ */ jsx(RebaseInternal, { loading, children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
13755
13893
  const resolvedApiUrl = apiUrl ?? client?.baseUrl;
13756
13894
  if (resolvedApiUrl) {
13757
13895
  return /* @__PURE__ */ jsx(ApiConfigProvider, { apiUrl: resolvedApiUrl, getAuthToken: authController.getAuthToken, children: content });
@@ -14193,9 +14331,6 @@ function saveEntityToMemoryCache(path, data) {
14193
14331
  function getEntityFromMemoryCache(path) {
14194
14332
  return entityCache.get(path);
14195
14333
  }
14196
- function hasEntityInCache(path) {
14197
- return entityCache.has(path);
14198
- }
14199
14334
  function getEntityFromCache(path) {
14200
14335
  if (isSessionStorageAvailable) {
14201
14336
  try {
@@ -14223,23 +14358,6 @@ function removeEntityFromCache(path) {
14223
14358
  }
14224
14359
  }
14225
14360
  }
14226
- function clearEntityCache() {
14227
- entityCache.clear();
14228
- if (isSessionStorageAvailable) {
14229
- try {
14230
- const keysToRemove = [];
14231
- for (let i = 0; i < sessionStorage.length; i++) {
14232
- const fullKey = sessionStorage.key(i);
14233
- if (fullKey && fullKey.startsWith(LOCAL_STORAGE_PREFIX)) {
14234
- keysToRemove.push(fullKey);
14235
- }
14236
- }
14237
- keysToRemove.forEach((key) => sessionStorage.removeItem(key));
14238
- } catch (error) {
14239
- console.error("Failed to clear entity cache from sessionStorage:", error);
14240
- }
14241
- }
14242
- }
14243
14361
  function flattenKeys(obj, prefix = "", result = []) {
14244
14362
  if (isObject(obj) || Array.isArray(obj)) {
14245
14363
  const plainObject = isPlainObject(obj);
@@ -14478,37 +14596,6 @@ async function resizeImage(file, imageResize) {
14478
14596
  });
14479
14597
  });
14480
14598
  }
14481
- function printChanged(props, prev, path = "", depth = 0, maxDepth = 10) {
14482
- if (depth > maxDepth) {
14483
- return;
14484
- }
14485
- if (props && prev && typeof props === "object" && typeof prev === "object") {
14486
- Object.keys(props).forEach((key) => {
14487
- printChanged(props[key], prev[key], path + "." + key, depth + 1, maxDepth);
14488
- });
14489
- } else if (props !== prev) {
14490
- console.log("Changed props:", path);
14491
- }
14492
- }
14493
- function useTraceUpdate(props, t0) {
14494
- const $ = c(3);
14495
- const maxDepth = t0 === void 0 ? 3 : t0;
14496
- const prev = useRef(props);
14497
- let t1;
14498
- if ($[0] !== maxDepth || $[1] !== props) {
14499
- t1 = () => {
14500
- console.log("Changed props:");
14501
- printChanged(props, prev.current, "", 0, maxDepth);
14502
- prev.current = props;
14503
- };
14504
- $[0] = maxDepth;
14505
- $[1] = props;
14506
- $[2] = t1;
14507
- } else {
14508
- t1 = $[2];
14509
- }
14510
- useEffect(t1);
14511
- }
14512
14599
  function isReferenceProperty(property) {
14513
14600
  if (!property) return null;
14514
14601
  if (property.type === "reference") return true;
@@ -14955,7 +15042,6 @@ export {
14955
15042
  UserSettingsView,
14956
15043
  buildCollapsedDefaults,
14957
15044
  buildEnumLabel,
14958
- clearEntityCache,
14959
15045
  clearEntityFetchCache,
14960
15046
  createFormexStub,
14961
15047
  deleteEntityWithCallbacks,
@@ -14972,12 +15058,9 @@ export {
14972
15058
  getIcon,
14973
15059
  getRowHeight,
14974
15060
  getSubcollectionColumnId,
14975
- hasEntityInCache,
14976
- iconSynonyms,
14977
15061
  iconsSearch,
14978
15062
  isEnumValueDisabled,
14979
15063
  populateEntityFetchCache,
14980
- printChanged,
14981
15064
  removeEntityFromCache,
14982
15065
  removeEntityFromMemoryCache,
14983
15066
  resolveComponentRef,
@@ -15028,11 +15111,9 @@ export {
15028
15111
  useStudioNavigationState,
15029
15112
  useStudioSideEntityController,
15030
15113
  useStudioUrlController,
15031
- useTraceUpdate,
15032
15114
  useTranslation,
15033
15115
  useUnsavedChangesDialog,
15034
15116
  useUserConfigurationPersistence,
15035
- useUserSelector,
15036
- useValidateAuthenticator
15117
+ useUserSelector
15037
15118
  };
15038
15119
  //# sourceMappingURL=index.es.js.map