@moh-sso/users 1.9.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  import { jsx as r, jsxs as u, Fragment as Re } from "react/jsx-runtime";
2
- import { InlineLoading as k, Stack as $, Button as A, Tile as z, MultiSelect as J, Tag as Z, Form as Ue, FormGroup as oe, TextInput as V, Checkbox as X, Dropdown as ie, OverflowMenu as Ae, OverflowMenuItem as j, ButtonSet as _e, DataTable as Le, Table as Pe, TableHead as Me, TableRow as le, TableSelectAll as we, TableHeader as xe, TableBody as Ee, TableSelectRow as Ge, TableCell as de } from "@carbon/react";
3
- import { useState as T, useEffect as ee, useMemo as w } from "react";
2
+ import { InlineLoading as N, Stack as C, Button as A, Tile as z, MultiSelect as J, Tag as Z, Form as Ue, FormGroup as oe, TextInput as V, Checkbox as X, Dropdown as ie, OverflowMenu as Ae, OverflowMenuItem as j, ButtonSet as Le, DataTable as _e, Table as Pe, TableHead as we, TableRow as le, TableSelectAll as Me, TableHeader as Ee, TableBody as xe, TableSelectRow as Ge, TableCell as de } from "@carbon/react";
3
+ import { useState as T, useEffect as ee, useMemo as M } from "react";
4
4
  import { useSelector as he } from "react-redux";
5
5
  import { selectUser as ge } from "@moh-sso/auth";
6
- import { useToast as te, FormInlineAlert as fe, useModal as Se, useHeaderPanel as Ne, DataTableShell as ke, TableStatusTag as De, RowActionsCell as He, DataTablePagination as Oe, ErrorState as Qe } from "@moh-sso/ui";
6
+ import { useToast as te, FormInlineAlert as fe, useModal as Se, useHeaderPanel as ke, PageLoading as Ne, DataTableShell as De, TableStatusTag as He, RowActionsCell as Oe, DataTablePagination as Qe, ErrorState as Fe } from "@moh-sso/ui";
7
7
  import { baseApi as se } from "@moh-sso/api";
