@tesouro/embedded-components-react 0.11.101 → 0.11.104

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