@tesouro/embedded-components-react 0.11.34 → 0.11.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -759,6 +759,7 @@ A single navigable settings surface combining profile, team, invoice, bill-pay,
759
759
  | Prop | Type | Default | Description |
760
760
  | ------------------------- | -------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------ |
761
761
  | `acceptInviteRedirectUri` | `string` | Same-origin `/accept-invite` | Where Team invite emails link to; set it when your landing route differs or the origin isn't allowlisted. |
762
+ | `teamInitialView` | `'invite'` | `undefined` | Opens the Team section on the invite form when the user may invite. Pair with a Team `selectedSection`. |
762
763
  | `labels` | `Partial<Labels>` | English labels | Overrides the settings heading copy. |
763
764
  | `featureLabels` | `Partial<FeatureLabels>` | English labels | Overrides section labels. |
764
765
  | `profileContent` | `ReactNode` | Profile widget | Replaces the profile section content. |
package/dist/index.d.ts CHANGED
@@ -3968,6 +3968,13 @@ interface SettingsWidgetProps extends WidgetProviderProps {
3968
3968
  * registered landing route differs from that default, or the origin is
3969
3969
  * not on the OIDC redirect-URI allowlist (preview/localhost). */
3970
3970
  acceptInviteRedirectUri?: string;
3971
+ /** Forwarded to the embedded Team section's {@link TeamWidget} as its
3972
+ * `initialView`. `'invite'` opens the Team section on the Invite team member
3973
+ * form when the user may invite, else on the team list. Pair it with
3974
+ * `selectedSection` or `defaultSelectedSection` set to the Team section.
3975
+ * Spent once the user leaves the Team section, so returning to it shows the
3976
+ * list. */
3977
+ teamInitialView?: 'invite';
3971
3978
  /** Forwarded to the embedded Help section's {@link HelpWidget} — where its
3972
3979
  * "Contact Us" line links (a support page URL or a `mailto:`). The line is
3973
3980
  * hidden entirely when unset, since the package has no tenant-agnostic
@@ -4011,7 +4018,7 @@ interface SettingsWidgetProps extends WidgetProviderProps {
4011
4018
  invoiceContent?: ReactNode;
4012
4019
  legalContent?: ReactNode;
4013
4020
  }
4014
- declare function SettingsWidget({ labels, featureLabels, acceptInviteRedirectUri, helpContactUrl, helpFaq, profileContactUrl, selectedSection, defaultSelectedSection, onSelectedSectionChange, additionalSections, profileContent, teamContent, billPayContent, helpContent, expenseContent, accountingContent, invoiceContent, legalContent, ...widgetProviderProps }: SettingsWidgetProps): React.JSX.Element;
4021
+ declare function SettingsWidget({ labels, featureLabels, acceptInviteRedirectUri, teamInitialView, helpContactUrl, helpFaq, profileContactUrl, selectedSection, defaultSelectedSection, onSelectedSectionChange, additionalSections, profileContent, teamContent, billPayContent, helpContent, expenseContent, accountingContent, invoiceContent, legalContent, ...widgetProviderProps }: SettingsWidgetProps): React.JSX.Element;
4015
4022
 
4016
4023
  interface TransfersWidgetLabels {
4017
4024
  widgetTitle: string;
@@ -721,6 +721,13 @@ interface SettingsWidgetProps extends WidgetProviderProps {
721
721
  * registered landing route differs from that default, or the origin is
722
722
  * not on the OIDC redirect-URI allowlist (preview/localhost). */
723
723
  acceptInviteRedirectUri?: string;
724
+ /** Forwarded to the embedded Team section's {@link TeamWidget} as its
725
+ * `initialView`. `'invite'` opens the Team section on the Invite team member
726
+ * form when the user may invite, else on the team list. Pair it with
727
+ * `selectedSection` or `defaultSelectedSection` set to the Team section.
728
+ * Spent once the user leaves the Team section, so returning to it shows the
729
+ * list. */
730
+ teamInitialView?: 'invite';
724
731
  /** Forwarded to the embedded Help section's {@link HelpWidget} — where its
725
732
  * "Contact Us" line links (a support page URL or a `mailto:`). The line is
726
733
  * hidden entirely when unset, since the package has no tenant-agnostic
@@ -764,7 +771,7 @@ interface SettingsWidgetProps extends WidgetProviderProps {
764
771
  invoiceContent?: ReactNode;
765
772
  legalContent?: ReactNode;
766
773
  }
767
- declare function SettingsWidget({ labels, featureLabels, acceptInviteRedirectUri, helpContactUrl, helpFaq, profileContactUrl, selectedSection, defaultSelectedSection, onSelectedSectionChange, additionalSections, profileContent, teamContent, billPayContent, helpContent, expenseContent, accountingContent, invoiceContent, legalContent, ...widgetProviderProps }: SettingsWidgetProps): React.JSX.Element;
774
+ declare function SettingsWidget({ labels, featureLabels, acceptInviteRedirectUri, teamInitialView, helpContactUrl, helpFaq, profileContactUrl, selectedSection, defaultSelectedSection, onSelectedSectionChange, additionalSections, profileContent, teamContent, billPayContent, helpContent, expenseContent, accountingContent, invoiceContent, legalContent, ...widgetProviderProps }: SettingsWidgetProps): React.JSX.Element;
768
775
 
769
776
  export { HELP_FAQ_EN, SettingsSection, SettingsWidget };
770
777
  export type { HelpFaqAnswer, HelpFaqBullet, HelpFaqBulletType, HelpFaqItem, HelpFaqSection, SettingsWidgetAdditionalSection, FeatureLabels as SettingsWidgetFeatureLabels, Labels as SettingsWidgetLabels, SettingsWidgetProps, SettingsWidgetSection, SettingsWidgetSectionId };
@@ -2891,6 +2891,13 @@ interface SettingsWidgetProps extends WidgetProviderProps {
2891
2891
  * registered landing route differs from that default, or the origin is
2892
2892
  * not on the OIDC redirect-URI allowlist (preview/localhost). */
2893
2893
  acceptInviteRedirectUri?: string;
2894
+ /** Forwarded to the embedded Team section's {@link TeamWidget} as its
2895
+ * `initialView`. `'invite'` opens the Team section on the Invite team member
2896
+ * form when the user may invite, else on the team list. Pair it with
2897
+ * `selectedSection` or `defaultSelectedSection` set to the Team section.
2898
+ * Spent once the user leaves the Team section, so returning to it shows the
2899
+ * list. */
2900
+ teamInitialView?: 'invite';
2894
2901
  /** Forwarded to the embedded Help section's {@link HelpWidget} — where its
2895
2902
  * "Contact Us" line links (a support page URL or a `mailto:`). The line is
2896
2903
  * hidden entirely when unset, since the package has no tenant-agnostic
@@ -29,11 +29,11 @@ import { HelpWidget as _ } from "../../../../help/feature/dist/index3.js";
29
29
  import "../../../../help/feature/dist/index.js";
30
30
  import { ProfileWidget as v } from "../../../../profile/feature/dist/index4.js";
31
31
  import "../../../../profile/feature/dist/index.js";
32
- import { useCallback as y, useEffect as b, useRef as x } from "react";
33
- import { jsx as S } from "react/jsx-runtime";
34
- import { useControllableState as C } from "@radix-ui/react-use-controllable-state";
32
+ import { useCallback as y, useEffect as b, useRef as x, useState as S } from "react";
33
+ import { jsx as C } from "react/jsx-runtime";
34
+ import { useControllableState as w } from "@radix-ui/react-use-controllable-state";
35
35
  // ../../libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/SettingsWidget/SettingsWidget.js
36
- var w = {
36
+ var T = {
37
37
  [s.Profile]: [],
38
38
  [s.Team]: [t.UserReadOrg],
39
39
  [s.Invoice]: [t.InvoiceReadOrg, t.OrganizationSettingsWriteOrg],
@@ -48,106 +48,112 @@ var w = {
48
48
  [s.Legal]: [],
49
49
  [s.Help]: []
50
50
  };
51
- function T({ labels: t, featureLabels: r, acceptInviteRedirectUri: u, helpContactUrl: T, helpFaq: E, profileContactUrl: D, selectedSection: O, defaultSelectedSection: k, onSelectedSectionChange: A, additionalSections: j, profileContent: M, teamContent: N, billPayContent: P, helpContent: F, expenseContent: I, accountingContent: L, invoiceContent: R, legalContent: z }) {
52
- let B = {
51
+ function E({ labels: t, featureLabels: r, acceptInviteRedirectUri: u, teamInitialView: E, helpContactUrl: D, helpFaq: O, profileContactUrl: k, selectedSection: A, defaultSelectedSection: j, onSelectedSectionChange: M, additionalSections: N, profileContent: ee, teamContent: te, billPayContent: ne, helpContent: P, expenseContent: F, accountingContent: I, invoiceContent: L, legalContent: R }) {
52
+ let z = {
53
53
  ...o,
54
54
  ...r
55
- }, V = x(null), H = n();
55
+ }, B = x(null), V = n();
56
56
  b(() => {
57
- H(l.Mounted);
58
- }, [H]);
59
- let { initResponse: U } = i(), W = U?.scopes, G = [
57
+ V(l.Mounted);
58
+ }, [V]);
59
+ let { initResponse: H } = i(), U = H?.scopes, [W, G] = S("unseen"), K = W === "spent", q = [
60
60
  {
61
61
  id: s.Profile,
62
- label: B.profileSection,
63
- content: M ?? /* @__PURE__ */ S(v, { contactUrl: D })
62
+ label: z.profileSection,
63
+ content: ee ?? /* @__PURE__ */ C(v, { contactUrl: k })
64
64
  },
