@tesouro/embedded-components-react 0.11.8 → 0.11.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.d.ts +7 -0
- package/dist/index.css +12 -49
- package/dist/index.d.ts +7 -0
- package/dist/lib/WidgetProvider.d.ts +7 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +8 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +99 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index36.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +110 -100
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index4.js +45 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +259 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +190 -165
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +7 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +151 -143
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +13 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index11.js +52 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +2 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +39 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +2 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +77 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +25 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +28 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index6.js +9 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index8.js +29 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +1 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/groupCollapse.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +48 -45
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +119 -116
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useTokenRefreshRef.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +11 -8
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/expectedApiNotFound.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/widgetTokenManager.js +65 -53
- package/dist/packages/shared-ui-shadcn/dist/index.js +1637 -1507
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +0 -28
|
@@ -1,53 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { groupBySectionHeading as c } from "./index8.js";
|
|
3
|
-
import { Fragment as l, useId as u } from "react";
|
|
4
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
5
|
-
import { MoreHorizontalIcon as p, MoreVerticalIcon as m } from "lucide-react";
|
|
6
|
-
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js
|
|
7
|
-
function h({ actions: h, triggerLabel: g, placement: _ = "row", testId: v }) {
|
|
8
|
-
let y = u();
|
|
9
|
-
if (!h.length) return null;
|
|
10
|
-
let b = _ === "header", x = _ === "header" || _ === "table", S = b ? p : m, C = c(h);
|
|
11
|
-
return /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d(s, {
|
|
12
|
-
asChild: !0,
|
|
13
|
-
children: /* @__PURE__ */ d(e, {
|
|
14
|
-
type: "button",
|
|
15
|
-
variant: x ? "ghost" : "outline",
|
|
16
|
-
size: "icon",
|
|
17
|
-
"aria-label": g,
|
|
18
|
-
"data-testid": v,
|
|
19
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
20
|
-
onClick: (e) => e.stopPropagation(),
|
|
21
|
-
children: /* @__PURE__ */ d(S, { className: "ttw:size-4" })
|
|
22
|
-
})
|
|
23
|
-
}), /* @__PURE__ */ d(n, {
|
|
24
|
-
align: "end",
|
|
25
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
26
|
-
onClick: (e) => e.stopPropagation(),
|
|
27
|
-
children: C.map((e, t) => {
|
|
28
|
-
let n = e.items.map((e) => {
|
|
29
|
-
let t = e.icon;
|
|
30
|
-
return /* @__PURE__ */ f(i, {
|
|
31
|
-
disabled: e.disabled,
|
|
32
|
-
onClick: e.onSelect,
|
|
33
|
-
children: [t ? /* @__PURE__ */ d(t, { className: "ttw:size-4" }) : null, e.label]
|
|
34
|
-
}, e.id);
|
|
35
|
-
});
|
|
36
|
-
if (!e.heading) return /* @__PURE__ */ d(l, { children: n }, e.items[0]?.id);
|
|
37
|
-
let s = `${y}-${t}`;
|
|
38
|
-
return /* @__PURE__ */ f(l, { children: [
|
|
39
|
-
t > 0 ? /* @__PURE__ */ d(o, {}) : null,
|
|
40
|
-
/* @__PURE__ */ d(a, {
|
|
41
|
-
id: s,
|
|
42
|
-
className: "ttw:py-1 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
|
|
43
|
-
children: e.heading
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ d(r, {
|
|
46
|
-
"aria-labelledby": s,
|
|
47
|
-
children: n
|
|
48
|
-
})
|
|
49
|
-
] }, e.items[0]?.id);
|
|
50
|
-
})
|
|
51
|
-
})] });
|
|
52
|
-
}
|
|
53
|
-
export { h as BillOverflowMenu, h as default };
|
|
1
|
+
import "./index8.js";
|
|
@@ -14,4 +14,5 @@ import { resolveLineItemAmountMinorUnits as T } from "./lib/resolveLineItemAmoun
|
|
|
14
14
|
import { resolveLineItemQuantity as E } from "./lib/resolveLineItemQuantity.js";
|
|
15
15
|
import { resolveVendor as D, resolveVendorName as O } from "./lib/resolveVendor.js";
|
|
16
16
|
import { BILL_PAY_WIDGET_NAME as k } from "./lib/widgetName.js";
|
|
17
|
-
|
|
17
|
+
import { buildGroupCollapse as A } from "./lib/groupCollapse.js";
|
|
18
|
+
export { e as AWAITING_APPROVAL_LABEL_EN, t as AWAITING_APPROVAL_UNKNOWN_LABEL_EN, n as BILL_DETAIL_ACTIONS_LABELS_EN, k as BILL_PAY_WIDGET_NAME, u as DuplicateVerdict, r as PAYMENT_HISTORY_LABELS_EN, i as SCHEDULED_RELATIVE_DAY_LABELS_EN, a as SCHEDULED_STATUS_BADGE_LABEL_EN, o as SCHEDULED_SUMMARY_LABEL_EN, A as buildGroupCollapse, g as compareByArrival, p as countSuspectedPayableDuplicateGroups, _ as duplicateVerdictMatches, d as formatBillMoney, f as formatScheduledDateLabel, v as groupSuspectedDuplicates, m as hasSuspectedPayableDuplicate, b as isEditablePayableStatus, x as isLiveScheduledPaymentRecord, S as maskAccountNumber, s as mergeBillDetailActionsLabels, c as mergeDecisionDialogCopy, l as mergePaymentHistoryMethodLabels, C as payableRemoval, w as resolveAmountDueMinorUnits, y as resolveDuplicateOriginalId, T as resolveLineItemAmountMinorUnits, E as resolveLineItemQuantity, D as resolveVendor, O as resolveVendorName, h as suspectedPayableDuplicates };
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/groupCollapse.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/groupCollapse.js
|
|
2
|
+
var e = [
|
|
3
|
+
"paid",
|
|
4
|
+
"scheduled",
|
|
5
|
+
"ready_to_pay",
|
|
6
|
+
"pending_approval",
|
|
7
|
+
"draft"
|
|
8
|
+
];
|
|
9
|
+
function t({ statuses: t, statusLabels: n, labels: r }) {
|
|
10
|
+
if (t.length <= 5) return;
|
|
11
|
+
let i = t.slice(4), a = [...new Set(i.map((e) => e ?? "unknown"))], o = (t) => {
|
|
12
|
+
let n = e.indexOf(t);
|
|
13
|
+
return n === -1 ? e.length : n;
|
|
14
|
+
}, s = [...a].sort((e, t) => o(e) - o(t));
|
|
15
|
+
return {
|
|
16
|
+
visibleCount: 4,
|
|
17
|
+
showMoreLabel: r.showMore(i.length),
|
|
18
|
+
summary: r.statusSummary(s.map((e) => n[e] ?? n.unknown ?? e)),
|
|
19
|
+
showLessLabel: r.showLess
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export { e as GROUP_SUMMARY_STATUS_ORDER, t as buildGroupCollapse };
|
|
@@ -3,55 +3,58 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { createClientSecretInstaller as e } from "../../../../data-access/dist/lib/scopedClientSecret.js";
|
|
6
|
-
import { registerQueryClient as t, unregisterQueryClient as
|
|
7
|
-
import { createEmbeddedClient as
|
|
8
|
-
import { EmbedApiProvider as
|
|
6
|
+
import { registerQueryClient as t, unregisterQueryClient as n } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
7
|
+
import { createEmbeddedClient as r } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
8
|
+
import { EmbedApiProvider as i } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
9
9
|
import "../../../../data-access/dist/index.js";
|
|
10
|
-
import { resolveUIFramework as
|
|
11
|
-
import { UIProvider as
|
|
12
|
-
import { useDesignSystemEnsurer as
|
|
10
|
+
import { resolveUIFramework as a } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
11
|
+
import { UIProvider as ee } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
12
|
+
import { useDesignSystemEnsurer as te } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
13
13
|
import "../../../../ui/dist/index.js";
|
|
14
|
-
import { getGlobalSnapshot as
|
|
15
|
-
import { configureEmbeddedClient as
|
|
16
|
-
import { generateCorrelationId as
|
|
17
|
-
import { WidgetContext as
|
|
18
|
-
import { resolveOrgId as
|
|
19
|
-
import { useWidgetFetch as
|
|
20
|
-
import { deriveOrganizationStatus as
|
|
21
|
-
import { deriveWidgetInitState as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
14
|
+
import { getGlobalSnapshot as o, subscribeToGlobal as ne } from "./globalStore.js";
|
|
15
|
+
import { configureEmbeddedClient as re } from "../analytics/client.js";
|
|
16
|
+
import { generateCorrelationId as ie } from "../analytics/ids.js";
|
|
17
|
+
import { WidgetContext as s } from "./WidgetContext.js";
|
|
18
|
+
import { resolveOrgId as c, useAuthEpoch as l } from "./utils.js";
|
|
19
|
+
import { useWidgetFetch as ae } from "./useWidgetFetch.js";
|
|
20
|
+
import { deriveOrganizationStatus as oe } from "./deriveOrganizationStatus.js";
|
|
21
|
+
import { deriveWidgetInitState as se, useWidgetInitPublisher as ce } from "./useWidgetInitPublisher.js";
|
|
22
|
+
import { useTokenRefreshRef as le } from "./useTokenRefreshRef.js";
|
|
23
|
+
import { useEffect as u, useMemo as d, useRef as f, useState as p, useSyncExternalStore as ue } from "react";
|
|
24
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
25
|
+
import { QueryClient as de, QueryClientProvider as fe } from "@tanstack/react-query";
|
|
25
26
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
|
|
26
27
|
function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configClient: y, gatewayRouting: b, linkComponent: x, uiFramework: S, analytics: C, unstable_initResponseOverride: w, disclosuresAcceptance: T, providerLabels: E }) {
|
|
27
|
-
let D =
|
|
28
|
+
let D = ue(ne, o, o), O = g ?? D.baseUrl, k = _ === void 0 ? D.widgetToken : _, A = v === void 0 ? D.organizationId : v, j = y ?? D.configClient, M = b ?? D.gatewayRouting, N = x ?? D.linkComponent, P = S ?? D.uiFramework, F = C !== !1, [I] = p(ie), L = f({
|
|
28
29
|
enabled: F,
|
|
29
30
|
organizationId: A,
|
|
30
31
|
rootCorrelationId: I
|
|
31
|
-
}), [R] =
|
|
32
|
+
}), [R] = p(() => new de({ defaultOptions: {
|
|
32
33
|
queries: {
|
|
33
34
|
retry: !1,
|
|
34
35
|
refetchOnWindowFocus: !1
|
|
35
36
|
},
|
|
36
37
|
mutations: { retry: !1 }
|
|
37
38
|
} }));
|
|
38
|
-
|
|
39
|
-
let z =
|
|
39
|
+
u(() => (t(R), () => n(R)), [R]);
|
|
40
|
+
let z = f(k);
|
|
40
41
|
z.current = k;
|
|
41
|
-
let B =
|
|
42
|
-
let e =
|
|
42
|
+
let B = le(), V = f(null), pe = d(() => e(V), []), me = l(k), H = d(() => {
|
|
43
|
+
let e = re(r(O), {
|
|
43
44
|
tokenRef: z,
|
|
44
45
|
analyticsContextRef: L,
|
|
45
|
-
clientSecretRef:
|
|
46
|
-
gatewayRouting: M
|
|
46
|
+
clientSecretRef: V,
|
|
47
|
+
gatewayRouting: M,
|
|
48
|
+
refreshTokenRef: B
|
|
47
49
|
});
|
|
48
50
|
return j ? j(e) : e;
|
|
49
51
|
}, [
|
|
50
52
|
O,
|
|
51
53
|
j,
|
|
52
|
-
M
|
|
54
|
+
M,
|
|
55
|
+
B
|
|
53
56
|
]);
|
|
54
|
-
|
|
57
|
+
u(() => {
|
|
55
58
|
if (!F || !("window" in globalThis)) return;
|
|
56
59
|
let e = !1;
|
|
57
60
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
@@ -60,11 +63,11 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
60
63
|
e = !0;
|
|
61
64
|
};
|
|
62
65
|
}, [F]);
|
|
63
|
-
let U =
|
|
64
|
-
|
|
66
|
+
let U = te(a(P));
|
|
67
|
+
u(() => {
|
|
65
68
|
U && U().catch(() => {});
|
|
66
69
|
}, [U]);
|
|
67
|
-
let { result:
|
|
70
|
+
let { result: he, loading: W, error: G, initStaleForToken: K, initReplacementPending: ge, refetch: q } = ae(w ? null : H, k, L), J = k ? w ?? he ?? void 0 : void 0, Y = !w && K, X = c(A, Y ? void 0 : J?.organizationId), _e = oe({
|
|
68
71
|
organizationId: X,
|
|
69
72
|
cascadeOrgId: A,
|
|
70
73
|
ownsFetch: !0,
|
|
@@ -73,8 +76,8 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
73
76
|
loading: W,
|
|
74
77
|
error: G,
|
|
75
78
|
hasResult: !!J,
|
|
76
|
-
initReplacementPending:
|
|
77
|
-
}),
|
|
79
|
+
initReplacementPending: ge
|
|
80
|
+
}), ve = d(() => se({
|
|
78
81
|
hasToken: !!k,
|
|
79
82
|
loading: W,
|
|
80
83
|
error: G,
|
|
@@ -87,8 +90,8 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
87
90
|
J,
|
|
88
91
|
Y
|
|
89
92
|
]);
|
|
90
|
-
|
|
91
|
-
let Z =
|
|
93
|
+
ce(ve, k);
|
|
94
|
+
let Z = d(() => ({
|
|
92
95
|
enabled: F,
|
|
93
96
|
organizationId: X,
|
|
94
97
|
rootCorrelationId: I
|
|
@@ -98,7 +101,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
98
101
|
I
|
|
99
102
|
]);
|
|
100
103
|
L.current = Z;
|
|
101
|
-
let Q =
|
|
104
|
+
let Q = d(() => ({
|
|
102
105
|
baseUrl: g,
|
|
103
106
|
widgetToken: _,
|
|
104
107
|
organizationId: v,
|
|
@@ -114,7 +117,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
114
117
|
b,
|
|
115
118
|
x,
|
|
116
119
|
S
|
|
117
|
-
]), $ =
|
|
120
|
+
]), $ = d(() => ({
|
|
118
121
|
baseUrl: O,
|
|
119
122
|
widgetToken: k,
|
|
120
123
|
organizationId: X,
|
|
@@ -132,7 +135,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
132
135
|
N,
|
|
133
136
|
P,
|
|
134
137
|
J
|
|
135
|
-
]),
|
|
138
|
+
]), ye = d(() => ({
|
|
136
139
|
resolved: $,
|
|
137
140
|
own: Q,
|
|
138
141
|
refetch: q,
|
|
@@ -155,18 +158,18 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
155
158
|
T,
|
|
156
159
|
E
|
|
157
160
|
]);
|
|
158
|
-
return /* @__PURE__ */
|
|
161
|
+
return /* @__PURE__ */ m(fe, {
|
|
159
162
|
client: R,
|
|
160
|
-
children: /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ m(i, {
|
|
161
164
|
client: H,
|
|
162
165
|
organizationId: X,
|
|
163
166
|
widgetToken: k,
|
|
164
|
-
installClientSecret:
|
|
165
|
-
authEpoch:
|
|
166
|
-
organizationStatus:
|
|
167
|
-
children: /* @__PURE__ */
|
|
168
|
-
value:
|
|
169
|
-
children: /* @__PURE__ */
|
|
167
|
+
installClientSecret: pe,
|
|
168
|
+
authEpoch: me,
|
|
169
|
+
organizationStatus: _e,
|
|
170
|
+
children: /* @__PURE__ */ m(s.Provider, {
|
|
171
|
+
value: ye,
|
|
172
|
+
children: /* @__PURE__ */ m(ee, {
|
|
170
173
|
linkComponent: N,
|
|
171
174
|
uiFramework: P,
|
|
172
175
|
children: h
|
|
@@ -24,94 +24,97 @@ import { noop as le, resolveOrgId as ue, useAuthEpoch as de } from "./utils.js";
|
|
|
24
24
|
import { useWidgetFetch as fe } from "./useWidgetFetch.js";
|
|
25
25
|
import { deriveOrganizationStatus as pe } from "./deriveOrganizationStatus.js";
|
|
26
26
|
import { deriveWidgetInitState as me, useWidgetInitPublisher as he } from "./useWidgetInitPublisher.js";
|
|
27
|
+
import { useTokenRefreshRef as ge } from "./useTokenRefreshRef.js";
|
|
27
28
|
import { useAnalyticsTrack as u } from "../analytics/hooks.js";
|
|
28
|
-
import { resolveProviderLabels as
|
|
29
|
-
import { WidgetErrorBoundary as
|
|
30
|
-
import { DISCLOSURES_REQUIRED_TEST_ID as d, hasRenderableAcceptanceSurface as f, resolveDisclosuresBlockedReason as p, shouldGateOnDisclosuresAcceptance as
|
|
31
|
-
import { useContext as
|
|
29
|
+
import { resolveProviderLabels as _e } from "./labels.js";
|
|
30
|
+
import { WidgetErrorBoundary as ve } from "./WidgetErrorBoundary.js";
|
|
31
|
+
import { DISCLOSURES_REQUIRED_TEST_ID as d, hasRenderableAcceptanceSurface as f, resolveDisclosuresBlockedReason as p, shouldGateOnDisclosuresAcceptance as ye } from "./isDisclosuresAcceptanceRequired.js";
|
|
32
|
+
import { useContext as be, useEffect as m, useMemo as h, useRef as g, useState as _, useSyncExternalStore as xe } from "react";
|
|
32
33
|
import { jsx as v } from "react/jsx-runtime";
|
|
33
|
-
import { QueryClient as
|
|
34
|
+
import { QueryClient as Se, QueryClientProvider as Ce } from "@tanstack/react-query";
|
|
34
35
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
|
|
35
|
-
function y({ children: re, baseUrl: s, widgetToken: c, organizationId: u, configClient: d, gatewayRouting: f, linkComponent: p, uiFramework: y, errorFallback:
|
|
36
|
+
function y({ children: re, baseUrl: s, widgetToken: c, organizationId: u, configClient: d, gatewayRouting: f, linkComponent: p, uiFramework: y, errorFallback: Te, onError: Ee, analytics: b, disclosuresAcceptance: De, providerLabels: Oe, widgetName: x }) {
|
|
36
37
|
e();
|
|
37
|
-
let S =
|
|
38
|
-
enabled:
|
|
39
|
-
organizationId:
|
|
40
|
-
rootCorrelationId:
|
|
41
|
-
widgetName:
|
|
42
|
-
widgetInstanceId:
|
|
43
|
-
}),
|
|
38
|
+
let S = be(l), C = xe(oe, ae, ae), w = S?.resolved ?? C, ke = S?.refetch ?? le, Ae = S?.loading ?? !1, je = S?.error ?? null, T = s ?? w.baseUrl, E = c === void 0 ? w.widgetToken : c, Me = S ? S.cascadeOrgId : C.organizationId, D = u === void 0 ? Me : u, O = d ?? w.configClient, k = f ?? w.gatewayRouting, A = p ?? w.linkComponent, j = y ?? w.uiFramework, M = De ?? S?.disclosuresAcceptance, N = Oe ?? S?.providerLabels, P = h(() => _e(N), [N]), F = S === null, I = F ? b !== !1 : S.analytics.enabled, [Ne] = _(ce), L = F ? Ne : S.analytics.rootCorrelationId, [Pe] = _(ce), R = x === void 0 ? S?.analytics.widgetName : x, z = x === void 0 ? S?.analytics.widgetInstanceId : Pe, B = g({
|
|
39
|
+
enabled: I,
|
|
40
|
+
organizationId: D,
|
|
41
|
+
rootCorrelationId: L,
|
|
42
|
+
widgetName: R,
|
|
43
|
+
widgetInstanceId: z
|
|
44
|
+
}), Fe = g(!1);
|
|
44
45
|
m(() => {
|
|
45
|
-
|
|
46
|
-
}, [b,
|
|
47
|
-
if (!
|
|
46
|
+
F || b === void 0 || Fe.current || (Fe.current = !0, console.warn("[tesouro-embedded] `analytics` on a nested WidgetProvider is ignored in v1. Set it on the outermost RootWidgetProvider or standalone WidgetProvider instead."));
|
|
47
|
+
}, [b, F]), m(() => {
|
|
48
|
+
if (!F || !I || !("window" in globalThis)) return;
|
|
48
49
|
let e = !1;
|
|
49
50
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
50
51
|
e || t();
|
|
51
52
|
}), () => {
|
|
52
53
|
e = !0;
|
|
53
54
|
};
|
|
54
|
-
}, [
|
|
55
|
-
let
|
|
55
|
+
}, [F, I]);
|
|
56
|
+
let V = ne(ee(j));
|
|
56
57
|
m(() => {
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
let
|
|
62
|
-
if (!
|
|
63
|
-
let e = se(i(
|
|
64
|
-
tokenRef:
|
|
65
|
-
analyticsContextRef:
|
|
66
|
-
clientSecretRef:
|
|
67
|
-
gatewayRouting:
|
|
58
|
+
V && V().catch(() => {});
|
|
59
|
+
}, [V]);
|
|
60
|
+
let Ie = S === null || s !== void 0 || c !== void 0 || u !== void 0 || d != null || f !== void 0 || x !== void 0, Le = g(E);
|
|
61
|
+
Le.current = E;
|
|
62
|
+
let Re = ge(), ze = g(null), Be = h(() => t(ze), []), Ve = o(), He = de(E), H = h(() => {
|
|
63
|
+
if (!Ie) return null;
|
|
64
|
+
let e = se(i(T), {
|
|
65
|
+
tokenRef: Le,
|
|
66
|
+
analyticsContextRef: B,
|
|
67
|
+
clientSecretRef: ze,
|
|
68
|
+
gatewayRouting: k,
|
|
69
|
+
refreshTokenRef: Re
|
|
68
70
|
});
|
|
69
|
-
return
|
|
71
|
+
return O ? O(e) : e;
|
|
70
72
|
}, [
|
|
71
|
-
|
|
72
|
-
w,
|
|
73
|
-
D,
|
|
74
|
-
O
|
|
75
|
-
]), W = S === null || s !== void 0 || c !== void 0, Be = W ? ze : Re.authEpoch, { result: G, loading: K, error: q, clearedForAuthChange: Ve, initStaleForToken: J, initReplacementPending: He, refetch: Ue } = fe(W ? U : null, W ? T : void 0, R), We = W ? Ue : ke, Ge = W ? K : Ae, Ke = W ? q : je, qe = S?.resolved.initResponse, Je = !W || !Ve && !q && !G && !!T && !K, Y = Je ? qe : G ?? void 0, X = Je ? W || (S?.initResponseStaleForToken ?? !1) : J, Ye = S === null, Xe = h(() => Ye ? me({
|
|
76
|
-
hasToken: !!T,
|
|
77
|
-
loading: K,
|
|
78
|
-
error: q,
|
|
79
|
-
initResponse: G ?? void 0,
|
|
80
|
-
initStaleForToken: J
|
|
81
|
-
}) : null, [
|
|
82
|
-
Ye,
|
|
73
|
+
Ie,
|
|
83
74
|
T,
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
O,
|
|
76
|
+
k,
|
|
77
|
+
Re
|
|
78
|
+
]), U = S === null || s !== void 0 || c !== void 0, Ue = U ? He : Ve.authEpoch, { result: W, loading: G, error: K, clearedForAuthChange: We, initStaleForToken: q, initReplacementPending: Ge, refetch: Ke } = fe(U ? H : null, U ? E : void 0, B), qe = U ? Ke : ke, Je = U ? G : Ae, Ye = U ? K : je, Xe = S?.resolved.initResponse, J = !U || !We && !K && !W && !!E && !G, Y = J ? Xe : W ?? void 0, X = J ? U || (S?.initResponseStaleForToken ?? !1) : q, Ze = S === null, Qe = h(() => Ze ? me({
|
|
79
|
+
hasToken: !!E,
|
|
80
|
+
loading: G,
|
|
81
|
+
error: K,
|
|
82
|
+
initResponse: W ?? void 0,
|
|
83
|
+
initStaleForToken: q
|
|
84
|
+
}) : null, [
|
|
85
|
+
Ze,
|
|
86
|
+
E,
|
|
86
87
|
G,
|
|
87
|
-
|
|
88
|
+
K,
|
|
89
|
+
W,
|
|
90
|
+
q
|
|
88
91
|
]);
|
|
89
|
-
he(
|
|
90
|
-
let Z = ue(
|
|
92
|
+
he(Qe, E);
|
|
93
|
+
let Z = ue(D, X ? void 0 : Y?.organizationId), $e = pe({
|
|
91
94
|
organizationId: Z,
|
|
92
|
-
cascadeOrgId:
|
|
93
|
-
ownsFetch:
|
|
94
|
-
parentStatus:
|
|
95
|
-
hasToken: !!
|
|
96
|
-
loading:
|
|
97
|
-
error:
|
|
98
|
-
hasResult: !!
|
|
99
|
-
initReplacementPending:
|
|
95
|
+
cascadeOrgId: D,
|
|
96
|
+
ownsFetch: U,
|
|
97
|
+
parentStatus: Ve.organizationStatus,
|
|
98
|
+
hasToken: !!E,
|
|
99
|
+
loading: G,
|
|
100
|
+
error: K,
|
|
101
|
+
hasResult: !!W,
|
|
102
|
+
initReplacementPending: Ge
|
|
100
103
|
}), Q = h(() => ({
|
|
101
|
-
enabled:
|
|
104
|
+
enabled: I,
|
|
102
105
|
organizationId: Z,
|
|
103
|
-
rootCorrelationId:
|
|
104
|
-
widgetName:
|
|
105
|
-
widgetInstanceId:
|
|
106
|
+
rootCorrelationId: L,
|
|
107
|
+
widgetName: R,
|
|
108
|
+
widgetInstanceId: z
|
|
106
109
|
}), [
|
|
107
|
-
P,
|
|
108
|
-
Z,
|
|
109
|
-
F,
|
|
110
110
|
I,
|
|
111
|
-
|
|
111
|
+
Z,
|
|
112
|
+
L,
|
|
113
|
+
R,
|
|
114
|
+
z
|
|
112
115
|
]);
|
|
113
|
-
|
|
114
|
-
let [$] = _(() => S === null ? new
|
|
116
|
+
B.current = Q;
|
|
117
|
+
let [$] = _(() => S === null ? new Se({ defaultOptions: {
|
|
115
118
|
queries: {
|
|
116
119
|
retry: !1,
|
|
117
120
|
refetchOnWindowFocus: !1
|
|
@@ -123,7 +126,7 @@ function y({ children: re, baseUrl: s, widgetToken: c, organizationId: u, config
|
|
|
123
126
|
let e = $;
|
|
124
127
|
return n(e), () => r(e);
|
|
125
128
|
}, [$]);
|
|
126
|
-
let
|
|
129
|
+
let et = h(() => ({
|
|
127
130
|
baseUrl: s,
|
|
128
131
|
widgetToken: c,
|
|
129
132
|
organizationId: u,
|
|
@@ -139,78 +142,78 @@ function y({ children: re, baseUrl: s, widgetToken: c, organizationId: u, config
|
|
|
139
142
|
f,
|
|
140
143
|
p,
|
|
141
144
|
y
|
|
142
|
-
]),
|
|
143
|
-
baseUrl:
|
|
144
|
-
widgetToken:
|
|
145
|
+
]), tt = h(() => ({
|
|
146
|
+
baseUrl: T,
|
|
147
|
+
widgetToken: E,
|
|
145
148
|
organizationId: Z,
|
|
146
|
-
configClient:
|
|
147
|
-
gatewayRouting:
|
|
148
|
-
linkComponent:
|
|
149
|
-
uiFramework:
|
|
149
|
+
configClient: O,
|
|
150
|
+
gatewayRouting: k,
|
|
151
|
+
linkComponent: A,
|
|
152
|
+
uiFramework: j,
|
|
150
153
|
initResponse: Y
|
|
151
154
|
}), [
|
|
152
|
-
w,
|
|
153
155
|
T,
|
|
156
|
+
E,
|
|
154
157
|
Z,
|
|
155
|
-
D,
|
|
156
158
|
O,
|
|
157
159
|
k,
|
|
158
160
|
A,
|
|
161
|
+
j,
|
|
159
162
|
Y
|
|
160
|
-
]),
|
|
161
|
-
resolved:
|
|
162
|
-
own:
|
|
163
|
-
refetch:
|
|
164
|
-
loading:
|
|
165
|
-
error:
|
|
163
|
+
]), nt = h(() => ({
|
|
164
|
+
resolved: tt,
|
|
165
|
+
own: et,
|
|
166
|
+
refetch: qe,
|
|
167
|
+
loading: Je,
|
|
168
|
+
error: Ye,
|
|
166
169
|
analytics: Q,
|
|
167
|
-
cascadeOrgId:
|
|
170
|
+
cascadeOrgId: D,
|
|
168
171
|
initResponseStaleForToken: X,
|
|
169
|
-
disclosuresAcceptance:
|
|
170
|
-
providerLabels:
|
|
172
|
+
disclosuresAcceptance: M,
|
|
173
|
+
providerLabels: N
|
|
171
174
|
}), [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
tt,
|
|
176
|
+
et,
|
|
177
|
+
qe,
|
|
178
|
+
Je,
|
|
179
|
+
Ye,
|
|
177
180
|
Q,
|
|
178
|
-
|
|
181
|
+
D,
|
|
179
182
|
X,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
]),
|
|
183
|
-
value:
|
|
183
|
+
M,
|
|
184
|
+
N
|
|
185
|
+
]), rt = /* @__PURE__ */ v(l.Provider, {
|
|
186
|
+
value: nt,
|
|
184
187
|
children: /* @__PURE__ */ v(te, {
|
|
185
|
-
linkComponent:
|
|
186
|
-
uiFramework:
|
|
187
|
-
children: /* @__PURE__ */ v(ie, { children: /* @__PURE__ */ v(
|
|
188
|
-
resetKeys: [
|
|
189
|
-
errorFallback:
|
|
190
|
-
onError:
|
|
191
|
-
labels:
|
|
192
|
-
children:
|
|
193
|
-
disclosuresAcceptance:
|
|
188
|
+
linkComponent: A,
|
|
189
|
+
uiFramework: j,
|
|
190
|
+
children: /* @__PURE__ */ v(ie, { children: /* @__PURE__ */ v(ve, {
|
|
191
|
+
resetKeys: [E],
|
|
192
|
+
errorFallback: Te,
|
|
193
|
+
onError: Ee,
|
|
194
|
+
labels: P,
|
|
195
|
+
children: ye(Y, x) ? /* @__PURE__ */ v(we, {
|
|
196
|
+
disclosuresAcceptance: M,
|
|
194
197
|
initStaleForToken: X,
|
|
195
|
-
labels:
|
|
198
|
+
labels: P
|
|
196
199
|
}) : re
|
|
197
200
|
}) })
|
|
198
201
|
})
|
|
199
|
-
}),
|
|
200
|
-
client:
|
|
202
|
+
}), it = H ? /* @__PURE__ */ v(a, {
|
|
203
|
+
client: H,
|
|
201
204
|
organizationId: Z,
|
|
202
|
-
widgetToken:
|
|
203
|
-
installClientSecret:
|
|
204
|
-
authEpoch:
|
|
205
|
-
organizationStatus:
|
|
206
|
-
children:
|
|
207
|
-
}) :
|
|
208
|
-
return $ ? /* @__PURE__ */ v(
|
|
205
|
+
widgetToken: E,
|
|
206
|
+
installClientSecret: Be,
|
|
207
|
+
authEpoch: Ue,
|
|
208
|
+
organizationStatus: $e,
|
|
209
|
+
children: rt
|
|
210
|
+
}) : rt;
|
|
211
|
+
return $ ? /* @__PURE__ */ v(Ce, {
|
|
209
212
|
client: $,
|
|
210
|
-
children:
|
|
211
|
-
}) :
|
|
213
|
+
children: it
|
|
214
|
+
}) : it;
|
|
212
215
|
}
|
|
213
|
-
function
|
|
216
|
+
function we({ disclosuresAcceptance: e, initStaleForToken: t, labels: n }) {
|
|
214
217
|
let r = re("error-state") ?? s, i = u(), a = f(e), o = p({
|
|
215
218
|
initStaleForToken: t,
|
|
216
219
|
hasAcceptanceSurface: a
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WidgetTokenRefreshContext as e } from "./WidgetTokenRefreshContext.js";
|
|
2
|
+
import { useContext as t, useRef as n } from "react";
|
|
3
|
+
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useTokenRefreshRef.js
|
|
4
|
+
function r() {
|
|
5
|
+
let r = t(e), i = n(null);
|
|
6
|
+
return i.current = r ? (e) => void r.reportRejectedToken(e) : null, i;
|
|
7
|
+
}
|
|
8
|
+
export { r as useTokenRefreshRef };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -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.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.10", n = "f57670c8612e26f60cc01a9f70379f59a80e9b92", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { attachTransportInterceptors as e } from "../../../../data-access/dist/lib/transportInterceptors.js";
|
|
2
2
|
import "../../../../data-access/dist/index.js";
|
|
3
|
-
import { attachAnalyticsInterceptors as t } from "./interceptor.js";
|
|
3
|
+
import { attachAnalyticsInterceptors as t, tokenCarriedBy as n } from "./interceptor.js";
|
|
4
4
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js
|
|
5
|
-
function
|
|
6
|
-
return e(
|
|
7
|
-
tokenRef:
|
|
8
|
-
clientSecretRef:
|
|
9
|
-
gatewayRouting:
|
|
10
|
-
}),
|
|
5
|
+
function r(r, { tokenRef: i, analyticsContextRef: a, clientSecretRef: o, gatewayRouting: s, refreshTokenRef: c }) {
|
|
6
|
+
return e(r, {
|
|
7
|
+
tokenRef: i,
|
|
8
|
+
clientSecretRef: o,
|
|
9
|
+
gatewayRouting: s
|
|
10
|
+
}), c && r.interceptors.error.use((e, t, r) => {
|
|
11
|
+
let a = n(r);
|
|
12
|
+
return t?.status === 401 && a && a === i.current && c.current?.(a), e;
|
|
13
|
+
}), t(r, a), r;
|
|
11
14
|
}
|
|
12
|
-
export {
|
|
15
|
+
export { r as configureEmbeddedClient };
|
|
@@ -3,7 +3,8 @@ var e = /* @__PURE__ */ new Set([
|
|
|
3
3
|
"GET /identity/v1/user-data/{key}",
|
|
4
4
|
"GET /embedded-banking/v1/credit-cards/{cardId}",
|
|
5
5
|
"GET /embedded-banking/v1/debit-cards/{cardId}",
|
|
6
|
-
"GET /finops/v1/payables/{payable_id}/suggestions"
|
|
6
|
+
"GET /finops/v1/payables/{payable_id}/suggestions",
|
|
7
|
+
"GET /identity/v1/financial_institution"
|
|
7
8
|
]);
|
|
8
9
|
function t(t, n, r) {
|
|
9
10
|
return t === 404 && n !== void 0 && r !== void 0 && e.has(`${n.toUpperCase()} ${r}`);
|