@tesouro/embedded-components-react 0.11.58 → 0.11.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +16 -16
  2. package/dist/index.css +40 -70
  3. package/dist/index.d.ts +19 -6
  4. package/dist/lib/CardDetailsWidget.d.ts +11 -3
  5. package/dist/lib/CreditCardsWidget.d.ts +19 -6
  6. package/dist/lib/DebitCardsWidget.d.ts +19 -6
  7. package/dist/lib/WidgetSuite.d.ts +19 -6
  8. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +112 -110
  9. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +1 -0
  10. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +0 -2
  11. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +94 -83
  12. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +32 -31
  13. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/labels.js +5 -2
  14. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialRow.js +41 -23
  15. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js +3 -0
  16. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +30 -25
  17. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +162 -190
  18. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +2 -2
  19. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyButton.js +35 -0
  20. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyableValue.js +18 -0
  21. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameEditor.js +43 -0
  22. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/cardFaceSurface.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +12 -8
  24. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index5.js +3 -3
  25. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +110 -104
  26. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/CreateCardWidget.js +74 -68
  27. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/PreparingView.js +19 -18
  28. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SetupView.js +110 -108
  29. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SuccessView.js +33 -42
  30. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/labels.js +10 -7
  31. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/labels.js +1 -0
  32. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/testIds.js +2 -6
  33. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/useCardsWidget.js +159 -145
  34. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/index.js +0 -1
  35. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +255 -112
  36. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +1 -1
  37. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/labels.js +4 -4
  38. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  39. package/package.json +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js +0 -22
  41. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js +0 -28
  42. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js +0 -64
  43. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/statusBadge.js +0 -11
  44. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardFaceSwatch.js +0 -11
  45. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +0 -103
  46. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/statusBadge.js +0 -11