8
- import { u as Fe, i as Be, e as ze, g as Ve, f as je } from "./users.api-DoE9CD9k.js";
9
- const n = "/admin/rbac", Ke = se.injectEndpoints({
8
+ import { u as Be, i as ze, e as Ve, g as je, f as Ke } from "./users.api-DoE9CD9k.js";
9
+ const n = "/admin/rbac", We = se.injectEndpoints({
10
10
  endpoints: (s) => ({
11
11
  registerRbacSystem: s.mutation({
12
12
  query: (e) => ({ url: `${n}/systems`, method: "POST", body: e }),
@@ -476,66 +476,66 @@ const n = "/admin/rbac", Ke = se.injectEndpoints({
476
476
  })
477
477
  })
478
478
  }), {
479
- useApplyRbacSyncMutation: Ct,
480
- useApplyRbacImportMutation: It,
481
- useAddSystemAccessRoleMutation: qt,
482
- useAddRbacGroupMemberMutation: Ut,
483
- useAssignGroupPermissionMutation: At,
479
+ useApplyRbacSyncMutation: It,
480
+ useApplyRbacImportMutation: qt,
481
+ useAddSystemAccessRoleMutation: Ut,
482
+ useAddRbacGroupMemberMutation: At,
483
+ useAssignGroupPermissionMutation: Lt,
484
484
  useAssignGroupRealmRoleMutation: _t,
485
- useAssignGroupSystemRoleMutation: Lt,
486
- useAssignRealmRolePermissionMutation: Pt,
485
+ useAssignGroupSystemRoleMutation: Pt,
486
+ useAssignRealmRolePermissionMutation: wt,
487
487
  useAssignSystemRolePermissionMutation: Mt,
488
- useBulkAssignPermissionMutation: wt,
488
+ useBulkAssignPermissionMutation: Et,
489
489
  useBulkRemovePermissionMutation: xt,
490
- useCopyRolePermissionsMutation: Et,
491
- useCreateAccessRequestMutation: Gt,
490
+ useCopyRolePermissionsMutation: Gt,
491
+ useCreateAccessRequestMutation: kt,
492
492
  useCreateChangeRequestMutation: Nt,
493
- useCreateRoleFromTemplateMutation: kt,
494
- useCreateSystemRoleMutation: Dt,
495
- useDecideAccessRequestMutation: Ht,
496
- useDecideChangeRequestMutation: Ot,
497
- useDeleteSystemRoleMutation: Qt,
498
- useExportRbacSeedQuery: Ft,
499
- useGetRbacDriftQuery: Bt,
500
- useGetRbacEffectiveAccessQuery: zt,
501
- useGetRbacGroupQuery: Vt,
502
- useGetAssignableUserAccessQuery: We,
503
- useGetUserAccessProfileQuery: Ye,
504
- useGetRealmRoleUsageQuery: jt,
505
- useGetRoleUsageQuery: Kt,
506
- useListAccessRequestsQuery: Wt,
507
- useListChangeRequestsQuery: Yt,
508
- useListRbacAuditEventsQuery: Jt,
509
- useGetRbacSystemQuery: Xt,
510
- useListRbacPermissionsQuery: Zt,
511
- useListRbacGroupMembersQuery: es,
512
- useListRbacGroupsQuery: ts,
513
- useListRbacRoleTemplatesQuery: ss,
514
- useListRbacSystemsQuery: as,
515
- useListRealmRolePermissionsQuery: rs,
516
- useListSystemRolesQuery: ns,
517
- usePreviewRbacChangeMutation: os,
518
- usePreviewRbacImportMutation: is,
519
- usePreviewRbacRealmExportDriftMutation: ls,
520
- usePreviewRbacSyncMutation: ds,
521
- useRemoveGroupPermissionMutation: cs,
522
- useRemoveRbacGroupMemberMutation: us,
523
- useRemoveGroupRealmRoleMutation: ms,
524
- useRemoveGroupSystemRoleMutation: ps,
525
- useRemoveRealmRolePermissionMutation: ys,
526
- useRemoveSystemAccessRoleMutation: Rs,
527
- useRemoveSystemRolePermissionMutation: hs,
528
- useSimulateRbacAccessMutation: gs,
529
- useSyncRbacGroupMembersMutation: fs,
530
- useUpdateUserAccessMutation: Je,
531
- useUpdateRbacPermissionMetadataMutation: Ss,
532
- useUpdateRbacSystemMutation: bs,
533
- useRegisterRbacSystemMutation: Ts,
534
- useTransitionRbacSystemMutation: vs,
535
- useUpdateSystemRoleMutation: $s,
536
- useUpsertRbacGroupMutation: Cs,
537
- useReplaceRbacGroupMembersMutation: Is
538
- } = Ke, P = "/admin/health-contexts", Xe = se.injectEndpoints({
493
+ useCreateRoleFromTemplateMutation: Dt,
494
+ useCreateSystemRoleMutation: Ht,
495
+ useDecideAccessRequestMutation: Ot,
496
+ useDecideChangeRequestMutation: Qt,
497
+ useDeleteSystemRoleMutation: Ft,
498
+ useExportRbacSeedQuery: Bt,
499
+ useGetRbacDriftQuery: zt,
500
+ useGetRbacEffectiveAccessQuery: Vt,
501
+ useGetRbacGroupQuery: jt,
502
+ useGetAssignableUserAccessQuery: Ye,
503
+ useGetUserAccessProfileQuery: Je,
504
+ useGetRealmRoleUsageQuery: Kt,
505
+ useGetRoleUsageQuery: Wt,
506
+ useListAccessRequestsQuery: Yt,
507
+ useListChangeRequestsQuery: Jt,
508
+ useListRbacAuditEventsQuery: Xt,
509
+ useGetRbacSystemQuery: Zt,
510
+ useListRbacPermissionsQuery: es,
511
+ useListRbacGroupMembersQuery: ts,
512
+ useListRbacGroupsQuery: ss,
513
+ useListRbacRoleTemplatesQuery: as,
514
+ useListRbacSystemsQuery: rs,
515
+ useListRealmRolePermissionsQuery: ns,
516
+ useListSystemRolesQuery: os,
517
+ usePreviewRbacChangeMutation: is,
518
+ usePreviewRbacImportMutation: ls,
519
+ usePreviewRbacRealmExportDriftMutation: ds,
520
+ usePreviewRbacSyncMutation: cs,
521
+ useRemoveGroupPermissionMutation: us,
522
+ useRemoveRbacGroupMemberMutation: ms,
523
+ useRemoveGroupRealmRoleMutation: ps,
524
+ useRemoveGroupSystemRoleMutation: ys,
525
+ useRemoveRealmRolePermissionMutation: Rs,
526
+ useRemoveSystemAccessRoleMutation: hs,
527
+ useRemoveSystemRolePermissionMutation: gs,
528
+ useSimulateRbacAccessMutation: fs,
529
+ useSyncRbacGroupMembersMutation: Ss,
530
+ useUpdateUserAccessMutation: Xe,
531
+ useUpdateRbacPermissionMetadataMutation: bs,
532
+ useUpdateRbacSystemMutation: Ts,
533
+ useRegisterRbacSystemMutation: vs,
534
+ useTransitionRbacSystemMutation: $s,
535
+ useUpdateSystemRoleMutation: Cs,
536
+ useUpsertRbacGroupMutation: Is,
537
+ useReplaceRbacGroupMembersMutation: qs
538
+ } = We, P = "/admin/health-contexts", Ze = se.injectEndpoints({
539
539
  endpoints: (s) => ({
540
540
  listHealthContexts: s.query({
541
541
  query: (e) => {
@@ -659,35 +659,39 @@ const n = "/admin/rbac", Ke = se.injectEndpoints({
659
659
  })
660
660
  })
661
661
  }), {
662
- useApplyHealthContextSyncMutation: qs,
663
- useCreateHealthContextMutation: Us,
664
- useDeleteHealthContextAliasMutation: As,
662
+ useApplyHealthContextSyncMutation: Us,
663
+ useCreateHealthContextMutation: As,
664
+ useDeleteHealthContextAliasMutation: Ls,
665
665
  useDeleteHealthContextMutation: _s,
666
- useListGroupHealthContextsQuery: Ls,
667
- useGetHealthContextDriftQuery: Ps,
666
+ useListGroupHealthContextsQuery: Ps,
667
+ useGetHealthContextDriftQuery: ws,
668
668
  useListHealthContextAliasesQuery: Ms,
669
- useListHealthContextsQuery: ws,
669
+ useListHealthContextsQuery: Es,
670
670
  useListUserHealthContextsQuery: xs,
671
- useReplaceGroupHealthContextsMutation: Es,
672
- useReplaceUserHealthContextsMutation: Gs,
671
+ useReplaceGroupHealthContextsMutation: Gs,
672
+ useReplaceUserHealthContextsMutation: ks,
673
673
  usePreviewHealthContextSyncMutation: Ns,
674
- useUpdateHealthContextMutation: ks,
675
- useUpsertHealthContextAliasMutation: Ds
676
- } = Xe, W = (s) => `/admin/platform/applications/${encodeURIComponent(s)}/identities`, U = (s) => `/admin/platform/applications/${encodeURIComponent(s)}/identity-sync`, Ze = se.injectEndpoints({
674
+ useUpdateHealthContextMutation: Ds,
675
+ useUpsertHealthContextAliasMutation: Hs
676
+ } = Ze, W = (s) => `/admin/platform/applications/${encodeURIComponent(s)}/identities`, $ = (s) => `/admin/platform/applications/${encodeURIComponent(s)}/identity-sync`, et = se.injectEndpoints({
677
677
  endpoints: (s) => ({
678
678
  // data is null when the application has no integration registered yet.
679
679
  getIdentitySyncIntegration: s.query({
680
- query: (e) => U(e),
680
+ query: (e) => $(e),
681
681
  transformResponse: (e) => e.data,
682
682
  providesTags: (e, t, a) => [{ type: "IdentitySync", id: `integration:${a}` }]
683
683
  }),
684
684
  saveIdentitySyncIntegration: s.mutation({
685
- query: ({ clientId: e, data: t }) => ({ url: U(e), method: "PUT", body: t }),
685
+ query: ({ clientId: e, data: t }) => ({ url: $(e), method: "PUT", body: t }),
686
686
  transformResponse: (e) => e.data,
687
687
  invalidatesTags: (e, t, { clientId: a }) => [
688
688
  { type: "IdentitySync", id: `integration:${a}` }
689
689
  ]
690
690
  }),
691
+ listPlatformScopes: s.query({
692
+ query: () => "/admin/platform/scopes",
693
+ transformResponse: (e) => e.data
694
+ }),
691
695
  listServiceIdentities: s.query({
692
696
  query: (e) => W(e),
693
697
  transformResponse: (e) => e.data.identities,
@@ -711,28 +715,36 @@ const n = "/admin/rbac", Ke = se.injectEndpoints({
711
715
  { type: "IdentitySync", id: `identities:${a}` }
712
716
  ]
713
717
  }),
718
+ checkIdentitySyncNetwork: s.mutation({
719
+ query: ({ clientId: e, origin: t }) => ({
720
+ url: `${$(e)}/network-check`,
721
+ method: "GET",
722
+ params: t ? { origin: t } : void 0
723
+ }),
724
+ transformResponse: (e) => e.data
725
+ }),
714
726
  describeIdentitySync: s.mutation({
715
- query: (e) => ({ url: `${U(e)}/describe`, method: "GET" }),
727
+ query: (e) => ({ url: `${$(e)}/describe`, method: "GET" }),
716
728
  transformResponse: (e) => e.data
717
729
  }),
718
730
  listIdentitySyncRuns: s.query({
719
- query: (e) => `${U(e)}/runs`,
731
+ query: (e) => `${$(e)}/runs`,
720
732
  transformResponse: (e) => e.data,
721
733
  providesTags: (e, t, a) => [{ type: "IdentitySync", id: `runs:${a}` }]
722
734
  }),
723
735
  startIdentitySyncRun: s.mutation({
724
- query: (e) => ({ url: `${U(e)}/runs`, method: "POST" }),
736
+ query: (e) => ({ url: `${$(e)}/runs`, method: "POST" }),
725
737
  transformResponse: (e) => e.data,
726
738
  invalidatesTags: (e, t, a) => [{ type: "IdentitySync", id: `runs:${a}` }]
727
739
  }),
728
740
  getIdentitySyncRun: s.query({
729
- query: ({ clientId: e, runId: t }) => `${U(e)}/runs/${encodeURIComponent(t)}`,
741
+ query: ({ clientId: e, runId: t }) => `${$(e)}/runs/${encodeURIComponent(t)}`,
730
742
  transformResponse: (e) => e.data,
731
743
  providesTags: (e, t, { runId: a }) => [{ type: "IdentitySync", id: `run:${a}` }]
732
744
  }),
733
745
  decideIdentitySyncRows: s.mutation({
734
746
  query: ({ clientId: e, runId: t, decision: a, accountIds: l, note: d }) => ({
735
- url: `${U(e)}/runs/${encodeURIComponent(t)}/decisions`,
747
+ url: `${$(e)}/runs/${encodeURIComponent(t)}/decisions`,
736
748
  method: "POST",
737
749
  body: { decision: a, accountIds: l, note: d }
738
750
  }),
@@ -741,7 +753,7 @@ const n = "/admin/rbac", Ke = se.injectEndpoints({
741
753
  }),
742
754
  applyIdentitySyncRun: s.mutation({
743
755
  query: ({ clientId: e, runId: t, resume: a }) => ({
744
- url: `${U(e)}/runs/${encodeURIComponent(t)}/apply`,
756
+ url: `${$(e)}/runs/${encodeURIComponent(t)}/apply`,
745
757
  method: "POST",
746
758
  body: { resume: a }
747
759
  }),
@@ -752,14 +764,14 @@ const n = "/admin/rbac", Ke = se.injectEndpoints({
752
764
  ]
753
765
  }),
754
766
  listIdentitySyncRevocations: s.query({
755
- query: ({ clientId: e, all: t }) => `${U(e)}/revocations?all=${t ? "true" : "false"}`,
767
+ query: ({ clientId: e, all: t }) => `${$(e)}/revocations?all=${t ? "true" : "false"}`,
756
768
  transformResponse: (e) => e.data,
757
769
  providesTags: (e, t, { clientId: a }) => [
758
770
  { type: "IdentitySync", id: `revocations:${a}` }
759
771
  ]
760
772
  }),
761
773
  resumeIdentitySyncRevocations: s.mutation({
762
- query: (e) => ({ url: `${U(e)}/revocations/resume`, method: "POST" }),
774
+ query: (e) => ({ url: `${$(e)}/revocations/resume`, method: "POST" }),
763
775
  transformResponse: (e) => e.data,
764
776
  invalidatesTags: (e, t, a) => [
765
777
  { type: "IdentitySync", id: `revocations:${a}` }
@@ -767,7 +779,7 @@ const n = "/admin/rbac", Ke = se.injectEndpoints({
767
779
  }),
768
780
  restoreIdentitySyncRevocation: s.mutation({
769
781
  query: ({ clientId: e, subject: t, reason: a }) => ({
770
- url: `${U(e)}/revocations/restore`,
782
+ url: `${$(e)}/revocations/restore`,
771
783
  method: "POST",
772
784
  body: { subject: t, reason: a }
773
785
  }),
@@ -778,44 +790,46 @@ const n = "/admin/rbac", Ke = se.injectEndpoints({
778
790
  })
779
791
  })
780
792
  }), {
781
- useGetIdentitySyncIntegrationQuery: Hs,
782
- useSaveIdentitySyncIntegrationMutation: Os,
783
- useDescribeIdentitySyncMutation: Qs,
784
- useListServiceIdentitiesQuery: Fs,
785
- useResolveServiceAccountMutation: Bs,
786
- useSaveServiceIdentityMutation: zs,
787
- useListIdentitySyncRunsQuery: Vs,
788
- useStartIdentitySyncRunMutation: js,
789
- useGetIdentitySyncRunQuery: Ks,
790
- useDecideIdentitySyncRowsMutation: Ws,
791
- useApplyIdentitySyncRunMutation: Ys,
792
- useListIdentitySyncRevocationsQuery: Js,
793
- useResumeIdentitySyncRevocationsMutation: Xs,
794
- useRestoreIdentitySyncRevocationMutation: Zs
795
- } = Ze;
796
- function et({ userId: s }) {
797
- const e = te(), { data: t, isLoading: a, isFetching: l, isError: d, error: c, refetch: f } = Ye(s), [S, { isLoading: g }] = Je(), [m, x] = T([]), [C, E] = T({});
793
+ useGetIdentitySyncIntegrationQuery: Os,
794
+ useSaveIdentitySyncIntegrationMutation: Qs,
795
+ useDescribeIdentitySyncMutation: Fs,
796
+ useCheckIdentitySyncNetworkMutation: Bs,
797
+ useListServiceIdentitiesQuery: zs,
798
+ useListPlatformScopesQuery: Vs,
799
+ useResolveServiceAccountMutation: js,
800
+ useSaveServiceIdentityMutation: Ks,
801
+ useListIdentitySyncRunsQuery: Ws,
802
+ useStartIdentitySyncRunMutation: Ys,
803
+ useGetIdentitySyncRunQuery: Js,
804
+ useDecideIdentitySyncRowsMutation: Xs,
805
+ useApplyIdentitySyncRunMutation: Zs,
806
+ useListIdentitySyncRevocationsQuery: ea,
807
+ useResumeIdentitySyncRevocationsMutation: ta,
808
+ useRestoreIdentitySyncRevocationMutation: sa
809
+ } = et;
810
+ function tt({ userId: s }) {
811
+ const e = te(), { data: t, isLoading: a, isFetching: l, isError: d, error: c, refetch: f } = Je(s), [S, { isLoading: g }] = Xe(), [m, E] = T([]), [I, x] = T({});
798
812
  ee(() => {
799
- t && (x(t.directAccess?.realmRoles ?? t.effectiveAccess.realmRoles ?? []), E(t.directAccess?.clientRoles ?? t.effectiveAccess.clientRoles ?? {}));
813
+ t && (E(t.directAccess?.realmRoles ?? t.effectiveAccess.realmRoles ?? []), x(t.directAccess?.clientRoles ?? t.effectiveAccess.clientRoles ?? {}));
800
814
  }, [t]);
801
- const I = w(
815
+ const q = M(
802
816
  () => (t?.assignable.realmRoles ?? []).map((o) => ({
803
817
  id: o.name,
804
818
  text: o.displayName || o.name
805
819
  })),
806
820
  [t?.assignable.realmRoles]
807
- ), G = w(
808
- () => tt(t?.effectiveAccess.permissions ?? []),
821
+ ), G = M(
822
+ () => st(t?.effectiveAccess.permissions ?? []),
809
823
  [t?.effectiveAccess.permissions]
810
- ), _ = w(
824
+ ), L = M(
811
825
  () => (t?.effectiveAccess.grantSources ?? []).filter(
812
826
  (o) => o.grantedByType.startsWith("group")
813
827
  ),
814
828
  [t?.effectiveAccess.grantSources]
815
- ), N = w(() => st(_), [_]), M = (o, h) => {
816
- E((L) => ({
817
- ...L,
818
- [o.clientId]: h
829
+ ), k = M(() => at(L), [L]), w = (o, R) => {
830
+ x((_) => ({
831
+ ..._,
832
+ [o.clientId]: R
819
833
  }));
820
834
  }, D = async () => {
821
835
  try {
@@ -823,14 +837,14 @@ function et({ userId: s }) {
823
837
  userId: s,
824
838
  data: {
825
839
  realmRoles: m,
826
- clientRoles: C
840
+ clientRoles: I
827
841
  }
828
842
  }).unwrap(), e.success("Access updated", "User roles and effective permissions were updated.");
829
843
  } catch (o) {
830
844
  e.error("Access update failed", ue(o, "Unable to update user access."));
831
845
  }
832
846
  };
833
- return a ? /* @__PURE__ */ r(k, { description: "Loading user access..." }) : d || !t ? /* @__PURE__ */ u($, { gap: 4, children: [
847
+ return a ? /* @__PURE__ */ r(N, { description: "Loading user access..." }) : d || !t ? /* @__PURE__ */ u(C, { gap: 4, children: [
834
848
  /* @__PURE__ */ r(
835
849
  fe,
836
850
  {
@@ -839,9 +853,9 @@ function et({ userId: s }) {
839
853
  }
840
854
  ),
841
855
  /* @__PURE__ */ r(A, { kind: "secondary", size: "sm", onClick: () => f(), children: "Retry" })
842
- ] }) : /* @__PURE__ */ u($, { gap: 5, children: [
843
- l && /* @__PURE__ */ r(k, { description: "Refreshing access profile..." }),
844
- /* @__PURE__ */ r(z, { children: /* @__PURE__ */ u($, { gap: 4, children: [
856
+ ] }) : /* @__PURE__ */ u(C, { gap: 5, children: [
857
+ l && /* @__PURE__ */ r(N, { description: "Refreshing access profile..." }),
858
+ /* @__PURE__ */ r(z, { children: /* @__PURE__ */ u(C, { gap: 4, children: [
845
859
  /* @__PURE__ */ r("strong", { children: "Realm roles" }),
846
860
  /* @__PURE__ */ r("small", { children: "These are direct user realm roles. Group-derived roles are shown as inherited access below." }),
847
861
  /* @__PURE__ */ r(
@@ -850,24 +864,24 @@ function et({ userId: s }) {
850
864
  id: `user-${s}-realm-roles`,
851
865
  titleText: "Realm roles",
852
866
  label: "Select realm roles",
853
- items: I,
867
+ items: q,
854
868
  itemToString: (o) => o?.text ?? "",
855
- selectedItems: I.filter((o) => m.includes(o.id)),
869
+ selectedItems: q.filter((o) => m.includes(o.id)),
856
870
  onChange: ({ selectedItems: o }) => {
857
- x((o ?? []).map((h) => h.id));
871
+ E((o ?? []).map((R) => R.id));
858
872
  }
859
873
  }
860
874
  )
861
875
  ] }) }),
862
- /* @__PURE__ */ r(z, { children: /* @__PURE__ */ u($, { gap: 5, children: [
876
+ /* @__PURE__ */ r(z, { children: /* @__PURE__ */ u(C, { gap: 5, children: [
863
877
  /* @__PURE__ */ r("strong", { children: "System roles and app access" }),
864
878
  /* @__PURE__ */ r("small", { children: "These are direct user system roles. Group-derived system roles are read-only in the inherited access section." }),
865
879
  t.assignable.systems.map((o) => {
866
- const h = o.roles.map((i) => ({
880
+ const R = o.roles.map((i) => ({
867
881
  id: i.name,
868
882
  text: i.displayName || i.name
869
- })), L = C[o.clientId] ?? [];
870
- return /* @__PURE__ */ u($, { gap: 3, children: [
883
+ })), _ = I[o.clientId] ?? [];
884
+ return /* @__PURE__ */ u(C, { gap: 3, children: [
871
885
  /* @__PURE__ */ u("div", { children: [
872
886
  /* @__PURE__ */ r("strong", { children: o.displayName || o.clientId }),
873
887
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("small", { children: o.clientId }) })
@@ -878,11 +892,11 @@ function et({ userId: s }) {
878
892
  id: `user-${s}-${o.clientId}-roles`,
879
893
  titleText: "System roles",
880
894
  label: "Select system roles",
881
- items: h,
895
+ items: R,
882
896
  itemToString: (i) => i?.text ?? "",
883
- selectedItems: h.filter((i) => L.includes(i.id)),
897
+ selectedItems: R.filter((i) => _.includes(i.id)),
884
898
  onChange: ({ selectedItems: i }) => {
885
- M(
899
+ w(
886
900
  o,
887
901
  (i ?? []).map((b) => b.id)
888
902
  );
@@ -896,7 +910,7 @@ function et({ userId: s }) {
896
910
  ] }, o.clientId);
897
911
  })
898
912
  ] }) }),
899
- /* @__PURE__ */ r(z, { children: /* @__PURE__ */ u($, { gap: 4, children: [
913
+ /* @__PURE__ */ r(z, { children: /* @__PURE__ */ u(C, { gap: 4, children: [
900
914
  /* @__PURE__ */ r("strong", { children: "Groups and inherited access" }),
901
915
  t.effectiveAccess.groups && t.effectiveAccess.groups.length > 0 ? /* @__PURE__ */ r("div", { className: "user-access-group-list", children: t.effectiveAccess.groups.map((o) => /* @__PURE__ */ u("div", { className: "user-access-group", children: [
902
916
  /* @__PURE__ */ u("div", { children: [
@@ -909,21 +923,21 @@ function et({ userId: s }) {
909
923
  o.displayName || o.name || o.path,
910
924
  ". Edit the group or Keycloak membership to change this access."
911
925
  ] }),
912
- /* @__PURE__ */ r(at, { sources: N[o.id] ?? [] })
926
+ /* @__PURE__ */ r(rt, { sources: k[o.id] ?? [] })
913
927
  ] }, o.id || o.path)) }) : /* @__PURE__ */ r("small", { children: "No Keycloak groups are synced for this user." })
914
928
  ] }) }),
915
- /* @__PURE__ */ r(z, { children: /* @__PURE__ */ u($, { gap: 4, children: [
929
+ /* @__PURE__ */ r(z, { children: /* @__PURE__ */ u(C, { gap: 4, children: [
916
930
  /* @__PURE__ */ r("strong", { children: "Effective permissions" }),
917
- Object.entries(G).map(([o, h]) => /* @__PURE__ */ u("div", { children: [
931
+ Object.entries(G).map(([o, R]) => /* @__PURE__ */ u("div", { children: [
918
932
  /* @__PURE__ */ r("small", { children: o }),
919
- /* @__PURE__ */ r(ce, { values: h.map((L) => L.key), type: "green" })
933
+ /* @__PURE__ */ r(ce, { values: R.map((_) => _.key), type: "green" })
920
934
  ] }, o)),
921
935
  t.effectiveAccess.permissions.length === 0 && /* @__PURE__ */ r("small", { children: "No permissions resolved for this user." })
922
936
  ] }) }),
923
937
  /* @__PURE__ */ r(A, { kind: "primary", disabled: g, onClick: D, children: g ? "Saving access..." : "Save access" })
924
938
  ] });
925
939
  }
926
- function tt(s) {
940
+ function st(s) {
927
941
  return s.reduce((e, t) => {
928
942
  const a = t.category || t.key.split(":")[0] || "other";
929
943
  return e[a] = [...e[a] ?? [], t], e;
@@ -932,13 +946,13 @@ function tt(s) {
932
946
  function ce({ values: s, type: e }) {
933
947
  return /* @__PURE__ */ r("div", { className: "user-access-tag-list", children: s.map((t) => /* @__PURE__ */ r(Z, { size: "sm", type: e, children: t }, t)) });
934
948
  }
935
- function st(s) {
949
+ function at(s) {
936
950
  return s.reduce((e, t) => {
937
951
  const a = t.groupId || "unknown";
938
952
  return e[a] = [...e[a] ?? [], t], e;
939
953
  }, {});
940
954
  }
941
- function at({ sources: s }) {
955
+ function rt({ sources: s }) {
942
956
  return s.length === 0 ? /* @__PURE__ */ r("small", { children: "Groups synced, but no group-derived permissions are mapped yet." }) : /* @__PURE__ */ r("div", { className: "user-access-inherited-list", children: s.map((e) => /* @__PURE__ */ u(
943
957
  Z,
944
958
  {
@@ -968,46 +982,46 @@ const me = (s) => ({
968
982
  enabled: s?.enabled ?? s?.isActive ?? !0,
969
983
  emailVerified: s?.emailVerified ?? !0
970
984
  });
971
- function rt({ mode: s, initialUser: e, onSuccess: t }) {
972
- const a = he(ge), l = s === "edit" && e?.id === a?.id, d = te(), [c, f] = T(() => me(e)), [S, g] = T(null), [m, { isLoading: x }] = Fe(), [C, { isLoading: E }] = Be(), { data: I, isLoading: G } = We(), _ = x || E, N = w(
973
- () => (I?.realmRoles ?? []).map((i) => ({
985
+ function nt({ mode: s, initialUser: e, onSuccess: t }) {
986
+ const a = he(ge), l = s === "edit" && e?.id === a?.id, d = te(), [c, f] = T(() => me(e)), [S, g] = T(null), [m, { isLoading: E }] = Be(), [I, { isLoading: x }] = ze(), { data: q, isLoading: G } = Ye(), L = E || x, k = M(
987
+ () => (q?.realmRoles ?? []).map((i) => ({
974
988
  id: i.name,
975
989
  text: i.displayName || i.name
976
990
  })),
977
- [I?.realmRoles]
991
+ [q?.realmRoles]
978
992
  );
979
993
  ee(() => {
980
994
  f(me(e)), g(null);
981
995
  }, [e, s]);
982
- const M = (i) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i), D = () => ({
996
+ const w = (i) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i), D = () => ({
983
997
  email: c.email.trim().toLowerCase(),
984
998
  firstName: c.firstName.trim(),
985
999
  lastName: c.lastName.trim(),
986
1000
  realmRoles: c.realmRoles,
987
1001
  enabled: c.enabled,
988
1002
  emailVerified: c.emailVerified
989
- }), o = w(() => !(!c.username.trim() || !c.firstName.trim() || !c.lastName.trim() || !M(c.email)), [c]), h = (i, b) => {
1003
+ }), o = M(() => !(!c.username.trim() || !c.firstName.trim() || !c.lastName.trim() || !w(c.email)), [c]), R = (i, b) => {
990
1004
  f((Q) => ({ ...Q, [i]: b }));
991
- }, L = async () => {
992
- if (!(!o || _)) {
1005
+ }, _ = async () => {
1006
+ if (!(!o || L)) {
993
1007
  g(null);
994
1008
  try {
995
1009
  s === "create" ? (await m({
996
1010
  username: c.username.trim().toLowerCase(),
997
1011
  ...D()
998
- }).unwrap(), d.success("User created", `User "${c.username}" was created successfully`)) : e?.id && (await C({
1012
+ }).unwrap(), d.success("User created", `User "${c.username}" was created successfully`)) : e?.id && (await I({
999
1013
  id: e.id,
1000
1014
  data: D()
1001
1015
  }).unwrap(), d.success("User updated", `Changes to "${c.username}" were saved`)), t?.();
1002
1016
  } catch (i) {
1003
- const b = nt(i) ?? (s === "create" ? "Failed to create user" : "Failed to update user");
1017
+ const b = ot(i) ?? (s === "create" ? "Failed to create user" : "Failed to update user");
1004
1018
  g(b), d.error("Operation failed", "Please review the form and try again");
1005
1019
  }
1006
1020
  }
1007
1021
  };
1008
- return /* @__PURE__ */ r(Ue, { children: /* @__PURE__ */ u($, { gap: 6, children: [
1022
+ return /* @__PURE__ */ r(Ue, { children: /* @__PURE__ */ u(C, { gap: 6, children: [
1009
1023
  S && /* @__PURE__ */ r(fe, { title: "Unable to save user", subtitle: S }),
1010
- /* @__PURE__ */ r(oe, { legendText: "User details", children: /* @__PURE__ */ u($, { gap: 4, children: [
1024
+ /* @__PURE__ */ r(oe, { legendText: "User details", children: /* @__PURE__ */ u(C, { gap: 4, children: [
1011
1025
  /* @__PURE__ */ r(
1012
1026
  V,
1013
1027
  {
@@ -1018,7 +1032,7 @@ function rt({ mode: s, initialUser: e, onSuccess: t }) {
1018
1032
  helperText: s === "edit" ? "Username cannot be changed" : void 0,
1019
1033
  value: c.username,
1020
1034
  onChange: (i) => {
1021
- h("username", i.target.value.toLowerCase());
1035
+ R("username", i.target.value.toLowerCase());
1022
1036
  }
1023
1037
  }
1024
1038
  ),
@@ -1030,10 +1044,10 @@ function rt({ mode: s, initialUser: e, onSuccess: t }) {
1030
1044
  type: "email",
1031
1045
  required: !0,
1032
1046
  value: c.email,
1033
- invalid: !!c.email && !M(c.email),
1047
+ invalid: !!c.email && !w(c.email),
1034
1048
  invalidText: "Enter a valid email address",
1035
1049
  onChange: (i) => {
1036
- h("email", i.target.value);
1050
+ R("email", i.target.value);
1037
1051
  }
1038
1052
  }
1039
1053
  ),
@@ -1045,7 +1059,7 @@ function rt({ mode: s, initialUser: e, onSuccess: t }) {
1045
1059
  required: !0,
1046
1060
  value: c.firstName,
1047
1061
  onChange: (i) => {
1048
- h("firstName", i.target.value);
1062
+ R("firstName", i.target.value);
1049
1063
  }
1050
1064
  }
1051
1065
  ),
@@ -1057,24 +1071,24 @@ function rt({ mode: s, initialUser: e, onSuccess: t }) {
1057
1071
  required: !0,
1058
1072
  value: c.lastName,
1059
1073
  onChange: (i) => {
1060
- h("lastName", i.target.value);
1074
+ R("lastName", i.target.value);
1061
1075
  }
1062
1076
  }
1063
1077
  )
1064
1078
  ] }) }),
1065
- /* @__PURE__ */ r(oe, { legendText: "Access control", children: /* @__PURE__ */ u($, { gap: 4, children: [
1079
+ /* @__PURE__ */ r(oe, { legendText: "Access control", children: /* @__PURE__ */ u(C, { gap: 4, children: [
1066
1080
  /* @__PURE__ */ r(
1067
1081
  J,
1068
1082
  {
1069
1083
  id: "realmRoles",
1070
1084
  titleText: "Realm roles",
1071
1085
  label: G ? "Loading realm roles..." : "Realm roles",
1072
- items: N,
1086
+ items: k,
1073
1087
  itemToString: (i) => i?.text ?? "",
1074
- selectedItems: N.filter((i) => c.realmRoles.includes(i.id)),
1088
+ selectedItems: k.filter((i) => c.realmRoles.includes(i.id)),
1075
1089
  disabled: G,
1076
1090
  onChange: ({ selectedItems: i }) => {
1077
- h(
1091
+ R(
1078
1092
  "realmRoles",
1079
1093
  (i ?? []).map((b) => b.id)
1080
1094
  );
@@ -1089,7 +1103,7 @@ function rt({ mode: s, initialUser: e, onSuccess: t }) {
1089
1103
  disabled: l,
1090
1104
  checked: c.enabled,
1091
1105
  onChange: (i, { checked: b }) => {
1092
- h("enabled", b);
1106
+ R("enabled", b);
1093
1107
  }
1094
1108
  }
1095
1109
  ),
@@ -1100,20 +1114,20 @@ function rt({ mode: s, initialUser: e, onSuccess: t }) {
1100
1114
  labelText: "Email verified",
1101
1115
  checked: c.emailVerified,
1102
1116
  onChange: (i, { checked: b }) => {
1103
- h("emailVerified", b);
1117
+ R("emailVerified", b);
1104
1118
  }
1105
1119
  }
1106
1120
  )
1107
1121
  ] }) }),
1108
- /* @__PURE__ */ r($, { orientation: "horizontal", gap: 3, children: /* @__PURE__ */ r(A, { kind: "primary", disabled: !o || _, onClick: L, children: _ ? /* @__PURE__ */ r(
1109
- k,
1122
+ /* @__PURE__ */ r(C, { orientation: "horizontal", gap: 3, children: /* @__PURE__ */ r(A, { kind: "primary", disabled: !o || L, onClick: _, children: L ? /* @__PURE__ */ r(
1123
+ N,
1110
1124
  {
1111
1125
  description: s === "create" ? "Creating user…" : "Saving changes…"
1112
1126
  }
1113
1127
  ) : s === "create" ? "Create user" : "Save changes" }) })
1114
1128
  ] }) });
1115
1129
  }
1116
- function nt(s) {
1130
+ function ot(s) {
1117
1131
  if (!s || typeof s != "object")
1118
1132
  return;
1119
1133
  const e = s;
@@ -1124,7 +1138,7 @@ function nt(s) {
1124
1138
  if (typeof e.error == "string")
1125
1139
  return e.error;
1126
1140
  }
1127
- function ot({ username: s, enabled: e, onConfirm: t, onCancel: a }) {
1141
+ function it({ username: s, enabled: e, onConfirm: t, onCancel: a }) {
1128
1142
  const [l, d] = T(!1);
1129
1143
  async function c() {
1130
1144
  try {
@@ -1143,21 +1157,21 @@ function ot({ username: s, enabled: e, onConfirm: t, onCancel: a }) {
1143
1157
  "?"
1144
1158
  ] }),
1145
1159
  /* @__PURE__ */ r("p", { className: "user-confirm-modal__description", children: e ? "The user will no longer be able to log in." : "The user will regain access to the platform." }),
1146
- l && /* @__PURE__ */ r(k, { description: e ? "Disabling user…" : "Enabling user…" }),
1160
+ l && /* @__PURE__ */ r(N, { description: e ? "Disabling user…" : "Enabling user…" }),
1147
1161
  /* @__PURE__ */ u("div", { className: "user-confirm-modal__actions", children: [
1148
1162
  /* @__PURE__ */ r(A, { kind: "secondary", onClick: a, disabled: l, children: "Cancel" }),
1149
1163
  /* @__PURE__ */ r(A, { kind: e ? "danger" : "primary", onClick: c, disabled: l, children: e ? "Disable user" : "Enable user" })
1150
1164
  ] })
1151
1165
  ] });
1152
1166
  }
1153
- function it() {
1167
+ function lt() {
1154
1168
  const { openModal: s, closeModal: e } = Se();
1155
1169
  function t({ username: a, enabled: l, onConfirm: d }) {
1156
1170
  s({
1157
1171
  title: l ? "Disable user" : "Enable user",
1158
1172
  size: "sm",
1159
1173
  content: /* @__PURE__ */ r(
1160
- ot,
1174
+ it,
1161
1175
  {
1162
1176
  username: a,
1163
1177
  enabled: l,
@@ -1172,7 +1186,7 @@ function it() {
1172
1186
  }
1173
1187
  return { openEnableUserModal: t };
1174
1188
  }
1175
- function lt({
1189
+ function dt({
1176
1190
  username: s,
1177
1191
  email: e,
1178
1192
  onConfirm: t,
@@ -1193,21 +1207,21 @@ function lt({
1193
1207
  "."
1194
1208
  ] }),
1195
1209
  /* @__PURE__ */ r("p", { className: "user-confirm-modal__description", children: e ? `A password reset email will be sent to ${e}.` : "The user will be required to set a new password on next login." }),
1196
- l && /* @__PURE__ */ r(k, { description: "Sending password reset…" }),
1210
+ l && /* @__PURE__ */ r(N, { description: "Sending password reset…" }),
1197
1211
  /* @__PURE__ */ u("div", { className: "user-confirm-modal__actions", children: [
1198
1212
  /* @__PURE__ */ r(A, { kind: "secondary", onClick: a, disabled: l, children: "Cancel" }),
1199
1213
  /* @__PURE__ */ r(A, { kind: "danger", onClick: c, disabled: l, children: "Reset password" })
1200
1214
  ] })
1201
1215
  ] });
1202
1216
  }
1203
- function dt() {
1217
+ function ct() {
1204
1218
  const { openModal: s, closeModal: e } = Se();
1205
1219
  function t({ username: a, email: l, onConfirm: d }) {
1206
1220
  s({
1207
1221
  title: "Reset password",
1208
1222
  size: "sm",
1209
1223
  content: /* @__PURE__ */ r(
1210
- lt,
1224
+ dt,
1211
1225
  {
1212
1226
  username: a,
1213
1227
  email: l,
@@ -1227,7 +1241,7 @@ const pe = [
1227
1241
  { id: "active", label: "Active" },
1228
1242
  { id: "disabled", label: "Disabled" }
1229
1243
  ];
1230
- function ct({
1244
+ function ut({
1231
1245
  onReset: s,
1232
1246
  status: e,
1233
1247
  roles: t,
@@ -1242,7 +1256,7 @@ function ct({
1242
1256
  id: m,
1243
1257
  label: m === "all" ? "All" : m
1244
1258
  }));
1245
- return /* @__PURE__ */ u($, { orientation: "horizontal", gap: 5, className: "user-filters", children: [
1259
+ return /* @__PURE__ */ u(C, { orientation: "horizontal", gap: 5, className: "user-filters", children: [
1246
1260
  /* @__PURE__ */ r(
1247
1261
  ie,
1248
1262
  {
@@ -1285,7 +1299,7 @@ function ct({
1285
1299
  /* @__PURE__ */ r(A, { kind: "ghost", size: "md", disabled: !d, onClick: s, children: "Clear filters" })
1286
1300
  ] });
1287
1301
  }
1288
- function ut({
1302
+ function mt({
1289
1303
  user: s,
1290
1304
  isCurrentUser: e = !1,
1291
1305
  onEdit: t,
@@ -1310,7 +1324,7 @@ function ut({
1310
1324
  /* @__PURE__ */ r(j, { itemText: "Reset password", hasDivider: !0, onClick: d })
1311
1325
  ] });
1312
1326
  }
1313
- function mt({
1327
+ function pt({
1314
1328
  users: s,
1315
1329
  currentUserId: e,
1316
1330
  loadingAction: t,
@@ -1320,22 +1334,22 @@ function mt({
1320
1334
  if (s.length === 0) return null;
1321
1335
  const d = s.every((g) => g.isActive), c = s.every((g) => !g.isActive), f = t !== null, S = s.some((g) => g.id === e);
1322
1336
  return /* @__PURE__ */ u(Re, { children: [
1323
- /* @__PURE__ */ u(_e, { className: "user-bulk-actions", children: [
1324
- /* @__PURE__ */ r(A, { kind: "secondary", disabled: d || f, onClick: a, children: t === "enable" ? /* @__PURE__ */ r(k, { description: "Enabling…" }) : `Enable (${s.length})` }),
1337
+ /* @__PURE__ */ u(Le, { className: "user-bulk-actions", children: [
1338
+ /* @__PURE__ */ r(A, { kind: "secondary", disabled: d || f, onClick: a, children: t === "enable" ? /* @__PURE__ */ r(N, { description: "Enabling…" }) : `Enable (${s.length})` }),
1325
1339
  /* @__PURE__ */ r(
1326
1340
  A,
1327
1341
  {
1328
1342
  kind: "danger",
1329
1343
  disabled: c || f || S,
1330
1344
  onClick: l,
1331
- children: t === "disable" ? /* @__PURE__ */ r(k, { description: "Disabling…" }) : `Disable (${s.length})`
1345
+ children: t === "disable" ? /* @__PURE__ */ r(N, { description: "Disabling…" }) : `Disable (${s.length})`
1332
1346
  }
1333
1347
  )
1334
1348
  ] }),
1335
1349
  S && /* @__PURE__ */ r("p", { children: "Deselect your account to disable other users. You cannot disable your own account." })
1336
1350
  ] });
1337
1351
  }
1338
- const pt = [
1352
+ const yt = [
1339
1353
  { key: "username", header: "Username" },
1340
1354
  { key: "email", header: "Email" },
1341
1355
  { key: "status", header: "Status" },
@@ -1348,17 +1362,17 @@ const pt = [
1348
1362
  verified: "users-table__col--hide-md",
1349
1363
  lastLogin: "users-table__col--hide-md"
1350
1364
  };
1351
- function yt() {
1352
- const s = he(ge), { openPanel: e, closePanel: t } = Ne(), { openEnableUserModal: a } = it(), { openResetPasswordModal: l } = dt(), d = te(), [c, f] = T(null), [S, g] = T(""), [m, x] = T("all"), [C, E] = T("all"), [I, G] = T(!1), [_, N] = T(1), [M, D] = T(10), { data: o = [], isLoading: h, isError: L, error: i, refetch: b } = ze(), [Q] = Ve(), [be] = je();
1365
+ function Rt() {
1366
+ const s = he(ge), { openPanel: e, closePanel: t } = ke(), { openEnableUserModal: a } = lt(), { openResetPasswordModal: l } = ct(), d = te(), [c, f] = T(null), [S, g] = T(""), [m, E] = T("all"), [I, x] = T("all"), [q, G] = T(!1), [L, k] = T(1), [w, D] = T(10), { data: o = [], isLoading: R, isError: _, error: i, refetch: b } = Ve(), [Q] = je(), [be] = Ke();
1353
1367
  ee(() => {
1354
- N(1);
1355
- }, [m, C, I, S]);
1356
- const Te = w(() => {
1368
+ k(1);
1369
+ }, [m, I, q, S]);
1370
+ const Te = M(() => {
1357
1371
  const p = /* @__PURE__ */ new Set();
1358
1372
  return o.forEach((v) => {
1359
1373
  v.realmRoles?.forEach((H) => p.add(H));
1360
1374
  }), ["all", ...Array.from(p)];
1361
- }, [o]), B = w(() => {
1375
+ }, [o]), B = M(() => {
1362
1376
  const p = S.trim().toLowerCase();
1363
1377
  return o.filter((v) => {
1364
1378
  if (p && ![v.username, v.email, v.firstName, v.lastName].some(
@@ -1366,12 +1380,12 @@ function yt() {
1366
1380
  ))
1367
1381
  return !1;
1368
1382
  const H = v.enabled ?? v.isActive ?? !1;
1369
- return !(m === "active" && !H || m === "disabled" && H || I && v.lastLoginAt || C !== "all" && !v.realmRoles?.includes(C));
1383
+ return !(m === "active" && !H || m === "disabled" && H || q && v.lastLoginAt || I !== "all" && !v.realmRoles?.includes(I));
1370
1384
  });
1371
- }, [o, m, C, I, S]), ve = w(() => {
1372
- const p = (_ - 1) * M;
1373
- return B.slice(p, p + M);
1374
- }, [B, _, M]).map((p) => ({
1385
+ }, [o, m, I, q, S]), ve = M(() => {
1386
+ const p = (L - 1) * w;
1387
+ return B.slice(p, p + w);
1388
+ }, [B, L, w]).map((p) => ({
1375
1389
  id: p.id,
1376
1390
  username: p.username,
1377
1391
  email: p.email ?? "—",
@@ -1381,20 +1395,20 @@ function yt() {
1381
1395
  actions: "",
1382
1396
  raw: p
1383
1397
  })), ae = () => {
1384
- g(""), x("all"), E("all"), G(!1);
1385
- }, re = S.trim() !== "" || m !== "all" || C !== "all" || I;
1386
- return /* @__PURE__ */ r(
1387
- ke,
1398
+ g(""), E("all"), x("all"), G(!1);
1399
+ }, re = S.trim() !== "" || m !== "all" || I !== "all" || q;
1400
+ return R ? /* @__PURE__ */ r(Ne, { description: "Loading users…" }) : /* @__PURE__ */ r(
1401
+ De,
1388
1402
  {
1389
1403
  title: "Users",
1390
1404
  description: "Manage users, roles, and access to applications.",
1391
1405
  rows: ve,
1392
- headers: pt,
1406
+ headers: yt,
1393
1407
  getRowId: (p) => p.id,
1394
- isLoading: h,
1408
+ isLoading: R,
1395
1409
  loadingDescription: "Loading users…",
1396
- tableState: L ? /* @__PURE__ */ r(
1397
- Qe,
1410
+ tableState: _ ? /* @__PURE__ */ r(
1411
+ Fe,
1398
1412
  {
1399
1413
  title: "Failed to load users",
1400
1414
  description: Y(i, "Failed to load users"),
@@ -1404,33 +1418,33 @@ function yt() {
1404
1418
  searchValue: S,
1405
1419
  onSearch: g,
1406
1420
  searchPlaceholder: "Search users by name or email",
1407
- resultsDescription: !h && !L ? `${B.length} of ${o.length} users` : void 0,
1421
+ resultsDescription: !R && !_ ? `${B.length} of ${o.length} users` : void 0,
1408
1422
  emptyActions: o.length > 0 && re ? /* @__PURE__ */ r(A, { kind: "ghost", onClick: ae, children: "Clear filters" }) : void 0,
1409
1423
  emptyTitle: o.length === 0 ? "No users yet" : "No matching users",
1410
1424
  emptyDescription: o.length === 0 ? "Users will appear here once they are created or synced." : "No users match the current search or filters.",
1411
1425
  filters: /* @__PURE__ */ r(
1412
- ct,
1426
+ ut,
1413
1427
  {
1414
1428
  onReset: ae,
1415
1429
  status: m,
1416
1430
  roles: Te,
1417
- selectedRole: C,
1418
- neverLoggedIn: I,
1431
+ selectedRole: I,
1432
+ neverLoggedIn: q,
1419
1433
  hasActiveFilters: re,
1420
- onStatusChange: x,
1421
- onRoleChange: E,
1434
+ onStatusChange: E,
1435
+ onRoleChange: x,
1422
1436
  onToggleNeverLoggedIn: () => {
1423
1437
  G((p) => !p);
1424
1438
  }
1425
1439
  }
1426
1440
  ),
1427
- children: ({ rows: p, headers: v }) => /* @__PURE__ */ r(Le, { rows: p, headers: v, children: ({ rows: H, headers: K, getHeaderProps: $e, getRowProps: Ce, getSelectionProps: ne, selectedRows: Ie }) => {
1441
+ children: ({ rows: p, headers: v }) => /* @__PURE__ */ r(_e, { rows: p, headers: v, children: ({ rows: H, headers: K, getHeaderProps: $e, getRowProps: Ce, getSelectionProps: ne, selectedRows: Ie }) => {
1428
1442
  const O = Ie.map(
1429
- (R) => R.cells.find((y) => y.info.header === "raw")?.value
1443
+ (h) => h.cells.find((y) => y.info.header === "raw")?.value
1430
1444
  );
1431
1445
  return /* @__PURE__ */ u(Re, { children: [
1432
1446
  /* @__PURE__ */ r(
1433
- mt,
1447
+ pt,
1434
1448
  {
1435
1449
  users: O,
1436
1450
  currentUserId: s?.id,
@@ -1438,7 +1452,7 @@ function yt() {
1438
1452
  onEnable: async () => {
1439
1453
  try {
1440
1454
  f("enable"), await Promise.all(
1441
- O.map((R) => Q({ id: R.id, enabled: !0 }).unwrap())
1455
+ O.map((h) => Q({ id: h.id, enabled: !0 }).unwrap())
1442
1456
  ), d.success({
1443
1457
  title: "Users enabled",
1444
1458
  subtitle: `${O.length} user(s) enabled.`
@@ -1453,7 +1467,7 @@ function yt() {
1453
1467
  }
1454
1468
  },
1455
1469
  onDisable: async () => {
1456
- if (O.some((R) => R.id === s?.id)) {
1470
+ if (O.some((h) => h.id === s?.id)) {
1457
1471
  d.error({
1458
1472
  title: "Cannot disable your own account",
1459
1473
  subtitle: "Deselect your account before disabling other users."
@@ -1462,7 +1476,7 @@ function yt() {
1462
1476
  }
1463
1477
  try {
1464
1478
  f("disable"), await Promise.all(
1465
- O.map((R) => Q({ id: R.id, enabled: !1 }).unwrap())
1479
+ O.map((h) => Q({ id: h.id, enabled: !1 }).unwrap())
1466
1480
  ), d.warning({
1467
1481
  title: "Users disabled",
1468
1482
  subtitle: `${O.length} user(s) disabled.`
@@ -1479,23 +1493,23 @@ function yt() {
1479
1493
  }
1480
1494
  ),
1481
1495
  /* @__PURE__ */ u(Pe, { children: [
1482
- /* @__PURE__ */ r(Me, { children: /* @__PURE__ */ u(le, { children: [
1483
- /* @__PURE__ */ r(we, { ...ne() }),
1484
- K.filter((R) => R.key !== "raw").map((R) => /* @__PURE__ */ r(
1485
- xe,
1496
+ /* @__PURE__ */ r(we, { children: /* @__PURE__ */ u(le, { children: [
1497
+ /* @__PURE__ */ r(Me, { ...ne() }),
1498
+ K.filter((h) => h.key !== "raw").map((h) => /* @__PURE__ */ r(
1499
+ Ee,
1486
1500
  {
1487
- ...$e({ header: R }),
1488
- className: ye[R.key],
1489
- children: R.header
1501
+ ...$e({ header: h }),
1502
+ className: ye[h.key],
1503
+ children: h.header
1490
1504
  }
1491
1505
  ))
1492
1506
  ] }) }),
1493
- /* @__PURE__ */ r(Ee, { children: H.map((R) => {
1494
- const y = R.cells.find((q) => q.info.header === "raw")?.value;
1495
- return /* @__PURE__ */ u(le, { ...Ce({ row: R }), children: [
1496
- /* @__PURE__ */ r(Ge, { ...ne({ row: R }) }),
1497
- R.cells.map((q) => q.info.header === "raw" ? null : q.info.header === "status" ? /* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(De, { status: String(q.value) }) }, q.id) : q.info.header === "actions" ? /* @__PURE__ */ r(He, { children: /* @__PURE__ */ r(
1498
- ut,
1507
+ /* @__PURE__ */ r(xe, { children: H.map((h) => {
1508
+ const y = h.cells.find((U) => U.info.header === "raw")?.value;
1509
+ return /* @__PURE__ */ u(le, { ...Ce({ row: h }), children: [
1510
+ /* @__PURE__ */ r(Ge, { ...ne({ row: h }) }),
1511
+ h.cells.map((U) => U.info.header === "raw" ? null : U.info.header === "status" ? /* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(He, { status: String(U.value) }) }, U.id) : U.info.header === "actions" ? /* @__PURE__ */ r(Oe, { children: /* @__PURE__ */ r(
1512
+ mt,
1499
1513
  {
1500
1514
  user: y,
1501
1515
  isCurrentUser: y.id === s?.id,
@@ -1503,7 +1517,7 @@ function yt() {
1503
1517
  e({
1504
1518
  title: "Edit user",
1505
1519
  content: /* @__PURE__ */ r(
1506
- rt,
1520
+ nt,
1507
1521
  {
1508
1522
  mode: "edit",
1509
1523
  initialUser: y,
@@ -1519,7 +1533,7 @@ function yt() {
1519
1533
  title: `Roles: ${y.username}`,
1520
1534
  size: "lg",
1521
1535
  content: /* @__PURE__ */ r(
1522
- et,
1536
+ tt,
1523
1537
  {
1524
1538
  userId: y.id
1525
1539
  },
@@ -1576,25 +1590,25 @@ function yt() {
1576
1590
  });
1577
1591
  }
1578
1592
  }
1579
- ) }, q.id) : /* @__PURE__ */ r(
1593
+ ) }, U.id) : /* @__PURE__ */ r(
1580
1594
  de,
1581
1595
  {
1582
- className: ye[q.info.header],
1583
- children: q.value
1596
+ className: ye[U.info.header],
1597
+ children: U.value
1584
1598
  },
1585
- q.id
1599
+ U.id
1586
1600
  ))
1587
1601
  ] });
1588
1602
  }) })
1589
1603
  ] }),
1590
1604
  /* @__PURE__ */ r(
1591
- Oe,
1605
+ Qe,
1592
1606
  {
1593
- page: _,
1594
- pageSize: M,
1607
+ page: L,
1608
+ pageSize: w,
1595
1609
  totalItems: B.length,
1596
- onChange: ({ page: R, pageSize: y }) => {
1597
- N(R), D(y);
1610
+ onChange: ({ page: h, pageSize: y }) => {
1611
+ k(h), D(y);
1598
1612
  }
1599
1613
  }
1600
1614
  )
@@ -1609,12 +1623,12 @@ function Y(s, e) {
1609
1623
  const t = s;
1610
1624
  return typeof t.data?.message == "string" ? t.data.message : typeof t.data?.error?.message == "string" ? t.data.error.message : typeof t.error == "string" ? t.error : e;
1611
1625
  }
1612
- function ea(s) {
1613
- return /* @__PURE__ */ r("div", { className: "moh-microfrontend-root", children: /* @__PURE__ */ r(yt, {}) });
1626
+ function aa(s) {
1627
+ return /* @__PURE__ */ r("div", { className: "moh-microfrontend-root", children: /* @__PURE__ */ r(Rt, {}) });
1614
1628
  }
1615
1629
  export {
1616
- rt as U,
1617
- yt as a,
1618
- ea as b
1630
+ nt as U,
1631
+ Rt as a,
1632
+ aa as b
1619
1633
  };
1620
- //# sourceMappingURL=root.component-DS7t4fGv.js.map
1634
+ //# sourceMappingURL=root.component-DRxPT5GU.js.map