@rebasepro/client-firebase 0.0.1-canary.4d4fb3e → 0.0.1-canary.ca2cb6e

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/index.es.js CHANGED
@@ -11,11 +11,14 @@ import Fuse from "fuse.js";
11
11
  import { getFunctions, httpsCallable } from "@firebase/functions";
12
12
  import { c } from "react-compiler-runtime";
13
13
  import { getDatabase, query as query$1, ref as ref$1, orderByKey, startAt, limitToFirst, get, onValue, push, set, remove, orderByChild } from "@firebase/database";
14
+ import equal from "react-fast-compare";
15
+ import { removeUndefined } from "@rebasepro/utils";
14
16
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
15
17
  import { useModeController, ErrorView, useSnackbarController, RebaseLogo, useBrowserTitleAndIcon, useBuildModeController, useBuildAdminModeController, useBuildLocalConfigurationPersistence, useValidateAuthenticator, RebaseRoutes, Rebase, AdminModeControllerProvider, SnackbarProvider, ModeControllerProvider } from "@rebasepro/core";
16
- import { useBuildCollectionRegistryController, useBuildUrlController, useBuildNavigationStateController, NavigationStateContext, UrlContext, CollectionRegistryContext, Scaffold, AppBar, Drawer, SideDialogs } from "@rebasepro/cms";
17
- import { MailIcon, CallIcon, PersonIcon, Button, cls, IconButton, ArrowBackIcon, Typography, TextField, CircularProgress, LoadingButton, CircularProgressCenter, CenteredView } from "@rebasepro/ui";
18
- import { Routes, Route, Outlet } from "react-router-dom";
18
+ import { useBuildCollectionRegistryController, useBuildUrlController, useBuildNavigationStateController, NavigationStateContext, UrlContext, CollectionRegistryContext, SideEntityProvider, RebaseRoute, Scaffold, AppBar, Drawer, SideDialogs } from "@rebasepro/admin";
19
+ import { iconSize, Button, cls, IconButton, Typography, TextField, CircularProgress, LoadingButton, CircularProgressCenter, CenteredView } from "@rebasepro/ui";
20
+ import { Navigate, Route, Outlet } from "react-router-dom";
21
+ import { MailIcon, PhoneIcon, UserIcon, ArrowLeftIcon } from "lucide-react";
19
22
  const useFirebaseAuthController = ({
20
23
  loading,
21
24
  firebaseApp,
@@ -262,10 +265,9 @@ function useFirebaseStorageSource({
262
265
  const projectId = firebaseApp?.options?.projectId;
263
266
  const urlsCache = {};
264
267
  return {
265
- uploadFile({
268
+ putObject({
266
269
  file,
267
- fileName,
268
- path,
270
+ key,
269
271
  metadata,
270
272
  bucket
271
273
  }) {
@@ -274,8 +276,7 @@ function useFirebaseStorageSource({
274
276
  const storageBucketUrl = bucket ?? bucketUrl;
275
277
  const storage = getStorage(firebaseApp, storageBucketUrl);
276
278
  if (!storage) throw Error("useFirebaseStorageSource Firebase not initialised");
277
- const usedFilename = fileName ?? file.name;
278
- const storageRef = ref(storage, `${path}/${usedFilename}`);
279
+ const storageRef = ref(storage, key);
279
280
  const uploadTask = uploadBytesResumable(storageRef, file, metadata);
280
281
  return new Promise((resolve, reject) => {
281
282
  let lastProgress = 0;
@@ -330,9 +331,9 @@ function useFirebaseStorageSource({
330
331
  const fullPath = uploadTask.snapshot.ref.fullPath;
331
332
  const bucketName = uploadTask.snapshot.ref.bucket;
332
333
  resolve({
333
- path: fullPath,
334
+ key: fullPath,
334
335
  bucket: bucketName,
335
- storageUrl: `gs://${bucketName}/${fullPath}`
336
+ storageUrl: `s3://${bucketName}/${fullPath}`
336
337
  });
337
338
  });
338
339
  });
@@ -340,7 +341,7 @@ function useFirebaseStorageSource({
340
341
  return Promise.reject(error);
341
342
  }
342
343
  },
343
- async getFile(path, bucket) {
344
+ async getObject(path, bucket) {
344
345
  try {
345
346
  if (!firebaseApp) throw Error("useFirebaseStorageSource Firebase not initialised");
346
347
  const storageBucketUrl = bucket ?? bucketUrl;
@@ -356,12 +357,14 @@ function useFirebaseStorageSource({
356
357
  throw e;
357
358
  }
358
359
  },
359
- async getDownloadURL(storagePathOrUrl, bucket) {
360
+ async getSignedUrl(storagePathOrUrl, bucket) {
360
361
  if (!firebaseApp) throw Error("useFirebaseStorageSource Firebase not initialised");
361
362
  let resolvedPathOrUrl = storagePathOrUrl;
362
363
  let resolvedBucket = bucket;
363
- if (storagePathOrUrl.startsWith("gs://")) {
364
- const withoutProtocol = storagePathOrUrl.substring("gs://".length);
364
+ const match = storagePathOrUrl.match(/^(s3|gs):\/\//);
365
+ if (match) {
366
+ const protocolLength = match[0].length;
367
+ const withoutProtocol = storagePathOrUrl.substring(protocolLength);
365
368
  const firstSlash = withoutProtocol.indexOf("/");
366
369
  if (firstSlash > 0) {
367
370
  resolvedBucket = withoutProtocol.substring(0, firstSlash);
@@ -389,18 +392,18 @@ function useFirebaseStorageSource({
389
392
  throw e;
390
393
  }
391
394
  },
392
- async list(path, options) {
395
+ async listObjects(prefix, options) {
393
396
  if (!firebaseApp) throw Error("useFirebaseStorageSource Firebase not initialised");
394
397
  const storageBucketUrl = options?.bucket ?? bucketUrl;
395
398
  const storage = getStorage(firebaseApp, storageBucketUrl);
396
399
  if (!storage) throw Error("useFirebaseStorageSource Firebase not initialised");
397
- const folderRef = ref(storage, path);
400
+ const folderRef = ref(storage, prefix);
398
401
  return await list(folderRef, {
399
402
  maxResults: options?.maxResults,
400
403
  pageToken: options?.pageToken
401
404
  });
402
405
  },
403
- async deleteFile(path, bucket) {
406
+ async deleteObject(path, bucket) {
404
407
  if (!firebaseApp) throw Error("useFirebaseStorageSource Firebase not initialised");
405
408
  const storageBucketUrl = bucket ?? bucketUrl;
406
409
  const storage = getStorage(firebaseApp, storageBucketUrl);
@@ -1472,6 +1475,8 @@ function cmsToFirestoreModel(data, firestore, inArray = false) {
1472
1475
  } else if (data.isEntityReference && data.isEntityReference()) {
1473
1476
  const targetFirestore = data.databaseId ? getFirestore(firestore.app, data.databaseId) : firestore;
1474
1477
  return doc(targetFirestore, data.path, data.id);
1478
+ } else if (data && typeof data === "object" && data.__type === "relation" && data.path && data.id) {
1479
+ return doc(firestore, data.path, String(data.id));
1475
1480
  } else if (data instanceof GeoPoint) {
1476
1481
  return new GeoPoint$1(data.latitude, data.longitude);
1477
1482
  } else if (data instanceof Date) {
@@ -1842,7 +1847,282 @@ function _temp$1() {
1842
1847
  size: "invisible"
1843
1848
  });
1844
1849
  }
1845
- const googleIcon = (mode) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: 32, height: 32, children: [
1850
+ function useBuildUserManagement({
1851
+ authController,
1852
+ dataSourceDelegate,
1853
+ roles: rolesProp,
1854
+ usersPath = "__FIRECMS/config/users",
1855
+ rolesPath = "__FIRECMS/config/roles",
1856
+ allowDefaultRolesCreation,
1857
+ includeCollectionConfigPermissions
1858
+ }) {
1859
+ if (!authController) {
1860
+ throw Error("useBuildUserManagement: You need to provide an authController since version 3.0.0-beta.11. Check https://firecms.co/docs/pro/migrating_from_v3_beta");
1861
+ }
1862
+ const rolesDefinedInCode = (rolesProp ?? [])?.length > 0;
1863
+ const [rolesLoading, setRolesLoading] = React.useState(!rolesDefinedInCode);
1864
+ const [usersLoading, setUsersLoading] = React.useState(true);
1865
+ const [roles, setRoles] = React.useState(rolesProp ?? []);
1866
+ const [usersWithRoleIds, setUsersWithRoleIds] = React.useState([]);
1867
+ const users = usersWithRoleIds.map((u) => ({
1868
+ ...u
1869
+ }));
1870
+ const [rolesError, setRolesError] = React.useState();
1871
+ const [usersError, setUsersError] = React.useState();
1872
+ const _usersLoading = usersLoading;
1873
+ const _rolesLoading = rolesLoading;
1874
+ const loading = _rolesLoading || _usersLoading;
1875
+ useEffect(() => {
1876
+ if (rolesDefinedInCode) return;
1877
+ if (!dataSourceDelegate || !rolesPath) return;
1878
+ if (dataSourceDelegate.initialised !== void 0 && !dataSourceDelegate.initialised) return;
1879
+ if (authController?.initialLoading) return;
1880
+ setRolesLoading(true);
1881
+ return dataSourceDelegate.listenCollection?.({
1882
+ path: rolesPath,
1883
+ onUpdate(entities) {
1884
+ setRolesError(void 0);
1885
+ console.debug("Updating roles", entities);
1886
+ try {
1887
+ const newRoles = entityToRoles(entities);
1888
+ if (!equal(newRoles, roles)) {
1889
+ setRoles(newRoles);
1890
+ }
1891
+ } catch (e) {
1892
+ setRoles([]);
1893
+ console.error("Error loading roles", e);
1894
+ setRolesError(e);
1895
+ }
1896
+ setRolesLoading(false);
1897
+ },
1898
+ onError(e_0) {
1899
+ setRoles([]);
1900
+ console.error("Error loading roles", e_0);
1901
+ setRolesError(e_0);
1902
+ setRolesLoading(false);
1903
+ }
1904
+ });
1905
+ }, [rolesDefinedInCode, dataSourceDelegate?.initialised, authController?.initialLoading, authController?.user?.uid, rolesPath]);
1906
+ useEffect(() => {
1907
+ if (!dataSourceDelegate || !usersPath) return;
1908
+ if (dataSourceDelegate.initialised !== void 0 && !dataSourceDelegate.initialised) {
1909
+ return;
1910
+ }
1911
+ if (authController?.initialLoading) {
1912
+ return;
1913
+ }
1914
+ setUsersLoading(true);
1915
+ return dataSourceDelegate.listenCollection?.({
1916
+ path: usersPath,
1917
+ onUpdate(entities_0) {
1918
+ console.debug("Updating users", entities_0);
1919
+ setUsersError(void 0);
1920
+ try {
1921
+ const newUsers = entitiesToUsers(entities_0);
1922
+ setUsersWithRoleIds(newUsers);
1923
+ } catch (e_1) {
1924
+ setUsersWithRoleIds([]);
1925
+ console.error("Error loading users", e_1);
1926
+ setUsersError(e_1);
1927
+ }
1928
+ setUsersLoading(false);
1929
+ },
1930
+ onError(e_2) {
1931
+ console.error("Error loading users", e_2);
1932
+ setUsersWithRoleIds([]);
1933
+ setUsersError(e_2);
1934
+ setUsersLoading(false);
1935
+ }
1936
+ });
1937
+ }, [dataSourceDelegate?.initialised, authController?.initialLoading, authController?.user?.uid, usersPath]);
1938
+ const saveUser = useCallback(async (user) => {
1939
+ if (!dataSourceDelegate) throw Error("useBuildUserManagement Firebase not initialised");
1940
+ if (!usersPath) throw Error("useBuildUserManagement Firestore not initialised");
1941
+ console.debug("Persisting user", user);
1942
+ const roleIds = user.roles;
1943
+ const email = user.email?.toLowerCase().trim();
1944
+ if (!email) throw Error("Email is required");
1945
+ const userExists = users.find((u_0) => u_0.email?.toLowerCase() === email);
1946
+ const data = {
1947
+ ...user,
1948
+ roles: roleIds ?? []
1949
+ };
1950
+ if (!userExists) {
1951
+ data.created_on = /* @__PURE__ */ new Date();
1952
+ }
1953
+ if (userExists && userExists.uid !== user.uid) {
1954
+ const entity = {
1955
+ values: {},
1956
+ path: usersPath,
1957
+ id: userExists.uid
1958
+ };
1959
+ await dataSourceDelegate.deleteEntity({
1960
+ entity
1961
+ }).then(() => {
1962
+ console.debug("Deleted previous user", userExists);
1963
+ }).catch((e_3) => {
1964
+ console.error("Error deleting user", e_3);
1965
+ });
1966
+ }
1967
+ return dataSourceDelegate.saveEntity({
1968
+ status: "existing",
1969
+ path: usersPath,
1970
+ entityId: email,
1971
+ values: removeUndefined(data)
1972
+ }).then(() => user);
1973
+ }, [usersPath, dataSourceDelegate?.initialised]);
1974
+ const saveRole = useCallback((role) => {
1975
+ if (!dataSourceDelegate) throw Error("useBuildUserManagement Firebase not initialised");
1976
+ if (!rolesPath) throw Error("useBuildUserManagement Firestore not initialised");
1977
+ console.debug("Persisting role", role);
1978
+ const {
1979
+ id,
1980
+ ...roleData
1981
+ } = role;
1982
+ return dataSourceDelegate.saveEntity({
1983
+ status: "existing",
1984
+ path: rolesPath,
1985
+ entityId: id,
1986
+ values: removeUndefined(roleData)
1987
+ }).then(() => {
1988
+ return;
1989
+ });
1990
+ }, [rolesPath, dataSourceDelegate?.initialised]);
1991
+ const deleteUser = useCallback(async (user_0) => {
1992
+ if (!dataSourceDelegate) throw Error("useBuildUserManagement Firebase not initialised");
1993
+ if (!usersPath) throw Error("useBuildUserManagement Firestore not initialised");
1994
+ console.debug("Deleting", user_0);
1995
+ const {
1996
+ uid
1997
+ } = user_0;
1998
+ const entity_0 = {
1999
+ path: usersPath,
2000
+ id: uid,
2001
+ values: {}
2002
+ };
2003
+ await dataSourceDelegate.deleteEntity({
2004
+ entity: entity_0
2005
+ });
2006
+ }, [usersPath, dataSourceDelegate?.initialised]);
2007
+ const deleteRole = useCallback(async (role_0) => {
2008
+ if (!dataSourceDelegate) throw Error("useBuildUserManagement Firebase not initialised");
2009
+ if (!rolesPath) throw Error("useBuildUserManagement Firestore not initialised");
2010
+ console.debug("Deleting", role_0);
2011
+ const {
2012
+ id: id_0
2013
+ } = role_0;
2014
+ const entity_1 = {
2015
+ path: rolesPath,
2016
+ id: id_0,
2017
+ values: {}
2018
+ };
2019
+ await dataSourceDelegate.deleteEntity({
2020
+ entity: entity_1
2021
+ });
2022
+ }, [rolesPath, dataSourceDelegate?.initialised]);
2023
+ const defineRolesFor = useCallback((user_1) => {
2024
+ if (!usersWithRoleIds) throw Error("Users not loaded");
2025
+ const mgmtUser = usersWithRoleIds.find((u_1) => u_1.email?.toLowerCase() === user_1?.email?.toLowerCase());
2026
+ if (!mgmtUser || !mgmtUser.roles) return void 0;
2027
+ return roles.filter((r) => mgmtUser.roles.includes(r.id));
2028
+ }, [roles, usersWithRoleIds]);
2029
+ const authenticator = useCallback(({
2030
+ user: user_2
2031
+ }) => {
2032
+ if (loading) {
2033
+ return false;
2034
+ }
2035
+ if (user_2 === null) {
2036
+ console.warn("User is null, returning");
2037
+ return false;
2038
+ }
2039
+ if (users.length === 0) {
2040
+ console.warn("No users created yet");
2041
+ return true;
2042
+ }
2043
+ const mgmtUser_0 = users.find((u_2) => u_2.email?.toLowerCase() === user_2?.email?.toLowerCase());
2044
+ if (mgmtUser_0) {
2045
+ const needsUidUpdate = mgmtUser_0.uid !== user_2.uid;
2046
+ const needsPhotoUpdate = user_2.photoURL && mgmtUser_0.photoURL !== user_2.photoURL;
2047
+ if (needsUidUpdate || needsPhotoUpdate) {
2048
+ const updateReason = needsUidUpdate ? "uid" : "photoURL";
2049
+ console.debug(`User ${updateReason} has changed, updating user in user management system`);
2050
+ saveUser({
2051
+ ...mgmtUser_0,
2052
+ uid: user_2.uid,
2053
+ ...needsPhotoUpdate ? {
2054
+ photoURL: user_2.photoURL
2055
+ } : {}
2056
+ }).then(() => {
2057
+ console.debug("User updated in user management system", mgmtUser_0);
2058
+ }).catch((e_4) => {
2059
+ console.error("Error updating user in user management system", e_4);
2060
+ });
2061
+ }
2062
+ console.debug("User found in user management system", mgmtUser_0);
2063
+ return true;
2064
+ }
2065
+ throw Error("Could not find a user with the provided email in the user management system.");
2066
+ }, [loading, users]);
2067
+ const userRoles = authController.user ? defineRolesFor(authController.user) : void 0;
2068
+ const isAdmin = (userRoles ?? []).some((r_0) => r_0.id === "admin");
2069
+ const userRoleIds = userRoles?.map((r_1) => r_1.id);
2070
+ useEffect(() => {
2071
+ console.debug("Setting user roles", {
2072
+ userRoles,
2073
+ roles
2074
+ });
2075
+ authController.setUserRoles?.(userRoles ?? []);
2076
+ }, [userRoleIds]);
2077
+ const getUser = useCallback((uid_0) => {
2078
+ if (!users) return null;
2079
+ const user_3 = users.find((u_3) => u_3.uid === uid_0);
2080
+ return user_3 ?? null;
2081
+ }, [users]);
2082
+ return {
2083
+ loading,
2084
+ roles,
2085
+ users,
2086
+ saveUser,
2087
+ saveRole,
2088
+ rolesError,
2089
+ deleteUser,
2090
+ deleteRole,
2091
+ usersError,
2092
+ isAdmin,
2093
+ allowDefaultRolesCreation: allowDefaultRolesCreation === void 0 ? true : allowDefaultRolesCreation,
2094
+ includeCollectionConfigPermissions: Boolean(includeCollectionConfigPermissions),
2095
+ defineRolesFor,
2096
+ authenticator,
2097
+ ...authController,
2098
+ initialLoading: authController.initialLoading || loading,
2099
+ userRoles,
2100
+ getUser,
2101
+ user: authController.user ? {
2102
+ ...authController.user,
2103
+ roles: userRoles
2104
+ } : null
2105
+ };
2106
+ }
2107
+ const entitiesToUsers = (docs) => {
2108
+ return docs.map((doc2) => {
2109
+ const data = doc2.values;
2110
+ const newVar = {
2111
+ uid: doc2.id,
2112
+ ...data,
2113
+ created_on: data?.created_on,
2114
+ updated_on: data?.updated_on
2115
+ };
2116
+ return newVar;
2117
+ });
2118
+ };
2119
+ const entityToRoles = (entities) => {
2120
+ return entities.map((doc2) => ({
2121
+ id: doc2.id,
2122
+ ...doc2.values
2123
+ }));
2124
+ };
2125
+ const googleIcon = (mode) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: 24, height: 24, children: [
1846
2126
  /* @__PURE__ */ jsxs("linearGradient", { id: "95yY7w43Oj6n2vH63j6HJb", x1: "29.401", x2: "29.401", y1: "4.064", y2: "106.734", gradientTransform: "matrix(1 0 0 -1 0 66)", gradientUnits: "userSpaceOnUse", children: [
1847
2127
  /* @__PURE__ */ jsx("stop", { offset: "0", stopColor: "#ff5840" }),
1848
2128
  /* @__PURE__ */ jsx("stop", { offset: ".007", stopColor: "#ff5840" }),
@@ -1871,13 +2151,13 @@ const googleIcon = (mode) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PUR
1871
2151
  ] }),
1872
2152
  /* @__PURE__ */ jsx("path", { fill: "url(#95yY7w43Oj6n2vH63j6HJe)", d: "M59,31.97c0.01,7.73-3.26,14.58-8.55,19.31l-7.62-6.72c2.1-1.61,3.77-3.71,4.84-6.15\n c0.29-0.66-0.2-1.41-0.92-1.41H37c-2.21,0-4-1.79-4-4v-2c0-2.21,1.79-4,4-4h17C56.75,27,59,29.22,59,31.97z" })
1873
2153
  ] }) });
1874
- const appleIcon = (mode) => /* @__PURE__ */ jsx("svg", { width: 32, height: 32, viewBox: "0 0 56 56", style: {
2154
+ const appleIcon = (mode) => /* @__PURE__ */ jsx("svg", { width: 24, height: 24, viewBox: "0 0 56 56", style: {
1875
2155
  transform: "scale(2.8)"
1876
2156
  }, version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("g", { stroke: mode === "light" ? "#424245" : "white", strokeWidth: "0.5", fillRule: "evenodd", children: /* @__PURE__ */ jsx("path", { d: "M28.2226562,20.3846154 C29.0546875,20.3846154 30.0976562,19.8048315 30.71875,19.0317864 C31.28125,18.3312142 31.6914062,17.352829 31.6914062,16.3744437 C31.6914062,16.2415766 31.6796875,16.1087095 31.65625,16 C30.7304687,16.0362365 29.6171875,16.640178 28.9492187,17.4494596 C28.421875,18.06548 27.9414062,19.0317864 27.9414062,20.0222505 C27.9414062,20.1671964 27.9648438,20.3121424 27.9765625,20.3604577 C28.0351562,20.3725366 28.1289062,20.3846154 28.2226562,20.3846154 Z M25.2929688,35 C26.4296875,35 26.9335938,34.214876 28.3515625,34.214876 C29.7929688,34.214876 30.109375,34.9758423 31.375,34.9758423 C32.6171875,34.9758423 33.4492188,33.792117 34.234375,32.6325493 C35.1132812,31.3038779 35.4765625,29.9993643 35.5,29.9389701 C35.4179688,29.9148125 33.0390625,28.9122695 33.0390625,26.0979021 C33.0390625,23.6579784 34.9140625,22.5588048 35.0195312,22.474253 C33.7773438,20.6382708 31.890625,20.5899555 31.375,20.5899555 C29.9804688,20.5899555 28.84375,21.4596313 28.1289062,21.4596313 C27.3554688,21.4596313 26.3359375,20.6382708 25.1289062,20.6382708 C22.8320312,20.6382708 20.5,22.5950413 20.5,26.2911634 C20.5,28.5861411 21.3671875,31.013986 22.4335938,32.5842339 C23.3476562,33.9129053 24.1445312,35 25.2929688,35 Z", fill: mode === "light" ? "#424245" : "white", fillRule: "nonzero" }) }) });
1877
- const githubIcon = (mode) => /* @__PURE__ */ jsx("svg", { fill: mode === "light" ? "#1c1e21" : "white", role: "img", viewBox: "0 0 24 24", width: 28, height: 28, xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" }) });
1878
- const facebookIcon = (mode) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 28, height: 28, viewBox: "0 0 90 90", children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M90,15.001C90,7.119,82.884,0,75,0H15C7.116,0,0,7.119,0,15.001v59.998 C0,82.881,7.116,90,15.001,90H45V56H34V41h11v-5.844C45,25.077,52.568,16,61.875,16H74v15H61.875C60.548,31,59,32.611,59,35.024V41 h15v15H59v34h16c7.884,0,15-7.119,15-15.001V15.001z", fill: mode === "light" ? "#39569c" : "white" }) }) });
1879
- const microsoftIcon = (mode) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 28, height: 28, viewBox: "0 0 480 480", children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M0.176,224L0.001,67.963l192-26.072V224H0.176z M224.001,37.241L479.937,0v224H224.001V37.241z M479.999,256l-0.062,224 l-255.936-36.008V256H479.999z M192.001,439.918L0.157,413.621L0.147,256h191.854V439.918z", fill: mode === "light" ? "#00a2ed" : "white" }) }) });
1880
- const twitterIcon = (mode) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 28, height: 28, viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { fill: mode === "light" ? "#00acee" : "white", d: "M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z" }) });
2157
+ const githubIcon = (mode) => /* @__PURE__ */ jsx("svg", { fill: mode === "light" ? "#1c1e21" : "white", role: "img", viewBox: "0 0 24 24", width: 24, height: 24, xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" }) });
2158
+ const facebookIcon = (mode) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 90 90", children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M90,15.001C90,7.119,82.884,0,75,0H15C7.116,0,0,7.119,0,15.001v59.998 C0,82.881,7.116,90,15.001,90H45V56H34V41h11v-5.844C45,25.077,52.568,16,61.875,16H74v15H61.875C60.548,31,59,32.611,59,35.024V41 h15v15H59v34h16c7.884,0,15-7.119,15-15.001V15.001z", fill: mode === "light" ? "#39569c" : "white" }) }) });
2159
+ const microsoftIcon = (mode) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 480 480", children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M0.176,224L0.001,67.963l192-26.072V224H0.176z M224.001,37.241L479.937,0v224H224.001V37.241z M479.999,256l-0.062,224 l-255.936-36.008V256H479.999z M192.001,439.918L0.157,413.621L0.147,256h191.854V439.918z", fill: mode === "light" ? "#00a2ed" : "white" }) }) });
2160
+ const twitterIcon = (mode) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { fill: mode === "light" ? "#00acee" : "white", d: "M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z" }) });
1881
2161
  function FirebaseLoginView({
1882
2162
  children,
1883
2163
  allowSkipLogin,
@@ -1989,9 +2269,9 @@ function FirebaseLoginView({
1989
2269
  buildErrorView(),
1990
2270
  !passwordLoginSelected && !phoneLoginSelected && /* @__PURE__ */ jsxs("div", { className: "my-4 w-full", children: [
1991
2271
  buildOauthLoginButtons(authController, resolvedSignInOptions, modeState.mode, disabled),
1992
- resolvedSignInOptions.includes("password") && /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Email/password", icon: /* @__PURE__ */ jsx(MailIcon, { size: 28 }), onClick: () => setPasswordLoginSelected(true) }),
1993
- resolvedSignInOptions.includes("phone") && /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Phone number", icon: /* @__PURE__ */ jsx(CallIcon, { size: 28 }), onClick: () => setPhoneLoginSelected(true) }),
1994
- resolvedSignInOptions.includes("anonymous") && /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Log in anonymously", icon: /* @__PURE__ */ jsx(PersonIcon, { size: 28 }), onClick: authController.anonymousLogin }),
2272
+ resolvedSignInOptions.includes("password") && /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Email/password", icon: /* @__PURE__ */ jsx(MailIcon, { size: iconSize.medium }), onClick: () => setPasswordLoginSelected(true) }),
2273
+ resolvedSignInOptions.includes("phone") && /* @__PURE__ */ jsx(LoginButton, { disabled, text: "PhoneIcon number", icon: /* @__PURE__ */ jsx(PhoneIcon, { size: iconSize.medium }), onClick: () => setPhoneLoginSelected(true) }),
2274
+ resolvedSignInOptions.includes("anonymous") && /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Log in anonymously", icon: /* @__PURE__ */ jsx(UserIcon, { size: "medium" }), onClick: authController.anonymousLogin }),
1995
2275
  allowSkipLogin && /* @__PURE__ */ jsx(Button, { className: "m-1 mb-4", variant: "text", disabled, onClick: authController.skipLogin, children: "Skip login" })
1996
2276
  ] }),
1997
2277
  passwordLoginSelected && /* @__PURE__ */ jsx(LoginForm, { authController, onClose: () => setPasswordLoginSelected(false), mode: modeState.mode, noUserComponent, disableSignupScreen, disableResetPassword }),
@@ -2008,10 +2288,10 @@ function LoginButton(t0) {
2008
2288
  text,
2009
2289
  disabled
2010
2290
  } = t0;
2011
- const t1 = disabled ? "" : "hover:text-surface-800 hover:dark:text-white";
2291
+ const t1 = disabled ? "" : "hover:text-surface-950 hover:dark:text-white";
2012
2292
  let t2;
2013
2293
  if ($[0] !== t1) {
2014
- t2 = cls("w-full bg-white dark:bg-surface-800 text-surface-900 dark:text-surface-100", t1);
2294
+ t2 = cls("w-full bg-white dark:bg-surface-950 text-surface-900 dark:text-surface-100", t1);
2015
2295
  $[0] = t1;
2016
2296
  $[1] = t2;
2017
2297
  } else {
@@ -2121,7 +2401,7 @@ function PhoneLoginForm(t0) {
2121
2401
  }
2122
2402
  let t4;
2123
2403
  if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2124
- t4 = /* @__PURE__ */ jsx(ArrowBackIcon, { className: "w-5 h-5" });
2404
+ t4 = /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "w-5 h-5" });
2125
2405
  $[7] = t4;
2126
2406
  } else {
2127
2407
  t4 = $[7];
@@ -2302,7 +2582,7 @@ function LoginForm({
2302
2582
  };
2303
2583
  const label = loginState === "registration" ? "Please enter your email and password to create an account" : loginState === "password" ? "Please enter your password" : "Please enter your email";
2304
2584
  return /* @__PURE__ */ jsx("form", { className: "w-full", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs("div", { className: "max-w-[480px] w-full flex flex-col gap-4", children: [
2305
- /* @__PURE__ */ jsx(IconButton, { onClick: onBackPressed, children: /* @__PURE__ */ jsx(ArrowBackIcon, { className: "w-5 h-5" }) }),
2585
+ /* @__PURE__ */ jsx(IconButton, { onClick: onBackPressed, children: /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "w-5 h-5" }) }),
2306
2586
  /* @__PURE__ */ jsx("div", { children: loginState === "registration" && noUserComponent }),
2307
2587
  /* @__PURE__ */ jsx(Typography, { className: `${loginState === "registration" && disableSignupScreen ? "hidden" : "flex"}`, variant: "subtitle2", children: label }),
2308
2588
  (loginState === "email" || loginState === "registration") && /* @__PURE__ */ jsx(TextField, { placeholder: "Email", autoFocus: true, value: email ?? "", disabled: authController.authLoading, type: "email", onChange: (event_1) => setEmail(event_1.target.value) }),
@@ -2355,7 +2635,7 @@ function buildOauthLoginButtons(authController, providers, mode, disabled) {
2355
2635
  }
2356
2636
  const DEFAULT_SIGN_IN_OPTIONS = [GoogleAuthProvider.PROVIDER_ID];
2357
2637
  function RebaseFirebaseApp(t0) {
2358
- const $ = c(93);
2638
+ const $ = c(98);
2359
2639
  const {
2360
2640
  name,
2361
2641
  logo,
@@ -2537,82 +2817,97 @@ function RebaseFirebaseApp(t0) {
2537
2817
  }
2538
2818
  const urlController = useBuildUrlController(t15);
2539
2819
  let t16;
2540
- if ($[33] !== firestoreDelegate) {
2541
- t16 = buildRebaseData(firestoreDelegate);
2542
- $[33] = firestoreDelegate;
2543
- $[34] = t16;
2820
+ if ($[33] !== authController || $[34] !== firestoreDelegate) {
2821
+ t16 = {
2822
+ authController,
2823
+ dataSourceDelegate: firestoreDelegate
2824
+ };
2825
+ $[33] = authController;
2826
+ $[34] = firestoreDelegate;
2827
+ $[35] = t16;
2544
2828
  } else {
2545
- t16 = $[34];
2829
+ t16 = $[35];
2546
2830
  }
2831
+ const defaultUserManagement = useBuildUserManagement(t16);
2832
+ const activeUserManagement = userManagement ?? defaultUserManagement;
2547
2833
  let t17;
2548
- if ($[35] !== adminModeController.mode || $[36] !== adminViews || $[37] !== authController || $[38] !== collectionRegistryController || $[39] !== collections || $[40] !== plugins || $[41] !== t16 || $[42] !== urlController || $[43] !== userManagement || $[44] !== views) {
2549
- t17 = {
2834
+ if ($[36] !== firestoreDelegate) {
2835
+ t17 = buildRebaseData(firestoreDelegate);
2836
+ $[36] = firestoreDelegate;
2837
+ $[37] = t17;
2838
+ } else {
2839
+ t17 = $[37];
2840
+ }
2841
+ const t18 = activeUserManagement;
2842
+ let t19;
2843
+ if ($[38] !== adminModeController.mode || $[39] !== adminViews || $[40] !== authController || $[41] !== collectionRegistryController || $[42] !== collections || $[43] !== plugins || $[44] !== t17 || $[45] !== t18 || $[46] !== urlController || $[47] !== views) {
2844
+ t19 = {
2550
2845
  collections,
2551
2846
  views,
2552
2847
  adminViews,
2553
2848
  authController,
2554
- data: t16,
2849
+ data: t17,
2555
2850
  plugins,
2556
2851
  collectionRegistryController,
2557
2852
  urlController,
2558
2853
  adminMode: adminModeController.mode,
2559
- userManagement
2854
+ userManagement: t18
2560
2855
  };
2561
- $[35] = adminModeController.mode;
2562
- $[36] = adminViews;
2563
- $[37] = authController;
2564
- $[38] = collectionRegistryController;
2565
- $[39] = collections;
2566
- $[40] = plugins;
2567
- $[41] = t16;
2568
- $[42] = urlController;
2569
- $[43] = userManagement;
2570
- $[44] = views;
2571
- $[45] = t17;
2856
+ $[38] = adminModeController.mode;
2857
+ $[39] = adminViews;
2858
+ $[40] = authController;
2859
+ $[41] = collectionRegistryController;
2860
+ $[42] = collections;
2861
+ $[43] = plugins;
2862
+ $[44] = t17;
2863
+ $[45] = t18;
2864
+ $[46] = urlController;
2865
+ $[47] = views;
2866
+ $[48] = t19;
2572
2867
  } else {
2573
- t17 = $[45];
2868
+ t19 = $[48];
2574
2869
  }
2575
- const navigationStateController = useBuildNavigationStateController(t17);
2870
+ const navigationStateController = useBuildNavigationStateController(t19);
2576
2871
  if (firebaseConfigLoading || !firebaseApp || loading) {
2577
- let t182;
2578
- if ($[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2579
- t182 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(CircularProgressCenter, {}) });
2580
- $[46] = t182;
2872
+ let t202;
2873
+ if ($[49] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2874
+ t202 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(CircularProgressCenter, {}) });
2875
+ $[49] = t202;
2581
2876
  } else {
2582
- t182 = $[46];
2877
+ t202 = $[49];
2583
2878
  }
2584
- return t182;
2879
+ return t202;
2585
2880
  }
2586
2881
  if (configError) {
2587
- let t182;
2588
- if ($[47] !== configError) {
2589
- t182 = /* @__PURE__ */ jsx(CenteredView, { children: configError });
2590
- $[47] = configError;
2591
- $[48] = t182;
2882
+ let t202;
2883
+ if ($[50] !== configError) {
2884
+ t202 = /* @__PURE__ */ jsx(CenteredView, { children: configError });
2885
+ $[50] = configError;
2886
+ $[51] = t202;
2592
2887
  } else {
2593
- t182 = $[48];
2888
+ t202 = $[51];
2594
2889
  }
2595
- return t182;
2890
+ return t202;
2596
2891
  }
2597
- let t18;
2598
- if ($[49] !== firebaseApp.options.projectId) {
2599
- t18 = (t192) => {
2892
+ let t20;
2893
+ if ($[52] !== firebaseApp.options.projectId) {
2894
+ t20 = (t212) => {
2600
2895
  const {
2601
2896
  entity
2602
- } = t192;
2897
+ } = t212;
2603
2898
  return `https://console.firebase.google.com/project/${firebaseApp.options.projectId}/firestore/data/${entity.path}/${entity.id}`;
2604
2899
  };
2605
- $[49] = firebaseApp.options.projectId;
2606
- $[50] = t18;
2900
+ $[52] = firebaseApp.options.projectId;
2901
+ $[53] = t20;
2607
2902
  } else {
2608
- t18 = $[50];
2903
+ t20 = $[53];
2609
2904
  }
2610
- let t19;
2611
- if ($[51] !== allowSkipLogin || $[52] !== authController || $[53] !== authLoading || $[54] !== autoOpenDrawer || $[55] !== canAccessMainView || $[56] !== components || $[57] !== firebaseApp || $[58] !== logo || $[59] !== logoDark || $[60] !== modeController || $[61] !== name || $[62] !== notAllowedError || $[63] !== signInOptions) {
2612
- t19 = (t202) => {
2905
+ let t21;
2906
+ if ($[54] !== allowSkipLogin || $[55] !== authController || $[56] !== authLoading || $[57] !== autoOpenDrawer || $[58] !== canAccessMainView || $[59] !== components || $[60] !== firebaseApp || $[61] !== logo || $[62] !== logoDark || $[63] !== modeController || $[64] !== name || $[65] !== navigationStateController || $[66] !== notAllowedError || $[67] !== signInOptions || $[68] !== urlController) {
2907
+ t21 = (t222) => {
2613
2908
  const {
2614
2909
  loading: loading_0
2615
- } = t202;
2910
+ } = t222;
2616
2911
  let component;
2617
2912
  if (loading_0 || authLoading) {
2618
2913
  component = /* @__PURE__ */ jsx(CircularProgressCenter, { size: "large" });
@@ -2622,101 +2917,108 @@ function RebaseFirebaseApp(t0) {
2622
2917
  const LoginViewUsed = components?.LoginView ?? FirebaseLoginView;
2623
2918
  component = /* @__PURE__ */ jsx(LoginViewUsed, { logo: usedLogo, allowSkipLogin, signInOptions: signInOptions ?? DEFAULT_SIGN_IN_OPTIONS, firebaseApp, authController, notAllowedError });
2624
2919
  } else {
2625
- component = /* @__PURE__ */ jsx(Routes, { children: /* @__PURE__ */ jsxs(Route, { element: /* @__PURE__ */ jsxs(Scaffold, { logo: usedLogo, autoOpenDrawer, children: [
2920
+ const firstCollectionEntry = navigationStateController.topLevelNavigation?.navigationEntries.find(_temp3);
2921
+ const fallbackRoute = firstCollectionEntry ? /* @__PURE__ */ jsx(Navigate, { to: urlController.buildUrlCollectionPath(firstCollectionEntry.id), replace: true }) : /* @__PURE__ */ jsx(CenteredView, { children: "No home page or collections provided." });
2922
+ component = /* @__PURE__ */ jsx(SideEntityProvider, { children: /* @__PURE__ */ jsx(RebaseRoutes, { children: /* @__PURE__ */ jsxs(Route, { element: /* @__PURE__ */ jsxs(Scaffold, { logo: usedLogo, autoOpenDrawer, children: [
2626
2923
  /* @__PURE__ */ jsx(AppBar, { title: name, logo: usedLogo }),
2627
2924
  /* @__PURE__ */ jsx(Drawer, {}),
2628
2925
  /* @__PURE__ */ jsx(Outlet, {}),
2629
2926
  /* @__PURE__ */ jsx(SideDialogs, {})
2630
2927
  ] }), children: [
2631
- components?.HomePage && /* @__PURE__ */ jsx(Route, { path: "/", element: /* @__PURE__ */ jsx(components.HomePage, {}) }),
2632
- /* @__PURE__ */ jsx(Route, { path: "/c/*", element: /* @__PURE__ */ jsx(RebaseRoutes, {}) })
2633
- ] }) });
2928
+ /* @__PURE__ */ jsx(Route, { path: "/", element: components?.HomePage ? /* @__PURE__ */ jsx(components.HomePage, {}) : fallbackRoute }),
2929
+ /* @__PURE__ */ jsx(Route, { path: "/c/*", element: /* @__PURE__ */ jsx(RebaseRoute, {}) })
2930
+ ] }) }) });
2634
2931
  }
2635
2932
  }
2636
2933
  return component;
2637
2934
  };
2638
- $[51] = allowSkipLogin;
2639
- $[52] = authController;
2640
- $[53] = authLoading;
2641
- $[54] = autoOpenDrawer;
2642
- $[55] = canAccessMainView;
2643
- $[56] = components;
2644
- $[57] = firebaseApp;
2645
- $[58] = logo;
2646
- $[59] = logoDark;
2647
- $[60] = modeController;
2648
- $[61] = name;
2649
- $[62] = notAllowedError;
2650
- $[63] = signInOptions;
2651
- $[64] = t19;
2935
+ $[54] = allowSkipLogin;
2936
+ $[55] = authController;
2937
+ $[56] = authLoading;
2938
+ $[57] = autoOpenDrawer;
2939
+ $[58] = canAccessMainView;
2940
+ $[59] = components;
2941
+ $[60] = firebaseApp;
2942
+ $[61] = logo;
2943
+ $[62] = logoDark;
2944
+ $[63] = modeController;
2945
+ $[64] = name;
2946
+ $[65] = navigationStateController;
2947
+ $[66] = notAllowedError;
2948
+ $[67] = signInOptions;
2949
+ $[68] = urlController;
2950
+ $[69] = t21;
2652
2951
  } else {
2653
- t19 = $[64];
2952
+ t21 = $[69];
2654
2953
  }
2655
- let t20;
2656
- if ($[65] !== authController || $[66] !== dateTimeFormat || $[67] !== firestoreDelegate || $[68] !== locale || $[69] !== onAnalyticsEvent || $[70] !== plugins || $[71] !== propertyConfigs || $[72] !== storageSource || $[73] !== t18 || $[74] !== t19 || $[75] !== userConfigPersistence || $[76] !== userManagement) {
2657
- t20 = /* @__PURE__ */ jsx(Rebase, { authController, userConfigPersistence, dateTimeFormat, driver: firestoreDelegate, storageSource, userManagement, entityLinkBuilder: t18, locale, onAnalyticsEvent, plugins, propertyConfigs, children: t19 });
2658
- $[65] = authController;
2659
- $[66] = dateTimeFormat;
2660
- $[67] = firestoreDelegate;
2661
- $[68] = locale;
2662
- $[69] = onAnalyticsEvent;
2663
- $[70] = plugins;
2664
- $[71] = propertyConfigs;
2665
- $[72] = storageSource;
2666
- $[73] = t18;
2667
- $[74] = t19;
2668
- $[75] = userConfigPersistence;
2669
- $[76] = userManagement;
2670
- $[77] = t20;
2671
- } else {
2672
- t20 = $[77];
2673
- }
2674
- let t21;
2675
- if ($[78] !== navigationStateController || $[79] !== t20) {
2676
- t21 = /* @__PURE__ */ jsx(NavigationStateContext.Provider, { value: navigationStateController, children: t20 });
2677
- $[78] = navigationStateController;
2954
+ let t22;
2955
+ if ($[70] !== activeUserManagement || $[71] !== authController || $[72] !== dateTimeFormat || $[73] !== firestoreDelegate || $[74] !== locale || $[75] !== onAnalyticsEvent || $[76] !== plugins || $[77] !== propertyConfigs || $[78] !== storageSource || $[79] !== t20 || $[80] !== t21 || $[81] !== userConfigPersistence) {
2956
+ t22 = /* @__PURE__ */ jsx(Rebase, { authController, userConfigPersistence, dateTimeFormat, driver: firestoreDelegate, storageSource, userManagement: activeUserManagement, entityLinkBuilder: t20, locale, onAnalyticsEvent, plugins, propertyConfigs, children: t21 });
2957
+ $[70] = activeUserManagement;
2958
+ $[71] = authController;
2959
+ $[72] = dateTimeFormat;
2960
+ $[73] = firestoreDelegate;
2961
+ $[74] = locale;
2962
+ $[75] = onAnalyticsEvent;
2963
+ $[76] = plugins;
2964
+ $[77] = propertyConfigs;
2965
+ $[78] = storageSource;
2678
2966
  $[79] = t20;
2679
2967
  $[80] = t21;
2968
+ $[81] = userConfigPersistence;
2969
+ $[82] = t22;
2680
2970
  } else {
2681
- t21 = $[80];
2682
- }
2683
- let t22;
2684
- if ($[81] !== t21 || $[82] !== urlController) {
2685
- t22 = /* @__PURE__ */ jsx(UrlContext.Provider, { value: urlController, children: t21 });
2686
- $[81] = t21;
2687
- $[82] = urlController;
2688
- $[83] = t22;
2689
- } else {
2690
- t22 = $[83];
2971
+ t22 = $[82];
2691
2972
  }
2692
2973
  let t23;
2693
- if ($[84] !== collectionRegistryController || $[85] !== t22) {
2694
- t23 = /* @__PURE__ */ jsx(CollectionRegistryContext.Provider, { value: collectionRegistryController, children: t22 });
2695
- $[84] = collectionRegistryController;
2696
- $[85] = t22;
2697
- $[86] = t23;
2974
+ if ($[83] !== navigationStateController || $[84] !== t22) {
2975
+ t23 = /* @__PURE__ */ jsx(NavigationStateContext.Provider, { value: navigationStateController, children: t22 });
2976
+ $[83] = navigationStateController;
2977
+ $[84] = t22;
2978
+ $[85] = t23;
2698
2979
  } else {
2699
- t23 = $[86];
2980
+ t23 = $[85];
2700
2981
  }
2701
2982
  let t24;
2702
- if ($[87] !== adminModeController || $[88] !== t23) {
2703
- t24 = /* @__PURE__ */ jsx(AdminModeControllerProvider, { value: adminModeController, children: t23 });
2704
- $[87] = adminModeController;
2705
- $[88] = t23;
2706
- $[89] = t24;
2983
+ if ($[86] !== t23 || $[87] !== urlController) {
2984
+ t24 = /* @__PURE__ */ jsx(UrlContext.Provider, { value: urlController, children: t23 });
2985
+ $[86] = t23;
2986
+ $[87] = urlController;
2987
+ $[88] = t24;
2707
2988
  } else {
2708
- t24 = $[89];
2989
+ t24 = $[88];
2709
2990
  }
2710
2991
  let t25;
2711
- if ($[90] !== modeController || $[91] !== t24) {
2712
- t25 = /* @__PURE__ */ jsx(SnackbarProvider, { children: /* @__PURE__ */ jsx(ModeControllerProvider, { value: modeController, children: t24 }) });
2713
- $[90] = modeController;
2714
- $[91] = t24;
2715
- $[92] = t25;
2992
+ if ($[89] !== collectionRegistryController || $[90] !== t24) {
2993
+ t25 = /* @__PURE__ */ jsx(CollectionRegistryContext.Provider, { value: collectionRegistryController, children: t24 });
2994
+ $[89] = collectionRegistryController;
2995
+ $[90] = t24;
2996
+ $[91] = t25;
2997
+ } else {
2998
+ t25 = $[91];
2999
+ }
3000
+ let t26;
3001
+ if ($[92] !== adminModeController || $[93] !== t25) {
3002
+ t26 = /* @__PURE__ */ jsx(AdminModeControllerProvider, { value: adminModeController, children: t25 });
3003
+ $[92] = adminModeController;
3004
+ $[93] = t25;
3005
+ $[94] = t26;
2716
3006
  } else {
2717
- t25 = $[92];
3007
+ t26 = $[94];
3008
+ }
3009
+ let t27;
3010
+ if ($[95] !== modeController || $[96] !== t26) {
3011
+ t27 = /* @__PURE__ */ jsx(SnackbarProvider, { children: /* @__PURE__ */ jsx(ModeControllerProvider, { value: modeController, children: t26 }) });
3012
+ $[95] = modeController;
3013
+ $[96] = t26;
3014
+ $[97] = t27;
3015
+ } else {
3016
+ t27 = $[97];
2718
3017
  }
2719
- return t25;
3018
+ return t27;
3019
+ }
3020
+ function _temp3(e) {
3021
+ return e.type === "collection";
2720
3022
  }
2721
3023
  function _temp2(a, b) {
2722
3024
  return {
@@ -2747,6 +3049,7 @@ export {
2747
3049
  performAlgoliaTextSearch,
2748
3050
  performPineconeTextSearch,
2749
3051
  useAppCheck,
3052
+ useBuildUserManagement,
2750
3053
  useFirebaseAuthController,
2751
3054
  useFirebaseRTDBDelegate,
2752
3055
  useFirebaseStorageSource,