@@ -88,7 +88,7 @@ interface CardsListLabels {
88
88
  activateButton: string;
89
89
  /** Accessible name for a row's Activate button; the card name is appended. */
90
90
  activateButtonForCard: string;
91
- /** Accessible name for a row's open-details control; card name appended. */
91
+ /** Accessible name for a row, which opens the card; card name appended. */
92
92
  selectCardButton: string;
93
93
  /** Separator between a card's nickname and its last four digits. */
94
94
  cardNameSeparator: string;
@@ -757,8 +757,7 @@ interface CardDetailsFieldLabels {
757
757
  nickname: string;
758
758
  /**
759
759
  * Heading for the billing-address block (EMBD-5466 restyle): one section,
760
- * one heading, with each address line as its own copyable line inside it
761
- * rather than a separately-labeled row per line.
760
+ * one heading, with a single copy control for the complete address.
762
761
  */
763
762
  billingAddress: string;
764
763
  /** Sub-header over the merchant categories / velocity control rows. */
@@ -768,12 +767,16 @@ interface CardDetailsFieldLabels {
768
767
  perTransactionMax: string;
769
768
  /** Stands in for a row whose value the card does not carry. */
770
769
  emptyValue: string;
770
+ /** @deprecated Cardholder is shown on the card face without a copy control. */
771
771
  copyCardholderAriaLabel: string;
772
+ /** @deprecated Nickname is shown in the heading without a copy control. */
772
773
  copyNicknameAriaLabel: string;
774
+ copyBillingAddressAriaLabel: string;
773
775
  copyBillingAddressLine1AriaLabel: string;
774
776
  copyBillingAddressLine2AriaLabel: string;
775
777
  copyBillingAddressCityStateAriaLabel: string;
776
778
  copyBillingAddressPostalCodeAriaLabel: string;
779
+ copiedLabel: string;
777
780
  }
778
781
  /** Copy for the controls the owner can switch on alongside the details. */
779
782
  interface CardDetailsActionLabels {
@@ -786,6 +789,7 @@ interface CardDetailsActionLabels {
786
789
  }
787
790
  /** Copy for the nickname row's inline editor. */
788
791
  interface CardDetailsNicknameLabels {
792
+ edit: string;
789
793
  /** Accessible name for the control that opens the editor. */
790
794
  editAriaLabel: string;
791
795
  /** Accessible name for the editor's text field. */
@@ -824,6 +828,7 @@ interface CardDetailsCredentialsLabels {
824
828
  copyCardNumberAriaLabel: string;
825
829
  copyExpirationDateAriaLabel: string;
826
830
  copySecurityCodeAriaLabel: string;
831
+ copiedLabel: string;
827
832
  /** Shown next to the control when the reveal failed. */
828
833
  errorDescription: string;
829
834
  }
@@ -887,6 +892,9 @@ interface ActivateCardStatusLabels {
887
892
  submittingAriaLabel: string;
888
893
  successTitle: string;
889
894
  successDescription: string;
895
+ successCardholderLabel: string;
896
+ successLastFourLabel: string;
897
+ successFormatLabel: string;
890
898
  /** Label for the optional post-success control. */
891
899
  done: string;
892
900
  /** Fallback failure copy when the owner supplies no `errorMessage`. */
@@ -911,7 +919,7 @@ interface ActivateCardPanelLabels {
911
919
  * panel's own labels stay with the panel.
912
920
  */
913
921
  interface CardDetailsFeatureLabels {
914
- /** Confirmation toast after a copy affordance writes to the clipboard. */
922
+ /** @deprecated Unused: copy buttons confirm themselves. */
915
923
  copySuccessToast: string;
916
924
  /**
917
925
  * Toast shown when activation is refused because the card is no longer
@@ -1085,7 +1093,10 @@ interface CreateCardWidgetLabels {
1085
1093
  success: {
1086
1094
  title: string;
1087
1095
  description: string;
1088
- createAnother: string;
1096
+ cardholderLabel: string;
1097
+ lastFourLabel: string;
1098
+ formatLabel: string;
1099
+ done: string;
1089
1100
  viewCard: string;
1090
1101
  };
1091
1102
  footer: {
@@ -1193,7 +1204,7 @@ type CreateCardWidgetProps = WidgetProviderProps & {
1193
1204
  *
1194
1205
  * They are separate from `CardsListLabels` (the `ui` lib's) because the cells
1195
1206
  * reaching that library are already formatted: the em-dash, the nickname
1196
- * fallback and the "Viewing" prefix are all written *here*, so the UI lib has
1207
+ * fallback and the pager's range are all written *here*, so the UI lib has
1197
1208
  * no key to override them with. `bank-accounts-widget`'s `featureLabels` is the
1198
1209
  * precedent for the split.
1199
1210
  *
@@ -1218,6 +1229,8 @@ interface CardsFeatureLabels {
1218
1229
  * for the case where there is nothing at all to show.
1219
1230
  */
1220
1231
  untitledFundingAccount: string;
1232
+ /** `{from}` and `{to}` are substituted. */
1233
+ pageRange: string;
1221
1234
  /** Display copy per card lifecycle status; keys are the generated code terms. */
1222
1235
  cardStatus: Record<CardStatus, string>;
1223
1236
  /** Display copy per card form factor; keys are the generated code terms. */
@@ -1655,7 +1655,7 @@ interface CardsListLabels {
1655
1655
  activateButton: string;
1656
1656
  /** Accessible name for a row's Activate button; the card name is appended. */
1657
1657
  activateButtonForCard: string;
1658
- /** Accessible name for a row's open-details control; card name appended. */
1658
+ /** Accessible name for a row, which opens the card; card name appended. */
1659
1659
  selectCardButton: string;
1660
1660
  /** Separator between a card's nickname and its last four digits. */
1661
1661
  cardNameSeparator: string;
@@ -1703,8 +1703,7 @@ interface CardDetailsFieldLabels {
1703
1703
  nickname: string;
1704
1704
  /**
1705
1705
  * Heading for the billing-address block (EMBD-5466 restyle): one section,
1706
- * one heading, with each address line as its own copyable line inside it
1707
- * rather than a separately-labeled row per line.
1706
+ * one heading, with a single copy control for the complete address.
1708
1707
  */
1709
1708
  billingAddress: string;
1710
1709
  /** Sub-header over the merchant categories / velocity control rows. */
@@ -1714,12 +1713,16 @@ interface CardDetailsFieldLabels {
1714
1713
  perTransactionMax: string;
1715
1714
  /** Stands in for a row whose value the card does not carry. */
1716
1715
  emptyValue: string;
1716
+ /** @deprecated Cardholder is shown on the card face without a copy control. */
1717
1717
  copyCardholderAriaLabel: string;
1718
+ /** @deprecated Nickname is shown in the heading without a copy control. */
1718
1719
  copyNicknameAriaLabel: string;
1720
+ copyBillingAddressAriaLabel: string;
1719
1721
  copyBillingAddressLine1AriaLabel: string;
1720
1722
  copyBillingAddressLine2AriaLabel: string;
1721
1723
  copyBillingAddressCityStateAriaLabel: string;
1722
1724
  copyBillingAddressPostalCodeAriaLabel: string;
1725
+ copiedLabel: string;
1723
1726
  }
1724
1727
  /** Copy for the controls the owner can switch on alongside the details. */
1725
1728
  interface CardDetailsActionLabels {
@@ -1732,6 +1735,7 @@ interface CardDetailsActionLabels {
1732
1735
  }
1733
1736
  /** Copy for the nickname row's inline editor. */
1734
1737
  interface CardDetailsNicknameLabels {
1738
+ edit: string;
1735
1739
  /** Accessible name for the control that opens the editor. */
1736
1740
  editAriaLabel: string;
1737
1741
  /** Accessible name for the editor's text field. */
@@ -1770,6 +1774,7 @@ interface CardDetailsCredentialsLabels {
1770
1774
  copyCardNumberAriaLabel: string;
1771
1775
  copyExpirationDateAriaLabel: string;
1772
1776
  copySecurityCodeAriaLabel: string;
1777
+ copiedLabel: string;
1773
1778
  /** Shown next to the control when the reveal failed. */
1774
1779
  errorDescription: string;
1775
1780
  }
@@ -1833,6 +1838,9 @@ interface ActivateCardStatusLabels {
1833
1838
  submittingAriaLabel: string;
1834
1839
  successTitle: string;
1835
1840
  successDescription: string;
1841
+ successCardholderLabel: string;
1842
+ successLastFourLabel: string;
1843
+ successFormatLabel: string;
1836
1844
  /** Label for the optional post-success control. */
1837
1845
  done: string;
1838
1846
  /** Fallback failure copy when the owner supplies no `errorMessage`. */
@@ -1857,7 +1865,7 @@ interface ActivateCardPanelLabels {
1857
1865
  * panel's own labels stay with the panel.
1858
1866
  */
1859
1867
  interface CardDetailsFeatureLabels {
1860
- /** Confirmation toast after a copy affordance writes to the clipboard. */
1868
+ /** @deprecated Unused: copy buttons confirm themselves. */
1861
1869
  copySuccessToast: string;
1862
1870
  /**
1863
1871
  * Toast shown when activation is refused because the card is no longer
@@ -2031,7 +2039,10 @@ interface CreateCardWidgetLabels {
2031
2039
  success: {
2032
2040
  title: string;
2033
2041
  description: string;
2034
- createAnother: string;
2042
+ cardholderLabel: string;
2043
+ lastFourLabel: string;
2044
+ formatLabel: string;
2045
+ done: string;
2035
2046
  viewCard: string;
2036
2047
  };
2037
2048
  footer: {
@@ -2139,7 +2150,7 @@ type CreateCardWidgetProps = WidgetProviderProps & {
2139
2150
  *
2140
2151
  * They are separate from `CardsListLabels` (the `ui` lib's) because the cells
2141
2152
  * reaching that library are already formatted: the em-dash, the nickname
2142
- * fallback and the "Viewing" prefix are all written *here*, so the UI lib has
2153
+ * fallback and the pager's range are all written *here*, so the UI lib has
2143
2154
  * no key to override them with. `bank-accounts-widget`'s `featureLabels` is the
2144
2155
  * precedent for the split.
2145
2156
  *
@@ -2164,6 +2175,8 @@ interface CardsFeatureLabels {
2164
2175
  * for the case where there is nothing at all to show.
2165
2176
  */
2166
2177
  untitledFundingAccount: string;
2178
+ /** `{from}` and `{to}` are substituted. */
2179
+ pageRange: string;
2167
2180
  /** Display copy per card lifecycle status; keys are the generated code terms. */
2168
2181
  cardStatus: Record<CardStatus, string>;
2169
2182
  /** Display copy per card form factor; keys are the generated code terms. */
@@ -2,147 +2,147 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { OrganizationStatus as t } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
7
- import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
5
+ import { OrganizationStatus as e } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
6
+ import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
7
  import "../../../../shared/data-access/dist/index.js";
9
- import { EmbeddedToaster as r } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
8
+ import { EmbeddedToaster as n } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
10
9
  import "../../../../shared/ui/dist/index.js";
11
- import { useAnalyticsTrack as i } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
12
- import { WidgetProvider as a } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
13
- import { useRefetchWidget as o, useWidgetConfig as s, useWidgetError as c, useWidgetInitStaleForToken as l } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
14
- import { CardProgram as u } from "../../../../shared/feature/dist/lib/card/cardProgram.js";
10
+ import { useAnalyticsTrack as r } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
11
+ import { WidgetProvider as i } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
12
+ import { useRefetchWidget as a, useWidgetConfig as o, useWidgetError as s, useWidgetInitStaleForToken as c } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
+ import { CardProgram as l } from "../../../../shared/feature/dist/lib/card/cardProgram.js";
15
14
  import "../../../../shared/feature/dist/index.js";
16
- import { resolveCardDetailsFeatureLabels as d } from "./labels.js";
17
- import { CardDetailsWidgetAnalyticsEvent as f, WIDGET_NAME as p } from "./analytics/events.js";
18
- import { copyTextToClipboard as m, formatCardNumber as ee, formatExpirationDate as te } from "./formatters.js";
19
- import { CardProgramValidity as h, resolveCanRevealCredentials as ne, resolveCardDetailsPanelState as re, resolveCardDetailsPresentation as ie, resolveCardDetailsRevealState as ae, resolveCardProgramValidity as oe } from "./cardDetailsView.js";
20
- import { activateCardPanelTestIds as se, cardDetailsPanelTestIds as ce } from "./testIds.js";
21
- import { useCreditCardDetailsQuery as le } from "../../../data-access/dist/index6.js";
22
- import { useDebitCardCredentialsQuery as ue } from "../../../data-access/dist/index7.js";
23
- import { useDebitCardDetailsQuery as de } from "../../../data-access/dist/index8.js";
15
+ import { resolveCardDetailsFeatureLabels as u } from "./labels.js";
16
+ import { CardDetailsWidgetAnalyticsEvent as d, WIDGET_NAME as f } from "./analytics/events.js";
17
+ import { copyTextToClipboard as p, formatCardNumber as m, formatExpirationDate as ee } from "./formatters.js";
18
+ import { CardProgramValidity as h, resolveCanRevealCredentials as te, resolveCardDetailsPanelState as ne, resolveCardDetailsPresentation as re, resolveCardDetailsRevealState as ie, resolveCardProgramValidity as ae } from "./cardDetailsView.js";
19
+ import { activateCardPanelTestIds as oe, cardDetailsPanelTestIds as se } from "./testIds.js";
20
+ import { useCreditCardDetailsQuery as ce } from "../../../data-access/dist/index6.js";
21
+ import { useDebitCardCredentialsQuery as g } from "../../../data-access/dist/index7.js";
22
+ import { useDebitCardDetailsQuery as le } from "../../../data-access/dist/index8.js";
24
23
  import "../../../data-access/dist/index.js";
25
- import { CardDetailsPanel as fe } from "../../../ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js";
26
- import { ActivateCardPanel as g } from "../../../ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js";
24
+ import { CardDetailsPanel as ue } from "../../../ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js";
25
+ import { ActivateCardPanel as de } from "../../../ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js";
27
26
  import "../../../ui/dist/index.js";
28
- import { useActivateCard as pe } from "./useActivateCard.js";
29
- import { useCardLock as me } from "./useCardLock.js";
30
- import { useEditCardNickname as he } from "./useEditCardNickname.js";
31
- import { useCallback as _, useEffect as v, useMemo as y, useState as b } from "react";
32
- import { Fragment as ge, jsx as x, jsxs as _e } from "react/jsx-runtime";
27
+ import { useActivateCard as fe } from "./useActivateCard.js";
28
+ import { useCardLock as pe } from "./useCardLock.js";
29
+ import { useEditCardNickname as me } from "./useEditCardNickname.js";
30
+ import { useCallback as _, useEffect as v, useMemo as y, useState as he } from "react";
31
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
33
32
  // ../../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js
34
- function S({ cardId: a, cardProgram: p, onClose: S, labels: C, activateLabels: ve, featureLabels: w, cardArtSrc: T, bankLogoSrc: E, bankLogoAlt: D }) {
35
- let O = i(), k = c(), A = o(), { initResponse: j } = s(), { organizationStatus: ye } = n(), M = l();
33
+ function C({ cardId: i, cardProgram: f, onClose: C, labels: w, activateLabels: ge, featureLabels: T, cardArtSrc: E, bankLogoSrc: D, bankLogoAlt: O }) {
34
+ let k = r(), A = s(), j = a(), { initResponse: M } = o(), { organizationStatus: _e } = t(), ve = c();
36
35
  v(() => {
37
- O(f.Mounted);
38
- }, [O]);
39
- let N = y(() => d(w), [w]), P = oe(p), F = p === u.Credit, be = p === u.Debit, xe = le({
40
- cardId: a,
36
+ k(d.Mounted);
37
+ }, [k]);
38
+ let N = y(() => u(T), [T]), P = ae(f), F = f === l.Credit, ye = f === l.Debit, be = ce({
39
+ cardId: i,
41
40
  enabled: F
42
- }), I = de({
43
- cardId: a,
44
- enabled: be
45
- }), { data: L, isError: Se, isNotFound: Ce, refetch: R } = F ? xe : I, z = ye === t.None, B = re({
41
+ }), xe = le({
42
+ cardId: i,
43
+ enabled: ye
44
+ }), { data: I, isError: L, isNotFound: Se, refetch: R } = F ? be : xe, z = _e === e.None, B = ne({
46
45
  programValidity: P,
47
- isNotFound: Ce,
48
- isError: !!k || Se || z,
49
- hasCard: !!L
46
+ isNotFound: Se,
47
+ isError: !!A || L || z,
48
+ hasCard: !!I
50
49
  });
51
50
  v(() => {
52
51
  if (P === h.Supported) return;
53
- let e = `"${u.Credit}" or "${u.Debit}"`;
54
- console.error(P === h.Missing ? `[CardDetailsWidget] cardProgram is required and was not set. Pass ${e} — it selects which card program to read, so there is no default. No card was fetched.` : `[CardDetailsWidget] cardProgram must be ${e}, received ${JSON.stringify(p)}. No card was fetched.`);
55
- }, [p, P]);
56
- let [we, V] = b(), H = we === a;
52
+ let e = `"${l.Credit}" or "${l.Debit}"`;
53
+ console.error(P === h.Missing ? `[CardDetailsWidget] cardProgram is required and was not set. Pass ${e} — it selects which card program to read, so there is no default. No card was fetched.` : `[CardDetailsWidget] cardProgram must be ${e}, received ${JSON.stringify(f)}. No card was fetched.`);
54
+ }, [f, P]);
55
+ let [Ce, V] = he(), H = Ce === i;
57
56
  v(() => {
58
57
  V(void 0);
59
- }, [a]);
60
- let U = ne({
58
+ }, [i]);
59
+ let U = te({
61
60
  panelState: B,
62
- cardProgram: p,
63
- cardStatus: L?.cardStatus
61
+ cardProgram: f,
62
+ cardStatus: I?.cardStatus
64
63
  });
65
64
  v(() => {
66
65
  H && !U && V(void 0);
67
66
  }, [H, U]);
68
- let W = ue({
69
- cardId: a,
67
+ let W = g({
68
+ cardId: i,
70
69
  enabled: U && H
71
- }), G = ae({
70
+ }), G = ie({
72
71
  isRevealRequested: H,
73
72
  isError: W.isError,
74
73
  hasCredentials: !!W.data
75
- }), K = y(() => B === "loaded" && L ? ie({
76
- card: L,
77
- cardProgram: p,
74
+ }), K = y(() => B === "loaded" && I ? re({
75
+ card: I,
76
+ cardProgram: f,
78
77
  labels: N
79
78
  }) : void 0, [
80
- L,
81
- p,
79
+ I,
80
+ f,
82
81
  N,
83
82
  B
84
- ]), Te = _(async (t) => {
85
- await m(t) && (e.success(N.copySuccessToast), O(f.ValueCopied));
86
- }, [N.copySuccessToast, O]), q = B === "loaded" ? L : void 0, J = pe({
87
- cardId: a,
88
- cardProgram: p,
83
+ ]), we = _(async (e) => {
84
+ let t = await p(e);
85
+ return t && k(d.ValueCopied), t;
86
+ }, [k]), q = B === "loaded" ? I : void 0, J = fe({
87
+ cardId: i,
88
+ cardProgram: f,
89
89
  card: q,
90
- scopes: j?.scopes,
91
- currentUserId: M ? void 0 : j?.userId ?? void 0,
90
+ scopes: M?.scopes,
91
+ currentUserId: ve ? void 0 : M?.userId ?? void 0,
92
92
  conflictToast: N.activationConflictToast
93
- }), Y = me({
94
- cardId: a,
95
- cardProgram: p,
93
+ }), Y = pe({
94
+ cardId: i,
95
+ cardProgram: f,
96
96
  card: q,
97
- scopes: j?.scopes,
97
+ scopes: M?.scopes,
98
98
  conflictToast: N.lockConflictToast
99
- }), X = he({
100
- cardId: a,
101
- cardProgram: p,
99
+ }), X = me({
100
+ cardId: i,
101
+ cardProgram: f,
102
102
  card: q,
103
103
  nickname: K?.nickname,
104
- scopes: j?.scopes,
104
+ scopes: M?.scopes,
105
105
  conflictToast: N.nicknameConflictToast,
106
106
  successToast: N.nicknameUpdatedToast
107
- }), { refetch: Z } = W, Ee = _(() => {
108
- H ? Z() : V(a);
107
+ }), { refetch: Z } = W, Te = _(() => {
108
+ H ? Z() : V(i);
109
109
  }, [
110
- a,
110
+ i,
111
111
  H,
112
112
  Z
113
- ]), De = _(() => {
113
+ ]), Ee = _(() => {
114
114
  V(void 0);
115
115
  }, []), Q = _(() => {
116
- V(void 0), S?.();
117
- }, [S]), Oe = _(() => {
116
+ V(void 0), C?.();
117
+ }, [C]), De = _(() => {
118
118
  J.finish(), Q();
119
- }, [J.finish, Q]), ke = y(() => W.isForbidden ? {
120
- ...C,
119
+ }, [J.finish, Q]), Oe = y(() => W.isForbidden ? {
120
+ ...w,
121
121
  credentials: {
122
- ...C?.credentials,
122
+ ...w?.credentials,
123
123
  errorDescription: N.revealNotPermittedDescription
124
124
  }
125
- } : C, [
125
+ } : w, [
126
126
  W.isForbidden,
127
- C,
127
+ w,
128
128
  N.revealNotPermittedDescription
129
129
  ]), $ = y(() => {
130
130
  if (G === "revealed" && W.data) return {
131
- cardNumber: ee(W.data.pan),
132
- expirationDate: te(W.data.expirationDate),
131
+ cardNumber: m(W.data.pan),
132
+ expirationDate: ee(W.data.expirationDate),
133
133
  securityCode: W.data.cvv
134
134
  };
135
- }, [W.data, G]), Ae = _(() => {
136
- k || z ? A() : R();
135
+ }, [W.data, G]), ke = _(() => {
136
+ A || z ? j() : R();
137
137
  }, [
138
138
  z,
139
139
  R,
140
- A,
141
- k
140
+ j,
141
+ A
142
142
  ]);
143
- return /* @__PURE__ */ _e(ge, { children: [/* @__PURE__ */ x(r, {}), J.isOpen ? /* @__PURE__ */ x(g, {
144
- testIds: se,
145
- labels: ve,
143
+ return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(n, {}), J.isOpen ? /* @__PURE__ */ x(de, {
144
+ testIds: oe,
145
+ labels: ge,
146
146
  state: J.state,
147
147
  values: J.values,
148
148
  errors: J.errors,
@@ -150,25 +150,27 @@ function S({ cardId: a, cardProgram: p, onClose: S, labels: C, activateLabels: v
150
150
  onValuesChange: J.onValuesChange,
151
151
  onSubmit: J.onSubmit,
152
152
  onClose: J.close,
153
- onDone: S ? Oe : void 0,
154
- cardArtSrc: T,
155
- bankLogoSrc: E,
156
- bankLogoAlt: D,
153
+ onDone: C ? De : J.close,
154
+ cardArtSrc: E,
155
+ bankLogoSrc: D,
156
+ bankLogoAlt: O,
157
157
  cardholderName: K?.cardholderName,
158
158
  maskedCardNumber: K?.maskedCardNumber,
159
- programLabel: K?.programLabel
160
- }) : /* @__PURE__ */ x(fe, {
161
- testIds: ce,
162
- labels: ke,
159
+ programLabel: K?.programLabel,
160
+ lastFour: K?.lastFour,
161
+ formFactorLabel: K?.formFactorLabel
162
+ }) : /* @__PURE__ */ x(ue, {
163
+ testIds: se,
164
+ labels: Oe,
163
165
  state: B,
164
166
  nickname: K?.nickname,
165
167
  statusLabel: K?.statusLabel,
166
168
  statusTone: K?.statusTone,
167
169
  formFactorLabel: K?.formFactorLabel,
168
- onClose: S ? Q : void 0,
169
- cardArtSrc: T,
170
- bankLogoSrc: E,
171
- bankLogoAlt: D,
170
+ onClose: C ? Q : void 0,
171
+ cardArtSrc: E,
172
+ bankLogoSrc: D,
173
+ bankLogoAlt: O,
172
174
  cardholderName: K?.cardholderName,
173
175
  maskedCardNumber: K?.maskedCardNumber,
174
176
  programLabel: K?.programLabel,
@@ -176,7 +178,7 @@ function S({ cardId: a, cardProgram: p, onClose: S, labels: C, activateLabels: v
176
178
  allowedCategories: K?.allowedCategories,
177
179
  spendLimitLabels: K?.spendLimitLabels,
178
180
  perTransactionMaxLabel: K?.perTransactionMaxLabel,
179
- onCopy: Te,
181
+ onCopy: we,
180
182
  onEditNickname: X.onEditNickname,
181
183
  nicknameEditState: X.editState,
182
184
  nicknameDraft: X.draft,
@@ -185,8 +187,8 @@ function S({ cardId: a, cardProgram: p, onClose: S, labels: C, activateLabels: v
185
187
  onCancelNicknameEdit: X.onCancel,
186
188
  isNicknameSaveDisabled: X.isSaveDisabled,
187
189
  onActivate: J.canActivate ? J.open : void 0,
188
- onViewCard: U ? Ee : void 0,
189
- onHideCard: U ? De : void 0,
190
+ onViewCard: U ? Te : void 0,
191
+ onHideCard: U ? Ee : void 0,
190
192
  revealState: G,
191
193
  revealedCardNumber: $?.cardNumber,
192
194
  revealedExpirationDate: $?.expirationDate,
@@ -195,25 +197,25 @@ function S({ cardId: a, cardProgram: p, onClose: S, labels: C, activateLabels: v
195
197
  lockState: Y.lockState,
196
198
  onLockCard: Y.onLockCard,
197
199
  onUnlockCard: Y.onUnlockCard,
198
- onRetry: P === h.Supported ? Ae : void 0
200
+ onRetry: P === h.Supported ? ke : void 0
199
201
  })] });
200
202
  }
201
- function C({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: d, providerLabels: f, ...m }) {
202
- return /* @__PURE__ */ x(a, {
203
- widgetName: p,
203
+ function w({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: a, linkComponent: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: d, providerLabels: p, ...m }) {
204
+ return /* @__PURE__ */ x(i, {
205
+ widgetName: f,
204
206
  baseUrl: e,
205
207
  widgetToken: t,
206
208
  organizationId: n,
207
209
  configClient: r,
208
- gatewayRouting: i,
210
+ gatewayRouting: a,
209
211
  linkComponent: o,
210
212
  uiFramework: s,
211
213
  errorFallback: c,
212
214
  onError: l,
213
215
  analytics: u,
214
216
  disclosuresAcceptance: d,
215
- providerLabels: f,
216
- children: /* @__PURE__ */ x(S, { ...m })
217
+ providerLabels: p,
218
+ children: /* @__PURE__ */ x(C, { ...m })
217
219
  });
218
220
  }
219
- export { C as CardDetailsWidget, C as default };
221
+ export { w as CardDetailsWidget, w as default };
@@ -29,6 +29,7 @@ function d({ card: e, cardProgram: r, labels: a }) {
29
29
  formFactorLabel: a.formFactorLabels[e.cardType],
30
30
  programLabel: a.programLabels[r],
31
31
  maskedCardNumber: i(e.lastFourDigits),
32
+ lastFour: e.lastFourDigits,
32
33
  cardholderName: o || void 0,
33
34
  nickname: s || void 0,
34
35
  billingAddress: n(e.billingAddress),
@@ -1,7 +1,5 @@
1
- import "./lib/CardDetailsPanel/statusBadge.js";
2
1
  import "./lib/CardDetailsPanel/CardDetailsHeader.js";
3
2
  import "./lib/CardDetailsPanel/CardFace.js";
4
- import "./lib/CardDetailsPanel/DetailCopyRow.js";
5
3
  import "./lib/CardDetailsPanel/labels.js";
6
4
  import { CardDetailsPanel as e } from "./lib/CardDetailsPanel/CardDetailsPanel.js";
7
5
  import "./lib/ActivateCardPanel/labels.js";