@tesouro/embedded-components-react 0.2.267 → 0.2.270
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 +15 -12
- package/dist/experimental/WidgetSuite.d.ts +25 -1
- package/dist/experimental/index.d.ts +25 -1
- package/dist/index.css +3 -0
- package/dist/index.d.ts +46 -22
- package/dist/lib/AcceptDisclosuresWidget.d.ts +25 -1
- package/dist/lib/BalancesWidget.d.ts +24 -0
- package/dist/lib/BankAccountOnboardingWidget.d.ts +25 -1
- package/dist/lib/BankAccountsWidget.d.ts +25 -1
- package/dist/lib/BillPayWidget.d.ts +24 -0
- package/dist/lib/CardDetailsWidget.d.ts +25 -1
- package/dist/lib/CardsWidget.d.ts +25 -1
- package/dist/lib/ChartOfAccountsWidget.d.ts +25 -1
- package/dist/lib/CounterpartsWidget.d.ts +25 -1
- package/dist/lib/CreateCardWidget.d.ts +25 -1
- package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +25 -1
- package/dist/lib/ExpenseManagementWidget.d.ts +25 -1
- package/dist/lib/ExpenseRequirementsWidget.d.ts +25 -1
- package/dist/lib/HelpWidget.d.ts +25 -1
- package/dist/lib/InsightsWidget.d.ts +24 -0
- package/dist/lib/InvoicingWidget.d.ts +25 -1
- package/dist/lib/LinkedAccountsWidget.d.ts +25 -1
- package/dist/lib/ProductsWidget.d.ts +25 -1
- package/dist/lib/ProfileWidget.d.ts +25 -1
- package/dist/lib/ReceiptMatchWidget.d.ts +25 -1
- package/dist/lib/ReceivablesWidget.d.ts +25 -1
- package/dist/lib/SettingsWidget.d.ts +25 -1
- package/dist/lib/TagsWidget.d.ts +25 -1
- package/dist/lib/TeamWidget.d.ts +25 -1
- package/dist/lib/TransfersWidget.d.ts +24 -0
- package/dist/lib/WidgetProvider.d.ts +25 -1
- package/dist/lib/WidgetProviderPublic.d.ts +24 -0
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +122 -121
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +94 -93
- package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +12 -11
- package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -21
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/widgetGatewayHosts.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +76 -67
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +107 -101
- 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 +12 -4
- package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +106 -105
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +9 -8
- package/package.json +1 -1
package/dist/lib/TagsWidget.d.ts
CHANGED
|
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
|
|
|
477
477
|
* ```
|
|
478
478
|
*/
|
|
479
479
|
configClient?: (client: EmbeddedClient) => EmbeddedClient;
|
|
480
|
+
/**
|
|
481
|
+
* Overrides the widget-gateway routing decision for the scoped HTTP client.
|
|
482
|
+
*
|
|
483
|
+
* Any caller reaching the Tesouro API with a widget token must route data
|
|
484
|
+
* requests through the widget gateway: prefix the path with
|
|
485
|
+
* `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
|
|
486
|
+
* provider applies both automatically per request when the request origin is
|
|
487
|
+
* a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
|
|
488
|
+
* generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
|
|
489
|
+
* init round-trip) always pass through untouched.
|
|
490
|
+
*
|
|
491
|
+
* - `undefined` — decide from the request origin, as above. Inherits from
|
|
492
|
+
* the nearest ancestor or global store like every other config field.
|
|
493
|
+
* - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
|
|
494
|
+
* custom domain in front of the gateway).
|
|
495
|
+
* - `false` — never apply it. For hosts that route widget requests their own
|
|
496
|
+
* way, such as a same-origin BFF whose `configClient` retargets every
|
|
497
|
+
* request.
|
|
498
|
+
*
|
|
499
|
+
* Independent of {@link configClient}: a host that only adds a header keeps
|
|
500
|
+
* the built-in routing, and the built-in interceptor runs before any
|
|
501
|
+
* `configClient` interceptor.
|
|
502
|
+
*/
|
|
503
|
+
gatewayRouting?: boolean;
|
|
480
504
|
/**
|
|
481
505
|
* Component the embedded widgets should render in place of plain `<a>` tags.
|
|
482
506
|
*
|
|
@@ -653,7 +677,7 @@ type TagsWidgetProps = WidgetProviderProps & TagsWidgetOwnProps;
|
|
|
653
677
|
* <TagsWidget baseUrl="https://api.tesouro.com" widgetToken="wt_..." organizationId="org_..." />
|
|
654
678
|
* ```
|
|
655
679
|
*/
|
|
656
|
-
declare function TagsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TagsWidgetProps): React.JSX.Element;
|
|
680
|
+
declare function TagsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TagsWidgetProps): React.JSX.Element;
|
|
657
681
|
|
|
658
682
|
export { TagsWidget };
|
|
659
683
|
export type { TagDeleteDialogLabels, TagFormSheetLabels, TagMessageLabels, TagsScreenLabels, TagsWidgetProps };
|
package/dist/lib/TeamWidget.d.ts
CHANGED
|
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
|
|
|
477
477
|
* ```
|
|
478
478
|
*/
|
|
479
479
|
configClient?: (client: EmbeddedClient) => EmbeddedClient;
|
|
480
|
+
/**
|
|
481
|
+
* Overrides the widget-gateway routing decision for the scoped HTTP client.
|
|
482
|
+
*
|
|
483
|
+
* Any caller reaching the Tesouro API with a widget token must route data
|
|
484
|
+
* requests through the widget gateway: prefix the path with
|
|
485
|
+
* `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
|
|
486
|
+
* provider applies both automatically per request when the request origin is
|
|
487
|
+
* a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
|
|
488
|
+
* generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
|
|
489
|
+
* init round-trip) always pass through untouched.
|
|
490
|
+
*
|
|
491
|
+
* - `undefined` — decide from the request origin, as above. Inherits from
|
|
492
|
+
* the nearest ancestor or global store like every other config field.
|
|
493
|
+
* - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
|
|
494
|
+
* custom domain in front of the gateway).
|
|
495
|
+
* - `false` — never apply it. For hosts that route widget requests their own
|
|
496
|
+
* way, such as a same-origin BFF whose `configClient` retargets every
|
|
497
|
+
* request.
|
|
498
|
+
*
|
|
499
|
+
* Independent of {@link configClient}: a host that only adds a header keeps
|
|
500
|
+
* the built-in routing, and the built-in interceptor runs before any
|
|
501
|
+
* `configClient` interceptor.
|
|
502
|
+
*/
|
|
503
|
+
gatewayRouting?: boolean;
|
|
480
504
|
/**
|
|
481
505
|
* Component the embedded widgets should render in place of plain `<a>` tags.
|
|
482
506
|
*
|
|
@@ -814,7 +838,7 @@ interface TeamWidgetProps extends WidgetProviderProps {
|
|
|
814
838
|
*/
|
|
815
839
|
acceptInviteRedirectUri?: string;
|
|
816
840
|
}
|
|
817
|
-
declare function TeamWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TeamWidgetProps): React.JSX.Element;
|
|
841
|
+
declare function TeamWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TeamWidgetProps): React.JSX.Element;
|
|
818
842
|
|
|
819
843
|
export { TeamWidget };
|
|
820
844
|
export type { FeatureLabels as TeamWidgetFeatureLabels, Labels as TeamWidgetLabels, TeamWidgetProps };
|
|
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
|
|
|
477
477
|
* ```
|
|
478
478
|
*/
|
|
479
479
|
configClient?: (client: EmbeddedClient) => EmbeddedClient;
|
|
480
|
+
/**
|
|
481
|
+
* Overrides the widget-gateway routing decision for the scoped HTTP client.
|
|
482
|
+
*
|
|
483
|
+
* Any caller reaching the Tesouro API with a widget token must route data
|
|
484
|
+
* requests through the widget gateway: prefix the path with
|
|
485
|
+
* `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
|
|
486
|
+
* provider applies both automatically per request when the request origin is
|
|
487
|
+
* a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
|
|
488
|
+
* generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
|
|
489
|
+
* init round-trip) always pass through untouched.
|
|
490
|
+
*
|
|
491
|
+
* - `undefined` — decide from the request origin, as above. Inherits from
|
|
492
|
+
* the nearest ancestor or global store like every other config field.
|
|
493
|
+
* - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
|
|
494
|
+
* custom domain in front of the gateway).
|
|
495
|
+
* - `false` — never apply it. For hosts that route widget requests their own
|
|
496
|
+
* way, such as a same-origin BFF whose `configClient` retargets every
|
|
497
|
+
* request.
|
|
498
|
+
*
|
|
499
|
+
* Independent of {@link configClient}: a host that only adds a header keeps
|
|
500
|
+
* the built-in routing, and the built-in interceptor runs before any
|
|
501
|
+
* `configClient` interceptor.
|
|
502
|
+
*/
|
|
503
|
+
gatewayRouting?: boolean;
|
|
480
504
|
/**
|
|
481
505
|
* Component the embedded widgets should render in place of plain `<a>` tags.
|
|
482
506
|
*
|
|
@@ -561,6 +561,30 @@ interface WidgetConfigInput {
|
|
|
561
561
|
* ```
|
|
562
562
|
*/
|
|
563
563
|
configClient?: (client: EmbeddedClient) => EmbeddedClient;
|
|
564
|
+
/**
|
|
565
|
+
* Overrides the widget-gateway routing decision for the scoped HTTP client.
|
|
566
|
+
*
|
|
567
|
+
* Any caller reaching the Tesouro API with a widget token must route data
|
|
568
|
+
* requests through the widget gateway: prefix the path with
|
|
569
|
+
* `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
|
|
570
|
+
* provider applies both automatically per request when the request origin is
|
|
571
|
+
* a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
|
|
572
|
+
* generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
|
|
573
|
+
* init round-trip) always pass through untouched.
|
|
574
|
+
*
|
|
575
|
+
* - `undefined` — decide from the request origin, as above. Inherits from
|
|
576
|
+
* the nearest ancestor or global store like every other config field.
|
|
577
|
+
* - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
|
|
578
|
+
* custom domain in front of the gateway).
|
|
579
|
+
* - `false` — never apply it. For hosts that route widget requests their own
|
|
580
|
+
* way, such as a same-origin BFF whose `configClient` retargets every
|
|
581
|
+
* request.
|
|
582
|
+
*
|
|
583
|
+
* Independent of {@link configClient}: a host that only adds a header keeps
|
|
584
|
+
* the built-in routing, and the built-in interceptor runs before any
|
|
585
|
+
* `configClient` interceptor.
|
|
586
|
+
*/
|
|
587
|
+
gatewayRouting?: boolean;
|
|
564
588
|
/**
|
|
565
589
|
* Component the embedded widgets should render in place of plain `<a>` tags.
|
|
566
590
|
*
|
|
@@ -914,7 +938,7 @@ interface RootWidgetProviderProps extends WidgetProviderBaseProps {
|
|
|
914
938
|
* @see {@link useWidgetConfig} to read the resolved config in descendants
|
|
915
939
|
* @see {@link setGlobalWidgetConfig} to push config imperatively from outside React
|
|
916
940
|
*/
|
|
917
|
-
declare function RootWidgetProvider({ children, baseUrl, widgetToken, organizationId, configClient, linkComponent, uiFramework, implementation, analytics, unstable_initResponseOverride, }: PropsWithChildren<RootWidgetProviderProps>): React.JSX.Element;
|
|
941
|
+
declare function RootWidgetProvider({ children, baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, implementation, analytics, unstable_initResponseOverride, }: PropsWithChildren<RootWidgetProviderProps>): React.JSX.Element;
|
|
918
942
|
|
|
919
943
|
/**
|
|
920
944
|
* Props for {@link WidgetProvider}.
|
|
@@ -476,6 +476,30 @@ interface WidgetConfigInput {
|
|
|
476
476
|
* ```
|
|
477
477
|
*/
|
|
478
478
|
configClient?: (client: EmbeddedClient) => EmbeddedClient;
|
|
479
|
+
/**
|
|
480
|
+
* Overrides the widget-gateway routing decision for the scoped HTTP client.
|
|
481
|
+
*
|
|
482
|
+
* Any caller reaching the Tesouro API with a widget token must route data
|
|
483
|
+
* requests through the widget gateway: prefix the path with
|
|
484
|
+
* `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
|
|
485
|
+
* provider applies both automatically per request when the request origin is
|
|
486
|
+
* a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
|
|
487
|
+
* generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
|
|
488
|
+
* init round-trip) always pass through untouched.
|
|
489
|
+
*
|
|
490
|
+
* - `undefined` — decide from the request origin, as above. Inherits from
|
|
491
|
+
* the nearest ancestor or global store like every other config field.
|
|
492
|
+
* - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
|
|
493
|
+
* custom domain in front of the gateway).
|
|
494
|
+
* - `false` — never apply it. For hosts that route widget requests their own
|
|
495
|
+
* way, such as a same-origin BFF whose `configClient` retargets every
|
|
496
|
+
* request.
|
|
497
|
+
*
|
|
498
|
+
* Independent of {@link configClient}: a host that only adds a header keeps
|
|
499
|
+
* the built-in routing, and the built-in interceptor runs before any
|
|
500
|
+
* `configClient` interceptor.
|
|
501
|
+
*/
|
|
502
|
+
gatewayRouting?: boolean;
|
|
479
503
|
/**
|
|
480
504
|
* Component the embedded widgets should render in place of plain `<a>` tags.
|
|
481
505
|
*
|
package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js
CHANGED
|
@@ -113,20 +113,21 @@ function S({ invitationToken: e, userId: t, labelOverrides: n, content: i, label
|
|
|
113
113
|
errorMessage: p
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
function C({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i,
|
|
116
|
+
function C({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, ...p }) {
|
|
117
117
|
return /* @__PURE__ */ _(s, {
|
|
118
118
|
widgetName: t,
|
|
119
119
|
baseUrl: e,
|
|
120
120
|
widgetToken: n,
|
|
121
121
|
organizationId: r,
|
|
122
122
|
configClient: i,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
gatewayRouting: a,
|
|
124
|
+
linkComponent: o,
|
|
125
|
+
implementation: c,
|
|
126
|
+
uiFramework: l,
|
|
127
|
+
errorFallback: u,
|
|
128
|
+
onError: d,
|
|
129
|
+
analytics: f,
|
|
130
|
+
children: /* @__PURE__ */ _(x, { ...p })
|
|
130
131
|
});
|
|
131
132
|
}
|
|
132
133
|
//#endregion
|
|
@@ -9,32 +9,32 @@ import { useAnalyticsTrack as i } from "../../../shared/feature/dist/lib/analyti
|
|
|
9
9
|
import { WidgetProvider as a } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
10
10
|
import { getStateOptions as o } from "../../../shared/util/dist/lib/usStates.js";
|
|
11
11
|
import { extractApiErrorMessage as s } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
12
|
-
import { useRefetchWidget as
|
|
13
|
-
import { getNaicsOptions as
|
|
12
|
+
import { useRefetchWidget as ee, useWidgetConfig as c } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
13
|
+
import { getNaicsOptions as l } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
|
|
14
14
|
import "../../../shared/feature/dist/index.js";
|
|
15
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as
|
|
16
|
-
import { interpolateBankName as
|
|
17
|
-
import { ResultStep as
|
|
18
|
-
import { MarketingWidget as
|
|
15
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as u } from "../../ui/dist/index4.js";
|
|
16
|
+
import { interpolateBankName as d } from "../../ui/dist/index6.js";
|
|
17
|
+
import { ResultStep as te } from "../../ui/dist/index11.js";
|
|
18
|
+
import { MarketingWidget as ne } from "../../ui/dist/index28.js";
|
|
19
19
|
import "../../ui/dist/index.js";
|
|
20
|
-
import { BusinessDetailsStep as
|
|
21
|
-
import { PersonalDetailsStep as
|
|
22
|
-
import { AdditionalOwnersStep as
|
|
23
|
-
import { buildCreateApplicationBody as
|
|
24
|
-
import { OnboardingAnalyticsEvent as
|
|
25
|
-
import { DEFAULT_LABELS as
|
|
26
|
-
import { ApplicationClientSecretProvider as
|
|
27
|
-
import { useCreateApplication as
|
|
28
|
-
import { useUpdateApplication as
|
|
29
|
-
import { useSubmitApplication as
|
|
30
|
-
import { usePollApplicationCompletion as
|
|
31
|
-
import { OnboardingSuppressionReason as
|
|
32
|
-
import { useOrganizationOnboardingSuppression as
|
|
20
|
+
import { BusinessDetailsStep as re } from "./index9.js";
|
|
21
|
+
import { PersonalDetailsStep as ie } from "./index11.js";
|
|
22
|
+
import { AdditionalOwnersStep as ae } from "./index13.js";
|
|
23
|
+
import { buildCreateApplicationBody as oe, buildUpdateApplicationBody as se } from "./index14.js";
|
|
24
|
+
import { OnboardingAnalyticsEvent as f, WIDGET_NAME as p } from "./index15.js";
|
|
25
|
+
import { DEFAULT_LABELS as m } from "./index16.js";
|
|
26
|
+
import { ApplicationClientSecretProvider as ce, useApplicationClientSecret as le } from "../../data-access/dist/index2.js";
|
|
27
|
+
import { useCreateApplication as ue } from "../../data-access/dist/index4.js";
|
|
28
|
+
import { useUpdateApplication as de } from "../../data-access/dist/index6.js";
|
|
29
|
+
import { useSubmitApplication as fe } from "../../data-access/dist/index7.js";
|
|
30
|
+
import { usePollApplicationCompletion as pe } from "../../data-access/dist/index8.js";
|
|
31
|
+
import { OnboardingSuppressionReason as h } from "../../data-access/dist/index9.js";
|
|
32
|
+
import { useOrganizationOnboardingSuppression as me } from "../../data-access/dist/index10.js";
|
|
33
33
|
import "../../data-access/dist/index.js";
|
|
34
|
-
import { useCallback as
|
|
35
|
-
import { Fragment as
|
|
34
|
+
import { useCallback as g, useEffect as _, useMemo as v, useRef as he, useState as y } from "react";
|
|
35
|
+
import { Fragment as ge, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
36
36
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js
|
|
37
|
-
var
|
|
37
|
+
var _e = {
|
|
38
38
|
companyLegalName: "",
|
|
39
39
|
companyDbaName: "",
|
|
40
40
|
businessAddress: "",
|
|
@@ -48,7 +48,7 @@ var ge = {
|
|
|
48
48
|
naicsCode: "",
|
|
49
49
|
isAuthorized: null,
|
|
50
50
|
isCheckboxChecked: !1
|
|
51
|
-
},
|
|
51
|
+
}, ve = {
|
|
52
52
|
firstName: "",
|
|
53
53
|
lastName: "",
|
|
54
54
|
dateOfBirth: void 0,
|
|
@@ -62,7 +62,7 @@ var ge = {
|
|
|
62
62
|
ownsOver25Percent: null,
|
|
63
63
|
ownershipPercentage: null
|
|
64
64
|
};
|
|
65
|
-
function
|
|
65
|
+
function ye(e, t) {
|
|
66
66
|
if (e === 0) return {
|
|
67
67
|
title: t.businessReviewTitle,
|
|
68
68
|
subtitle: t.businessReviewSubtitle
|
|
@@ -72,7 +72,7 @@ function ve(e, t) {
|
|
|
72
72
|
subtitle: t.personalReviewSubtitle
|
|
73
73
|
};
|
|
74
74
|
let n = {
|
|
75
|
-
...
|
|
75
|
+
...u,
|
|
76
76
|
...t.additionalOwners
|
|
77
77
|
};
|
|
78
78
|
return {
|
|
@@ -80,55 +80,55 @@ function ve(e, t) {
|
|
|
80
80
|
subtitle: n.subheading
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, [
|
|
88
|
-
let
|
|
89
|
-
...
|
|
90
|
-
...
|
|
83
|
+
function be({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboard: u, labels: p, initialBusinessDetails: ce, initialPersonalDetails: be, initialAdditionalOwners: S, bankLogoSrc: xe, disclosureLinks: Se, marketingContent: C = null, open: Ce, defaultOpen: we, onOpenChange: w }) {
|
|
84
|
+
let T = i();
|
|
85
|
+
_(() => {
|
|
86
|
+
T(f.Mounted);
|
|
87
|
+
}, [T]);
|
|
88
|
+
let E = {
|
|
89
|
+
...m,
|
|
90
|
+
...p,
|
|
91
91
|
stepIndicator: {
|
|
92
|
-
...
|
|
93
|
-
...
|
|
92
|
+
...m.stepIndicator,
|
|
93
|
+
...p?.stepIndicator
|
|
94
94
|
},
|
|
95
|
-
businessDetails:
|
|
96
|
-
personalDetails:
|
|
97
|
-
additionalOwners:
|
|
95
|
+
businessDetails: p?.businessDetails ?? {},
|
|
96
|
+
personalDetails: p?.personalDetails ?? {},
|
|
97
|
+
additionalOwners: p?.additionalOwners ?? {},
|
|
98
98
|
result: {
|
|
99
|
-
...
|
|
100
|
-
...
|
|
99
|
+
...m.result,
|
|
100
|
+
...p?.result
|
|
101
101
|
}
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
}, [
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
|
|
108
|
-
}, []), ze =
|
|
109
|
-
|
|
110
|
-
}, [j,
|
|
111
|
-
|
|
112
|
-
}, [a]), Ve =
|
|
113
|
-
...ge,
|
|
114
|
-
...oe
|
|
115
|
-
})), [P, We] = b(() => ({
|
|
102
|
+
}, D = c().initResponse, { termsHref: Te, privacyHref: Ee, electronicCommunicationHref: De, patriotActHref: Oe } = Se ?? {}, ke = C !== null, O = Ce === void 0, [Ae, k] = y(!1), [je, Me] = y(!0), [Ne, Pe] = y(() => we ?? !1), Fe = xe ?? C?.bankLogoSrc ?? void 0, A = O ? Ne : Ce, Ie = we ?? !1, j = g((e) => {
|
|
103
|
+
O && Pe(e), w?.(e);
|
|
104
|
+
}, [w, O]), Le = g(() => {
|
|
105
|
+
T(f.OpenMarketing), k(!0);
|
|
106
|
+
}, [T]), Re = g(() => {
|
|
107
|
+
k(!1);
|
|
108
|
+
}, []), ze = g(() => {
|
|
109
|
+
T(f.BeginOnboarding), k(!1), j(!0);
|
|
110
|
+
}, [j, T]), Be = g(() => {
|
|
111
|
+
Me(!1), a();
|
|
112
|
+
}, [a]), Ve = ee(), [M, N] = y(0), [He, Ue] = y(() => ({
|
|
116
113
|
..._e,
|
|
117
|
-
...
|
|
118
|
-
})), [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
...ce
|
|
115
|
+
})), [P, We] = y(() => ({
|
|
116
|
+
...ve,
|
|
117
|
+
...be
|
|
118
|
+
})), [Ge, Ke] = y(() => S ?? []), [F, qe] = y(null), [I, Je] = y(null), [L, Ye] = y(null), [R, Xe] = y(null), [Ze, z] = y(null), [B, V] = y(!1), [H, U] = y(null), W = ue(), G = de(), K = fe(), Qe = pe(), { setClientSecret: $e } = le(), q = me(), J = he(null);
|
|
119
|
+
_(() => () => J.current?.abort(), []);
|
|
120
|
+
let et = v(() => l(E.businessDetails.naicsTitles), [E.businessDetails.naicsTitles]), tt = v(() => o(E.businessDetails.stateTitles), [E.businessDetails.stateTitles]), nt = v(() => o(E.personalDetails.stateTitles), [E.personalDetails.stateTitles]), rt = v(() => o(E.additionalOwners.stateTitles), [E.additionalOwners.stateTitles]), Y = B || H !== null, it = D?.status === "ACTIVE" || D?.status === "INACTIVE", X = D?.status === "INVITED", Z = !!D && !Y && (it || X || q.isSuppressed), Q = Z ? it ? h.UserAlreadyOnboarded : X ? h.UserInvitedToOrganization : q.reason : null;
|
|
121
|
+
if (_(() => {
|
|
122
|
+
!Z || !Q || (T(f.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
|
|
123
123
|
}, [
|
|
124
124
|
Z,
|
|
125
125
|
Q,
|
|
126
|
-
|
|
127
|
-
]), !
|
|
126
|
+
T
|
|
127
|
+
]), !D || !Y && (Z || !q.isResolved)) return null;
|
|
128
128
|
let at = F?.companyStructure === "SOLE_PROPRIETORSHIP", ot = [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
E.stepIndicator.business,
|
|
130
|
+
E.stepIndicator.personal,
|
|
131
|
+
E.stepIndicator.ownership
|
|
132
132
|
], st = M === 0 ? F : M === 1 ? I : M === 2 ? L : null, $ = W.isPending || G.isPending || K.isPending || B, ct = () => {
|
|
133
133
|
z(null), N((e) => e === 0 ? 0 : e - 1);
|
|
134
134
|
}, lt = () => {
|
|
@@ -141,7 +141,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
141
141
|
try {
|
|
142
142
|
let r = await K.mutateAsync({ path: { id: e } });
|
|
143
143
|
if (t.signal.aborted) return;
|
|
144
|
-
if (!r.id) throw Error(
|
|
144
|
+
if (!r.id) throw Error(E.submitFailedError);
|
|
145
145
|
n = !0, (await Qe(e, { signal: t.signal })).status === "complete" ? (U("success"), Ve(), Be()) : U("pending");
|
|
146
146
|
} catch (e) {
|
|
147
147
|
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
@@ -157,7 +157,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
157
157
|
if (!F) return;
|
|
158
158
|
let e = R;
|
|
159
159
|
if (!e) {
|
|
160
|
-
let t = await W.mutateAsync({ body:
|
|
160
|
+
let t = await W.mutateAsync({ body: oe(F) });
|
|
161
161
|
e = t.id, Xe(e), t.clientSecret && $e(t.clientSecret);
|
|
162
162
|
}
|
|
163
163
|
N(1);
|
|
@@ -165,7 +165,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
165
165
|
if (!I || !F || !R) return;
|
|
166
166
|
await G.mutateAsync({
|
|
167
167
|
path: { id: R },
|
|
168
|
-
body:
|
|
168
|
+
body: se({
|
|
169
169
|
businessDetails: F,
|
|
170
170
|
applicant: I
|
|
171
171
|
})
|
|
@@ -174,28 +174,28 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
174
174
|
if (!L || !R) return;
|
|
175
175
|
await G.mutateAsync({
|
|
176
176
|
path: { id: R },
|
|
177
|
-
body:
|
|
177
|
+
body: se({ businessOwners: L })
|
|
178
178
|
}), await ut(R);
|
|
179
179
|
}
|
|
180
180
|
} catch (e) {
|
|
181
|
-
let t = s(e) ?? (e instanceof Error ? e.message : void 0) ??
|
|
181
|
+
let t = s(e) ?? (e instanceof Error ? e.message : void 0) ?? E.genericRetryError;
|
|
182
182
|
z(t);
|
|
183
183
|
}
|
|
184
|
-
}, ft =
|
|
184
|
+
}, ft = ye(Math.min(M, 2), E), pt = D.bankName?.trim() || E.fallbackBankName, mt = d(E.shellFdicDisclaimer, pt);
|
|
185
185
|
if (Y) {
|
|
186
|
-
let r = F?.companyLegalName ?? "", i =
|
|
187
|
-
...
|
|
188
|
-
...
|
|
186
|
+
let r = F?.companyLegalName ?? "", i = D.bankName?.trim() || E.fallbackBankName, a = H ?? "pending", o = a === "success", s = {
|
|
187
|
+
...m.result,
|
|
188
|
+
...E.result
|
|
189
189
|
};
|
|
190
|
-
return /* @__PURE__ */
|
|
191
|
-
open:
|
|
190
|
+
return /* @__PURE__ */ b(e, {
|
|
191
|
+
open: A,
|
|
192
192
|
onOpenChange: j,
|
|
193
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ x(t, {
|
|
194
194
|
className: "ttw:grid ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:grid-rows-[1fr] ttw:gap-0 ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ b(n, {
|
|
196
196
|
className: "ttw:sr-only",
|
|
197
|
-
children:
|
|
198
|
-
}), /* @__PURE__ */
|
|
197
|
+
children: E.modalTitle
|
|
198
|
+
}), /* @__PURE__ */ b(te, {
|
|
199
199
|
status: a,
|
|
200
200
|
isLoading: B,
|
|
201
201
|
loadingMessage: s.loadingMessage,
|
|
@@ -205,32 +205,32 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
205
205
|
followUpEmail: I?.workEmail ?? "",
|
|
206
206
|
emailBoxLead: s.pendingEmailBoxLead,
|
|
207
207
|
navigateToDashboardLabel: s.navigateToDashboard,
|
|
208
|
-
bankLogoSrc:
|
|
209
|
-
bankLogoAlt:
|
|
210
|
-
fdicDisclaimer:
|
|
211
|
-
onNavigateToDashboard:
|
|
208
|
+
bankLogoSrc: Fe,
|
|
209
|
+
bankLogoAlt: d(s.bankLogoAlt, i),
|
|
210
|
+
fdicDisclaimer: d(s.fdicDisclaimer, i),
|
|
211
|
+
onNavigateToDashboard: u
|
|
212
212
|
})]
|
|
213
213
|
})
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
let ht = M === 2 ?
|
|
217
|
-
return /* @__PURE__ */
|
|
218
|
-
open:
|
|
216
|
+
let ht = M === 2 ? E.submit : E.next, gt = st === null || $;
|
|
217
|
+
return /* @__PURE__ */ x(ge, { children: [ke && je && C ? /* @__PURE__ */ b(ne, {
|
|
218
|
+
open: Ae,
|
|
219
219
|
isVisible: !0,
|
|
220
|
-
vspLogo:
|
|
221
|
-
bankingText:
|
|
222
|
-
primaryCaption:
|
|
223
|
-
secondaryCaption:
|
|
224
|
-
providedByCaption:
|
|
225
|
-
modalPrimaryImg:
|
|
226
|
-
primaryModalHeader:
|
|
227
|
-
benefits:
|
|
228
|
-
appearance:
|
|
220
|
+
vspLogo: C.vspLogo,
|
|
221
|
+
bankingText: C.bankingText,
|
|
222
|
+
primaryCaption: C.primaryCaption,
|
|
223
|
+
secondaryCaption: C.secondaryCaption,
|
|
224
|
+
providedByCaption: C.providedByCaption,
|
|
225
|
+
modalPrimaryImg: C.modalPrimaryImg,
|
|
226
|
+
primaryModalHeader: C.primaryModalHeader,
|
|
227
|
+
benefits: C.benefits,
|
|
228
|
+
appearance: C.appearance,
|
|
229
229
|
onOpenMarketingModal: Le,
|
|
230
230
|
onCloseMarketingModal: Re,
|
|
231
231
|
onPrimaryCtaClick: ze
|
|
232
|
-
}) : null, /* @__PURE__ */
|
|
233
|
-
open:
|
|
232
|
+
}) : null, /* @__PURE__ */ x(r, {
|
|
233
|
+
open: A,
|
|
234
234
|
defaultOpen: Ie,
|
|
235
235
|
onOpenChange: j,
|
|
236
236
|
title: ft.title,
|
|
@@ -248,33 +248,33 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
248
248
|
nextIcon: null,
|
|
249
249
|
errorMessage: Ze,
|
|
250
250
|
labels: {
|
|
251
|
-
backButton: M === 0 ?
|
|
252
|
-
cancelButton:
|
|
251
|
+
backButton: M === 0 ? E.cancel : E.back,
|
|
252
|
+
cancelButton: E.cancel
|
|
253
253
|
},
|
|
254
254
|
children: [
|
|
255
|
-
M === 0 ? /* @__PURE__ */
|
|
255
|
+
M === 0 ? /* @__PURE__ */ b(re, {
|
|
256
256
|
value: He,
|
|
257
257
|
onValueChange: Ue,
|
|
258
258
|
onSnapshotChange: qe,
|
|
259
259
|
naicsOptions: et,
|
|
260
260
|
stateOptions: tt,
|
|
261
261
|
isSubmitting: $,
|
|
262
|
-
labels:
|
|
262
|
+
labels: E.businessDetails,
|
|
263
263
|
bankName: pt,
|
|
264
|
-
termsHref:
|
|
265
|
-
privacyHref:
|
|
266
|
-
electronicCommunicationHref:
|
|
267
|
-
patriotActHref:
|
|
264
|
+
termsHref: Te,
|
|
265
|
+
privacyHref: Ee,
|
|
266
|
+
electronicCommunicationHref: De,
|
|
267
|
+
patriotActHref: Oe
|
|
268
268
|
}, "business") : null,
|
|
269
|
-
M === 1 ? /* @__PURE__ */
|
|
269
|
+
M === 1 ? /* @__PURE__ */ b(ie, {
|
|
270
270
|
value: P,
|
|
271
271
|
onValueChange: We,
|
|
272
272
|
onSnapshotChange: Je,
|
|
273
273
|
stateOptions: nt,
|
|
274
274
|
isSubmitting: $,
|
|
275
|
-
labels:
|
|
275
|
+
labels: E.personalDetails
|
|
276
276
|
}, "personal") : null,
|
|
277
|
-
M === 2 ? /* @__PURE__ */
|
|
277
|
+
M === 2 ? /* @__PURE__ */ b(ae, {
|
|
278
278
|
owners: Ge,
|
|
279
279
|
onOwnersChange: Ke,
|
|
280
280
|
primaryOwnerName: `${P.firstName} ${P.lastName}`.trim(),
|
|
@@ -282,30 +282,31 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
282
282
|
stateOptions: rt,
|
|
283
283
|
onSnapshotChange: Ye,
|
|
284
284
|
isSubmitting: $,
|
|
285
|
-
labels:
|
|
285
|
+
labels: E.additionalOwners
|
|
286
286
|
}) : null
|
|
287
287
|
]
|
|
288
288
|
})] });
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
return /* @__PURE__ */
|
|
290
|
+
function S({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, implementation: s, uiFramework: ee, errorFallback: c, onError: l, analytics: u, ...d }) {
|
|
291
|
+
return /* @__PURE__ */ b(a, {
|
|
292
292
|
baseUrl: e,
|
|
293
293
|
widgetToken: t,
|
|
294
294
|
organizationId: n,
|
|
295
295
|
configClient: r,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
gatewayRouting: i,
|
|
297
|
+
linkComponent: o,
|
|
298
|
+
implementation: s,
|
|
299
|
+
uiFramework: ee,
|
|
299
300
|
errorFallback: c,
|
|
300
301
|
onError: l,
|
|
301
302
|
analytics: u,
|
|
302
|
-
widgetName:
|
|
303
|
-
children: /* @__PURE__ */
|
|
303
|
+
widgetName: p,
|
|
304
|
+
children: /* @__PURE__ */ b(xe, { ...d })
|
|
304
305
|
});
|
|
305
306
|
}
|
|
306
|
-
function
|
|
307
|
-
let { initResponse: t } =
|
|
308
|
-
return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */
|
|
307
|
+
function xe(e) {
|
|
308
|
+
let { initResponse: t } = c(), n = t?.userId ?? null, [r, i] = y(n), [a, o] = y(0);
|
|
309
|
+
return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ b(ce, { children: /* @__PURE__ */ b(be, { ...e }, a) }, a);
|
|
309
310
|
}
|
|
310
311
|
//#endregion
|
|
311
|
-
export {
|
|
312
|
+
export { S as BankAccountOnboardingWidget, S as default };
|
package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js
CHANGED
|
@@ -45,20 +45,21 @@ function l({ labels: t, accountDetailsLabels: n, featureLabels: l, isBankingTagl
|
|
|
45
45
|
...C
|
|
46
46
|
})] });
|
|
47
47
|
}
|
|
48
|
-
function u({ baseUrl: e, widgetToken: r, organizationId: i, configClient: a,
|
|
48
|
+
function u({ baseUrl: e, widgetToken: r, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: c, implementation: u, uiFramework: d, errorFallback: f, onError: p, analytics: m, ...h }) {
|
|
49
49
|
return /* @__PURE__ */ s(t, {
|
|
50
50
|
widgetName: n,
|
|
51
51
|
baseUrl: e,
|
|
52
52
|
widgetToken: r,
|
|
53
53
|
organizationId: i,
|
|
54
54
|
configClient: a,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
gatewayRouting: o,
|
|
56
|
+
linkComponent: c,
|
|
57
|
+
implementation: u,
|
|
58
|
+
uiFramework: d,
|
|
59
|
+
errorFallback: f,
|
|
60
|
+
onError: p,
|
|
61
|
+
analytics: m,
|
|
62
|
+
children: /* @__PURE__ */ s(l, { ...h })
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
//#endregion
|