@tesouro/embedded-components-react 0.5.202 → 0.5.203
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 +20 -6
- package/dist/index.css +3 -0
- package/dist/index.d.ts +66 -7
- package/dist/index.js +7 -6
- package/dist/lib/MarketingWidget.d.ts +66 -7
- package/dist/lib/MarketingWidget.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js +33 -81
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index5.js +34 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index6.js +20 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js +161 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index3.js +5 -1
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index8.js +34 -81
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index9.js +92 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationApplicationStatus.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -513,15 +513,29 @@ A self-contained widget that walks an applicant through the embedded bank-accoun
|
|
|
513
513
|
|
|
514
514
|
A self-contained marketing card and modal that presents host-supplied banking product copy (logo, captions, "How it works" steps, benefits, colors). The card renders two CTAs — Apply now and Learn more — and the modal's own CTA. The host wires all three to whatever should happen next — typically opening `BankAccountOnboardingWidget`.
|
|
515
515
|
|
|
516
|
-
The widget renders nothing until widget init
|
|
516
|
+
The widget renders nothing until widget init and the organization's `application-status` read resolve. It hides itself when the caller is already onboarded (`ACTIVE` / `INACTIVE`), invited (`INVITED`), or their organization's bank-account application is `COMPLETE`.
|
|
517
|
+
|
|
518
|
+
Otherwise the card follows the organization's bank-account application:
|
|
519
|
+
|
|
520
|
+
| Application status | Started by the caller | Started by a colleague |
|
|
521
|
+
| ---------------------- | ------------------------------------------ | ------------------------------ |
|
|
522
|
+
| none | Normal offer | Normal offer |
|
|
523
|
+
| `DRAFT` | Normal offer, CTA reads Resume application | Status chip + message, no CTAs |
|
|
524
|
+
| `SUBMITTED` | Status chip + message, no CTAs | Status chip + message, no CTAs |
|
|
525
|
+
| `DENIED` | Status chip + message, no CTAs | Status chip + message, no CTAs |
|
|
526
|
+
| `DELETED` / `CANCELED` | Normal offer | Normal offer |
|
|
527
|
+
| `COMPLETE` | Hidden | Hidden |
|
|
528
|
+
|
|
529
|
+
Resume application calls the same `onPrimaryCtaClick`: `BankAccountOnboardingWidget` resumes the caller's own draft by itself. The bank's name in the messages comes from widget init (`bankName`). Tenant-specific assets and copy are always passed in as `content` — the published package does not look up white-label or bank maps.
|
|
517
530
|
|
|
518
531
|
#### Props
|
|
519
532
|
|
|
520
|
-
| Prop | Type
|
|
521
|
-
| ------------------- |
|
|
522
|
-
| `content` | `MarketingWidgetContent`
|
|
523
|
-
| `onPrimaryCtaClick` | `() => void`
|
|
524
|
-
| `labels` | `PartialDeep<MarketingWidgetLabels>`
|
|
533
|
+
| Prop | Type | Required | Description |
|
|
534
|
+
| ------------------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
535
|
+
| `content` | `MarketingWidgetContent` | Yes | Host-resolved card and modal copy, images, "How it works" steps, benefits, and appearance. |
|
|
536
|
+
| `onPrimaryCtaClick` | `() => void` | Yes | Called when the applicant clicks Apply now on the card or the modal CTA (default label: Start application). Closes the modal first. |
|
|
537
|
+
| `labels` | `PartialDeep<MarketingWidgetLabels>` | No | Override Apply now, Learn more, the modal CTA + subtext, and the modal dismiss `aria-label`. |
|
|
538
|
+
| `statusLabels` | `PartialDeep<MarketingWidgetStatusLabels>` | No | Override the Resume application label and the chip, heading and body copy of each application-status message. Heading and body are functions of `{ bankName }`. |
|
|
525
539
|
|
|
526
540
|
### ProductsWidget
|
|
527
541
|
|
package/dist/index.css
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -5163,10 +5163,63 @@ interface MarketingWidgetContent {
|
|
|
5163
5163
|
appearance: MarketingWidgetAppearance;
|
|
5164
5164
|
}
|
|
5165
5165
|
|
|
5166
|
+
/**
|
|
5167
|
+
* Values a status label can interpolate. The bank name comes from widget init
|
|
5168
|
+
* and already has its fallback applied, so a label never sees null. The rest
|
|
5169
|
+
* come from the `application-status` read, already formatted, and are absent
|
|
5170
|
+
* when it does not carry them (the dates are null for applications that
|
|
5171
|
+
* predate the backend recording them), so every label has copy for both.
|
|
5172
|
+
*
|
|
5173
|
+
* There is no applicant email: the read does not return one, so the denied
|
|
5174
|
+
* copy for the applicant's own application says "your email" instead of the
|
|
5175
|
+
* spec's "[applicant email]".
|
|
5176
|
+
*/
|
|
5177
|
+
interface MarketingStatusLabelValues {
|
|
5178
|
+
bankName: string;
|
|
5179
|
+
/** The applicant's full name, for either ownership. */
|
|
5180
|
+
applicantName?: string;
|
|
5181
|
+
/** When the application was started, formatted by `formatDate`. */
|
|
5182
|
+
startedOn?: string;
|
|
5183
|
+
/** When the application was submitted, formatted by `formatDate`. */
|
|
5184
|
+
submittedOn?: string;
|
|
5185
|
+
/** When the application was denied, formatted by `formatDate`. */
|
|
5186
|
+
deniedOn?: string;
|
|
5187
|
+
}
|
|
5188
|
+
/**
|
|
5189
|
+
* Copy for one application state: the status chip, an optional brand-colored
|
|
5190
|
+
* heading, and the lines under it.
|
|
5191
|
+
*/
|
|
5192
|
+
interface MarketingStatusNoticeLabels {
|
|
5193
|
+
chipLabel: string;
|
|
5194
|
+
/** Omit for a state whose mock has no heading (the denied states). */
|
|
5195
|
+
heading?: (values: MarketingStatusLabelValues) => string;
|
|
5196
|
+
body: (values: MarketingStatusLabelValues) => string[];
|
|
5197
|
+
}
|
|
5198
|
+
interface MarketingWidgetStatusLabels {
|
|
5199
|
+
/** Replaces the Apply CTA (card and modal) while the caller's own application is a draft. */
|
|
5200
|
+
resumeApplication: string;
|
|
5201
|
+
/** Stands in for the bank's name when widget init does not carry one. */
|
|
5202
|
+
bankNameFallback: string;
|
|
5203
|
+
/**
|
|
5204
|
+
* Formats an application date (an ISO date-time from the status read) for
|
|
5205
|
+
* the `startedOn` / `submittedOn` / `deniedOn` values. A label, not a
|
|
5206
|
+
* hardcoded formatter, so a host can localize it with the copy.
|
|
5207
|
+
*/
|
|
5208
|
+
formatDate: (isoDateTime: string) => string;
|
|
5209
|
+
draftStartedByOther: MarketingStatusNoticeLabels;
|
|
5210
|
+
submittedByYou: MarketingStatusNoticeLabels;
|
|
5211
|
+
submittedByOther: MarketingStatusNoticeLabels;
|
|
5212
|
+
deniedByYou: MarketingStatusNoticeLabels;
|
|
5213
|
+
deniedByOther: MarketingStatusNoticeLabels;
|
|
5214
|
+
}
|
|
5215
|
+
declare const MARKETING_WIDGET_STATUS_LABELS_EN: MarketingWidgetStatusLabels;
|
|
5216
|
+
|
|
5166
5217
|
type InnerProps = {
|
|
5167
5218
|
content: MarketingWidgetContent;
|
|
5168
5219
|
onPrimaryCtaClick: () => void;
|
|
5169
5220
|
labels?: PartialDeep<MarketingWidgetLabels>;
|
|
5221
|
+
/** Overrides for the copy shown when the organization already has an application. */
|
|
5222
|
+
statusLabels?: PartialDeep<MarketingWidgetStatusLabels>;
|
|
5170
5223
|
};
|
|
5171
5224
|
type MarketingWidgetProps = WidgetProviderProps & InnerProps;
|
|
5172
5225
|
/**
|
|
@@ -5174,11 +5227,17 @@ type MarketingWidgetProps = WidgetProviderProps & InnerProps;
|
|
|
5174
5227
|
* `content` (logos, copy, colors) and wire `onPrimaryCtaClick` to whatever
|
|
5175
5228
|
* should happen next — typically opening bank-account onboarding.
|
|
5176
5229
|
*
|
|
5177
|
-
* Renders nothing until widget init
|
|
5178
|
-
*
|
|
5179
|
-
*
|
|
5180
|
-
*
|
|
5181
|
-
*
|
|
5230
|
+
* Renders nothing until widget init and the organization's application
|
|
5231
|
+
* status resolve, and hides itself when the caller is already onboarded
|
|
5232
|
+
* (`ACTIVE` / `INACTIVE`), invited (`INVITED`), or their organization's
|
|
5233
|
+
* bank-account application is `COMPLETE`.
|
|
5234
|
+
*
|
|
5235
|
+
* Otherwise it follows that application's status (EMBD-6173): the caller's own
|
|
5236
|
+
* `DRAFT` renames Apply to "Resume application"; a colleague's `DRAFT`, any
|
|
5237
|
+
* `SUBMITTED` and any `DENIED` application replace the captions and CTAs
|
|
5238
|
+
* with a status chip and message; no application, or a `DELETED` / `CANCELED` one, shows the
|
|
5239
|
+
* normal offer. A `DENIED` message hides itself 30 days after the denial, and
|
|
5240
|
+
* a status this widget does not know hides the card.
|
|
5182
5241
|
*/
|
|
5183
5242
|
declare function MarketingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: MarketingWidgetProps): React.JSX.Element;
|
|
5184
5243
|
|
|
@@ -5398,5 +5457,5 @@ interface CheckAmountAndDetailScreenProps {
|
|
|
5398
5457
|
|
|
5399
5458
|
type PendingFeatureStyleSources = CheckAmountAndDetailScreenProps | GapCoverageAlertProps | NoPolicyBannerProps;
|
|
5400
5459
|
|
|
5401
|
-
export { ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, ADDITIONAL_OWNERS_LABELS_EN, AcceptDisclosuresWidget, BALANCES_WIDGET_LABELS_EN, BUSINESS_DETAILS_LABELS_EN, BalancesWidget, BankAccountOnboardingWidget, BankAccountsWidget, BillPayWidget, CardDetailsWidget, CounterpartsWidget, CreditCardsWidget, CustomersWidget, DebitCardsWidget, ERROR_STATE_ID, ExpenseManagementWidget, HELP_FAQ_EN, INSIGHTS_FEATURE_LABELS_EN, INSIGHTS_WIDGET_LABELS_EN, Implementation, InsightsWidget, ReceivablesWidgetMonite as InvoicingWidget, LinkedAccountsWidget, MARKETING_WIDGET_LABELS_EN, MarketingBenefitIcon, MarketingWidget, PERSONAL_DETAILS_LABELS_EN, ProductsWidget, RESULT_LABELS_EN, ReceivablesWidget, RefreshingRootWidgetProvider, RootWidgetProvider, SINGLE_INSIGHT_LABELS_EN, Scope, SettingsSection, SettingsWidget, DEFAULT_FEATURE_LABELS as TRANSFERS_FEATURE_LABELS_EN, TRANSFERS_WIDGET_LABELS_EN, TransfersWidget, UIFramework, UploadReceiptWidget, WIDGET_SUITE_DEFAULT_SECTIONS, WIDGET_SUITE_LABELS_EN, WidgetProvider, WidgetSuite, WidgetSuiteSectionId, WidgetTokenRefreshProvider, cloneEmbeddedClient, getGlobalWidgetConfig, getGlobalWidgetInitState, isScope, registerDesignSystemEnsurer, registerUIRenderers, setGlobalWidgetConfig, subscribeToGlobalWidgetInitState, updateGlobalWidgetConfig, useDisclosuresAcceptanceSurface, useOwnWidgetConfig, useRefetchWidget, useWidgetConfig, useWidgetError, useWidgetInitStaleForToken, useWidgetLoading, useWidgetToken };
|
|
5402
|
-
export type { AcceptDisclosuresWidgetLabels, AcceptDisclosuresWidgetProps, AccordionItemCardLabels, Labels$3 as AccountDetailsWidgetLabels, ActivateCardPanelLabels, AdditionalOwner, AdditionalOwnersLabels, AddressFormSheetLabels, BalancesWidgetLabels, BalancesWidgetProps, BankAccountFormSheetLabels, BankAccountOnboardingWidgetLabels, BankAccountOnboardingWidgetProps, FeatureLabels$3 as BankAccountsWidgetFeatureLabels, Labels$4 as BankAccountsWidgetLabels, BankAccountsWidgetProps, BillPayWidgetProps, BusinessDetailsLabels, BusinessDetailsValues, CardDetailsFeatureLabels, CardDetailsPanelLabels as CardDetailsWidgetLabels, CardDetailsWidgetProps, CardsFeatureLabels, CardsListLabels as CardsLabels, CardsPagination, CompanyStructureValue, ConfirmDeleteDialogLabels, CounterpartActionTarget, CounterpartDetailsSheetLabels, CounterpartFormSheetLabels, CounterpartMessageLabels, CounterpartMode, CounterpartsScreenLabels, CounterpartsWidgetProps, CreditCardsWidgetProps, CustomersWidgetOwnProps, CustomersWidgetProps, DebitCardsWidgetProps, DisclosureLinks, EmbeddedClient, Labels$2 as ExpenseManagementWidgetLabels, ExpenseManagementWidgetProps, FileViewerLabels, HelpFaqAnswer, HelpFaqBullet, HelpFaqBulletType, HelpFaqItem, HelpFaqSection, InsightsFeatureLabels, InsightsWidgetLabels, InsightsWidgetProps, ReceivablesWidgetMoniteProps as InvoicingWidgetProps, LinkComponent, LinkComponentProps, FeatureLabels$2 as LinkedAccountsWidgetFeatureLabels, Labels$1 as LinkedAccountsWidgetLabels, LinkedAccountsWidgetProps, MarketingWidgetAppearance, MarketingWidgetBenefit, MarketingWidgetContent, MarketingWidgetHowItWorksStep, MarketingWidgetImage, MarketingWidgetLabels, MarketingWidgetProps, MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, PendingFeatureStyleSources, PersonalDetailsLabels, PersonalDetailsValues, ProductDeleteDialogLabels, ProductDetailsSheetLabels, ProductFormSheetLabels, ProductMessageLabels, ProductsScreenLabels, ProductsWidgetProps, ReceiptMatchSummary, ReceivableActionDialogLabels, ReceivableDetailsSheetLabelOverrides, ReceivableDetailsSheetLabels, ReceivableDocumentType, ReceivableFormSheetLabels, ReceivableMessageLabels, ReceivablePaymentDialogLabels, ReceivableSendDialogLabels, ReceivableStatusBadgeLabels, ReceivablesScreenLabelOverrides, ReceivablesScreenLabels, ReceivablesWidgetProps, ReceivablesWidgetTab, RefreshingRootWidgetProviderProps, ResultLabels, RootWidgetProviderProps, SettingsWidgetAdditionalSection, FeatureLabels$1 as SettingsWidgetFeatureLabels, Labels as SettingsWidgetLabels, SettingsWidgetProps, SettingsWidgetSection, SettingsWidgetSectionId, SingleInsightLabels, TransactionDetailsActionsLabels, TransactionDetailsLabels, FeatureLabels as TransfersWidgetFeatureLabels, TransfersWidgetLabels, TransfersWidgetProps, UploadReceiptWidgetProps, WidgetConfig, WidgetConfigInput, WidgetInitResponse, WidgetInitState, WidgetProviderLabels, WidgetProviderProps, WidgetSuiteCardsLabels, WidgetSuiteDashboardLabels, WidgetSuiteDisclosureLabels, WidgetSuiteExpensesLabels, WidgetSuiteLabelOverrides, WidgetSuiteLabels, WidgetSuiteMenuLabels, WidgetSuiteOnboardingGateLabels, WidgetSuiteOnboardingLabels, WidgetSuiteProps, WidgetSuiteSectionContentLabels, WidgetSuiteSectionTitleLabels, WidgetTokenFetcher, WidgetTokenManager, WidgetTokenRefreshProviderProps, WidgetTokenState };
|
|
5460
|
+
export { ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, ADDITIONAL_OWNERS_LABELS_EN, AcceptDisclosuresWidget, BALANCES_WIDGET_LABELS_EN, BUSINESS_DETAILS_LABELS_EN, BalancesWidget, BankAccountOnboardingWidget, BankAccountsWidget, BillPayWidget, CardDetailsWidget, CounterpartsWidget, CreditCardsWidget, CustomersWidget, DebitCardsWidget, ERROR_STATE_ID, ExpenseManagementWidget, HELP_FAQ_EN, INSIGHTS_FEATURE_LABELS_EN, INSIGHTS_WIDGET_LABELS_EN, Implementation, InsightsWidget, ReceivablesWidgetMonite as InvoicingWidget, LinkedAccountsWidget, MARKETING_WIDGET_LABELS_EN, MARKETING_WIDGET_STATUS_LABELS_EN, MarketingBenefitIcon, MarketingWidget, PERSONAL_DETAILS_LABELS_EN, ProductsWidget, RESULT_LABELS_EN, ReceivablesWidget, RefreshingRootWidgetProvider, RootWidgetProvider, SINGLE_INSIGHT_LABELS_EN, Scope, SettingsSection, SettingsWidget, DEFAULT_FEATURE_LABELS as TRANSFERS_FEATURE_LABELS_EN, TRANSFERS_WIDGET_LABELS_EN, TransfersWidget, UIFramework, UploadReceiptWidget, WIDGET_SUITE_DEFAULT_SECTIONS, WIDGET_SUITE_LABELS_EN, WidgetProvider, WidgetSuite, WidgetSuiteSectionId, WidgetTokenRefreshProvider, cloneEmbeddedClient, getGlobalWidgetConfig, getGlobalWidgetInitState, isScope, registerDesignSystemEnsurer, registerUIRenderers, setGlobalWidgetConfig, subscribeToGlobalWidgetInitState, updateGlobalWidgetConfig, useDisclosuresAcceptanceSurface, useOwnWidgetConfig, useRefetchWidget, useWidgetConfig, useWidgetError, useWidgetInitStaleForToken, useWidgetLoading, useWidgetToken };
|
|
5461
|
+
export type { AcceptDisclosuresWidgetLabels, AcceptDisclosuresWidgetProps, AccordionItemCardLabels, Labels$3 as AccountDetailsWidgetLabels, ActivateCardPanelLabels, AdditionalOwner, AdditionalOwnersLabels, AddressFormSheetLabels, BalancesWidgetLabels, BalancesWidgetProps, BankAccountFormSheetLabels, BankAccountOnboardingWidgetLabels, BankAccountOnboardingWidgetProps, FeatureLabels$3 as BankAccountsWidgetFeatureLabels, Labels$4 as BankAccountsWidgetLabels, BankAccountsWidgetProps, BillPayWidgetProps, BusinessDetailsLabels, BusinessDetailsValues, CardDetailsFeatureLabels, CardDetailsPanelLabels as CardDetailsWidgetLabels, CardDetailsWidgetProps, CardsFeatureLabels, CardsListLabels as CardsLabels, CardsPagination, CompanyStructureValue, ConfirmDeleteDialogLabels, CounterpartActionTarget, CounterpartDetailsSheetLabels, CounterpartFormSheetLabels, CounterpartMessageLabels, CounterpartMode, CounterpartsScreenLabels, CounterpartsWidgetProps, CreditCardsWidgetProps, CustomersWidgetOwnProps, CustomersWidgetProps, DebitCardsWidgetProps, DisclosureLinks, EmbeddedClient, Labels$2 as ExpenseManagementWidgetLabels, ExpenseManagementWidgetProps, FileViewerLabels, HelpFaqAnswer, HelpFaqBullet, HelpFaqBulletType, HelpFaqItem, HelpFaqSection, InsightsFeatureLabels, InsightsWidgetLabels, InsightsWidgetProps, ReceivablesWidgetMoniteProps as InvoicingWidgetProps, LinkComponent, LinkComponentProps, FeatureLabels$2 as LinkedAccountsWidgetFeatureLabels, Labels$1 as LinkedAccountsWidgetLabels, LinkedAccountsWidgetProps, MarketingStatusLabelValues, MarketingStatusNoticeLabels, MarketingWidgetAppearance, MarketingWidgetBenefit, MarketingWidgetContent, MarketingWidgetHowItWorksStep, MarketingWidgetImage, MarketingWidgetLabels, MarketingWidgetProps, MarketingWidgetStatusLabels, MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, PendingFeatureStyleSources, PersonalDetailsLabels, PersonalDetailsValues, ProductDeleteDialogLabels, ProductDetailsSheetLabels, ProductFormSheetLabels, ProductMessageLabels, ProductsScreenLabels, ProductsWidgetProps, ReceiptMatchSummary, ReceivableActionDialogLabels, ReceivableDetailsSheetLabelOverrides, ReceivableDetailsSheetLabels, ReceivableDocumentType, ReceivableFormSheetLabels, ReceivableMessageLabels, ReceivablePaymentDialogLabels, ReceivableSendDialogLabels, ReceivableStatusBadgeLabels, ReceivablesScreenLabelOverrides, ReceivablesScreenLabels, ReceivablesWidgetProps, ReceivablesWidgetTab, RefreshingRootWidgetProviderProps, ResultLabels, RootWidgetProviderProps, SettingsWidgetAdditionalSection, FeatureLabels$1 as SettingsWidgetFeatureLabels, Labels as SettingsWidgetLabels, SettingsWidgetProps, SettingsWidgetSection, SettingsWidgetSectionId, SingleInsightLabels, TransactionDetailsActionsLabels, TransactionDetailsLabels, FeatureLabels as TransfersWidgetFeatureLabels, TransfersWidgetLabels, TransfersWidgetProps, UploadReceiptWidgetProps, WidgetConfig, WidgetConfigInput, WidgetInitResponse, WidgetInitState, WidgetProviderLabels, WidgetProviderProps, WidgetSuiteCardsLabels, WidgetSuiteDashboardLabels, WidgetSuiteDisclosureLabels, WidgetSuiteExpensesLabels, WidgetSuiteLabelOverrides, WidgetSuiteLabels, WidgetSuiteMenuLabels, WidgetSuiteOnboardingGateLabels, WidgetSuiteOnboardingLabels, WidgetSuiteProps, WidgetSuiteSectionContentLabels, WidgetSuiteSectionTitleLabels, WidgetTokenFetcher, WidgetTokenManager, WidgetTokenRefreshProviderProps, WidgetTokenState };
|
package/dist/index.js
CHANGED
|
@@ -61,16 +61,17 @@ import "./lib/InsightsWidget.js";
|
|
|
61
61
|
import "./lib/InvoicingWidget.js";
|
|
62
62
|
import "./lib/LinkedAccountsWidget.js";
|
|
63
63
|
import "./lib/BankAccountOnboardingWidget.js";
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
64
|
+
import { MARKETING_WIDGET_STATUS_LABELS_EN as ae } from "./libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js";
|
|
65
|
+
import { MARKETING_WIDGET_LABELS_EN as oe } from "./libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index2.js";
|
|
66
|
+
import { MarketingBenefitIcon as se } from "./libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index3.js";
|
|
67
|
+
import { MarketingWidget as ce } from "./libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js";
|
|
67
68
|
import "./lib/MarketingWidget.js";
|
|
68
|
-
import { ProductsWidget as
|
|
69
|
+
import { ProductsWidget as le } from "./libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js";
|
|
69
70
|
import "./lib/ProductsWidget.js";
|
|
70
71
|
import "./lib/ReceivablesWidget.js";
|
|
71
72
|
import "./lib/SettingsWidget.js";
|
|
72
73
|
import "./lib/TransfersWidget.js";
|
|
73
|
-
import { WidgetProvider as
|
|
74
|
+
import { WidgetProvider as ue } from "./lib/WidgetProviderPublic.js";
|
|
74
75
|
import "./lib/WidgetProvider.js";
|
|
75
76
|
import "./packages/tesouro-embedded-components-react/src/scopes.js";
|
|
76
|
-
export { Y as ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, Z as ADDITIONAL_OWNERS_LABELS_EN, X as AcceptDisclosuresWidget, M as BALANCES_WIDGET_LABELS_EN, Q as BUSINESS_DETAILS_LABELS_EN, N as BalancesWidget, te as BankAccountOnboardingWidget, D as BankAccountsWidget, O as BillPayWidget, k as CardDetailsWidget, re as CounterpartsWidget, A as CreditCardsWidget, ie as CustomersWidget, j as DebitCardsWidget, l as ERROR_STATE_ID, z as ExpenseManagementWidget, U as HELP_FAQ_EN, P as INSIGHTS_FEATURE_LABELS_EN, F as INSIGHTS_WIDGET_LABELS_EN, u as Implementation, L as InsightsWidget, B as InvoicingWidget, G as LinkedAccountsWidget,
|
|
77
|
+
export { Y as ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, Z as ADDITIONAL_OWNERS_LABELS_EN, X as AcceptDisclosuresWidget, M as BALANCES_WIDGET_LABELS_EN, Q as BUSINESS_DETAILS_LABELS_EN, N as BalancesWidget, te as BankAccountOnboardingWidget, D as BankAccountsWidget, O as BillPayWidget, k as CardDetailsWidget, re as CounterpartsWidget, A as CreditCardsWidget, ie as CustomersWidget, j as DebitCardsWidget, l as ERROR_STATE_ID, z as ExpenseManagementWidget, U as HELP_FAQ_EN, P as INSIGHTS_FEATURE_LABELS_EN, F as INSIGHTS_WIDGET_LABELS_EN, u as Implementation, L as InsightsWidget, B as InvoicingWidget, G as LinkedAccountsWidget, oe as MARKETING_WIDGET_LABELS_EN, ae as MARKETING_WIDGET_STATUS_LABELS_EN, se as MarketingBenefitIcon, ce as MarketingWidget, $ as PERSONAL_DETAILS_LABELS_EN, le as ProductsWidget, ee as RESULT_LABELS_EN, V as ReceivablesWidget, y as RefreshingRootWidgetProvider, g as RootWidgetProvider, I as SINGLE_INSIGHT_LABELS_EN, i as Scope, H as SettingsSection, W as SettingsWidget, K as TRANSFERS_FEATURE_LABELS_EN, q as TRANSFERS_WIDGET_LABELS_EN, J as TransfersWidget, o as UIFramework, R as UploadReceiptWidget, t as WIDGET_SUITE_DEFAULT_SECTIONS, e as WIDGET_SUITE_LABELS_EN, ue as WidgetProvider, ne as WidgetSuite, n as WidgetSuiteSectionId, _ as WidgetTokenRefreshProvider, r as cloneEmbeddedClient, d as getGlobalWidgetConfig, m as getGlobalWidgetInitState, a as isScope, s as registerDesignSystemEnsurer, c as registerUIRenderers, f as setGlobalWidgetConfig, h as subscribeToGlobalWidgetInitState, p as updateGlobalWidgetConfig, b as useDisclosuresAcceptanceSurface, x as useOwnWidgetConfig, S as useRefetchWidget, C as useWidgetConfig, w as useWidgetError, T as useWidgetInitStaleForToken, E as useWidgetLoading, v as useWidgetToken };
|
|
@@ -688,10 +688,63 @@ interface WidgetProviderProps extends WidgetProviderBaseProps {
|
|
|
688
688
|
providerLabels?: Partial<WidgetProviderLabels>;
|
|
689
689
|
}
|
|
690
690
|
|
|
691
|
+
/**
|
|
692
|
+
* Values a status label can interpolate. The bank name comes from widget init
|
|
693
|
+
* and already has its fallback applied, so a label never sees null. The rest
|
|
694
|
+
* come from the `application-status` read, already formatted, and are absent
|
|
695
|
+
* when it does not carry them (the dates are null for applications that
|
|
696
|
+
* predate the backend recording them), so every label has copy for both.
|
|
697
|
+
*
|
|
698
|
+
* There is no applicant email: the read does not return one, so the denied
|
|
699
|
+
* copy for the applicant's own application says "your email" instead of the
|
|
700
|
+
* spec's "[applicant email]".
|
|
701
|
+
*/
|
|
702
|
+
interface MarketingStatusLabelValues {
|
|
703
|
+
bankName: string;
|
|
704
|
+
/** The applicant's full name, for either ownership. */
|
|
705
|
+
applicantName?: string;
|
|
706
|
+
/** When the application was started, formatted by `formatDate`. */
|
|
707
|
+
startedOn?: string;
|
|
708
|
+
/** When the application was submitted, formatted by `formatDate`. */
|
|
709
|
+
submittedOn?: string;
|
|
710
|
+
/** When the application was denied, formatted by `formatDate`. */
|
|
711
|
+
deniedOn?: string;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Copy for one application state: the status chip, an optional brand-colored
|
|
715
|
+
* heading, and the lines under it.
|
|
716
|
+
*/
|
|
717
|
+
interface MarketingStatusNoticeLabels {
|
|
718
|
+
chipLabel: string;
|
|
719
|
+
/** Omit for a state whose mock has no heading (the denied states). */
|
|
720
|
+
heading?: (values: MarketingStatusLabelValues) => string;
|
|
721
|
+
body: (values: MarketingStatusLabelValues) => string[];
|
|
722
|
+
}
|
|
723
|
+
interface MarketingWidgetStatusLabels {
|
|
724
|
+
/** Replaces the Apply CTA (card and modal) while the caller's own application is a draft. */
|
|
725
|
+
resumeApplication: string;
|
|
726
|
+
/** Stands in for the bank's name when widget init does not carry one. */
|
|
727
|
+
bankNameFallback: string;
|
|
728
|
+
/**
|
|
729
|
+
* Formats an application date (an ISO date-time from the status read) for
|
|
730
|
+
* the `startedOn` / `submittedOn` / `deniedOn` values. A label, not a
|
|
731
|
+
* hardcoded formatter, so a host can localize it with the copy.
|
|
732
|
+
*/
|
|
733
|
+
formatDate: (isoDateTime: string) => string;
|
|
734
|
+
draftStartedByOther: MarketingStatusNoticeLabels;
|
|
735
|
+
submittedByYou: MarketingStatusNoticeLabels;
|
|
736
|
+
submittedByOther: MarketingStatusNoticeLabels;
|
|
737
|
+
deniedByYou: MarketingStatusNoticeLabels;
|
|
738
|
+
deniedByOther: MarketingStatusNoticeLabels;
|
|
739
|
+
}
|
|
740
|
+
declare const MARKETING_WIDGET_STATUS_LABELS_EN: MarketingWidgetStatusLabels;
|
|
741
|
+
|
|
691
742
|
type InnerProps = {
|
|
692
743
|
content: MarketingWidgetContent;
|
|
693
744
|
onPrimaryCtaClick: () => void;
|
|
694
745
|
labels?: PartialDeep<MarketingWidgetLabels>;
|
|
746
|
+
/** Overrides for the copy shown when the organization already has an application. */
|
|
747
|
+
statusLabels?: PartialDeep<MarketingWidgetStatusLabels>;
|
|
695
748
|
};
|
|
696
749
|
type MarketingWidgetProps = WidgetProviderProps & InnerProps;
|
|
697
750
|
/**
|
|
@@ -699,13 +752,19 @@ type MarketingWidgetProps = WidgetProviderProps & InnerProps;
|
|
|
699
752
|
* `content` (logos, copy, colors) and wire `onPrimaryCtaClick` to whatever
|
|
700
753
|
* should happen next — typically opening bank-account onboarding.
|
|
701
754
|
*
|
|
702
|
-
* Renders nothing until widget init
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
755
|
+
* Renders nothing until widget init and the organization's application
|
|
756
|
+
* status resolve, and hides itself when the caller is already onboarded
|
|
757
|
+
* (`ACTIVE` / `INACTIVE`), invited (`INVITED`), or their organization's
|
|
758
|
+
* bank-account application is `COMPLETE`.
|
|
759
|
+
*
|
|
760
|
+
* Otherwise it follows that application's status (EMBD-6173): the caller's own
|
|
761
|
+
* `DRAFT` renames Apply to "Resume application"; a colleague's `DRAFT`, any
|
|
762
|
+
* `SUBMITTED` and any `DENIED` application replace the captions and CTAs
|
|
763
|
+
* with a status chip and message; no application, or a `DELETED` / `CANCELED` one, shows the
|
|
764
|
+
* normal offer. A `DENIED` message hides itself 30 days after the denial, and
|
|
765
|
+
* a status this widget does not know hides the card.
|
|
707
766
|
*/
|
|
708
767
|
declare function MarketingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: MarketingWidgetProps): React.JSX.Element;
|
|
709
768
|
|
|
710
|
-
export { MARKETING_WIDGET_LABELS_EN, MarketingBenefitIcon, MarketingWidget };
|
|
711
|
-
export type { MarketingWidgetAppearance, MarketingWidgetBenefit, MarketingWidgetContent, MarketingWidgetHowItWorksStep, MarketingWidgetImage, MarketingWidgetLabels, MarketingWidgetProps };
|
|
769
|
+
export { MARKETING_WIDGET_LABELS_EN, MARKETING_WIDGET_STATUS_LABELS_EN, MarketingBenefitIcon, MarketingWidget };
|
|
770
|
+
export type { MarketingStatusLabelValues, MarketingStatusNoticeLabels, MarketingWidgetAppearance, MarketingWidgetBenefit, MarketingWidgetContent, MarketingWidgetHowItWorksStep, MarketingWidgetImage, MarketingWidgetLabels, MarketingWidgetProps, MarketingWidgetStatusLabels };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { MARKETING_WIDGET_STATUS_LABELS_EN as e } from "../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js";
|
|
2
|
+
import { MARKETING_WIDGET_LABELS_EN as t } from "../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index2.js";
|
|
3
|
+
import { MarketingBenefitIcon as n } from "../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index3.js";
|
|
4
|
+
import { MarketingWidget as r } from "../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js";
|
|
4
5
|
import "../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js";
|
|
5
|
-
export {
|
|
6
|
+
export { t as MARKETING_WIDGET_LABELS_EN, e as MARKETING_WIDGET_STATUS_LABELS_EN, n as MarketingBenefitIcon, r as MarketingWidget };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { MARKETING_WIDGET_STATUS_LABELS_EN as e } from "./index4.js";
|
|
2
|
+
import { MARKETING_WIDGET_LABELS_EN as t } from "../../ui/dist/index2.js";
|
|
3
|
+
import { MarketingBenefitIcon as n } from "../../ui/dist/index3.js";
|
|
4
|
+
import { MarketingWidget as r } from "./index7.js";
|
|
5
|
+
export { t as MARKETING_WIDGET_LABELS_EN, e as MARKETING_WIDGET_STATUS_LABELS_EN, n as MarketingBenefitIcon, r as MarketingWidget };
|
|
@@ -3,6 +3,7 @@ var e = {
|
|
|
3
3
|
root: "marketing-widget",
|
|
4
4
|
learnMoreButton: "marketing-widget-learn-more-button",
|
|
5
5
|
applyNowButton: "marketing-widget-apply-now-button",
|
|
6
|
+
statusMessage: "marketing-widget-status-message",
|
|
6
7
|
modal: "marketing-widget-modal",
|
|
7
8
|
primaryCtaButton: "marketing-widget-primary-cta-button"
|
|
8
9
|
};
|
|
@@ -1,85 +1,37 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { useOrganizationOnboardingSuppression as e } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
6
|
-
import "../../../shared/data-access/dist/index.js";
|
|
7
|
-
import { useAnalyticsTrack as t } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
8
|
-
import { WidgetProvider as n } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
9
|
-
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
-
import "../../../shared/feature/dist/index.js";
|
|
11
|
-
import { MarketingWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index2.js";
|
|
12
|
-
import { marketingWidgetTestIds as o } from "./index3.js";
|
|
13
|
-
import { MARKETING_WIDGET_LABELS_EN as s } from "../../ui/dist/index2.js";
|
|
14
|
-
import { MarketingBenefitIcon as c } from "../../ui/dist/index3.js";
|
|
15
|
-
import { MarketingWidget as l } from "../../ui/dist/index8.js";
|
|
16
|
-
import "../../ui/dist/index.js";
|
|
17
|
-
import { useCallback as u, useEffect as d, useState as f } from "react";
|
|
18
|
-
import { jsx as p } from "react/jsx-runtime";
|
|
19
1
|
//#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"INACTIVE",
|
|
23
|
-
"INVITED"
|
|
24
|
-
]);
|
|
25
|
-
function h({ content: n, onPrimaryCtaClick: a, labels: s }) {
|
|
26
|
-
let c = t(), { initResponse: h } = r(), g = e(), [_, v] = f(!1);
|
|
27
|
-
d(() => {
|
|
28
|
-
c(i.Mounted);
|
|
29
|
-
}, [c]);
|
|
30
|
-
let y = u(() => {
|
|
31
|
-
c(i.OpenModal), v(!0);
|
|
32
|
-
}, [c]), b = u(() => {
|
|
33
|
-
v(!1);
|
|
34
|
-
}, []), x = u(() => {
|
|
35
|
-
c(i.PrimaryCta), v(!1), a();
|
|
36
|
-
}, [a, c]);
|
|
37
|
-
return !h?.status || m.has(h.status) || g.isSuppressed || !g.isResolved ? null : /* @__PURE__ */ p(l, {
|
|
38
|
-
open: _,
|
|
39
|
-
vspLogo: n.vspLogo,
|
|
40
|
-
bankingText: n.bankingText,
|
|
41
|
-
primaryCaption: n.primaryCaption,
|
|
42
|
-
secondaryCaption: n.secondaryCaption,
|
|
43
|
-
providedByCaption: n.providedByCaption,
|
|
44
|
-
primaryModalHeader: n.primaryModalHeader,
|
|
45
|
-
howItWorksHeader: n.howItWorksHeader,
|
|
46
|
-
howItWorksSteps: n.howItWorksSteps,
|
|
47
|
-
fromDayOneHeader: n.fromDayOneHeader,
|
|
48
|
-
benefits: n.benefits,
|
|
49
|
-
appearance: n.appearance,
|
|
50
|
-
onOpenMarketingModal: y,
|
|
51
|
-
onCloseMarketingModal: b,
|
|
52
|
-
onPrimaryCtaClick: x,
|
|
53
|
-
labels: s,
|
|
54
|
-
testIds: {
|
|
55
|
-
root: o.root,
|
|
56
|
-
learnMoreButton: o.learnMoreButton,
|
|
57
|
-
applyNowButton: o.applyNowButton,
|
|
58
|
-
modal: {
|
|
59
|
-
root: o.modal,
|
|
60
|
-
primaryCtaButton: o.primaryCtaButton
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
64
4
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
67
|
-
widgetName: a,
|
|
68
|
-
baseUrl: e,
|
|
69
|
-
widgetToken: t,
|
|
70
|
-
organizationId: r,
|
|
71
|
-
configClient: i,
|
|
72
|
-
gatewayRouting: o,
|
|
73
|
-
linkComponent: s,
|
|
74
|
-
implementation: c,
|
|
75
|
-
uiFramework: l,
|
|
76
|
-
errorFallback: u,
|
|
77
|
-
onError: d,
|
|
78
|
-
analytics: f,
|
|
79
|
-
disclosuresAcceptance: m,
|
|
80
|
-
providerLabels: g,
|
|
81
|
-
children: /* @__PURE__ */ p(h, { ..._ })
|
|
82
|
-
});
|
|
5
|
+
function t({ applicantName: e, submittedOn: t }) {
|
|
6
|
+
return e && t ? [`Submitted by ${e} on ${t}.`] : e ? [`Submitted by ${e}.`] : t ? [`Submitted on ${t}.`] : [];
|
|
83
7
|
}
|
|
8
|
+
var n = {
|
|
9
|
+
chipLabel: "Under review",
|
|
10
|
+
heading: ({ bankName: e }) => `Your business's application is with ${e}.`,
|
|
11
|
+
body: (e) => [...t(e), `${e.applicantName ?? "The applicant"} will be contacted with updates.`]
|
|
12
|
+
}, r = {
|
|
13
|
+
resumeApplication: "Resume application",
|
|
14
|
+
bankNameFallback: "the bank",
|
|
15
|
+
formatDate: (e) => new Date(e).toLocaleDateString("en-US", {
|
|
16
|
+
month: "short",
|
|
17
|
+
day: "numeric",
|
|
18
|
+
year: "numeric"
|
|
19
|
+
}),
|
|
20
|
+
draftStartedByOther: {
|
|
21
|
+
chipLabel: "Application in progress",
|
|
22
|
+
heading: ({ startedOn: e }) => e ? `Your business already started applying on ${e}.` : "Your business already started applying.",
|
|
23
|
+
body: () => ["Only the user who started the application can finish it. If someone else needs to apply instead, the original applicant can cancel theirs so someone else can start one."]
|
|
24
|
+
},
|
|
25
|
+
submittedByYou: n,
|
|
26
|
+
submittedByOther: n,
|
|
27
|
+
deniedByYou: {
|
|
28
|
+
chipLabel: "Not approved",
|
|
29
|
+
body: ({ deniedOn: e }) => [e ? `Application denied on ${e}. Details have been sent to your email.` : "Application denied. Details have been sent to your email."]
|
|
30
|
+
},
|
|
31
|
+
deniedByOther: {
|
|
32
|
+
chipLabel: "Not approved",
|
|
33
|
+
body: ({ bankName: t, applicantName: n }) => [`${e(t)} was unable to approve your business's application.`, `${n ?? "The applicant"} has the details.`]
|
|
34
|
+
}
|
|
35
|
+
};
|
|
84
36
|
//#endregion
|
|
85
|
-
export {
|
|
37
|
+
export { r as MARKETING_WIDGET_STATUS_LABELS_EN };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index5.js
|
|
2
|
+
var e = {
|
|
3
|
+
Offer: "offer",
|
|
4
|
+
Resume: "resume",
|
|
5
|
+
DraftStartedByOther: "draftStartedByOther",
|
|
6
|
+
SubmittedByYou: "submittedByYou",
|
|
7
|
+
SubmittedByOther: "submittedByOther",
|
|
8
|
+
DeniedByYou: "deniedByYou",
|
|
9
|
+
DeniedByOther: "deniedByOther",
|
|
10
|
+
Hidden: "hidden"
|
|
11
|
+
}, t = 2592e6;
|
|
12
|
+
function n(e) {
|
|
13
|
+
if (e?.status !== "DENIED") return null;
|
|
14
|
+
let n = Date.parse(e.deniedAt ?? e.updatedAt);
|
|
15
|
+
return Number.isFinite(n) ? n + t : null;
|
|
16
|
+
}
|
|
17
|
+
function r(t, r = Date.now()) {
|
|
18
|
+
if (!t) return e.Offer;
|
|
19
|
+
let i = t.ownership === "STARTED_BY_YOU";
|
|
20
|
+
switch (t.status) {
|
|
21
|
+
case "COMPLETE": return e.Hidden;
|
|
22
|
+
case "DRAFT": return i ? e.Resume : e.DraftStartedByOther;
|
|
23
|
+
case "SUBMITTED": return i ? e.SubmittedByYou : e.SubmittedByOther;
|
|
24
|
+
case "DENIED": {
|
|
25
|
+
let a = n(t);
|
|
26
|
+
return a !== null && r > a ? e.Hidden : i ? e.DeniedByYou : e.DeniedByOther;
|
|
27
|
+
}
|
|
28
|
+
case "DELETED":
|
|
29
|
+
case "CANCELED": return e.Offer;
|
|
30
|
+
default: return e.Hidden;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { t as DENIED_NOTICE_DURATION_MS, e as MarketingApplicationView, n as deniedNoticeExpiresAt, r as marketingApplicationViewFor };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index6.js
|
|
2
|
+
var e = [
|
|
3
|
+
"COMPLETE",
|
|
4
|
+
"SUBMITTED",
|
|
5
|
+
"DRAFT",
|
|
6
|
+
"DENIED"
|
|
7
|
+
], t = /* @__PURE__ */ new Set(["DELETED", "CANCELED"]);
|
|
8
|
+
function n(e) {
|
|
9
|
+
return e.find((e) => e.ownership === "STARTED_BY_YOU") ?? e[0] ?? null;
|
|
10
|
+
}
|
|
11
|
+
function r(r) {
|
|
12
|
+
let i = r.filter((e) => e.product === "BANK_ACCOUNT" && !t.has(e.status));
|
|
13
|
+
for (let t of e) {
|
|
14
|
+
let e = i.filter((e) => e.status === t);
|
|
15
|
+
if (e.length > 0) return n(e);
|
|
16
|
+
}
|
|
17
|
+
return n(i);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { r as selectBankAccountApplication };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useOrganizationApplicationStatus as e } from "../../../shared/data-access/dist/lib/useOrganizationApplicationStatus.js";
|
|
6
|
+
import "../../../shared/data-access/dist/index.js";
|
|
7
|
+
import { useAnalyticsTrack as t } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
8
|
+
import { WidgetProvider as n } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
9
|
+
import { useWidgetConfig as r, useWidgetInitStaleForToken as i } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
+
import "../../../shared/feature/dist/index.js";
|
|
11
|
+
import { MARKETING_WIDGET_STATUS_LABELS_EN as a } from "./index4.js";
|
|
12
|
+
import { MarketingWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "./index2.js";
|
|
13
|
+
import { marketingWidgetTestIds as c } from "./index3.js";
|
|
14
|
+
import { MarketingApplicationView as l, deniedNoticeExpiresAt as u, marketingApplicationViewFor as d } from "./index5.js";
|
|
15
|
+
import { selectBankAccountApplication as f } from "./index6.js";
|
|
16
|
+
import { MARKETING_WIDGET_LABELS_EN as p } from "../../ui/dist/index2.js";
|
|
17
|
+
import { MarketingBenefitIcon as m, MarketingWidgetStatusTone as h } from "../../ui/dist/index3.js";
|
|
18
|
+
import { MarketingWidget as g } from "../../ui/dist/index9.js";
|
|
19
|
+
import "../../ui/dist/index.js";
|
|
20
|
+
import { useCallback as _, useEffect as v, useMemo as y, useReducer as b, useState as x } from "react";
|
|
21
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
22
|
+
//#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js
|
|
23
|
+
var C = 2 ** 31 - 1, w = /* @__PURE__ */ new Set([
|
|
24
|
+
"ACTIVE",
|
|
25
|
+
"INACTIVE",
|
|
26
|
+
"INVITED"
|
|
27
|
+
]), T = {
|
|
28
|
+
[l.DraftStartedByOther]: "draftStartedByOther",
|
|
29
|
+
[l.SubmittedByYou]: "submittedByYou",
|
|
30
|
+
[l.SubmittedByOther]: "submittedByOther",
|
|
31
|
+
[l.DeniedByYou]: "deniedByYou",
|
|
32
|
+
[l.DeniedByOther]: "deniedByOther"
|
|
33
|
+
}, E = {
|
|
34
|
+
[l.DraftStartedByOther]: h.Brand,
|
|
35
|
+
[l.SubmittedByYou]: h.Warning,
|
|
36
|
+
[l.SubmittedByOther]: h.Warning,
|
|
37
|
+
[l.DeniedByYou]: h.Danger,
|
|
38
|
+
[l.DeniedByOther]: h.Danger
|
|
39
|
+
};
|
|
40
|
+
function D(e) {
|
|
41
|
+
return e in T;
|
|
42
|
+
}
|
|
43
|
+
function O(e) {
|
|
44
|
+
let t = a, n = (n) => ({
|
|
45
|
+
...t[n],
|
|
46
|
+
...e?.[n]
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
resumeApplication: e?.resumeApplication ?? t.resumeApplication,
|
|
50
|
+
bankNameFallback: e?.bankNameFallback ?? t.bankNameFallback,
|
|
51
|
+
formatDate: e?.formatDate ?? t.formatDate,
|
|
52
|
+
draftStartedByOther: n("draftStartedByOther"),
|
|
53
|
+
submittedByYou: n("submittedByYou"),
|
|
54
|
+
submittedByOther: n("submittedByOther"),
|
|
55
|
+
deniedByYou: n("deniedByYou"),
|
|
56
|
+
deniedByOther: n("deniedByOther")
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function k(e, t, n) {
|
|
60
|
+
let r = (e) => e ? n(e) : void 0;
|
|
61
|
+
return {
|
|
62
|
+
bankName: t,
|
|
63
|
+
applicantName: [e?.applicantFirstName, e?.applicantLastName].map((e) => e?.trim()).filter(Boolean).join(" ") || void 0,
|
|
64
|
+
startedOn: r(e?.createdAt),
|
|
65
|
+
submittedOn: r(e?.submittedAt),
|
|
66
|
+
deniedOn: r(e?.deniedAt)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function A({ content: n, onPrimaryCtaClick: a, labels: s, statusLabels: p }) {
|
|
70
|
+
let m = t(), { initResponse: h } = r(), A = i(), j = e(), [M, N] = x(!1), [P, F] = b((e) => e + 1, 0), I = y(() => f(j.applications), [j.applications]), L = u(I), R = y(() => O(p), [p]), z = d(I), B = h?.bankName || R.bankNameFallback, V = y(() => {
|
|
71
|
+
if (!D(z)) return;
|
|
72
|
+
let e = R[T[z]], t = k(I, B, R.formatDate);
|
|
73
|
+
return {
|
|
74
|
+
chipLabel: e.chipLabel,
|
|
75
|
+
chipTone: E[z],
|
|
76
|
+
heading: e.heading?.(t),
|
|
77
|
+
body: e.body(t)
|
|
78
|
+
};
|
|
79
|
+
}, [
|
|
80
|
+
I,
|
|
81
|
+
B,
|
|
82
|
+
R,
|
|
83
|
+
z
|
|
84
|
+
]), H = y(() => z === l.Resume ? {
|
|
85
|
+
...s,
|
|
86
|
+
applyNow: R.resumeApplication,
|
|
87
|
+
primaryCta: R.resumeApplication
|
|
88
|
+
} : s, [
|
|
89
|
+
s,
|
|
90
|
+
R.resumeApplication,
|
|
91
|
+
z
|
|
92
|
+
]);
|
|
93
|
+
v(() => {
|
|
94
|
+
m(o.Mounted);
|
|
95
|
+
}, [m]), v(() => {
|
|
96
|
+
if (L === null) return;
|
|
97
|
+
let e = L - Date.now();
|
|
98
|
+
if (e < 0) return;
|
|
99
|
+
let t = setTimeout(F, Math.min(e + 1, C));
|
|
100
|
+
return () => clearTimeout(t);
|
|
101
|
+
}, [L, P]);
|
|
102
|
+
let U = !V && z !== l.Hidden;
|
|
103
|
+
M && !U && N(!1);
|
|
104
|
+
let W = _(() => {
|
|
105
|
+
m(o.OpenModal), N(!0);
|
|
106
|
+
}, [m]), G = _(() => {
|
|
107
|
+
N(!1);
|
|
108
|
+
}, []), K = _(() => {
|
|
109
|
+
m(o.PrimaryCta), N(!1), a();
|
|
110
|
+
}, [a, m]);
|
|
111
|
+
return !h?.status || w.has(h.status) || A || !j.isResolved || z === l.Hidden ? null : /* @__PURE__ */ S(g, {
|
|
112
|
+
open: M,
|
|
113
|
+
vspLogo: n.vspLogo,
|
|
114
|
+
bankingText: n.bankingText,
|
|
115
|
+
primaryCaption: n.primaryCaption,
|
|
116
|
+
secondaryCaption: n.secondaryCaption,
|
|
117
|
+
providedByCaption: n.providedByCaption,
|
|
118
|
+
primaryModalHeader: n.primaryModalHeader,
|
|
119
|
+
howItWorksHeader: n.howItWorksHeader,
|
|
120
|
+
howItWorksSteps: n.howItWorksSteps,
|
|
121
|
+
fromDayOneHeader: n.fromDayOneHeader,
|
|
122
|
+
benefits: n.benefits,
|
|
123
|
+
appearance: n.appearance,
|
|
124
|
+
onOpenMarketingModal: W,
|
|
125
|
+
onCloseMarketingModal: G,
|
|
126
|
+
onPrimaryCtaClick: K,
|
|
127
|
+
statusMessage: V,
|
|
128
|
+
labels: H,
|
|
129
|
+
testIds: {
|
|
130
|
+
root: c.root,
|
|
131
|
+
learnMoreButton: c.learnMoreButton,
|
|
132
|
+
applyNowButton: c.applyNowButton,
|
|
133
|
+
statusMessage: c.statusMessage,
|
|
134
|
+
modal: {
|
|
135
|
+
root: c.modal,
|
|
136
|
+
primaryCtaButton: c.primaryCtaButton
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function j({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
|
|
142
|
+
return /* @__PURE__ */ S(n, {
|
|
143
|
+
widgetName: s,
|
|
144
|
+
baseUrl: e,
|
|
145
|
+
widgetToken: t,
|
|
146
|
+
organizationId: r,
|
|
147
|
+
configClient: i,
|
|
148
|
+
gatewayRouting: a,
|
|
149
|
+
linkComponent: o,
|
|
150
|
+
implementation: c,
|
|
151
|
+
uiFramework: l,
|
|
152
|
+
errorFallback: u,
|
|
153
|
+
onError: d,
|
|
154
|
+
analytics: f,
|
|
155
|
+
disclosuresAcceptance: p,
|
|
156
|
+
providerLabels: m,
|
|
157
|
+
children: /* @__PURE__ */ S(A, { ...h })
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
export { p as MARKETING_WIDGET_LABELS_EN, a as MARKETING_WIDGET_STATUS_LABELS_EN, m as MarketingBenefitIcon, j as MarketingWidget };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MARKETING_WIDGET_LABELS_EN as e } from "./index2.js";
|
|
2
|
-
import { MarketingBenefitIcon as t } from "./index3.js";
|
|
2
|
+
import { MarketingBenefitIcon as t, MarketingWidgetStatusTone as n } from "./index3.js";
|
|
3
3
|
import "./index7.js";
|
|
4
|
-
import { MarketingWidget as
|
|
5
|
-
export { e as MARKETING_WIDGET_LABELS_EN, t as MarketingBenefitIcon,
|
|
4
|
+
import { MarketingWidget as r } from "./index9.js";
|
|
5
|
+
export { e as MARKETING_WIDGET_LABELS_EN, t as MarketingBenefitIcon, r as MarketingWidget, n as MarketingWidgetStatusTone };
|
|
@@ -5,6 +5,10 @@ var e = {
|
|
|
5
5
|
Document: "document",
|
|
6
6
|
Dollar: "dollar",
|
|
7
7
|
Card: "card"
|
|
8
|
+
}, t = {
|
|
9
|
+
Brand: "brand",
|
|
10
|
+
Warning: "warning",
|
|
11
|
+
Danger: "danger"
|
|
8
12
|
};
|
|
9
13
|
//#endregion
|
|
10
|
-
export { e as MarketingBenefitIcon };
|
|
14
|
+
export { e as MarketingBenefitIcon, t as MarketingWidgetStatusTone };
|
|
@@ -1,88 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
1
|
+
import { Badge as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { MarketingWidgetStatusTone as n } from "./index3.js";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
4
|
//#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index8.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
borderRadius: _.borderRadius,
|
|
17
|
-
boxShadow: _.boxShadow
|
|
18
|
-
},
|
|
5
|
+
var a = {
|
|
6
|
+
[n.Brand]: "ttw:border-transparent",
|
|
7
|
+
[n.Warning]: "ttw:border-amber-100 ttw:bg-amber-100 ttw:text-amber-700",
|
|
8
|
+
[n.Danger]: "ttw:border-destructive/20 ttw:bg-destructive/20 ttw:text-destructive"
|
|
9
|
+
};
|
|
10
|
+
function o({ statusMessage: o, primaryColor: s, testId: c }) {
|
|
11
|
+
let { chipLabel: l, chipTone: u, heading: d, body: f } = o, p = u === n.Brand;
|
|
12
|
+
return /* @__PURE__ */ i("div", {
|
|
13
|
+
"data-testid": c,
|
|
14
|
+
className: "ttw:flex ttw:flex-col ttw:items-start",
|
|
19
15
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
className: "ttw:
|
|
30
|
-
|
|
31
|
-
})]
|
|
16
|
+
/* @__PURE__ */ i(e, {
|
|
17
|
+
variant: "outline",
|
|
18
|
+
className: t("ttw:mb-2 ttw:gap-2 ttw:rounded-full ttw:px-3 ttw:py-1 ttw:text-sm", a[u]),
|
|
19
|
+
style: p ? {
|
|
20
|
+
color: s,
|
|
21
|
+
backgroundColor: `color-mix(in srgb, ${s} 12%, transparent)`
|
|
22
|
+
} : void 0,
|
|
23
|
+
children: [/* @__PURE__ */ r("span", {
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
className: "ttw:size-2 ttw:rounded-full ttw:bg-current"
|
|
26
|
+
}), l]
|
|
32
27
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
className: "ttw:
|
|
28
|
+
d ? /* @__PURE__ */ r("p", {
|
|
29
|
+
className: "ttw:text-xl ttw:font-semibold",
|
|
30
|
+
style: { color: s },
|
|
35
31
|
children: d
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
className: "ttw:
|
|
39
|
-
children:
|
|
40
|
-
|
|
41
|
-
style: { color: _.primaryColor },
|
|
42
|
-
children: l
|
|
43
|
-
}), /* @__PURE__ */ i("p", {
|
|
44
|
-
className: "ttw:leading-snug",
|
|
45
|
-
style: { color: _.primaryColor },
|
|
46
|
-
children: u
|
|
47
|
-
})]
|
|
48
|
-
}),
|
|
49
|
-
/* @__PURE__ */ a("div", {
|
|
50
|
-
className: "ttw:flex ttw:flex-wrap ttw:gap-3",
|
|
51
|
-
children: [/* @__PURE__ */ i(e, {
|
|
52
|
-
type: "button",
|
|
53
|
-
"data-testid": S?.applyNowButton,
|
|
54
|
-
onClick: b,
|
|
55
|
-
className: "ttw:h-auto ttw:rounded-xl ttw:px-6 ttw:py-2 ttw:text-base ttw:font-light ttw:transition-[filter] ttw:hover:brightness-90",
|
|
56
|
-
style: {
|
|
57
|
-
backgroundColor: _.primaryColor,
|
|
58
|
-
color: _.primaryContrastColor
|
|
59
|
-
},
|
|
60
|
-
children: C.applyNow
|
|
61
|
-
}), /* @__PURE__ */ i(e, {
|
|
62
|
-
type: "button",
|
|
63
|
-
variant: "outline",
|
|
64
|
-
"data-testid": S?.learnMoreButton,
|
|
65
|
-
onClick: v,
|
|
66
|
-
className: "ttw:h-auto ttw:rounded-xl ttw:px-6 ttw:py-2 ttw:text-base ttw:font-light",
|
|
67
|
-
children: C.learnMore
|
|
68
|
-
})]
|
|
69
|
-
})
|
|
32
|
+
}) : null,
|
|
33
|
+
f.map((e) => /* @__PURE__ */ r("p", {
|
|
34
|
+
className: "ttw:mt-1 ttw:text-sm ttw:text-muted-foreground",
|
|
35
|
+
children: e
|
|
36
|
+
}, e))
|
|
70
37
|
]
|
|
71
|
-
})
|
|
72
|
-
open: o,
|
|
73
|
-
vspLogo: s,
|
|
74
|
-
providedByCaption: d,
|
|
75
|
-
primaryModalHeader: f,
|
|
76
|
-
howItWorksHeader: p,
|
|
77
|
-
howItWorksSteps: m,
|
|
78
|
-
fromDayOneHeader: h,
|
|
79
|
-
benefits: g,
|
|
80
|
-
appearance: _,
|
|
81
|
-
onClose: y,
|
|
82
|
-
onPrimaryCtaClick: b,
|
|
83
|
-
labels: x,
|
|
84
|
-
testIds: S?.modal
|
|
85
|
-
})] });
|
|
38
|
+
});
|
|
86
39
|
}
|
|
87
40
|
//#endregion
|
|
88
|
-
export { o as
|
|
41
|
+
export { o as MarketingWidgetStatus };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { MARKETING_WIDGET_LABELS_EN as t } from "./index2.js";
|
|
3
|
+
import { MarketingWidgetModal as n } from "./index7.js";
|
|
4
|
+
import { MarketingWidgetStatus as r } from "./index8.js";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index9.js
|
|
7
|
+
function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCaption: d, providedByCaption: f, primaryModalHeader: p, howItWorksHeader: m, howItWorksSteps: h, fromDayOneHeader: g, benefits: _, appearance: v, onOpenMarketingModal: y, onCloseMarketingModal: b, onPrimaryCtaClick: x, statusMessage: S, labels: C, testIds: w }) {
|
|
8
|
+
let T = {
|
|
9
|
+
...t,
|
|
10
|
+
...C
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("div", {
|
|
13
|
+
"data-testid": w?.root,
|
|
14
|
+
className: "ttw:relative ttw:flex ttw:w-full ttw:flex-col ttw:items-start ttw:overflow-hidden ttw:border ttw:border-border ttw:p-6",
|
|
15
|
+
style: {
|
|
16
|
+
backgroundColor: v.cardBackgroundColor,
|
|
17
|
+
borderRadius: v.borderRadius,
|
|
18
|
+
boxShadow: v.boxShadow
|
|
19
|
+
},
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ o("div", {
|
|
22
|
+
className: "ttw:mb-2 ttw:flex ttw:items-center ttw:gap-3",
|
|
23
|
+
children: [/* @__PURE__ */ a("img", {
|
|
24
|
+
src: c.src,
|
|
25
|
+
alt: c.alt,
|
|
26
|
+
height: 40,
|
|
27
|
+
width: c.width,
|
|
28
|
+
className: "ttw:h-10 ttw:w-auto ttw:object-contain"
|
|
29
|
+
}), /* @__PURE__ */ a("p", {
|
|
30
|
+
className: "ttw:text-xl ttw:font-semibold ttw:text-foreground",
|
|
31
|
+
children: l
|
|
32
|
+
})]
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ a("p", {
|
|
35
|
+
className: "ttw:mb-2 ttw:text-sm ttw:text-muted-foreground",
|
|
36
|
+
children: f
|
|
37
|
+
}),
|
|
38
|
+
S ? /* @__PURE__ */ a(r, {
|
|
39
|
+
statusMessage: S,
|
|
40
|
+
primaryColor: v.primaryColor,
|
|
41
|
+
testId: w?.statusMessage
|
|
42
|
+
}) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("div", {
|
|
43
|
+
className: "ttw:mb-2 ttw:flex ttw:flex-col",
|
|
44
|
+
children: [/* @__PURE__ */ a("p", {
|
|
45
|
+
className: "ttw:text-xl ttw:font-semibold",
|
|
46
|
+
style: { color: v.primaryColor },
|
|
47
|
+
children: u
|
|
48
|
+
}), /* @__PURE__ */ a("p", {
|
|
49
|
+
className: "ttw:leading-snug",
|
|
50
|
+
style: { color: v.primaryColor },
|
|
51
|
+
children: d
|
|
52
|
+
})]
|
|
53
|
+
}), /* @__PURE__ */ o("div", {
|
|
54
|
+
className: "ttw:flex ttw:flex-wrap ttw:gap-3",
|
|
55
|
+
children: [/* @__PURE__ */ a(e, {
|
|
56
|
+
type: "button",
|
|
57
|
+
"data-testid": w?.applyNowButton,
|
|
58
|
+
onClick: x,
|
|
59
|
+
className: "ttw:h-auto ttw:rounded-xl ttw:px-6 ttw:py-2 ttw:text-base ttw:font-light ttw:transition-[filter] ttw:hover:brightness-90",
|
|
60
|
+
style: {
|
|
61
|
+
backgroundColor: v.primaryColor,
|
|
62
|
+
color: v.primaryContrastColor
|
|
63
|
+
},
|
|
64
|
+
children: T.applyNow
|
|
65
|
+
}), /* @__PURE__ */ a(e, {
|
|
66
|
+
type: "button",
|
|
67
|
+
variant: "outline",
|
|
68
|
+
"data-testid": w?.learnMoreButton,
|
|
69
|
+
onClick: y,
|
|
70
|
+
className: "ttw:h-auto ttw:rounded-xl ttw:px-6 ttw:py-2 ttw:text-base ttw:font-light",
|
|
71
|
+
children: T.learnMore
|
|
72
|
+
})]
|
|
73
|
+
})] })
|
|
74
|
+
]
|
|
75
|
+
}), /* @__PURE__ */ a(n, {
|
|
76
|
+
open: s,
|
|
77
|
+
vspLogo: c,
|
|
78
|
+
providedByCaption: f,
|
|
79
|
+
primaryModalHeader: p,
|
|
80
|
+
howItWorksHeader: m,
|
|
81
|
+
howItWorksSteps: h,
|
|
82
|
+
fromDayOneHeader: g,
|
|
83
|
+
benefits: _,
|
|
84
|
+
appearance: v,
|
|
85
|
+
onClose: b,
|
|
86
|
+
onPrimaryCtaClick: x,
|
|
87
|
+
labels: C,
|
|
88
|
+
testIds: w?.modal
|
|
89
|
+
})] });
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { s as MarketingWidget };
|
|
@@ -41,4 +41,5 @@ import { useAcceptWidgetDisclosures as si } from "./lib/disclosures/useAcceptWid
|
|
|
41
41
|
import { useDisclosuresQuery as ci } from "./lib/disclosures/useDisclosuresQuery.js";
|
|
42
42
|
import { OnboardingSuppressionReason as li } from "./lib/onboardingSuppressionReason.js";
|
|
43
43
|
import { useOrganizationOnboardingSuppression as ui } from "./lib/useOrganizationOnboardingSuppression.js";
|
|
44
|
-
|
|
44
|
+
import { useOrganizationApplicationStatus as di } from "./lib/useOrganizationApplicationStatus.js";
|
|
45
|
+
export { Ar as EmbedApiProvider, li as OnboardingSuppressionReason, Wr as Scope, ze as activateCreditCardMutation, Be as activateDebitCardMutation, vr as applicationStatusInvalidationKey, yr as applicationStatusQueryOptions, kr as attachTransportInterceptors, gr as authEpochPlaceholder, e as bulkUpdateDepartmentMembers, t as bulkUpdateLocationMembers, n as bulkUpdateRoleMembers, xr as cancelAllClients, Dr as cloneEmbeddedClient, Ve as connectExternalBankAccountMutation, He as createAchMoneyMovementMutation, Ue as createApplicationMutation, We as createBankAccountMutation, Ge as createBookTransferMutation, Ke as createCheckDepositMutation, br as createClientSecretInstaller, qe as createDebitCardMutation, r as createDepartment, Or as createEmbeddedClient, i as createLocation, a as createUser, Je as createVelocityControlMutation, o as deactivateDepartment, s as deactivateLocation, Ye as deleteApprovalPoliciesIdMutation, Xe as deleteBankAccountApplicationMutation, c as deleteCounterpartsId, l as deleteCounterpartsIdBankAccountsId, u as deleteEntitiesIdLogo, d as deleteFilesId, Ze as deleteLedgerAccountsIdMutation, f as deleteMeasureUnitsId, p as deletePayablesId, m as deletePayablesIdFile, h as deleteProductsId, Qe as deleteReceiptsIdMutation, g as deleteReceivablesId, $e as disableUserMutation, _ as downloadBankAccountTransactions, Pr as fetchWidgetInit, Kr as getAllPagesNextPageParam, qr as getAllPagesNextPaginationTokenParam, et as getAnalyticsPayablesOptions, tt as getAnalyticsPayablesQueryKey, nt as getAnalyticsReceiptsOptions, rt as getAnalyticsReceiptsQueryKey, it as getAnalyticsReceivablesOptions, at as getAnalyticsReceivablesQueryKey, ot as getAnalyticsTransactionsOptions, st as getAnalyticsTransactionsQueryKey, v as getApplicationStatus, y as getApprovalPolicies, ct as getApprovalPoliciesOptions, lt as getApprovalPoliciesQueryKey, b as getApprovalRequests, ut as getApprovalRequestsOptions, dt as getApprovalRequestsQueryKey, x as getBankAccountAccess, ft as getBankAccountAccessQueryKey, pt as getBankAccountApplicationOptions, mt as getBankAccountOptions, ht as getBankAccountQueryKey, S as getBankAccountStatement, gt as getBankAccountStatementsOptions, _t as getBankAccountTransactionsOptions, vt as getBankAccountTransactionsQueryKey, yt as getBankAccountTransfersOptions, bt as getBankAccountTransfersQueryKey, xt as getBankAccountsQueryKey, C as getCounterparts, St as getCounterpartsIdAddressesOptions, Ct as getCounterpartsIdAddressesQueryKey, wt as getCounterpartsIdBankAccountsOptions, Tt as getCounterpartsIdBankAccountsQueryKey, Et as getCounterpartsIdOptions, Dt as getCounterpartsIdQueryKey, Ot as getCounterpartsOptions, kt as getCounterpartsQueryKey, At as getCreditCardByIdOptions, jt as getCreditCardByIdQueryKey, Mt as getCreditCardsOptions, Nt as getCreditCardsQueryKey, Pt as getDebitCardByIdOptions, Ft as getDebitCardByIdQueryKey, It as getDebitCardCredentialsOptions, Lt as getDebitCardsOptions, Rt as getDebitCardsQueryKey, w as getDepartment, zt as getDepartmentOptions, Bt as getDepartmentQueryKey, T as getDepositableBankAccounts, Vt as getDepositableBankAccountsOptions, Ht as getDocumentsIdNextNumbersOptions, Ut as getDocumentsIdNextNumbersQueryKey, Wt as getEntitiesIdSettingsOptions, Gt as getEntitiesIdSettingsQueryKey, Kt as getEntityUsersMyEntityOptions, qt as getEntityUsersMyEntityQueryKey, Jt as getEntityUsersOptions, E as getExternalBankAccountAccess, Yt as getExternalBankAccountAccessQueryKey, Xt as getExternalBankAccountsOptions, Zt as getExternalBankAccountsQueryKey, Qt as getFilesQueryKey, $t as getLedgerAccountsQueryKey, D as getLocation, en as getLocationOptions, tn as getLocationQueryKey, nn as getMeasureUnitsOptions, rn as getMeasureUnitsQueryKey, an as getOrganizationOptions, O as getPayables, k as getPayablesId, A as getPayablesIdHistory, on as getPayablesIdHistoryOptions, sn as getPayablesIdHistoryQueryKey, j as getPayablesIdLineItems, cn as getPayablesIdLineItemsOptions, ln as getPayablesIdLineItemsQueryKey, un as getPayablesIdOptions, dn as getPayablesIdQueryKey, fn as getPayablesIdSuggestionsOptions, pn as getPayablesOptions, mn as getPayablesQueryKey, M as getPaymentRecords, hn as getPaymentRecordsOptions, gn as getPaymentRecordsQueryKey, N as getProducts, _n as getProductsIdOptions, vn as getProductsIdQueryKey, yn as getProductsOptions, bn as getProductsQueryKey, P as getReceipts, xn as getReceiptsIdQueryKey, Sn as getReceiptsOptions, Cn as getReceiptsQueryKey, F as getReceivables, wn as getReceivablesIdHistoryOptions, Tn as getReceivablesIdHistoryQueryKey, En as getReceivablesIdMailsOptions, Dn as getReceivablesIdMailsQueryKey, On as getReceivablesIdOptions, kn as getReceivablesIdPdfLinkOptions, An as getReceivablesIdPdfLinkQueryKey, jn as getReceivablesIdQueryKey, Mn as getReceivablesOptions, Nn as getReceivablesQueryKey, Pn as getTransactionsIdExpenseHistoryOptions, Fn as getTransactionsIdExpenseHistoryQueryKey, In as getTransactionsIdOptions, Ln as getTransactionsIdQueryKey, Rn as getTransactionsOptions, zn as getTransactionsQueryKey, Bn as getTransactionsValidationsOptions, Vn as getTransactionsValidationsQueryKey, I as getUsers, Hn as getUsersOptions, Un as getUsersQueryKey, Wn as getVelocityControlsQueryKey, Gn as grantBankAccountAccessMutation, Kn as grantExternalBankAccountAccessMutation, Fr as hasAnyScope, Sr as invalidateAllClients, Jr as isAllPagesResolving, Rr as isApiConflictError, zr as isApiForbiddenError, Br as isApiNotFoundError, Vr as isApiUnprocessableError, Gr as isScope, qn as linkExternalBankAccountMutation, L as listDepartments, Jn as listDepartmentsOptions, Yn as listDepartmentsQueryKey, R as listLocations, Xn as listLocationsOptions, Zn as listLocationsQueryKey, z as listRoles, Qn as listRolesQueryKey, B as manageBankAccountAccess, V as manageDebitCardAccess, $n as manageDebitCardAccessMutation, Mr as optionalOrganizationHeaders, Nr as organizationHeaders, er as patchApprovalPoliciesIdMutation, H as patchCounterpartsId, U as patchCounterpartsIdAddressesId, W as patchCounterpartsIdBankAccountsId, G as patchEntitiesIdSettings, tr as patchLedgerAccountsIdMutation, K as patchMeasureUnitsId, q as patchPayablesId, J as patchProductsId, nr as patchReceiptsIdMutation, Y as patchReceivablesId, X as patchTransactionsId, oi as personDisclosure, rr as postApprovalPoliciesMutation, Z as postApprovalRequestsIdApprove, Q as postApprovalRequestsIdReject, $ as postCounterparts, ee as postCounterpartsIdAddresses, te as postCounterpartsIdBankAccounts, ne as postCounterpartsIdBankAccountsIdMakeDefault, re as postFiles, ir as postLedgerAccountsMutation, ie as postMeasureUnits, ae as postPayables, oe as postPayablesIdApprovePaymentOperation, se as postPayablesIdAttachFile, ce as postPayablesIdCancel, le as postPayablesIdDuplicatesIdConfirm, ue as postPayablesIdDuplicatesIdDismiss, de as postPayablesIdMarkAsPaid, fe as postPayablesIdReject, pe as postPayablesIdReopen, me as postPayablesIdSchedulePayment, he as postPayablesIdSubmitForApproval, ge as postPayablesIdValidate, _e as postPayablesUploadFromFile, ve as postPaymentIntentsIdCancel, ye as postProducts, ar as postReceiptsUploadFromFileMutation, be as postReceivables, xe as postReceivablesIdAccept, Se as postReceivablesIdCancel, Ce as postReceivablesIdClone, we as postReceivablesIdDecline, Te as postReceivablesIdIssue, Ee as postReceivablesIdMarkAsPaid, De as postReceivablesIdMarkAsPartiallyPaid, Oe as postReceivablesIdMarkAsUncollectible, ke as postReceivablesIdSend, Ae as postTransactionsIdApprove, je as postTransactionsIdReject, Me as postTransactionsIdReopen, Ne as postTransactionsIdSubmit, Pe as putEntitiesIdLogo, Fe as putPayablesIdLineItems, or as putTransactionsValidationsMutation, Cr as registerQueryClient, wr as removeInactiveFromAllClients, Tr as setAllClientsQueriesData, sr as setDebitCardLockStatusMutation, cr as submitApplicationMutation, lr as unlinkExternalBankAccountMutation, Er as unregisterQueryClient, ur as updateApplicationMutation, dr as updateBankAccountMutation, fr as updateDebitCardMutation, Ie as updateDepartment, pr as updateExternalBankAccountMutation, Le as updateLocation, Re as updateUser, si as useAcceptWidgetDisclosures, Xr as useAllBankAccountsQuery, Zr as useAllDebitCardsQuery, Qr as useAllExternalBankAccountsQuery, ei as useAllLedgerAccountsQuery, $r as useAllMerchantCategoryGroupsQuery, ri as useAllOrganizationRolesQuery, ai as useAllOrganizationUsersQuery, Yr as useAutoFetchNextPage, Ir as useCurrentUserQuery, ci as useDisclosuresQuery, jr as useEmbedApi, Hr as useGetUserDataQuery, ti as useLedgerAccountsQuery, Lr as useMailboxAddress, di as useOrganizationApplicationStatus, ui as useOrganizationOnboardingSuppression, ni as usePaymentTermsQuery, ii as useRolePermissionsQueries, Ur as useUpsertUserDataMutation, mr as validateExternalBankAccountMutation, hr as verifyDebitCardMutation, _r as withAuthEpoch };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { applicationStatusQueryOptions as e } from "./applicationStatusQueryOptions.js";
|
|
6
|
+
import { useEmbedApi as t } from "./EmbedApiContext.js";
|
|
7
|
+
import { useQuery as n } from "@tanstack/react-query";
|
|
8
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationApplicationStatus.js
|
|
9
|
+
var r = [];
|
|
10
|
+
function i() {
|
|
11
|
+
let { client: i, widgetToken: a, authEpoch: o } = t(), s = !!a, c = n({
|
|
12
|
+
...e({
|
|
13
|
+
client: i,
|
|
14
|
+
widgetToken: a,
|
|
15
|
+
authEpoch: o
|
|
16
|
+
}),
|
|
17
|
+
enabled: s
|
|
18
|
+
}), l = c.data !== void 0 && !c.isPlaceholderData;
|
|
19
|
+
return {
|
|
20
|
+
applications: l ? c.data?.applications ?? r : r,
|
|
21
|
+
isResolved: !s || l || c.isError
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { i as useOrganizationApplicationStatus };
|
|
@@ -7,28 +7,28 @@ import { useEmbedApi as t } from "./EmbedApiContext.js";
|
|
|
7
7
|
import { OnboardingSuppressionReason as n } from "./onboardingSuppressionReason.js";
|
|
8
8
|
import { useQuery as r } from "@tanstack/react-query";
|
|
9
9
|
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js
|
|
10
|
-
var i = "COMPLETE", a = "BANK_ACCOUNT", o = "STARTED_BY_OTHER";
|
|
11
|
-
function
|
|
10
|
+
var i = "COMPLETE", a = "BANK_ACCOUNT", o = "STARTED_BY_OTHER", s = /* @__PURE__ */ new Set(["DELETED", "CANCELED"]);
|
|
11
|
+
function c(e) {
|
|
12
12
|
let t = e.filter((e) => e.product === a);
|
|
13
|
-
return t.some((e) => e.status === i) ? n.OrganizationApplicationComplete : t.some((e) => e.ownership === o) ? n.OrganizationApplicationStartedByOther : null;
|
|
13
|
+
return t.some((e) => e.status === i) ? n.OrganizationApplicationComplete : t.some((e) => e.ownership === o && !s.has(e.status)) ? n.OrganizationApplicationStartedByOther : null;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
let { client: n, widgetToken: i, authEpoch: a } = t(), o = !!i,
|
|
15
|
+
function l() {
|
|
16
|
+
let { client: n, widgetToken: i, authEpoch: a } = t(), o = !!i, s = r({
|
|
17
17
|
...e({
|
|
18
18
|
client: n,
|
|
19
19
|
widgetToken: i,
|
|
20
20
|
authEpoch: a
|
|
21
21
|
}),
|
|
22
22
|
enabled: o
|
|
23
|
-
}), l =
|
|
23
|
+
}), l = s.data ? c(s.data.applications ?? []) : null;
|
|
24
24
|
return {
|
|
25
25
|
isSuppressed: l !== null,
|
|
26
26
|
reason: l,
|
|
27
|
-
isResolved: !o ||
|
|
27
|
+
isResolved: !o || s.isSuccess || s.isError,
|
|
28
28
|
refetch: () => {
|
|
29
|
-
|
|
29
|
+
s.refetch();
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export {
|
|
34
|
+
export { l as useOrganizationOnboardingSuppression };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.203", n = "7cc1039fb78f2b28e512c642c10fad2272d186ff", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|