65
65
  {
66
66
  id: s.Team,
67
- label: B.teamSection,
68
- content: N ?? /* @__PURE__ */ S(m, { acceptInviteRedirectUri: u })
67
+ label: z.teamSection,
68
+ content: te ?? /* @__PURE__ */ C(m, {
69
+ acceptInviteRedirectUri: u,
70
+ initialView: K ? void 0 : E
71
+ })
69
72
  },
70
73
  {
71
74
  id: s.Invoice,
72
- label: B.invoiceSection,
73
- content: R ?? /* @__PURE__ */ S(f, { ref: V })
75
+ label: z.invoiceSection,
76
+ content: L ?? /* @__PURE__ */ C(f, { ref: B })
74
77
  },
75
78
  {
76
79
  id: s.Expense,
77
- label: B.expenseSection,
78
- content: I ?? /* @__PURE__ */ S(d, {
79
- approvalsLabel: B.expenseApprovalsTab,
80
- requirementsLabel: B.expenseRequirementsTab
80
+ label: z.expenseSection,
81
+ content: F ?? /* @__PURE__ */ C(d, {
82
+ approvalsLabel: z.expenseApprovalsTab,
83
+ requirementsLabel: z.expenseRequirementsTab
81
84
  })
82
85
  },
83
86
  {
84
87
  id: s.BillPay,
85
- label: B.billPaySection,
86
- content: P ?? /* @__PURE__ */ S(a, {
88
+ label: z.billPaySection,
89
+ content: ne ?? /* @__PURE__ */ C(a, {
87
90
  showHeaderTitle: !1,
88
- componentLabels: { header: { Description: B.billPayDescription } }
91
+ componentLabels: { header: { Description: z.billPayDescription } }
89
92
  })
90
93
  },
91
94
  {
92
95
  id: s.Accounting,
93
- label: B.accountingSection,
94
- content: L ?? /* @__PURE__ */ S(g, {})
96
+ label: z.accountingSection,
97
+ content: I ?? /* @__PURE__ */ C(g, {})
95
98
  },
96
99
  {
97
100
  id: s.Legal,
98
- label: B.legalSection,
99
- content: z ?? /* @__PURE__ */ S(p, {})
101
+ label: z.legalSection,
102
+ content: R ?? /* @__PURE__ */ C(p, {})
100
103
  },
101
104
  {
102
105
  id: s.Help,
103
- label: B.helpSection,
104
- content: F ?? /* @__PURE__ */ S(_, {
105
- contactUrl: T,
106
- faq: E
106
+ label: z.helpSection,
107
+ content: P ?? /* @__PURE__ */ C(_, {
108
+ contactUrl: D,
109
+ faq: O
107
110
  })
108
111
  }
109
- ], K = c(G.filter((t) => w[t.id].every((t) => e(W, [t]))), j ?? []), q = K[0]?.id ?? "", [J, Y] = C({
110
- prop: O,
111
- defaultProp: k ?? q,
112
- onChange: A,
112
+ ], J = c(q.filter((t) => T[t.id].every((t) => e(U, [t]))), N ?? []), Y = J[0]?.id ?? "", [X, Z] = w({
113
+ prop: A,
114
+ defaultProp: j ?? Y,
115
+ onChange: M,
113
116
  caller: "SettingsWidget"
114
- }), X = K.some((e) => e.id === J) ? J : q, Z = y((e) => {
115
- let t = V.current;
116
- X !== s.Invoice || !t ? Y(e) : t.confirmLeave().then((t) => {
117
- t && Y(e);
117
+ }), Q = J.some((e) => e.id === X) ? X : Y, $ = Q === s.Team;
118
+ W === "unseen" && $ ? G("showing") : W === "showing" && !$ && G("spent");
119
+ let re = y((e) => {
120
+ let t = B.current;
121
+ Q !== s.Invoice || !t ? Z(e) : t.confirmLeave().then((t) => {
122
+ t && Z(e);
118
123
  });
119
- }, [X, Y]);
120
- return /* @__PURE__ */ S(h, {
124
+ }, [Q, Z]);
125
+ return /* @__PURE__ */ C(h, {
121
126
  labels: t,
122
- sections: K,
123
- selectedSectionId: X,
124
- onSectionChange: Z
127
+ sections: J,
128
+ selectedSectionId: Q,
129
+ onSectionChange: re
125
130
  });
126
131
  }
127
- function E({ labels: e, featureLabels: t, acceptInviteRedirectUri: n, helpContactUrl: i, helpFaq: a, profileContactUrl: o, selectedSection: s, defaultSelectedSection: c, onSelectedSectionChange: l, additionalSections: d, profileContent: f, teamContent: p, billPayContent: m, helpContent: h, expenseContent: g, accountingContent: _, invoiceContent: v, legalContent: y, ...b }) {
128
- return /* @__PURE__ */ S(r, {
129
- ...b,
132
+ function D({ labels: e, featureLabels: t, acceptInviteRedirectUri: n, teamInitialView: i, helpContactUrl: a, helpFaq: o, profileContactUrl: s, selectedSection: c, defaultSelectedSection: l, onSelectedSectionChange: d, additionalSections: f, profileContent: p, teamContent: m, billPayContent: h, helpContent: g, expenseContent: _, accountingContent: v, invoiceContent: y, legalContent: b, ...x }) {
133
+ return /* @__PURE__ */ C(r, {
134
+ ...x,
130
135
  widgetName: u,
131
- children: /* @__PURE__ */ S(T, {
136
+ children: /* @__PURE__ */ C(E, {
132
137
  labels: e,
133
138
  featureLabels: t,
134
139
  acceptInviteRedirectUri: n,
135
- helpContactUrl: i,
136
- helpFaq: a,
137
- profileContactUrl: o,
138
- selectedSection: s,
139
- defaultSelectedSection: c,
140
- onSelectedSectionChange: l,
141
- additionalSections: d,
142
- profileContent: f,
143
- teamContent: p,
144
- billPayContent: m,
145
- helpContent: h,
146
- expenseContent: g,
147
- accountingContent: _,
148
- invoiceContent: v,
149
- legalContent: y
140
+ teamInitialView: i,
141
+ helpContactUrl: a,
142
+ helpFaq: o,
143
+ profileContactUrl: s,
144
+ selectedSection: c,
145
+ defaultSelectedSection: l,
146
+ onSelectedSectionChange: d,
147
+ additionalSections: f,
148
+ profileContent: p,
149
+ teamContent: m,
150
+ billPayContent: h,
151
+ helpContent: g,
152
+ expenseContent: _,
153
+ accountingContent: v,
154
+ invoiceContent: y,
155
+ legalContent: b
150
156
  })
151
157
  });
152
158
  }
153
- export { E as SettingsWidget, E as default };
159
+ export { D as SettingsWidget, D as default };
@@ -12,18 +12,18 @@ import "../../../../shared/data-access/dist/index.js";
12
12
  import "../../../../shared/ui/dist/index.js";
13
13
  import { useAnalyticsTrack as o } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
14
14
  import "../../../../shared/feature/dist/index.js";
15
- import { TeamWidgetAnalyticsEvent as ee } from "./index2.js";
16
- import { useInviteUserMutation as s } from "../../data-access/dist/index7.js";
17
- import { useAllTeamMembersQuery as te } from "../../data-access/dist/index14.js";
18
- import { useAllDepartmentsQuery as c } from "../../data-access/dist/index17.js";
15
+ import { TeamWidgetAnalyticsEvent as s } from "./index2.js";
16
+ import { useInviteUserMutation as c } from "../../data-access/dist/index7.js";
17
+ import { useAllTeamMembersQuery as ee } from "../../data-access/dist/index14.js";
18
+ import { useAllDepartmentsQuery as te } from "../../data-access/dist/index17.js";
19
19
  import { useAllLocationsQuery as ne } from "../../data-access/dist/index21.js";
20
20
  import "../../data-access/dist/index.js";
21
21
  import { toNamedSelectOptions as l, toReportingManagerOptions as re, toRoleCardOptions as ie } from "./index11.js";
22
22
  import { isAccountsSectionVisibleForRole as ae, isAdminPermissionSet as oe, isDebitCardAdminPermissionSet as se, isEmployeePermissionSet as u, toAccountAccessInputs as ce, toAccountAccessOptions as le } from "./index7.js";
23
- import { resolveAcceptInviteRedirectUri as ue } from "./index8.js";
24
- import { useMemo as d, useState as f } from "react";
23
+ import { resolveAcceptInviteRedirectUri as d } from "./index8.js";
24
+ import { useMemo as f, useState as p } from "react";
25
25
  // ../../libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index12.js
26
- var p = {
26
+ var m = {
27
27
  name: "",
28
28
  email: "",
29
29
  department: "",
@@ -31,83 +31,85 @@ var p = {
31
31
  reportingManager: "",
32
32
  role: "",
33
33
  accountAccess: []
34
- }, de = /^\S+@\S+\.\S+$/;
35
- function m({ canInvite: m, canReadDirectory: fe, canManageAccountAccess: h, canReadInternalAccounts: g, canReadExternalAccounts: _, canGrantDebitCardAccess: pe = !1, roles: v, roleCatalog: y = [], organizationId: b, featureLabels: x, acceptInviteRedirectUri: me }) {
36
- let he = o(), [S, C] = f(!1), [w, T] = f(p), [ge, E] = f({}), D = s(), O = S && m && fe, k = c({ enabled: O }), A = ne({ enabled: O }), j = te({
34
+ }, ue = /^\S+@\S+\.\S+$/;
35
+ function h({ canInvite: h, canReadDirectory: de, canManageAccountAccess: g, canReadInternalAccounts: _, canReadExternalAccounts: v, canGrantDebitCardAccess: y = !1, roles: b, roleCatalog: x = [], organizationId: S, featureLabels: C, acceptInviteRedirectUri: fe, openOnArrival: pe = !1 }) {
36
+ let me = o(), [w, T] = p(!1), [he, ge] = p(pe);
37
+ he && h && (ge(!1), T(!0));
38
+ let [E, D] = p(m), [_e, O] = p({}), k = c(), A = w && h && de, j = te({ enabled: A }), M = ne({ enabled: A }), N = ee({
37
39
  Status: "ACTIVE",
38
- enabled: O
39
- }), M = S && m && h, N = n({ enabled: M && g }), P = i({ enabled: M && _ }), F = S && m, I = d(() => v.map((e) => e.id), [v]), L = a({
40
- roleIds: I,
41
- enabled: F
42
- }), R = S && m && pe, z = r({ enabled: R }), _e = d(() => ie(v), [v]), B = d(() => k.isComplete ? l(k.data?.data ?? []) : [], [k.isComplete, k.data?.data]), ve = d(() => A.isComplete ? l(A.data?.data ?? []) : [], [A.isComplete, A.data?.data]), ye = d(() => j.isComplete ? re(j.data?.data ?? [], y, x, b) : [], [
43
- j.isComplete,
44
- j.data?.data,
45
- y,
40
+ enabled: A
41
+ }), P = w && h && g, F = n({ enabled: P && _ }), I = i({ enabled: P && v }), L = w && h, ve = f(() => b.map((e) => e.id), [b]), R = a({
42
+ roleIds: ve,
43
+ enabled: L
44
+ }), z = w && h && y, B = r({ enabled: z }), ye = f(() => ie(b), [b]), be = f(() => j.isComplete ? l(j.data?.data ?? []) : [], [j.isComplete, j.data?.data]), xe = f(() => M.isComplete ? l(M.data?.data ?? []) : [], [M.isComplete, M.data?.data]), Se = f(() => N.isComplete ? re(N.data?.data ?? [], x, C, S) : [], [
45
+ N.isComplete,
46
+ N.data?.data,
46
47
  x,
47
- b
48
- ]), V = O && !k.isComplete && !k.isError, H = O && !A.isComplete && !A.isError, U = O && !j.isComplete && !j.isError, be = O && k.isError, xe = O && A.isError, Se = O && j.isError, Ce = !g || !!N.data && !N.hasNextPage && !N.isFetchingNextPage, we = !_ || !!P.data && !P.hasNextPage && !P.isFetchingNextPage, W = !!w.role && L.resolvingRoleIds.has(w.role), G = F && !!w.role && (W || !L.byRoleId.has(w.role)) && !W, K = M && (g && N.isError || _ && P.isError || G), q = M && !K && (!Ce || !we || W), J = d(() => le(g ? N.data?.data ?? [] : [], _ ? P.data?.data ?? [] : [], {
49
- checking: x.accountTypeChecking,
50
- savings: x.accountTypeSavings
48
+ C,
49
+ S
50
+ ]), V = A && !j.isComplete && !j.isError, H = A && !M.isComplete && !M.isError, U = A && !N.isComplete && !N.isError, Ce = A && j.isError, we = A && M.isError, Te = A && N.isError, Ee = !_ || !!F.data && !F.hasNextPage && !F.isFetchingNextPage, De = !v || !!I.data && !I.hasNextPage && !I.isFetchingNextPage, W = !!E.role && R.resolvingRoleIds.has(E.role), G = L && !!E.role && (W || !R.byRoleId.has(E.role)) && !W, K = P && (_ && F.isError || v && I.isError || G), q = P && !K && (!Ee || !De || W), J = f(() => le(_ ? F.data?.data ?? [] : [], v ? I.data?.data ?? [] : [], {
51
+ checking: C.accountTypeChecking,
52
+ savings: C.accountTypeSavings
51
53
  }), [
52
- g,
53
54
  _,
54
- N.data?.data,
55
- P.data?.data,
56
- x.accountTypeChecking,
57
- x.accountTypeSavings
58
- ]), Te = J.options, Y = L.byRoleId.get(w.role), X = oe(Y), Z = R && se(Y), Q = Z && (t(z) || z.isFetching), Ee = Z && z.isError, $ = h && ae(!!w.role, u(Y)), De = h && u(Y), Oe = $ ? X ? "admin" : "picker" : De ? "employee" : "hidden";
55
+ v,
56
+ F.data?.data,
57
+ I.data?.data,
58
+ C.accountTypeChecking,
59
+ C.accountTypeSavings
60
+ ]), Oe = J.options, Y = R.byRoleId.get(E.role), X = oe(Y), Z = z && se(Y), Q = Z && (t(B) || B.isFetching), ke = Z && B.isError, $ = g && ae(!!E.role, u(Y)), Ae = g && u(Y), je = $ ? X ? "admin" : "picker" : Ae ? "employee" : "hidden";
59
61
  return {
60
- isInviteOpen: S,
61
- inviteForm: w,
62
- inviteErrors: ge,
63
- isInviting: D.isPending,
64
- inviteErrorMessage: D.isError ? x.inviteFailedError : void 0,
65
- roleOptions: _e,
66
- departmentOptions: B,
67
- locationOptions: ve,
68
- reportingManagerOptions: ye,
69
- accountAccessOptions: Te,
62
+ isInviteOpen: w,
63
+ inviteForm: E,
64
+ inviteErrors: _e,
65
+ isInviting: k.isPending,
66
+ inviteErrorMessage: k.isError ? C.inviteFailedError : void 0,
67
+ roleOptions: ye,
68
+ departmentOptions: be,
69
+ locationOptions: xe,
70
+ reportingManagerOptions: Se,
71
+ accountAccessOptions: Oe,
70
72
  departmentsLoading: V,
71
73
  locationsLoading: H,
72
74
  reportingManagersLoading: U,
73
- departmentsError: be,
74
- locationsError: xe,
75
- reportingManagersError: Se,
75
+ departmentsError: Ce,
76
+ locationsError: we,
77
+ reportingManagersError: Te,
76
78
  accountAccessLoading: q,
77
79
  accountAccessError: K,
78
- accountAccessMode: Oe,
80
+ accountAccessMode: je,
79
81
  isInviteSubmitBlocked: Q,
80
82
  openInviteForm: () => {
81
- m && (T(p), E({}), D.reset(), C(!0));
83
+ h && (D(m), O({}), k.reset(), T(!0));
82
84
  },
83
85
  closeInviteForm: () => {
84
- C(!1);
86
+ T(!1);
85
87
  },
86
- onInviteFormChange: T,
88
+ onInviteFormChange: D,
87
89
  onInviteSubmit: () => {
88
- if (!m || V || H || U || $ && (q || K) || W || Q) return;
89
- let t = {}, n = w.name.trim(), r = w.email.trim();
90
- n || (t.name = x.nameRequiredError), r ? de.test(r) || (t.email = x.emailInvalidError) : t.email = x.emailRequiredError;
91
- let i = w.role;
92
- if (v.some((e) => e.id === i) ? G ? t.role = x.rolePermissionsUnavailableError : X && !h ? t.role = x.roleNeedsAccountAccessError : Ee && (t.role = x.debitCardsUnavailableError, z.refetch()) : t.role = x.roleRequiredError, E(t), t.name || t.email || t.role) return;
93
- let a = $ ? X ? J.allAccountIds : w.accountAccess : [], o = ce(a, J.descriptors), s = Z ? (z.data?.data ?? []).map((e) => e.id) : [];
94
- D.mutate({
90
+ if (!h || V || H || U || $ && (q || K) || W || Q) return;
91
+ let t = {}, n = E.name.trim(), r = E.email.trim();
92
+ n || (t.name = C.nameRequiredError), r ? ue.test(r) || (t.email = C.emailInvalidError) : t.email = C.emailRequiredError;
93
+ let i = E.role;
94
+ if (b.some((e) => e.id === i) ? G ? t.role = C.rolePermissionsUnavailableError : X && !g ? t.role = C.roleNeedsAccountAccessError : ke && (t.role = C.debitCardsUnavailableError, B.refetch()) : t.role = C.roleRequiredError, O(t), t.name || t.email || t.role) return;
95
+ let a = $ ? X ? J.allAccountIds : E.accountAccess : [], o = ce(a, J.descriptors), c = Z ? (B.data?.data ?? []).map((e) => e.id) : [];
96
+ k.mutate({
95
97
  body: {
96
98
  name: n,
97
99
  email: r,
98
100
  status: "INVITED",
99
- reportingManagerUserId: w.reportingManager || null,
101
+ reportingManagerUserId: E.reportingManager || null,
100
102
  permissionIds: [],
101
- redirectUri: ue(me)
103
+ redirectUri: d(fe)
102
104
  },
103
105
  roleId: i,
104
- departmentId: w.department || void 0,
105
- locationId: w.location || void 0,
106
+ departmentId: E.department || void 0,
107
+ locationId: E.location || void 0,
106
108
  bankAccountAccess: o,
107
- debitCardIds: s
109
+ debitCardIds: c
108
110
  }, {
109
111
  onSuccess: (t) => {
110
- he(ee.MemberInvited, { memberId: t?.id }), C(!1), t?.debitCardAccessError === void 0 ? e.success(x.inviteSuccessToast) : (console.error("Failed to grant card access to invite:", t.debitCardAccessError), e.warning(x.inviteCardAccessWarningToast));
112
+ me(s.MemberInvited, { memberId: t?.id }), T(!1), t?.debitCardAccessError === void 0 ? e.success(C.inviteSuccessToast) : (console.error("Failed to grant card access to invite:", t.debitCardAccessError), e.warning(C.inviteCardAccessWarningToast));
111
113
  },
112
114
  onError: (e) => {
113
115
  console.error("Failed to send team invite:", e);
@@ -116,4 +118,4 @@ function m({ canInvite: m, canReadDirectory: fe, canManageAccountAccess: h, canR
116
118
  }
117
119
  };
118
120
  }
119
- export { m as useInviteForm };
121
+ export { h as useInviteForm };
@@ -44,319 +44,320 @@ var Ve = [
44
44
  5,
45
45
  10,
46
46
  25
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(() => ({
47
+ ], 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];
48
+ function m({ labels: i, featureLabels: a, acceptInviteRedirectUri: m, initialView: h }) {
49
+ let g = c(() => ({
50
50
  ...ce,
51
51
  ...a
52
- }), [a]), tt = r();
52
+ }), [a]), et = r();
53
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 = [
54
+ et(le.Mounted);
55
+ }, [et]);
56
+ let { organizationId: tt, widgetToken: nt, initResponse: _ } = ie(), { organizationStatus: rt } = te(), v = tt ?? (rt === e.Rotating ? _?.organizationId : void 0), y = _?.userId ?? void 0, it = !oe(), at = se(), ot = !!ae(), b = !!(tt && nt), st = !!(v && nt), x = c(() => t(_?.scopes, Ue), [_?.scopes]), S = st && x && !!_, C = _?.scopes, w = t(C, qe), ct = t(C, Je), lt = b && t(C, p) && w && ct, ut = b && x && t(C, p), dt = b && t(C, We), ft = b && t(C, Ge), pt = b && w && ct, mt = b && t(C, Ke), ht = b && x && t(C, [n.UserWriteOrg]), T = b && t(C, Ye), E = b && t(C, Xe), D = b && t(C, Ze) && T && E, gt = b && t(C, Qe) && t(C, $e), [O, _t] = l("members"), k = pe({
57
+ canRead: x && O === "departments",
58
+ canWrite: ht,
59
+ featureLabels: g
60
+ }), A = Ce({
61
+ canRead: x && O === "locations",
62
+ canWrite: ht,
63
+ featureLabels: g
64
+ }), vt = [
65
65
  {
66
66
  id: "members",
67
- label: m.teamMembersTab
67
+ label: g.teamMembersTab
68
68
  },
69
69
  {
70
70
  id: "departments",
71
- label: m.departmentsTab
71
+ label: g.departmentsTab
72
72
  },
73
73
  {
74
74
  id: "locations",
75
- label: m.locationsTab
75
+ label: g.locationsTab
76
76
  }
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,
77
+ ], [yt, j] = l(), [M, bt] = l(He), [xt, N] = l(0), [P, F] = l(), I = (lt || pt) && w, St = S && w && (!!P || !I), [Ct, wt] = l(), L = de({
78
+ Limit: M,
79
79
  Status: "ALL",
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);
80
+ PaginationToken: yt,
81
+ enabled: S
82
+ }), Tt = _?.organizationTypes ?? [], R = c(() => ({
83
+ organizationId: v ?? "",
84
+ organizationTypes: Tt
85
+ }), [v, Tt]), z = ne({ enabled: St }), Et = 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]), Dt = c(() => {
86
+ let e = I ? V.data?.data ?? [] : z.data?.data ?? [];
87
+ return ye(e, R);
88
88
  }, [
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;
89
+ I,
90
+ V.data,
91
+ z.data,
92
+ R
93
+ ]), Ot = Et.length > 0 && !z.isResolving && !z.isError, kt = c(() => ve(V.data?.data ?? [], R), [V.data, R]), U = Ot ? Et : kt, At = xe(B, g, F, U, v), jt = !!V.data, Mt = H.length > 0, Nt = lt && jt && Mt, Pt = pt && jt && Mt, W = Se({
94
+ canInvite: Nt,
95
+ canReadDirectory: x,
96
+ canManageAccountAccess: D,
97
+ canReadInternalAccounts: T,
98
+ canReadExternalAccounts: E,
99
+ canGrantDebitCardAccess: gt,
100
+ roles: H,
101
+ roleCatalog: U,
102
+ organizationId: v,
103
+ featureLabels: g,
104
+ acceptInviteRedirectUri: m,
105
+ openOnArrival: h === "invite"
106
+ }), G = De({
107
+ canEditAnyProfile: dt,
108
+ canEditOrgProfile: ft,
109
+ organizationId: v,
110
+ currentUserId: y,
111
+ canEditRole: Pt,
112
+ canReadDirectory: x,
113
+ canManageAccountAccess: D,
114
+ canReadInternalAccounts: T,
115
+ canReadExternalAccounts: E,
116
+ members: B,
117
+ roles: H,
118
+ allRoles: Dt,
119
+ roleCatalog: U,
120
+ featureLabels: g
121
+ }), K = Oe({
122
+ canDeactivate: mt,
123
+ canResendInvite: ut,
124
+ members: B,
125
+ featureLabels: g,
126
+ acceptInviteRedirectUri: m
127
+ }), Ft = L.data?.nextPaginationToken, It = L.data?.prevPaginationToken, q = P ? B.find((e) => e.id === P) : void 0, J = fe({ enabled: !!q && x }), Lt = J.data?.data ?? B, Y = q ? he(Lt, q.reportingManagerUserId) : void 0, Rt = c(() => q && J.isComplete ? _e(J.data?.data ?? [], q.id, g, U, v) : [], [
128
+ q,
129
+ J.isComplete,
130
+ J.data?.data,
131
+ g,
132
+ U,
133
+ v
134
+ ]), zt = !!L.data, X = zt && !!P && !q;
134
135
  s(() => {
135
- Rt && I(void 0);
136
- }, [Rt]);
137
- let zt = R.isError;
136
+ X && F(void 0);
137
+ }, [X]);
138
+ let Bt = L.isError;
138
139
  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
140
+ Bt && (j(void 0), N(0));
141
+ }, [Bt]);
142
+ let Vt = At.length, Ht = Vt === 0 ? 0 : xt * M + 1, Ut = xt * M + Vt, Wt = `${g.viewingRangeLabel} ${Ht}-${Ut}`, Z = me(q), Gt = !!(q && Te({
143
+ member: q,
144
+ organizationId: v,
145
+ canEditAnyProfile: dt,
146
+ canEditOrgProfile: ft,
147
+ currentUserId: y
148
+ })), Kt = !!(q && Ee({
149
+ member: q,
150
+ organizationId: v,
151
+ canEditRole: Pt,
152
+ currentUserId: y
153
+ })), qt = D && !!q && q?.id !== y, Jt = Gt || Kt || qt, Q = we({
154
+ selectedMember: q && Z ? q : void 0,
155
+ canReadInternalAccounts: T,
156
+ canReadExternalAccounts: E,
157
+ featureLabels: g,
158
+ allRoles: Dt
159
+ }), $ = c(() => q ? be(q, g, U, v) : void 0, [
160
+ q,
161
+ g,
162
+ U,
163
+ v
163
164
  ]);
164
165
  return /* @__PURE__ */ f(u, { children: [
165
166
  /* @__PURE__ */ d(re, {}),
166
- K.isEditOpen ? /* @__PURE__ */ d(Ae, {
167
- open: K.isEditOpen,
168
- memberName: K.editMemberName,
169
- memberEmail: K.editMemberEmail,
167
+ G.isEditOpen ? /* @__PURE__ */ d(Ae, {
168
+ open: G.isEditOpen,
169
+ memberName: G.editMemberName,
170
+ memberEmail: G.editMemberEmail,
170
171
  memberInitials: $?.initials,
171
- avatarSeed: J?.email,
172
+ avatarSeed: q?.email,
172
173
  roleBadgeLabel: $?.roleCardTitle,
173
174
  statusLabel: $?.statusLabel,
174
175
  statusTone: $?.statusTone,
175
176
  lastSignInLabel: $?.lastSignInLabel,
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
+ form: G.editForm,
224
178
  roleOptions: G.roleOptions,
225
179
  departmentOptions: G.departmentOptions,
226
180
  locationOptions: G.locationOptions,
227
181
  reportingManagerOptions: G.reportingManagerOptions,
228
- accountAccessOptions: G.accountAccessOptions,
229
182
  departmentsLoading: G.departmentsLoading,
230
183
  locationsLoading: G.locationsLoading,
231
184
  reportingManagersLoading: G.reportingManagersLoading,
232
185
  departmentsError: G.departmentsError,
233
186
  locationsError: G.locationsError,
234
187
  reportingManagersError: G.reportingManagersError,
235
- accountAccessLoading: G.accountAccessLoading,
236
- accountAccessError: G.accountAccessError,
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,
237
196
  accountAccessMode: G.accountAccessMode,
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,
197
+ accountAccessRows: G.accountAccessRows,
198
+ onAccountAccessToggle: G.onAccountAccessToggle,
199
+ isAccountAccessLoading: G.isAccountAccessLoading,
200
+ accountAccessErrorMessage: G.accountAccessErrorMessage,
201
+ onOpenChange: G.onEditOpenChange,
202
+ onFormChange: G.onEditFormChange,
203
+ onSubmit: G.onEditSubmit,
204
+ labels: i
205
+ }) : q ? /* @__PURE__ */ d(Pe, {
206
+ ...be(q, g, U, v),
207
+ avatarSeed: q.email,
208
+ reportingManagerName: Y?.name,
209
+ reportingManagerInitials: Y?.initials,
210
+ reportingManagerSeed: Y?.email,
211
+ directReports: Rt,
212
+ accountAccessLabel: Q.detailAccountAccessLabel,
213
+ accountAccessRows: Q.detailAccounts,
214
+ isAccountAccessLoading: Q.detailAccountsLoading,
215
+ isRoleLoading: w && z.isResolving,
216
+ onBackClick: () => {
217
+ wt(P), F(void 0);
218
+ },
219
+ onEditClick: Jt && Z ? () => G.openMemberEdit(q.id) : void 0,
220
+ onResendClick: ut && (q.status ?? "").trim().toUpperCase() === "INVITED" ? () => K.openResendConfirmation(q.id) : void 0,
221
+ onDeactivateClick: mt && Z && it && q.id !== y ? () => K.openDeactivateConfirmation(q.id) : void 0,
222
+ labels: i
223
+ }) : W.isInviteOpen ? /* @__PURE__ */ d(ke, {
224
+ form: W.inviteForm,
225
+ roleOptions: W.roleOptions,
226
+ departmentOptions: W.departmentOptions,
227
+ locationOptions: W.locationOptions,
228
+ reportingManagerOptions: W.reportingManagerOptions,
229
+ accountAccessOptions: W.accountAccessOptions,
230
+ departmentsLoading: W.departmentsLoading,
231
+ locationsLoading: W.locationsLoading,
232
+ reportingManagersLoading: W.reportingManagersLoading,
233
+ departmentsError: W.departmentsError,
234
+ locationsError: W.locationsError,
235
+ reportingManagersError: W.reportingManagersError,
236
+ accountAccessLoading: W.accountAccessLoading,
237
+ accountAccessError: W.accountAccessError,
238
+ accountAccessMode: W.accountAccessMode,
239
+ errors: W.inviteErrors,
240
+ submitErrorMessage: W.inviteErrorMessage,
241
+ isSubmitting: W.isInviting,
242
+ isSubmitBlocked: W.isInviteSubmitBlocked,
243
+ onFormChange: W.onInviteFormChange,
244
+ onBackClick: W.closeInviteForm,
245
+ onCancel: W.closeInviteForm,
246
+ onSubmit: W.onInviteSubmit,
246
247
  labels: i
247
248
  }) : /* @__PURE__ */ d("div", {
248
249
  className: "ttw:space-y-4 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
249
250
  children: /* @__PURE__ */ d(Fe, {
250
- tabs: gt,
251
- activeTabId: k,
252
- onTabChange: ht,
253
- children: k === "departments" ? /* @__PURE__ */ f(u, { children: [
251
+ tabs: vt,
252
+ activeTabId: O,
253
+ onTabChange: _t,
254
+ children: O === "departments" ? /* @__PURE__ */ f(u, { children: [
254
255
  /* @__PURE__ */ d(Me, {
255
256
  icon: /* @__PURE__ */ d(Le, { className: "ttw:size-4" }),
256
- ...A.panel
257
+ ...k.panel
257
258
  }),
258
- /* @__PURE__ */ d(je, { ...A.drawer }),
259
+ /* @__PURE__ */ d(je, { ...k.drawer }),
259
260
  /* @__PURE__ */ d(o, {
260
- open: A.deleteDialog.open,
261
+ open: k.deleteDialog.open,
261
262
  icon: /* @__PURE__ */ d(Be, {
262
263
  "aria-hidden": !0,
263
264
  className: "ttw:size-6"
264
265
  }),
265
- title: m.departmentDeleteDialogTitle,
266
- description: m.departmentDeleteDialogDescription,
267
- subjectName: A.deleteDialog.subjectName,
268
- confirmButtonLabel: m.departmentDeleteConfirmButton,
269
- errorMessage: A.deleteDialog.errorMessage,
270
- isConfirming: A.deleteDialog.isConfirming,
271
- onOpenChange: A.deleteDialog.onOpenChange,
272
- onConfirm: A.deleteDialog.onConfirm,
266
+ title: g.departmentDeleteDialogTitle,
267
+ description: g.departmentDeleteDialogDescription,
268
+ subjectName: k.deleteDialog.subjectName,
269
+ confirmButtonLabel: g.departmentDeleteConfirmButton,
270
+ errorMessage: k.deleteDialog.errorMessage,
271
+ isConfirming: k.deleteDialog.isConfirming,
272
+ onOpenChange: k.deleteDialog.onOpenChange,
273
+ onConfirm: k.deleteDialog.onConfirm,
273
274
  labels: i
274
275
  })
275
- ] }) : k === "locations" ? /* @__PURE__ */ f(u, { children: [
276
+ ] }) : O === "locations" ? /* @__PURE__ */ f(u, { children: [
276
277
  /* @__PURE__ */ d(Me, {
277
278
  icon: /* @__PURE__ */ d(ze, { className: "ttw:size-4" }),
278
- ...j.panel
279
+ ...A.panel
279
280
  }),
280
- /* @__PURE__ */ d(je, { ...j.drawer }),
281
+ /* @__PURE__ */ d(je, { ...A.drawer }),
281
282
  /* @__PURE__ */ d(o, {
282
- open: j.deleteDialog.open,
283
+ open: A.deleteDialog.open,
283
284
  icon: /* @__PURE__ */ d(Be, {
284
285
  "aria-hidden": !0,
285
286
  className: "ttw:size-6"
286
287
  }),
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,
288
+ title: g.locationDeleteDialogTitle,
289
+ description: g.locationDeleteDialogDescription,
290
+ subjectName: A.deleteDialog.subjectName,
291
+ confirmButtonLabel: g.locationDeleteConfirmButton,
292
+ errorMessage: A.deleteDialog.errorMessage,
293
+ isConfirming: A.deleteDialog.isConfirming,
294
+ onOpenChange: A.deleteDialog.onOpenChange,
295
+ onConfirm: A.deleteDialog.onConfirm,
295
296
  labels: i
296
297
  })
297
298
  ] }) : /* @__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,
299
+ rows: At,
300
+ isLoading: !ot && (ee(rt) && !L.data || at && !_ || S && L.isLoading),
301
+ isError: ot || S && L.isError,
302
+ showPagination: S && zt && !L.isError,
303
+ isPreviousPageDisabled: !It,
304
+ isNextPageDisabled: !Ft,
305
+ pageSize: M,
305
306
  pageSizeOptions: Ve,
306
- rangeLabel: Ut,
307
+ rangeLabel: Wt,
307
308
  onPageSizeChange: (e) => {
308
- vt(e), M(void 0), P(0);
309
+ bt(e), j(void 0), N(0);
309
310
  },
310
- autoFocusRowKey: xt,
311
+ autoFocusRowKey: Ct,
311
312
  onPreviousPageClick: () => {
312
- M(Pt ?? void 0), P((e) => Math.max(0, e - 1));
313
+ j(It ?? void 0), N((e) => Math.max(0, e - 1));
313
314
  },
314
315
  onNextPageClick: () => {
315
- M(Nt ?? void 0), P((e) => e + 1);
316
+ j(Ft ?? void 0), N((e) => e + 1);
316
317
  },
317
- onInviteClick: jt ? G.openInviteForm : void 0,
318
+ onInviteClick: Nt ? W.openInviteForm : void 0,
318
319
  labels: i
319
320
  })
320
321
  })
321
322
  }),
322
323
  /* @__PURE__ */ d(o, {
323
- open: q.isDeactivateOpen,
324
+ open: K.isDeactivateOpen,
324
325
  icon: /* @__PURE__ */ d(Ie, {
325
326
  "aria-hidden": !0,
326
327
  className: "ttw:size-6"
327
328
  }),
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,
329
+ title: g.deactivateDialogTitle,
330
+ description: g.deactivateDialogDescription,
331
+ subjectName: K.deactivateMemberName,
332
+ subjectDetail: K.deactivateMemberEmail,
333
+ confirmButtonLabel: g.deactivateConfirmButton,
334
+ errorMessage: K.deactivateErrorMessage,
335
+ isConfirming: K.isDeactivating,
336
+ onOpenChange: K.onDeactivateOpenChange,
337
+ onConfirm: K.onDeactivateConfirm,
337
338
  labels: i
338
339
  }),
339
340
  /* @__PURE__ */ d(o, {
340
- open: q.isResendOpen,
341
+ open: K.isResendOpen,
341
342
  icon: /* @__PURE__ */ d(Re, {
342
343
  "aria-hidden": !0,
343
344
  className: "ttw:size-6"
344
345
  }),
345
- title: m.resendDialogTitle,
346
- description: m.resendDialogDescription,
347
- subjectName: q.resendMemberName,
348
- subjectDetail: q.resendMemberEmail,
349
- confirmButtonLabel: m.resendConfirmButton,
346
+ title: g.resendDialogTitle,
347
+ description: g.resendDialogDescription,
348
+ subjectName: K.resendMemberName,
349
+ subjectDetail: K.resendMemberEmail,
350
+ confirmButtonLabel: g.resendConfirmButton,
350
351
  confirmVariant: "default",
351
- errorMessage: q.resendErrorMessage,
352
- isConfirming: q.isResending,
353
- onOpenChange: q.onResendOpenChange,
354
- onConfirm: q.onResendConfirm,
352
+ errorMessage: K.resendErrorMessage,
353
+ isConfirming: K.isResending,
354
+ onOpenChange: K.onResendOpenChange,
355
+ onConfirm: K.onResendConfirm,
355
356
  labels: i
356
357
  })
357
358
  ] });
358
359
  }
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
+ function h({ 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
361
  return /* @__PURE__ */ d(i, {
361
362
  widgetName: a,
362
363
  baseUrl: e,
@@ -371,7 +372,7 @@ function m({ baseUrl: e, widgetToken: ee, organizationId: te, configClient: t, g
371
372
  analytics: ae,
372
373
  disclosuresAcceptance: oe,
373
374
  providerLabels: se,
374
- children: /* @__PURE__ */ d(p, { ...ce })
375
+ children: /* @__PURE__ */ d(m, { ...ce })
375
376
  });
376
377
  }
377
- export { m as TeamWidget, m as default };
378
+ export { h as TeamWidget, h as default };
@@ -1,5 +1,5 @@
1
1
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.11.34", n = "11b9ed7f3ac2e8246ccea18a7e52c1f9b5af70ec", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.35", n = "87bc768e53b0eb0bddfcf93a788d2a1242276071", 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.11.34",
3
+ "version": "0.11.35",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [