@tesouro/embedded-components-react 0.9.51 → 0.9.53

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.
@@ -3,75 +3,77 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { isApiUnprocessableError as t } from "../../../../shared/data-access/dist/lib/isApiUnprocessableError.js";
7
+ import "../../../../shared/data-access/dist/index.js";
6
8
  import "../../../../shared/ui/dist/index.js";
7
- import { useAnalyticsTrack as t } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
9
+ import { useAnalyticsTrack as n } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
8
10
  import "../../../../shared/feature/dist/index.js";
9
- import { TeamWidgetAnalyticsEvent as n } from "./index2.js";
10
- import { useDeactivateTeamMemberMutation as r } from "../../data-access/dist/index4.js";
11
- import { useResendInviteMutation as i } from "../../data-access/dist/index8.js";
11
+ import { TeamWidgetAnalyticsEvent as r } from "./index2.js";
12
+ import { useDeactivateTeamMemberMutation as i } from "../../data-access/dist/index4.js";
13
+ import { useResendInviteMutation as a } from "../../data-access/dist/index8.js";
12
14
  import "../../data-access/dist/index.js";
13
- import { isMemberActionable as a, isMemberInvited as o } from "./index11.js";
14
- import { resolveAcceptInviteRedirectUri as s } from "./index8.js";
15
- import { useEffect as c, useState as l } from "react";
15
+ import { isMemberActionable as o, isMemberInvited as s } from "./index11.js";
16
+ import { resolveAcceptInviteRedirectUri as c } from "./index8.js";
17
+ import { useEffect as l, useState as u } from "react";
16
18
  //#region ../../libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js
17
- function u({ members: e, canPerform: t, onOpen: n, isEligible: r }) {
18
- let [i, o] = l(), s = i ? e.find((e) => e.id === i) : void 0, u = s && a(s) && (r?.(s) ?? !0) ? s : void 0, d = !!i && !u;
19
- return c(() => {
20
- d && o(void 0);
19
+ function d({ members: e, canPerform: t, onOpen: n, isEligible: r }) {
20
+ let [i, a] = u(), s = i ? e.find((e) => e.id === i) : void 0, c = s && o(s) && (r?.(s) ?? !0) ? s : void 0, d = !!i && !c;
21
+ return l(() => {
22
+ d && a(void 0);
21
23
  }, [d]), {
22
- member: u,
24
+ member: c,
23
25
  open: (r) => {
24
- t && e.some((e) => e.id === r) && (n(), o(r));
26
+ t && e.some((e) => e.id === r) && (n(), a(r));
25
27
  },
26
28
  onOpenChange: (e) => {
27
- e || o(void 0);
29
+ e || a(void 0);
28
30
  },
29
- close: () => o(void 0)
31
+ close: () => a(void 0)
30
32
  };
31
33
  }
32
- function d({ canDeactivate: a, canResendInvite: c, members: l, featureLabels: d, acceptInviteRedirectUri: f }) {
33
- let p = t(), m = r(), h = i(), g = u({
34
- members: l,
35
- canPerform: a,
36
- onOpen: () => m.reset()
37
- }), _ = () => {
38
- if (!a || !g.member) return;
39
- let e = g.member.id;
40
- m.mutate({ path: { userId: e } }, { onSuccess: () => {
41
- p(n.MemberDeactivated, { memberId: e }), g.close();
34
+ function f({ canDeactivate: o, canResendInvite: l, members: u, featureLabels: f, acceptInviteRedirectUri: p }) {
35
+ let m = n(), h = i(), g = a(), _ = d({
36
+ members: u,
37
+ canPerform: o,
38
+ onOpen: () => h.reset()
39
+ }), v = () => {
40
+ if (!o || !_.member) return;
41
+ let e = _.member.id;
42
+ h.mutate({ path: { userId: e } }, { onSuccess: () => {
43
+ m(r.MemberDeactivated, { memberId: e }), _.close();
42
44
  } });
43
- }, v = u({
44
- members: l,
45
- canPerform: c,
46
- onOpen: () => h.reset(),
47
- isEligible: o
45
+ }, y = d({
46
+ members: u,
47
+ canPerform: l,
48
+ onOpen: () => g.reset(),
49
+ isEligible: s
48
50
  });
49
51
  return {
50
- isDeactivateOpen: !!g.member,
51
- deactivateMemberName: g.member?.name ?? "",
52
- deactivateMemberEmail: g.member?.email ?? "",
53
- isDeactivating: m.isPending,
54
- deactivateErrorMessage: m.isError ? d.deactivateFailedError : void 0,
55
- openDeactivateConfirmation: g.open,
56
- onDeactivateOpenChange: g.onOpenChange,
57
- onDeactivateConfirm: _,
58
- isResendOpen: !!v.member,
59
- resendMemberName: v.member?.name ?? "",
60
- resendMemberEmail: v.member?.email ?? "",
61
- isResending: h.isPending,
62
- resendErrorMessage: h.isError ? d.resendFailedError : void 0,
63
- openResendConfirmation: v.open,
64
- onResendOpenChange: v.onOpenChange,
52
+ isDeactivateOpen: !!_.member,
53
+ deactivateMemberName: _.member?.name ?? "",
54
+ deactivateMemberEmail: _.member?.email ?? "",
55
+ isDeactivating: h.isPending,
56
+ deactivateErrorMessage: h.isError ? t(h.error) ? f.deactivateRejectedError : f.deactivateFailedError : void 0,
57
+ openDeactivateConfirmation: _.open,
58
+ onDeactivateOpenChange: _.onOpenChange,
59
+ onDeactivateConfirm: v,
60
+ isResendOpen: !!y.member,
61
+ resendMemberName: y.member?.name ?? "",
62
+ resendMemberEmail: y.member?.email ?? "",
63
+ isResending: g.isPending,
64
+ resendErrorMessage: g.isError ? f.resendFailedError : void 0,
65
+ openResendConfirmation: y.open,
66
+ onResendOpenChange: y.onOpenChange,
65
67
  onResendConfirm: () => {
66
- c && v.member && h.mutate({
67
- name: v.member.name,
68
- email: v.member.email,
69
- redirectUri: s(f)
68
+ l && y.member && g.mutate({
69
+ name: y.member.name,
70
+ email: y.member.email,
71
+ redirectUri: c(p)
70
72
  }, { onSuccess: () => {
71
- e.success(d.resendSuccessToast), v.close();
73
+ e.success(f.resendSuccessToast), y.close();
72
74
  } });
73
75
  }
74
76
  };
75
77
  }
76
78
  //#endregion
77
- export { d as useTeamActions };
79
+ export { f as useTeamActions };
@@ -6,373 +6,373 @@ import { OrganizationStatus as e, isOrganizationOnItsWay as ee } from "../../../
6
6
  import { useEmbedApi as te } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
7
  import { hasAnyScope as t } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
8
8
  import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
9
- import { useAllOrganizationRolesQuery as r } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
9
+ import { useAllOrganizationRolesQuery as ne } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
10
10
  import "../../../../shared/data-access/dist/index.js";
11
- import { EmbeddedToaster as ne } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
11
+ import { EmbeddedToaster as re } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
12
12
  import "../../../../shared/ui/dist/index.js";
13
- import { useAnalyticsTrack as re } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
13
+ import { useAnalyticsTrack as r } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
14
14
  import { WidgetProvider as i } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
15
- import { useWidgetConfig as ie, useWidgetError as ae, useWidgetLoading as oe } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
15
+ import { useWidgetConfig as ie, useWidgetError as ae, useWidgetInitStaleForToken as oe, useWidgetLoading as se } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
16
16
  import "../../../../shared/feature/dist/index.js";
17
- import { DEFAULT_FEATURE_LABELS as se } from "./index3.js";
18
- import { TeamWidgetAnalyticsEvent as a, WIDGET_NAME as o } from "./index2.js";
19
- import { useRolesQuery as ce } from "../../data-access/dist/index12.js";
20
- import { useTeamMembersQuery as le } from "../../data-access/dist/index13.js";
21
- import { useAllTeamMembersQuery as ue } from "../../data-access/dist/index14.js";
17
+ import { DEFAULT_FEATURE_LABELS as ce } from "./index3.js";
18
+ import { TeamWidgetAnalyticsEvent as le, WIDGET_NAME as a } from "./index2.js";
19
+ import { useRolesQuery as ue } from "../../data-access/dist/index12.js";
20
+ import { useTeamMembersQuery as de } from "../../data-access/dist/index13.js";
21
+ import { useAllTeamMembersQuery as fe } from "../../data-access/dist/index14.js";
22
22
  import "../../data-access/dist/index.js";
23
- import { useDepartmentsAdmin as de } from "./index6.js";
24
- import { isMemberActionable as fe, resolveReportingManager as pe, toAssignableRoles as me, toDirectReportRows as he, toRoleDisplayCatalog as ge, toScopedRoles as _e, toTeamMemberDetails as ve, toTeamMemberRows as ye } from "./index11.js";
25
- import { useInviteForm as be } from "./index12.js";
26
- import { useLocationsAdmin as xe } from "./index13.js";
27
- import { useMemberAccountAccess as Se } from "./index14.js";
28
- import { canEditMemberProfile as Ce, canEditMemberRole as we, useMemberEdit as Te } from "./index15.js";
29
- import { useTeamActions as Ee } from "./index16.js";
30
- import { InviteTeamMemberForm as De } from "../../ui/dist/index8.js";
31
- import { EditTeamMemberPanel as Oe } from "../../ui/dist/index10.js";
32
- import { GroupAdminDrawer as ke } from "../../ui/dist/index12.js";
33
- import { GroupAdminPanel as Ae } from "../../ui/dist/index14.js";
34
- import { TeamActionDialog as s } from "../../ui/dist/index15.js";
35
- import { TeamMembersTable as je } from "../../ui/dist/index17.js";
36
- import { TeamMemberDetails as Me } from "../../ui/dist/index18.js";
37
- import { TeamTabs as Ne } from "../../ui/dist/index19.js";
23
+ import { useDepartmentsAdmin as pe } from "./index6.js";
24
+ import { isMemberActionable as me, resolveReportingManager as he, toAssignableRoles as ge, toDirectReportRows as _e, toRoleDisplayCatalog as ve, toScopedRoles as ye, toTeamMemberDetails as be, toTeamMemberRows as xe } from "./index11.js";
25
+ import { useInviteForm as Se } from "./index12.js";
26
+ import { useLocationsAdmin as Ce } from "./index13.js";
27
+ import { useMemberAccountAccess as we } from "./index14.js";
28
+ import { canEditMemberProfile as Te, canEditMemberRole as Ee, useMemberEdit as De } from "./index15.js";
29
+ import { useTeamActions as Oe } from "./index16.js";
30
+ import { InviteTeamMemberForm as ke } from "../../ui/dist/index8.js";
31
+ import { EditTeamMemberPanel as Ae } from "../../ui/dist/index10.js";
32
+ import { GroupAdminDrawer as je } from "../../ui/dist/index12.js";
33
+ import { GroupAdminPanel as Me } from "../../ui/dist/index14.js";
34
+ import { TeamActionDialog as o } from "../../ui/dist/index15.js";
35
+ import { TeamMembersTable as Ne } from "../../ui/dist/index17.js";
36
+ import { TeamMemberDetails as Pe } from "../../ui/dist/index18.js";
37
+ import { TeamTabs as Fe } from "../../ui/dist/index19.js";
38
38
  import "../../ui/dist/index.js";
39
- import { useEffect as c, useMemo as l, useState as u } from "react";
40
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
41
- import { Ban as Pe, Building2 as Fe, MailIcon as Ie, MapPin as Le, Trash2 as Re } from "lucide-react";
39
+ import { useEffect as s, useMemo as c, useState as l } from "react";
40
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
41
+ import { Ban as Ie, Building2 as Le, MailIcon as Re, MapPin as ze, Trash2 as Be } from "lucide-react";
42
42
  //#region ../../libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js
43
- var ze = [
43
+ var Ve = [
44
44
  5,
45
45
  10,
46
46
  25
47
- ], Be = 10, Ve = [n.UserReadOrg], m = [n.UserWriteOrg, n.UserWriteAll], He = [n.UserWriteAll], Ue = [n.UserWriteOrg], We = [n.UserWriteOrg], Ge = [n.RoleReadOrg], Ke = [n.UserWriteOrg], qe = [n.BankAccountReadOrg], Je = [n.ExternalBankAccountReadOrg], Ye = [n.BankAccountWriteOrg], Xe = [n.DebitCardReadOrg], Ze = [n.DebitCardIssueOrg];
48
- function h({ labels: i, featureLabels: o, acceptInviteRedirectUri: h }) {
49
- let g = l(() => ({
50
- ...se,
51
- ...o
52
- }), [o]), Qe = re();
53
- c(() => {
54
- Qe(a.Mounted);
55
- }, [Qe]);
56
- let { organizationId: $e, widgetToken: et, initResponse: _ } = ie(), { organizationStatus: tt } = te(), v = $e ?? (tt === e.Rotating ? _?.organizationId : void 0), y = _?.userId ?? void 0, nt = oe(), rt = !!ae(), b = !!($e && et), it = !!(v && et), x = l(() => t(_?.scopes, Ve), [_?.scopes]), S = it && x && !!_, C = _?.scopes, w = t(C, Ge), at = t(C, Ke), ot = b && t(C, m) && w && at, st = b && x && t(C, m), ct = b && t(C, He), lt = b && t(C, Ue), ut = b && w && at, dt = b && t(C, We), ft = b && x && t(C, [n.UserWriteOrg]), T = b && t(C, qe), E = b && t(C, Je), D = b && t(C, Ye) && T && E, pt = b && t(C, Xe) && t(C, Ze), [O, mt] = u("members"), k = de({
57
- canRead: x && O === "departments",
58
- canWrite: ft,
59
- featureLabels: g
60
- }), A = xe({
61
- canRead: x && O === "locations",
62
- canWrite: ft,
63
- featureLabels: g
64
- }), ht = [
47
+ ], He = 10, Ue = [n.UserReadOrg], We = [n.UserWriteOrg, n.UserWriteAll], Ge = [n.UserWriteAll], Ke = [n.UserWriteOrg], qe = [n.UserWriteOrg], Je = [n.RoleReadOrg], Ye = [n.UserWriteOrg], Xe = [n.BankAccountReadOrg], Ze = [n.ExternalBankAccountReadOrg], Qe = [n.BankAccountWriteOrg], $e = [n.DebitCardReadOrg], et = [n.DebitCardIssueOrg];
48
+ function p({ labels: i, featureLabels: a, acceptInviteRedirectUri: p }) {
49
+ let m = c(() => ({
50
+ ...ce,
51
+ ...a
52
+ }), [a]), tt = r();
53
+ s(() => {
54
+ tt(le.Mounted);
55
+ }, [tt]);
56
+ let { organizationId: nt, widgetToken: rt, initResponse: h } = ie(), { organizationStatus: it } = te(), g = nt ?? (it === e.Rotating ? h?.organizationId : void 0), _ = h?.userId ?? void 0, at = !oe(), ot = se(), st = !!ae(), v = !!(nt && rt), ct = !!(g && rt), y = c(() => t(h?.scopes, Ue), [h?.scopes]), b = ct && y && !!h, x = h?.scopes, S = t(x, Je), C = t(x, Ye), w = v && t(x, We) && S && C, T = v && y && t(x, We), lt = v && t(x, Ge), ut = v && t(x, Ke), dt = v && S && C, ft = v && t(x, qe), pt = v && y && t(x, [n.UserWriteOrg]), E = v && t(x, Xe), D = v && t(x, Ze), O = v && t(x, Qe) && E && D, mt = v && t(x, $e) && t(x, et), [k, ht] = l("members"), A = pe({
57
+ canRead: y && k === "departments",
58
+ canWrite: pt,
59
+ featureLabels: m
60
+ }), j = Ce({
61
+ canRead: y && k === "locations",
62
+ canWrite: pt,
63
+ featureLabels: m
64
+ }), gt = [
65
65
  {
66
66
  id: "members",
67
- label: g.teamMembersTab
67
+ label: m.teamMembersTab
68
68
  },
69
69
  {
70
70
  id: "departments",
71
- label: g.departmentsTab
71
+ label: m.departmentsTab
72
72
  },
73
73
  {
74
74
  id: "locations",
75
- label: g.locationsTab
75
+ label: m.locationsTab
76
76
  }
77
- ], [gt, j] = u(), [M, _t] = u(Be), [vt, N] = u(0), [P, F] = u(), I = (ot || ut) && w, yt = S && w && (!!P || !I), [bt, xt] = u(), L = le({
78
- Limit: M,
77
+ ], [_t, M] = l(), [N, vt] = l(He), [yt, P] = l(0), [F, I] = l(), L = (w || dt) && S, bt = b && S && (!!F || !L), [xt, St] = l(), R = de({
78
+ Limit: N,
79
79
  Status: "ALL",
80
- PaginationToken: gt,
81
- enabled: S
82
- }), St = _?.organizationTypes ?? [], R = l(() => ({
83
- organizationId: v ?? "",
84
- organizationTypes: St
85
- }), [v, St]), z = r({ enabled: yt }), Ct = l(() => ge(z.data?.data ?? [], R), [z.data?.data, R]), B = S ? L.data?.data ?? [] : [], V = ce({ enabled: I }), H = l(() => me(V.data?.data ?? [], R), [V.data, R]), wt = l(() => {
86
- let e = I ? V.data?.data ?? [] : z.data?.data ?? [];
87
- return _e(e, R);
80
+ PaginationToken: _t,
81
+ enabled: b
82
+ }), Ct = h?.organizationTypes ?? [], z = c(() => ({
83
+ organizationId: g ?? "",
84
+ organizationTypes: Ct
85
+ }), [g, Ct]), B = ne({ enabled: bt }), wt = c(() => ve(B.data?.data ?? [], z), [B.data?.data, z]), V = b ? R.data?.data ?? [] : [], H = ue({ enabled: L }), U = c(() => ge(H.data?.data ?? [], z), [H.data, z]), Tt = c(() => {
86
+ let e = L ? H.data?.data ?? [] : B.data?.data ?? [];
87
+ return ye(e, z);
88
88
  }, [
89
- I,
90
- V.data,
91
- z.data,
92
- R
93
- ]), Tt = Ct.length > 0 && !z.isResolving && !z.isError, Et = l(() => ge(V.data?.data ?? [], R), [V.data, R]), U = Tt ? Ct : Et, Dt = ye(B, g, F, U, v), Ot = !!V.data, kt = H.length > 0, At = ot && Ot && kt, jt = ut && Ot && kt, W = be({
94
- canInvite: At,
95
- canReadDirectory: x,
96
- canManageAccountAccess: D,
97
- canReadInternalAccounts: T,
98
- canReadExternalAccounts: E,
99
- canGrantDebitCardAccess: pt,
100
- roles: H,
101
- roleCatalog: U,
102
- organizationId: v,
103
- featureLabels: g,
104
- acceptInviteRedirectUri: h
105
- }), G = Te({
106
- canEditAnyProfile: ct,
107
- canEditOrgProfile: lt,
108
- organizationId: v,
109
- currentUserId: y,
110
- canEditRole: jt,
111
- canReadDirectory: x,
112
- canManageAccountAccess: D,
113
- canReadInternalAccounts: T,
114
- canReadExternalAccounts: E,
115
- members: B,
116
- roles: H,
117
- allRoles: wt,
118
- roleCatalog: U,
119
- featureLabels: g
120
- }), K = Ee({
121
- canDeactivate: dt,
122
- canResendInvite: st,
123
- members: B,
124
- featureLabels: g,
125
- acceptInviteRedirectUri: h
126
- }), Mt = L.data?.nextPaginationToken, Nt = L.data?.prevPaginationToken, q = P ? B.find((e) => e.id === P) : void 0, J = ue({ enabled: !!q && x }), Pt = J.data?.data ?? B, Y = q ? pe(Pt, q.reportingManagerUserId) : void 0, Ft = l(() => q && J.isComplete ? he(J.data?.data ?? [], q.id, g, U, v) : [], [
127
- q,
128
- J.isComplete,
129
- J.data?.data,
130
- g,
131
- U,
132
- v
133
- ]), It = !!L.data, X = It && !!P && !q;
134
- c(() => {
135
- X && F(void 0);
136
- }, [X]);
137
- let Lt = L.isError;
138
- c(() => {
139
- Lt && (j(void 0), N(0));
140
- }, [Lt]);
141
- let Rt = Dt.length, zt = Rt === 0 ? 0 : vt * M + 1, Bt = vt * M + Rt, Vt = `${g.viewingRangeLabel} ${zt}-${Bt}`, Z = fe(q), Ht = !!(q && Ce({
142
- member: q,
143
- organizationId: v,
144
- canEditAnyProfile: ct,
145
- canEditOrgProfile: lt,
146
- currentUserId: y
147
- })), Ut = !!(q && we({
148
- member: q,
149
- organizationId: v,
150
- canEditRole: jt,
151
- currentUserId: y
152
- })), Wt = D && !!q && q?.id !== y, Gt = Ht || Ut || Wt, Q = Se({
153
- selectedMember: q && Z ? q : void 0,
154
- canReadInternalAccounts: T,
155
- canReadExternalAccounts: E,
156
- featureLabels: g,
157
- allRoles: wt
158
- }), $ = l(() => q ? ve(q, g, U, v) : void 0, [
159
- q,
160
- g,
161
- U,
162
- v
89
+ L,
90
+ H.data,
91
+ B.data,
92
+ z
93
+ ]), Et = wt.length > 0 && !B.isResolving && !B.isError, Dt = c(() => ve(H.data?.data ?? [], z), [H.data, z]), W = Et ? wt : Dt, Ot = xe(V, m, I, W, g), kt = !!H.data, At = U.length > 0, jt = w && kt && At, Mt = dt && kt && At, G = Se({
94
+ canInvite: jt,
95
+ canReadDirectory: y,
96
+ canManageAccountAccess: O,
97
+ canReadInternalAccounts: E,
98
+ canReadExternalAccounts: D,
99
+ canGrantDebitCardAccess: mt,
100
+ roles: U,
101
+ roleCatalog: W,
102
+ organizationId: g,
103
+ featureLabels: m,
104
+ acceptInviteRedirectUri: p
105
+ }), K = De({
106
+ canEditAnyProfile: lt,
107
+ canEditOrgProfile: ut,
108
+ organizationId: g,
109
+ currentUserId: _,
110
+ canEditRole: Mt,
111
+ canReadDirectory: y,
112
+ canManageAccountAccess: O,
113
+ canReadInternalAccounts: E,
114
+ canReadExternalAccounts: D,
115
+ members: V,
116
+ roles: U,
117
+ allRoles: Tt,
118
+ roleCatalog: W,
119
+ featureLabels: m
120
+ }), q = Oe({
121
+ canDeactivate: ft,
122
+ canResendInvite: T,
123
+ members: V,
124
+ featureLabels: m,
125
+ acceptInviteRedirectUri: p
126
+ }), Nt = R.data?.nextPaginationToken, Pt = R.data?.prevPaginationToken, J = F ? V.find((e) => e.id === F) : void 0, Y = fe({ enabled: !!J && y }), Ft = Y.data?.data ?? V, X = J ? he(Ft, J.reportingManagerUserId) : void 0, It = c(() => J && Y.isComplete ? _e(Y.data?.data ?? [], J.id, m, W, g) : [], [
127
+ J,
128
+ Y.isComplete,
129
+ Y.data?.data,
130
+ m,
131
+ W,
132
+ g
133
+ ]), Lt = !!R.data, Rt = Lt && !!F && !J;
134
+ s(() => {
135
+ Rt && I(void 0);
136
+ }, [Rt]);
137
+ let zt = R.isError;
138
+ s(() => {
139
+ zt && (M(void 0), P(0));
140
+ }, [zt]);
141
+ let Bt = Ot.length, Vt = Bt === 0 ? 0 : yt * N + 1, Ht = yt * N + Bt, Ut = `${m.viewingRangeLabel} ${Vt}-${Ht}`, Z = me(J), Wt = !!(J && Te({
142
+ member: J,
143
+ organizationId: g,
144
+ canEditAnyProfile: lt,
145
+ canEditOrgProfile: ut,
146
+ currentUserId: _
147
+ })), Gt = !!(J && Ee({
148
+ member: J,
149
+ organizationId: g,
150
+ canEditRole: Mt,
151
+ currentUserId: _
152
+ })), Kt = O && !!J && J?.id !== _, qt = Wt || Gt || Kt, Q = we({
153
+ selectedMember: J && Z ? J : void 0,
154
+ canReadInternalAccounts: E,
155
+ canReadExternalAccounts: D,
156
+ featureLabels: m,
157
+ allRoles: Tt
158
+ }), $ = c(() => J ? be(J, m, W, g) : void 0, [
159
+ J,
160
+ m,
161
+ W,
162
+ g
163
163
  ]);
164
- return /* @__PURE__ */ p(d, { children: [
165
- /* @__PURE__ */ f(ne, {}),
166
- G.isEditOpen ? /* @__PURE__ */ f(Oe, {
167
- open: G.isEditOpen,
168
- memberName: G.editMemberName,
169
- memberEmail: G.editMemberEmail,
164
+ return /* @__PURE__ */ f(u, { children: [
165
+ /* @__PURE__ */ d(re, {}),
166
+ K.isEditOpen ? /* @__PURE__ */ d(Ae, {
167
+ open: K.isEditOpen,
168
+ memberName: K.editMemberName,
169
+ memberEmail: K.editMemberEmail,
170
170
  memberInitials: $?.initials,
171
- avatarSeed: q?.email,
171
+ avatarSeed: J?.email,
172
172
  roleBadgeLabel: $?.roleCardTitle,
173
173
  statusLabel: $?.statusLabel,
174
174
  statusTone: $?.statusTone,
175
175
  lastSignInLabel: $?.lastSignInLabel,
176
- form: G.editForm,
176
+ form: K.editForm,
177
+ roleOptions: K.roleOptions,
178
+ departmentOptions: K.departmentOptions,
179
+ locationOptions: K.locationOptions,
180
+ reportingManagerOptions: K.reportingManagerOptions,
181
+ departmentsLoading: K.departmentsLoading,
182
+ locationsLoading: K.locationsLoading,
183
+ reportingManagersLoading: K.reportingManagersLoading,
184
+ departmentsError: K.departmentsError,
185
+ locationsError: K.locationsError,
186
+ reportingManagersError: K.reportingManagersError,
187
+ errors: K.editErrors,
188
+ submitErrorMessage: K.editErrorMessage,
189
+ isSubmitting: K.isSavingEdit,
190
+ isNameDisabled: K.isEditNameDisabled,
191
+ isRoleDisabled: K.isEditRoleDisabled,
192
+ isGroupDisabled: K.isEditGroupDisabled,
193
+ isReportingManagerDisabled: K.isEditReportingManagerDisabled,
194
+ isSaveDisabled: K.isEditSaveDisabled,
195
+ accountAccessMode: K.accountAccessMode,
196
+ accountAccessRows: K.accountAccessRows,
197
+ onAccountAccessToggle: K.onAccountAccessToggle,
198
+ isAccountAccessLoading: K.isAccountAccessLoading,
199
+ accountAccessErrorMessage: K.accountAccessErrorMessage,
200
+ onOpenChange: K.onEditOpenChange,
201
+ onFormChange: K.onEditFormChange,
202
+ onSubmit: K.onEditSubmit,
203
+ labels: i
204
+ }) : J ? /* @__PURE__ */ d(Pe, {
205
+ ...be(J, m, W, g),
206
+ avatarSeed: J.email,
207
+ reportingManagerName: X?.name,
208
+ reportingManagerInitials: X?.initials,
209
+ reportingManagerSeed: X?.email,
210
+ directReports: It,
211
+ accountAccessLabel: Q.detailAccountAccessLabel,
212
+ accountAccessRows: Q.detailAccounts,
213
+ isAccountAccessLoading: Q.detailAccountsLoading,
214
+ isRoleLoading: S && B.isResolving,
215
+ onBackClick: () => {
216
+ St(F), I(void 0);
217
+ },
218
+ onEditClick: qt && Z ? () => K.openMemberEdit(J.id) : void 0,
219
+ onResendClick: T && (J.status ?? "").trim().toUpperCase() === "INVITED" ? () => q.openResendConfirmation(J.id) : void 0,
220
+ onDeactivateClick: ft && Z && at && J.id !== _ ? () => q.openDeactivateConfirmation(J.id) : void 0,
221
+ labels: i
222
+ }) : G.isInviteOpen ? /* @__PURE__ */ d(ke, {
223
+ form: G.inviteForm,
177
224
  roleOptions: G.roleOptions,
178
225
  departmentOptions: G.departmentOptions,
179
226
  locationOptions: G.locationOptions,
180
227
  reportingManagerOptions: G.reportingManagerOptions,
228
+ accountAccessOptions: G.accountAccessOptions,
181
229
  departmentsLoading: G.departmentsLoading,
182
230
  locationsLoading: G.locationsLoading,
183
231
  reportingManagersLoading: G.reportingManagersLoading,
184
232
  departmentsError: G.departmentsError,
185
233
  locationsError: G.locationsError,
186
234
  reportingManagersError: G.reportingManagersError,
187
- errors: G.editErrors,
188
- submitErrorMessage: G.editErrorMessage,
189
- isSubmitting: G.isSavingEdit,
190
- isNameDisabled: G.isEditNameDisabled,
191
- isRoleDisabled: G.isEditRoleDisabled,
192
- isGroupDisabled: G.isEditGroupDisabled,
193
- isReportingManagerDisabled: G.isEditReportingManagerDisabled,
194
- isSaveDisabled: G.isEditSaveDisabled,
235
+ accountAccessLoading: G.accountAccessLoading,
236
+ accountAccessError: G.accountAccessError,
195
237
  accountAccessMode: G.accountAccessMode,
196
- accountAccessRows: G.accountAccessRows,
197
- onAccountAccessToggle: G.onAccountAccessToggle,
198
- isAccountAccessLoading: G.isAccountAccessLoading,
199
- accountAccessErrorMessage: G.accountAccessErrorMessage,
200
- onOpenChange: G.onEditOpenChange,
201
- onFormChange: G.onEditFormChange,
202
- onSubmit: G.onEditSubmit,
203
- labels: i
204
- }) : q ? /* @__PURE__ */ f(Me, {
205
- ...ve(q, g, U, v),
206
- avatarSeed: q.email,
207
- reportingManagerName: Y?.name,
208
- reportingManagerInitials: Y?.initials,
209
- reportingManagerSeed: Y?.email,
210
- directReports: Ft,
211
- accountAccessLabel: Q.detailAccountAccessLabel,
212
- accountAccessRows: Q.detailAccounts,
213
- isAccountAccessLoading: Q.detailAccountsLoading,
214
- isRoleLoading: w && z.isResolving,
215
- onBackClick: () => {
216
- xt(P), F(void 0);
217
- },
218
- onEditClick: Gt && Z ? () => G.openMemberEdit(q.id) : void 0,
219
- onResendClick: st && (q.status ?? "").trim().toUpperCase() === "INVITED" ? () => K.openResendConfirmation(q.id) : void 0,
220
- onDeactivateClick: dt && Z ? () => K.openDeactivateConfirmation(q.id) : void 0,
238
+ errors: G.inviteErrors,
239
+ submitErrorMessage: G.inviteErrorMessage,
240
+ isSubmitting: G.isInviting,
241
+ isSubmitBlocked: G.isInviteSubmitBlocked,
242
+ onFormChange: G.onInviteFormChange,
243
+ onBackClick: G.closeInviteForm,
244
+ onCancel: G.closeInviteForm,
245
+ onSubmit: G.onInviteSubmit,
221
246
  labels: i
222
- }) : W.isInviteOpen ? /* @__PURE__ */ f(De, {
223
- form: W.inviteForm,
224
- roleOptions: W.roleOptions,
225
- departmentOptions: W.departmentOptions,
226
- locationOptions: W.locationOptions,
227
- reportingManagerOptions: W.reportingManagerOptions,
228
- accountAccessOptions: W.accountAccessOptions,
229
- departmentsLoading: W.departmentsLoading,
230
- locationsLoading: W.locationsLoading,
231
- reportingManagersLoading: W.reportingManagersLoading,
232
- departmentsError: W.departmentsError,
233
- locationsError: W.locationsError,
234
- reportingManagersError: W.reportingManagersError,
235
- accountAccessLoading: W.accountAccessLoading,
236
- accountAccessError: W.accountAccessError,
237
- accountAccessMode: W.accountAccessMode,
238
- errors: W.inviteErrors,
239
- submitErrorMessage: W.inviteErrorMessage,
240
- isSubmitting: W.isInviting,
241
- isSubmitBlocked: W.isInviteSubmitBlocked,
242
- onFormChange: W.onInviteFormChange,
243
- onBackClick: W.closeInviteForm,
244
- onCancel: W.closeInviteForm,
245
- onSubmit: W.onInviteSubmit,
246
- labels: i
247
- }) : /* @__PURE__ */ f("div", {
247
+ }) : /* @__PURE__ */ d("div", {
248
248
  className: "ttw:space-y-4 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
249
- children: /* @__PURE__ */ f(Ne, {
250
- tabs: ht,
251
- activeTabId: O,
252
- onTabChange: mt,
253
- children: O === "departments" ? /* @__PURE__ */ p(d, { children: [
254
- /* @__PURE__ */ f(Ae, {
255
- icon: /* @__PURE__ */ f(Fe, { className: "ttw:size-4" }),
256
- ...k.panel
257
- }),
258
- /* @__PURE__ */ f(ke, { ...k.drawer }),
259
- /* @__PURE__ */ f(s, {
260
- open: k.deleteDialog.open,
261
- icon: /* @__PURE__ */ f(Re, {
262
- "aria-hidden": !0,
263
- className: "ttw:size-6"
264
- }),
265
- title: g.departmentDeleteDialogTitle,
266
- description: g.departmentDeleteDialogDescription,
267
- subjectName: k.deleteDialog.subjectName,
268
- confirmButtonLabel: g.departmentDeleteConfirmButton,
269
- errorMessage: k.deleteDialog.errorMessage,
270
- isConfirming: k.deleteDialog.isConfirming,
271
- onOpenChange: k.deleteDialog.onOpenChange,
272
- onConfirm: k.deleteDialog.onConfirm,
273
- labels: i
274
- })
275
- ] }) : O === "locations" ? /* @__PURE__ */ p(d, { children: [
276
- /* @__PURE__ */ f(Ae, {
277
- icon: /* @__PURE__ */ f(Le, { className: "ttw:size-4" }),
249
+ children: /* @__PURE__ */ d(Fe, {
250
+ tabs: gt,
251
+ activeTabId: k,
252
+ onTabChange: ht,
253
+ children: k === "departments" ? /* @__PURE__ */ f(u, { children: [
254
+ /* @__PURE__ */ d(Me, {
255
+ icon: /* @__PURE__ */ d(Le, { className: "ttw:size-4" }),
278
256
  ...A.panel
279
257
  }),
280
- /* @__PURE__ */ f(ke, { ...A.drawer }),
281
- /* @__PURE__ */ f(s, {
258
+ /* @__PURE__ */ d(je, { ...A.drawer }),
259
+ /* @__PURE__ */ d(o, {
282
260
  open: A.deleteDialog.open,
283
- icon: /* @__PURE__ */ f(Re, {
261
+ icon: /* @__PURE__ */ d(Be, {
284
262
  "aria-hidden": !0,
285
263
  className: "ttw:size-6"
286
264
  }),
287
- title: g.locationDeleteDialogTitle,
288
- description: g.locationDeleteDialogDescription,
265
+ title: m.departmentDeleteDialogTitle,
266
+ description: m.departmentDeleteDialogDescription,
289
267
  subjectName: A.deleteDialog.subjectName,
290
- confirmButtonLabel: g.locationDeleteConfirmButton,
268
+ confirmButtonLabel: m.departmentDeleteConfirmButton,
291
269
  errorMessage: A.deleteDialog.errorMessage,
292
270
  isConfirming: A.deleteDialog.isConfirming,
293
271
  onOpenChange: A.deleteDialog.onOpenChange,
294
272
  onConfirm: A.deleteDialog.onConfirm,
295
273
  labels: i
296
274
  })
297
- ] }) : /* @__PURE__ */ f(je, {
298
- rows: Dt,
299
- isLoading: !rt && (ee(tt) && !L.data || nt && !_ || S && L.isLoading),
300
- isError: rt || S && L.isError,
301
- showPagination: S && It && !L.isError,
302
- isPreviousPageDisabled: !Nt,
303
- isNextPageDisabled: !Mt,
304
- pageSize: M,
305
- pageSizeOptions: ze,
306
- rangeLabel: Vt,
275
+ ] }) : k === "locations" ? /* @__PURE__ */ f(u, { children: [
276
+ /* @__PURE__ */ d(Me, {
277
+ icon: /* @__PURE__ */ d(ze, { className: "ttw:size-4" }),
278
+ ...j.panel
279
+ }),
280
+ /* @__PURE__ */ d(je, { ...j.drawer }),
281
+ /* @__PURE__ */ d(o, {
282
+ open: j.deleteDialog.open,
283
+ icon: /* @__PURE__ */ d(Be, {
284
+ "aria-hidden": !0,
285
+ className: "ttw:size-6"
286
+ }),
287
+ title: m.locationDeleteDialogTitle,
288
+ description: m.locationDeleteDialogDescription,
289
+ subjectName: j.deleteDialog.subjectName,
290
+ confirmButtonLabel: m.locationDeleteConfirmButton,
291
+ errorMessage: j.deleteDialog.errorMessage,
292
+ isConfirming: j.deleteDialog.isConfirming,
293
+ onOpenChange: j.deleteDialog.onOpenChange,
294
+ onConfirm: j.deleteDialog.onConfirm,
295
+ labels: i
296
+ })
297
+ ] }) : /* @__PURE__ */ d(Ne, {
298
+ rows: Ot,
299
+ isLoading: !st && (ee(it) && !R.data || ot && !h || b && R.isLoading),
300
+ isError: st || b && R.isError,
301
+ showPagination: b && Lt && !R.isError,
302
+ isPreviousPageDisabled: !Pt,
303
+ isNextPageDisabled: !Nt,
304
+ pageSize: N,
305
+ pageSizeOptions: Ve,
306
+ rangeLabel: Ut,
307
307
  onPageSizeChange: (e) => {
308
- _t(e), j(void 0), N(0);
308
+ vt(e), M(void 0), P(0);
309
309
  },
310
- autoFocusRowKey: bt,
310
+ autoFocusRowKey: xt,
311
311
  onPreviousPageClick: () => {
312
- j(Nt ?? void 0), N((e) => Math.max(0, e - 1));
312
+ M(Pt ?? void 0), P((e) => Math.max(0, e - 1));
313
313
  },
314
314
  onNextPageClick: () => {
315
- j(Mt ?? void 0), N((e) => e + 1);
315
+ M(Nt ?? void 0), P((e) => e + 1);
316
316
  },
317
- onInviteClick: At ? W.openInviteForm : void 0,
317
+ onInviteClick: jt ? G.openInviteForm : void 0,
318
318
  labels: i
319
319
  })
320
320
  })
321
321
  }),
322
- /* @__PURE__ */ f(s, {
323
- open: K.isDeactivateOpen,
324
- icon: /* @__PURE__ */ f(Pe, {
322
+ /* @__PURE__ */ d(o, {
323
+ open: q.isDeactivateOpen,
324
+ icon: /* @__PURE__ */ d(Ie, {
325
325
  "aria-hidden": !0,
326
326
  className: "ttw:size-6"
327
327
  }),
328
- title: g.deactivateDialogTitle,
329
- description: g.deactivateDialogDescription,
330
- subjectName: K.deactivateMemberName,
331
- subjectDetail: K.deactivateMemberEmail,
332
- confirmButtonLabel: g.deactivateConfirmButton,
333
- errorMessage: K.deactivateErrorMessage,
334
- isConfirming: K.isDeactivating,
335
- onOpenChange: K.onDeactivateOpenChange,
336
- onConfirm: K.onDeactivateConfirm,
328
+ title: m.deactivateDialogTitle,
329
+ description: m.deactivateDialogDescription,
330
+ subjectName: q.deactivateMemberName,
331
+ subjectDetail: q.deactivateMemberEmail,
332
+ confirmButtonLabel: m.deactivateConfirmButton,
333
+ errorMessage: q.deactivateErrorMessage,
334
+ isConfirming: q.isDeactivating,
335
+ onOpenChange: q.onDeactivateOpenChange,
336
+ onConfirm: q.onDeactivateConfirm,
337
337
  labels: i
338
338
  }),
339
- /* @__PURE__ */ f(s, {
340
- open: K.isResendOpen,
341
- icon: /* @__PURE__ */ f(Ie, {
339
+ /* @__PURE__ */ d(o, {
340
+ open: q.isResendOpen,
341
+ icon: /* @__PURE__ */ d(Re, {
342
342
  "aria-hidden": !0,
343
343
  className: "ttw:size-6"
344
344
  }),
345
- title: g.resendDialogTitle,
346
- description: g.resendDialogDescription,
347
- subjectName: K.resendMemberName,
348
- subjectDetail: K.resendMemberEmail,
349
- confirmButtonLabel: g.resendConfirmButton,
345
+ title: m.resendDialogTitle,
346
+ description: m.resendDialogDescription,
347
+ subjectName: q.resendMemberName,
348
+ subjectDetail: q.resendMemberEmail,
349
+ confirmButtonLabel: m.resendConfirmButton,
350
350
  confirmVariant: "default",
351
- errorMessage: K.resendErrorMessage,
352
- isConfirming: K.isResending,
353
- onOpenChange: K.onResendOpenChange,
354
- onConfirm: K.onResendConfirm,
351
+ errorMessage: q.resendErrorMessage,
352
+ isConfirming: q.isResending,
353
+ onOpenChange: q.onResendOpenChange,
354
+ onConfirm: q.onResendConfirm,
355
355
  labels: i
356
356
  })
357
357
  ] });
358
358
  }
359
- function g({ baseUrl: e, widgetToken: ee, organizationId: te, configClient: t, gatewayRouting: n, linkComponent: r, uiFramework: ne, errorFallback: re, onError: ie, analytics: ae, disclosuresAcceptance: oe, providerLabels: se, ...a }) {
360
- return /* @__PURE__ */ f(i, {
361
- widgetName: o,
359
+ function m({ baseUrl: e, widgetToken: ee, organizationId: te, configClient: t, gatewayRouting: n, linkComponent: ne, uiFramework: re, errorFallback: r, onError: ie, analytics: ae, disclosuresAcceptance: oe, providerLabels: se, ...ce }) {
360
+ return /* @__PURE__ */ d(i, {
361
+ widgetName: a,
362
362
  baseUrl: e,
363
363
  widgetToken: ee,
364
364
  organizationId: te,
365
365
  configClient: t,
366
366
  gatewayRouting: n,
367
- linkComponent: r,
368
- uiFramework: ne,
369
- errorFallback: re,
367
+ linkComponent: ne,
368
+ uiFramework: re,
369
+ errorFallback: r,
370
370
  onError: ie,
371
371
  analytics: ae,
372
372
  disclosuresAcceptance: oe,
373
373
  providerLabels: se,
374
- children: /* @__PURE__ */ f(h, { ...a })
374
+ children: /* @__PURE__ */ d(p, { ...ce })
375
375
  });
376
376
  }
377
377
  //#endregion
378
- export { g as TeamWidget, g as default };
378
+ export { m as TeamWidget, m as default };
@@ -15,6 +15,7 @@ var e = {
15
15
  inviteFailedError: "Something went wrong while sending the invite. Please try again.",
16
16
  editFailedError: "Something went wrong while saving the changes. Please try again.",
17
17
  deactivateFailedError: "Something went wrong while deactivating the member. Please try again.",
18
+ deactivateRejectedError: "This member is the organization’s only authorized signer, so they can’t be deactivated. Make someone else an authorized signer first.",
18
19
  manageAccessFailedError: "Something went wrong while updating account access. Please try again.",
19
20
  loadAccessFailedError: "We couldn’t load this member’s account access. Please try again.",
20
21
  roleNeedsAccountAccessError: "Assigning the Admin or Employee role changes account access, which requires the account-access permission. Ask an admin with that permission to make this change.",
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.9.51", n = "711ea950827ffff865585feabbe132f758fea8d2", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.9.53", n = "e3d19a67f84bf8690644ada81d9515df10b62ea3", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.9.51",
3
+ "version": "0.9.53",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [