@justifi/webcomponents 5.7.6-rc-15 → 5.7.6-rc-16

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 (86) hide show
  1. package/dist/cjs/{check-pkg-version-ByX4f7IS.js → check-pkg-version-BkzyzJ71.js} +1 -1
  2. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  3. package/dist/cjs/justifi-apple-pay.cjs.entry.js +10 -6
  4. package/dist/cjs/justifi-bank-account-form_5.cjs.entry.js +2 -2
  5. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  6. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  7. package/dist/cjs/justifi-button_5.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  9. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
  10. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  13. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  19. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  21. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  24. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  25. package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +2 -2
  26. package/dist/cjs/{package-B9lk24pE.js → package-e83u_82Y.js} +1 -1
  27. package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +10 -6
  28. package/dist/docs.json +1 -1
  29. package/dist/esm/{check-pkg-version-B41631Te.js → check-pkg-version-Ddp_kLM5.js} +1 -1
  30. package/dist/esm/hidden-input_2.entry.js +1 -1
  31. package/dist/esm/justifi-apple-pay.entry.js +10 -6
  32. package/dist/esm/justifi-bank-account-form_5.entry.js +2 -2
  33. package/dist/esm/justifi-business-details.entry.js +2 -2
  34. package/dist/esm/justifi-business-form.entry.js +2 -2
  35. package/dist/esm/justifi-button_5.entry.js +2 -2
  36. package/dist/esm/justifi-checkout.entry.js +2 -2
  37. package/dist/esm/justifi-checkouts-list.entry.js +2 -2
  38. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  39. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  40. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  41. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  42. package/dist/esm/justifi-payment-details.entry.js +2 -2
  43. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  44. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  45. package/dist/esm/justifi-payments-list.entry.js +2 -2
  46. package/dist/esm/justifi-payout-details.entry.js +2 -2
  47. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  48. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  49. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  50. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  51. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  52. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  53. package/dist/esm/justifi-tokenize-payment-method.entry.js +2 -2
  54. package/dist/esm/{package-DQw405te.js → package-HMZ8vsvN.js} +1 -1
  55. package/dist/module/justifi-apple-pay.js +10 -6
  56. package/dist/module/package.js +1 -1
  57. package/dist/webcomponents/{p-b0d13720.entry.js → p-04169a4a.entry.js} +1 -1
  58. package/dist/webcomponents/{p-09ed066a.entry.js → p-1c79237c.entry.js} +1 -1
  59. package/dist/webcomponents/{p-60bd5d42.entry.js → p-207f4e07.entry.js} +1 -1
  60. package/dist/webcomponents/{p-08ddd64a.entry.js → p-35bc4279.entry.js} +1 -1
  61. package/dist/webcomponents/{p-e0084249.entry.js → p-3fb1b0be.entry.js} +1 -1
  62. package/dist/webcomponents/{p-b0e5ec4a.entry.js → p-487fd882.entry.js} +1 -1
  63. package/dist/webcomponents/{p-cfe079ec.entry.js → p-6b9dfd09.entry.js} +1 -1
  64. package/dist/webcomponents/{p-ade655af.entry.js → p-7db0847f.entry.js} +1 -1
  65. package/dist/webcomponents/{p-5dcb70a4.entry.js → p-90a2875b.entry.js} +1 -1
  66. package/dist/webcomponents/{p-54f63be6.entry.js → p-935f8208.entry.js} +1 -1
  67. package/dist/webcomponents/{p-0d42a7d1.entry.js → p-948066ff.entry.js} +1 -1
  68. package/dist/webcomponents/{p-DgpDYsPj.js → p-CDmdt8BH.js} +1 -1
  69. package/dist/webcomponents/p-HMZ8vsvN.js +1 -0
  70. package/dist/webcomponents/{p-4f730a07.entry.js → p-a60c67e6.entry.js} +1 -1
  71. package/dist/webcomponents/{p-3f6f37f7.entry.js → p-b0f90f5d.entry.js} +1 -1
  72. package/dist/webcomponents/{p-6c315467.entry.js → p-b6d05490.entry.js} +1 -1
  73. package/dist/webcomponents/p-bb481c67.entry.js +1 -0
  74. package/dist/webcomponents/{p-35183cd8.entry.js → p-be4c5b34.entry.js} +1 -1
  75. package/dist/webcomponents/{p-25926883.entry.js → p-c983e9bb.entry.js} +1 -1
  76. package/dist/webcomponents/{p-848f201c.entry.js → p-df82aca6.entry.js} +1 -1
  77. package/dist/webcomponents/{p-3638ee2a.entry.js → p-e5ae45c3.entry.js} +1 -1
  78. package/dist/webcomponents/{p-d012ef90.entry.js → p-f18076ba.entry.js} +1 -1
  79. package/dist/webcomponents/{p-a593ea40.entry.js → p-f2bae759.entry.js} +1 -1
  80. package/dist/webcomponents/{p-51713085.entry.js → p-f3f8a5a2.entry.js} +1 -1
  81. package/dist/webcomponents/{p-8e2a45e4.entry.js → p-fb6723b7.entry.js} +1 -1
  82. package/dist/webcomponents/{p-e325a33c.entry.js → p-fcc30769.entry.js} +1 -1
  83. package/dist/webcomponents/webcomponents.esm.js +1 -1
  84. package/package.json +1 -1
  85. package/dist/webcomponents/p-28053d61.entry.js +0 -1
  86. package/dist/webcomponents/p-DQw405te.js +0 -1
@@ -10,7 +10,7 @@ import './Pagination-CLHwhyvu.js';
10
10
  import './Payment-Bs0-9Lnt.js';
11
11
  import { B as Business, b as BusinessFormServerErrors } from './Business-BCoP0TAV.js';
12
12
  import './Dispute-7MWRbTXI.js';
13
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
13
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
14
14
  import { B as Button } from './button-DxM4-mlD.js';
15
15
  import { S as StyledHost } from './styled-host-B_XBaM7z.js';
16
16
  import { H as Header1 } from './header-1-B0PFwGib.js';
@@ -25,7 +25,7 @@ import './state-options-BX8GieXu.js';
25
25
  import './business-form-options-CgssATyg.js';
26
26
  import './index-B9me4yN2.js';
27
27
  import './helpers-Mu7LQT-w.js';
28
- import './package-DQw405te.js';
28
+ import './package-HMZ8vsvN.js';
29
29
  import './Api-DQM93PRm.js';
30
30
  import './parts-D3G5aVLy.js';
31
31
  import './utils-BeQLScSm.js';
@@ -8,7 +8,7 @@ import './event-types-CZfYo5-1.js';
8
8
  import { H as Header1 } from './header-1-B0PFwGib.js';
9
9
  import { H as Header2, b as insuranceValuesOn, i as insuranceValues } from './insurance-state-DQH40x6F.js';
10
10
  import { H as Header3 } from './header-3-D3gxg6YU.js';
11
- import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-B41631Te.js';
11
+ import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-Ddp_kLM5.js';
12
12
  import './config-state-BrllxiM0.js';
13
13
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes, b as ComponentErrorMessages } from './ComponentError-Cjcsf8ku.js';
14
14
  import { I as ICheckoutStatus } from './Refund-4B3c-kLz.js';
@@ -19,7 +19,7 @@ import './Dispute-7MWRbTXI.js';
19
19
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
20
20
  import { C as CheckoutService } from './checkout.service-CXeKDZTF.js';
21
21
  import './index-B9me4yN2.js';
22
- import './package-DQw405te.js';
22
+ import './package-HMZ8vsvN.js';
23
23
  import './Api-DQM93PRm.js';
24
24
  import './helpers-Mu7LQT-w.js';
25
25
  import './state-options-BX8GieXu.js';
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
2
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
2
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
3
3
  import { c as checkoutStore } from './checkout.store-QrBBYQfi.js';
4
4
  import { d as checkoutSummary } from './parts-D3G5aVLy.js';
5
5
  import { P as PaymentMethodTypes } from './Payment-Bs0-9Lnt.js';
6
6
  import { S as StyledHost } from './styled-host-B_XBaM7z.js';
7
7
  import './event-types-CZfYo5-1.js';
8
- import './package-DQw405te.js';
8
+ import './package-HMZ8vsvN.js';
9
9
  import './Api-DQM93PRm.js';
10
10
  import './config-state-BrllxiM0.js';
11
11
  import './index-B9me4yN2.js';
@@ -8,7 +8,7 @@ import './Payment-Bs0-9Lnt.js';
8
8
  import './Business-BCoP0TAV.js';
9
9
  import './Dispute-7MWRbTXI.js';
10
10
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
11
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
11
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
12
12
  import { C as CheckoutService } from './checkout.service-CXeKDZTF.js';
13
13
  import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccounts-C62B2OC_.js';
14
14
  import { S as StyledHost } from './styled-host-B_XBaM7z.js';
@@ -17,7 +17,7 @@ import { d as defaultColumnsKeys } from './checkouts-table-Djb7Yj6O.js';
17
17
  import './index-B9me4yN2.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
19
  import './state-options-BX8GieXu.js';
20
- import './package-DQw405te.js';
20
+ import './package-HMZ8vsvN.js';
21
21
  import './Api-DQM93PRm.js';
22
22
  import './badge-D-vrtiQR.js';
23
23
  import './parts-D3G5aVLy.js';
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
2
2
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
3
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
4
4
  import { a as Dispute } from './Dispute-7MWRbTXI.js';
5
5
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
6
6
  import { D as DisputeService } from './dispute.service-DWs_TX-m.js';
7
- import './package-DQw405te.js';
7
+ import './package-HMZ8vsvN.js';
8
8
  import './Api-DQM93PRm.js';
9
9
  import './config-state-BrllxiM0.js';
10
10
  import './index-B9me4yN2.js';
@@ -9,7 +9,7 @@ import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './Compone
9
9
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
10
10
  import { D as DisputeService } from './dispute.service-DWs_TX-m.js';
11
11
  import { D as DisputeManagementClickActions } from './event-types-Bg2SZArf.js';
12
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
12
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
13
13
  import './Api-DQM93PRm.js';
14
14
  import './config-state-BrllxiM0.js';
15
15
  import './index-B9me4yN2.js';
@@ -20,7 +20,7 @@ import './Dispute-7MWRbTXI.js';
20
20
  import './Business-BCoP0TAV.js';
21
21
  import './helpers-Mu7LQT-w.js';
22
22
  import './state-options-BX8GieXu.js';
23
- import './package-DQw405te.js';
23
+ import './package-HMZ8vsvN.js';
24
24
 
25
25
  const makeUpdateDisputeResponse = ({ authToken, disputeId, service }) => async ({ payload, onSuccess, onError, final = () => { } }) => {
26
26
  var _a;
@@ -8,14 +8,14 @@ import './Business-BCoP0TAV.js';
8
8
  import './Dispute-7MWRbTXI.js';
9
9
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
10
10
  import { E as ErrorState } from './utils-CBJo9jNE.js';
11
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
11
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
12
12
  import './config-state-BrllxiM0.js';
13
13
  import './index-B9me4yN2.js';
14
14
  import './utils-B7jE0g5_.js';
15
15
  import './helpers-Mu7LQT-w.js';
16
16
  import './state-options-BX8GieXu.js';
17
17
  import './parts-D3G5aVLy.js';
18
- import './package-DQw405te.js';
18
+ import './package-HMZ8vsvN.js';
19
19
 
20
20
  const api = Api();
21
21
  class ReportsService {
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent } from './index-kpoIU4v_.js'
2
2
  import { ap as heading5, am as heading4, ae as buttonPrimary, z as text } from './parts-D3G5aVLy.js';
3
3
  import { S as StyledHost } from './styled-host-B_XBaM7z.js';
4
4
  import './event-types-CZfYo5-1.js';
5
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
5
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
6
6
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
7
7
  import { B as BusinessService } from './business.service-BgXdRyYa.js';
8
8
  import { B as Business } from './Business-BCoP0TAV.js';
@@ -16,7 +16,7 @@ import './Payment-Bs0-9Lnt.js';
16
16
  import './Dispute-7MWRbTXI.js';
17
17
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
18
18
  import { T as TerminalService } from './terminal.service-BLeBxTv4.js';
19
- import './package-DQw405te.js';
19
+ import './package-HMZ8vsvN.js';
20
20
  import './Api-DQM93PRm.js';
21
21
  import './helpers-Mu7LQT-w.js';
22
22
  import './state-options-BX8GieXu.js';
@@ -3,7 +3,7 @@ import { P as PaymentService } from './payment.service-BnDr_9vX.js';
3
3
  import { m as makeGetPaymentDetails } from './get-payment-details-j8nOngzB.js';
4
4
  import { E as ErrorState } from './utils-CBJo9jNE.js';
5
5
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
6
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
6
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
7
7
  import './Api-DQM93PRm.js';
8
8
  import './config-state-BrllxiM0.js';
9
9
  import './index-B9me4yN2.js';
@@ -17,7 +17,7 @@ import './helpers-Mu7LQT-w.js';
17
17
  import './state-options-BX8GieXu.js';
18
18
  import './utils-BeQLScSm.js';
19
19
  import './parts-D3G5aVLy.js';
20
- import './package-DQw405te.js';
20
+ import './package-HMZ8vsvN.js';
21
21
 
22
22
  const PaymentDetails = class {
23
23
  constructor(hostRef) {
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
2
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
2
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
3
3
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
4
4
  import { m as makeGetBusiness, a as makePostProvisioning } from './payment-provisioning-actions-ONP8lDnV.js';
5
5
  import { B as BusinessService } from './business.service-BgXdRyYa.js';
@@ -9,7 +9,7 @@ import './Pagination-CLHwhyvu.js';
9
9
  import './Payment-Bs0-9Lnt.js';
10
10
  import './Business-BCoP0TAV.js';
11
11
  import './Dispute-7MWRbTXI.js';
12
- import './package-DQw405te.js';
12
+ import './package-HMZ8vsvN.js';
13
13
  import './utils-BeQLScSm.js';
14
14
  import './config-state-BrllxiM0.js';
15
15
  import './index-B9me4yN2.js';
@@ -7,7 +7,7 @@ import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
7
7
  import './Payment-Bs0-9Lnt.js';
8
8
  import './Business-BCoP0TAV.js';
9
9
  import './Dispute-7MWRbTXI.js';
10
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
10
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
11
11
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
12
12
  import { P as PaymentService } from './payment.service-BnDr_9vX.js';
13
13
  import { T as Table, l as TableWrapper, a as TableComponent, b as TableHead, c as TableHeadRow, d as TableBody, e as TableLoadingState, f as TableEmptyState, g as TableErrorState, h as TableRow, i as TableFoot, j as TableFootRow, k as TableFootCell } from './table-CTPfsGKi.js';
@@ -17,7 +17,7 @@ import { N as tableHeadCell, O as getAlternateTableCellPart } from './parts-D3G5
17
17
  import './index-B9me4yN2.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
19
  import './state-options-BX8GieXu.js';
20
- import './package-DQw405te.js';
20
+ import './package-HMZ8vsvN.js';
21
21
  import './Api-DQM93PRm.js';
22
22
  import './spinner-D-vbFqC6.js';
23
23
 
@@ -9,7 +9,7 @@ import { a as Payment } from './Payment-Bs0-9Lnt.js';
9
9
  import './Business-BCoP0TAV.js';
10
10
  import './Dispute-7MWRbTXI.js';
11
11
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
12
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
12
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
13
13
  import { S as StyledHost } from './styled-host-B_XBaM7z.js';
14
14
  import './event-types-CZfYo5-1.js';
15
15
  import { d as defaultColumnsKeys } from './payments-table-BuiNqlwv.js';
@@ -17,7 +17,7 @@ import './Api-DQM93PRm.js';
17
17
  import './index-B9me4yN2.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
19
  import './state-options-BX8GieXu.js';
20
- import './package-DQw405te.js';
20
+ import './package-HMZ8vsvN.js';
21
21
  import './payments-status-DVYzDcJ4.js';
22
22
  import './badge-D-vrtiQR.js';
23
23
  import './parts-D3G5aVLy.js';
@@ -10,14 +10,14 @@ import './Business-BCoP0TAV.js';
10
10
  import './Dispute-7MWRbTXI.js';
11
11
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
12
12
  import { E as ErrorState } from './utils-CBJo9jNE.js';
13
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
13
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
14
14
  import { m as makeGetPayoutCSV } from './get-payout-csv-D-Lnooki.js';
15
15
  import './Api-DQM93PRm.js';
16
16
  import './index-B9me4yN2.js';
17
17
  import './helpers-Mu7LQT-w.js';
18
18
  import './state-options-BX8GieXu.js';
19
19
  import './parts-D3G5aVLy.js';
20
- import './package-DQw405te.js';
20
+ import './package-HMZ8vsvN.js';
21
21
 
22
22
  const makeGetPayoutDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
23
23
  var _a;
@@ -7,7 +7,7 @@ import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
7
7
  import './Payment-Bs0-9Lnt.js';
8
8
  import './Business-BCoP0TAV.js';
9
9
  import './Dispute-7MWRbTXI.js';
10
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
10
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
11
11
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
12
12
  import { P as PayoutService } from './payout.service-Ai1aEuFC.js';
13
13
  import { T as Table, l as TableWrapper, a as TableComponent, b as TableHead, c as TableHeadRow, d as TableBody, e as TableLoadingState, f as TableEmptyState, g as TableErrorState, h as TableRow, i as TableFoot, j as TableFootRow, k as TableFootCell } from './table-CTPfsGKi.js';
@@ -17,7 +17,7 @@ import { N as tableHeadCell, O as getAlternateTableCellPart } from './parts-D3G5
17
17
  import './index-B9me4yN2.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
19
  import './state-options-BX8GieXu.js';
20
- import './package-DQw405te.js';
20
+ import './package-HMZ8vsvN.js';
21
21
  import './Api-DQM93PRm.js';
22
22
  import './spinner-D-vbFqC6.js';
23
23
 
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
2
2
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
3
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
4
4
  import { P as PayoutService } from './payout.service-Ai1aEuFC.js';
5
5
  import './config-state-BrllxiM0.js';
6
6
  import './utils-B7jE0g5_.js';
@@ -15,7 +15,7 @@ import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccoun
15
15
  import { S as StyledHost } from './styled-host-B_XBaM7z.js';
16
16
  import './event-types-CZfYo5-1.js';
17
17
  import { d as defaultColumnsKeys } from './payouts-table-cgIXP54P.js';
18
- import './package-DQw405te.js';
18
+ import './package-HMZ8vsvN.js';
19
19
  import './Api-DQM93PRm.js';
20
20
  import './index-B9me4yN2.js';
21
21
  import './helpers-Mu7LQT-w.js';
@@ -13,7 +13,7 @@ import { S as StyledHost } from './styled-host-B_XBaM7z.js';
13
13
  import './event-types-CZfYo5-1.js';
14
14
  import { P as PaymentService } from './payment.service-BnDr_9vX.js';
15
15
  import { m as makeGetPaymentDetails } from './get-payment-details-j8nOngzB.js';
16
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
16
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
17
17
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
18
18
  import { A as Api } from './Api-DQM93PRm.js';
19
19
  import { S as Skeleton } from './skeleton-CZfDofm6.js';
@@ -22,7 +22,7 @@ import './index-B9me4yN2.js';
22
22
  import './helpers-Mu7LQT-w.js';
23
23
  import './state-options-BX8GieXu.js';
24
24
  import './parts-D3G5aVLy.js';
25
- import './package-DQw405te.js';
25
+ import './package-HMZ8vsvN.js';
26
26
 
27
27
  const amountValidation = (maxAmount) => {
28
28
  const max = +maxAmount;
@@ -7,14 +7,14 @@ import './Payment-Bs0-9Lnt.js';
7
7
  import './Business-BCoP0TAV.js';
8
8
  import './Dispute-7MWRbTXI.js';
9
9
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
10
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
10
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
11
11
  import { c as checkoutStore } from './checkout.store-QrBBYQfi.js';
12
12
  import './config-state-BrllxiM0.js';
13
13
  import './index-B9me4yN2.js';
14
14
  import './utils-B7jE0g5_.js';
15
15
  import './helpers-Mu7LQT-w.js';
16
16
  import './state-options-BX8GieXu.js';
17
- import './package-DQw405te.js';
17
+ import './package-HMZ8vsvN.js';
18
18
 
19
19
  const api = Api();
20
20
  class InsuranceService {
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
2
2
  import { S as StyledHost } from './styled-host-B_XBaM7z.js';
3
3
  import './event-types-CZfYo5-1.js';
4
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
4
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
5
5
  import { d as defaultColumnsKeys } from './terminal-orders-table-CvK516_V.js';
6
6
  import './config-state-BrllxiM0.js';
7
7
  import './utils-B7jE0g5_.js';
@@ -13,7 +13,7 @@ import './Business-BCoP0TAV.js';
13
13
  import './Dispute-7MWRbTXI.js';
14
14
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
15
15
  import { A as Api } from './Api-DQM93PRm.js';
16
- import './package-DQw405te.js';
16
+ import './package-HMZ8vsvN.js';
17
17
  import './parts-D3G5aVLy.js';
18
18
  import './badge-D-vrtiQR.js';
19
19
  import './index-B9me4yN2.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
2
2
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
3
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
4
4
  import { T as TerminalService } from './terminal.service-BLeBxTv4.js';
5
5
  import './config-state-BrllxiM0.js';
6
6
  import './utils-B7jE0g5_.js';
@@ -14,7 +14,7 @@ import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccoun
14
14
  import { S as StyledHost } from './styled-host-B_XBaM7z.js';
15
15
  import './event-types-CZfYo5-1.js';
16
16
  import { d as defaultColumnsKeys } from './terminals-table-2QGQITkt.js';
17
- import './package-DQw405te.js';
17
+ import './package-HMZ8vsvN.js';
18
18
  import './Api-DQM93PRm.js';
19
19
  import './index-B9me4yN2.js';
20
20
  import './helpers-Mu7LQT-w.js';
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js'
2
2
  import { B as Button } from './button-DxM4-mlD.js';
3
3
  import { S as StyledHost } from './styled-host-B_XBaM7z.js';
4
4
  import './event-types-CZfYo5-1.js';
5
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B41631Te.js';
5
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Ddp_kLM5.js';
6
6
  import './config-state-BrllxiM0.js';
7
7
  import './utils-B7jE0g5_.js';
8
8
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
@@ -13,7 +13,7 @@ import './Business-BCoP0TAV.js';
13
13
  import './Dispute-7MWRbTXI.js';
14
14
  import { c as checkoutStore } from './checkout.store-QrBBYQfi.js';
15
15
  import './parts-D3G5aVLy.js';
16
- import './package-DQw405te.js';
16
+ import './package-HMZ8vsvN.js';
17
17
  import './Api-DQM93PRm.js';
18
18
  import './index-B9me4yN2.js';
19
19
  import './helpers-Mu7LQT-w.js';
@@ -1,5 +1,5 @@
1
1
  const name = "@justifi/webcomponents";
2
- const version = "5.7.6-rc-15";
2
+ const version = "5.7.6-rc-16";
3
3
  var packageJson = {
4
4
  name: name,
5
5
  version: version};
@@ -738,14 +738,15 @@ const ApplePay = /*@__PURE__*/ proxyCustomElement(class ApplePay extends HTMLEle
738
738
  });
739
739
  }
740
740
  watchPropsChange() {
741
- if (this.applePayService) {
742
- this.applePayService.setApiBaseUrl(this.apiBaseUrl);
743
- this.applePayService.setAuthToken(checkoutStore.authToken);
744
- }
745
741
  this.initializeApplePay();
746
742
  }
747
743
  async initializeApplePay() {
744
+ console.log('Initializing Apple Pay');
748
745
  try {
746
+ if (this.applePayService) {
747
+ this.applePayService.setApiBaseUrl(this.apiBaseUrl);
748
+ this.applePayService.setAuthToken(checkoutStore.authToken);
749
+ }
749
750
  this.isLoading = true;
750
751
  this.error = null;
751
752
  if (!checkoutStore.paymentAmount) {
@@ -810,10 +811,13 @@ const ApplePay = /*@__PURE__*/ proxyCustomElement(class ApplePay extends HTMLEle
810
811
  this.isAvailable &&
811
812
  this.canMakePayments &&
812
813
  !this.error;
813
- return (h(StyledHost, { key: '953181f3712f10b4b9b04bef01234c8e4933e9b5' }, h("script", { key: '56f8b6ea2195084a6da92f621971d36f6d1f9a1c', src: "https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js" }), h("div", { key: 'e0bc21900fa8d1c6530fd85949df3597671bc2d2', class: 'apple-pay-container' }, h(ApplePaySkeleton, { key: '9fe1873351ebd2f44ac55e9f1b4226546bc974c7', isReady: isReady }), !this.isLoading && this.error && (h("div", { key: '037b2c8b667b2979bee387036e3f61e73bac7a9c', class: 'apple-pay-error', role: 'alert' }, h("span", { key: '690db2fcceeeed89ef79604e4055b674faa88ec7', class: 'error-icon' }, "\u26A0\uFE0F"), h("span", { key: '0b8dbc5aba93ac1f2653ad25bf8591010a76ce01', class: 'error-message' }, this.error))), !this.isLoading && !this.error && !this.isAvailable && (h("div", { key: '485cd6aa6cf5913b868ae377e7d92bbf4e06ef26', class: 'apple-pay-unavailable' }, h("span", { key: '5d19e24d39f197dd67f3f06244763771a8d79f66', class: 'unavailable-message' }, "Apple Pay is not available on this device"))), !this.isLoading &&
814
+ return (h(StyledHost, { key: '627782068c729d8a2ed515957b0d1d30497c43fb' }, h("script", { key: '526abcdccd477a882c2087c1d9a2272edc24c759', async: true, onLoad: () => {
815
+ console.log('Apple Pay SDK loaded');
816
+ this.initializeApplePay();
817
+ }, src: "https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js" }), h("div", { key: '29221d2d2c4ebc00ba0d27e428bdc2c26b9a3dff', class: 'apple-pay-container' }, h(ApplePaySkeleton, { key: '9135d2ad9bfbcd3b84a687738d733c2b6d1c7a31', isReady: isReady }), !this.isLoading && this.error && (h("div", { key: 'da6585c2eb35ab82aa1e21e3895dc379854a35b1', class: 'apple-pay-error', role: 'alert' }, h("span", { key: '4a3234ea9927e49bf3a8658c2800ae4baf2c8a2e', class: 'error-icon' }, "\u26A0\uFE0F"), h("span", { key: '13627e68c6132fed6e08558386995e660f78b01b', class: 'error-message' }, this.error))), !this.isLoading && !this.error && !this.isAvailable && (h("div", { key: 'db9167ed16f32614610f2168d25e5a4643e22879', class: 'apple-pay-unavailable' }, h("span", { key: 'f09c6e9d8325fb324dfc537edf51d80f800588a9', class: 'unavailable-message' }, "Apple Pay is not available on this device"))), !this.isLoading &&
814
818
  !this.error &&
815
819
  this.isAvailable &&
816
- this.canMakePayments && (h(ApplePayButton, { key: 'ad33bb08354abf930de5e3f1d873ee2818929a40', buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick }))), h("style", { key: '59d757ff744c1a684e8c4d78a0d2463ded62288a' }, `
820
+ this.canMakePayments && (h(ApplePayButton, { key: '2e7c23547883e165edea0ffb776e49007b8d82a1', buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick }))), h("style", { key: '99c32299d475bcbb8a093505c9254de4ab87145f' }, `
817
821
  .apple-pay-container {
818
822
  width: 100%;
819
823
  }
@@ -1,5 +1,5 @@
1
1
  const name = "@justifi/webcomponents";
2
- const version = "5.7.6-rc-15";
2
+ const version = "5.7.6-rc-16";
3
3
  var webcomponentsPackageJson = {
4
4
  name: name,
5
5
  version: version};
@@ -1 +1 @@
1
- import{r as e,c as t,h as a}from"./p-kpoIU4v_.js";import{c as d,J as i}from"./p-DgpDYsPj.js";import{c as s}from"./p-BYakc1Om.js";import{d as c}from"./p-D3G5aVLy.js";import{P as o}from"./p-BDUTtU21.js";import{S as f}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import"./p-DQw405te.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-7MWRbTXI.js";const h={bankAccount:"New bank account",card:"New credit or debit card"},r=class{constructor(a){e(this,a),this.errorEvent=t(this,"error-event"),this.loadedEvent=t(this,"loaded"),this.submitEvent=t(this,"submit-event"),this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.paymentMethodOptions=[],this.savePaymentMethod=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){d(),this.analytics=new i(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}savePaymentMethodChanged(e){this.savePaymentMethod=e.detail}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){this.isSubmitting=!1,console.error("checkout error",e.detail)}paymentMethodOptionSelected(e){s.selectedPaymentMethod=e.detail.id}async fillBillingForm(e){s.billingFormFields=e}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){s.checkoutId=this.checkoutId,s.authToken=this.authToken,s.disableCreditCard=this.disableCreditCard,s.disableBankAccount=this.disableBankAccount,s.disableBnpl=this.disableBnpl,s.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){this.isSubmitting=!0,this.modularCheckoutRef.submitCheckout(s.billingFormFields)}get canSavePaymentMethod(){return s.selectedPaymentMethod===o.card||s.selectedPaymentMethod===o.bankAccount}get showBillingForm(){return s.selectedPaymentMethod===o.card&&!this.hideCardBillingForm||s.selectedPaymentMethod===o.bankAccount&&!this.hideBankAccountBillingForm}get showBillingFormSection(){return s.selectedPaymentMethod===o.card||s.selectedPaymentMethod===o.bankAccount}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}get showPostalCodeForm(){return s.selectedPaymentMethod===o.card&&this.hideCardBillingForm}render(){return a(f,{key:"4fb1d82b065de6c1e4651a246a53f8e58451d6f6"},a("justifi-modular-checkout",{key:"232cf32890422f474cf929b7c7ed7246d7b39c75",ref:e=>this.modularCheckoutRef=e,authToken:this.authToken,checkoutId:this.checkoutId,savePaymentMethod:this.canSavePaymentMethod&&this.savePaymentMethod},a("div",{key:"677ad110b05520be3b729995657086f0f6cbf337",class:"row gy-3 jfi-checkout-core"},a("div",{key:"458c84541dd154dd8b4ad1d0f2320e2308cc1785",class:"col-12",part:c},a("justifi-header",{key:"440a7d1ad7b21da3db66e6c6f1f9afefb434a089",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),a("section",{key:"99bd431a8f70ce6e764cc04da3d0aaae6f0ebcbe"},a("justifi-checkout-summary",{key:"52da663e5bed35f0deb220800c7ede8835a3671b"}))),a("div",{key:"e95b1c6830d20c5af57c558badb04d07d3c48f23",class:"col-12 mt-4"},a("slot",{key:"527d58d4806d2e1bbcba499e97ab65f6c9c7efb9",name:"insurance"})),a("div",{key:"69d1319d1e05852de4f5566ad3be20bc9a6ee499",class:"col-12 mt-4"},a("justifi-header",{key:"1682f909f22172a44da54118aefe428f92908e91",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&a("justifi-header",{key:"7942a12143bea0235705969737e11d59bc5180e1",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),a("div",{key:"497664d455695693c4f9a1a4465c62ad4d5b6bdf",class:"d-flex flex-column"},a("section",{key:"d3da4c18b430e1b36f7b9ba20be517994e763b5e"},a("div",{key:"1cc0f0462a0f70d2acc4c9fdee25fbb2fe953c22"},a("justifi-saved-payment-methods",{key:"576da27df84d67bc69f2d95f00a6c440fa73f7ed"}),a("justifi-sezzle-payment-method",{key:"6544a3a250ee012870a9edce71dd763553d44554"}),!this.disableCreditCard&&a("div",{key:"79050f768d8d76c4d882bed667e85391c230a960"},a("payment-method-option",{key:"5a6c1dc583766707e6215203fdba176bd65b501d",paymentMethodOptionId:o.card,isSelected:s.selectedPaymentMethod===o.card,clickHandler:()=>{s.selectedPaymentMethod=o.card},radioButtonHidden:this.disableCreditCard,label:h[o.card]}),s.selectedPaymentMethod===o.card&&a("div",{key:"5e6f0b854191a9a5db8936b2e30518fba251e478",class:"mt-4 mb-4"},a("justifi-card-form",{key:"6c3f72f27dfe36924fe94ab4f7c79b6b9ff19b47"}))),!this.disableBankAccount&&a("div",{key:"f6a88103b2c30e4dd10e733b19aaa29a7a44430c"},a("payment-method-option",{key:"67ef047a8caad5bc389238d54bb3d7056ca4b9e6",paymentMethodOptionId:o.bankAccount,isSelected:s.selectedPaymentMethod===o.bankAccount,clickHandler:()=>{s.selectedPaymentMethod=o.bankAccount},radioButtonHidden:this.disableBankAccount,label:h[o.bankAccount]}),s.selectedPaymentMethod===o.bankAccount&&a("div",{key:"e67924184fc43811523081711f59865a01d7cf9f",class:"mt-4 mb-4"},a("justifi-bank-account-form",{key:"a01cdfe8be1bc98d4c0f75c2a9f2ca1cce519042"}))))))),this.showBillingFormSection&&a("div",{key:"a15f1202548c7d6c302c2b2827168a6a119f8634",class:"col-12 mt-4"},this.showBillingForm&&a("justifi-header",{key:"ee654c812cb097449937da4253e191de1ee669d5",text:"Billing Address",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPostalCodeForm&&a("justifi-postal-code-form",{key:"2a5736e6da3354f7a9d1a5b8870a2f61c09c2592"}),this.showBillingForm&&a("justifi-billing-information-form",{key:"7dd63931e75d7583b4f51a1f6bb2b1e84a46e078"})),a("div",{key:"54aeb0f07f574ee004ec02cd279265202cffa9bf",class:"col-12"},this.canSavePaymentMethod&&a("justifi-save-new-payment-method",{key:"2e010be22091cee1ebc4353d5dac3b49639175e7"})),a("div",{key:"71df812c8a922ae8b447d647f69675230c092db9",class:"mt-4"},a("justifi-button",{key:"057cd18c6235c73cc69ca85e9cb35a2a614a4d9a",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disableBnpl:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{r as justifi_checkout}
1
+ import{r as e,c as t,h as a}from"./p-kpoIU4v_.js";import{c as d,J as i}from"./p-CDmdt8BH.js";import{c as s}from"./p-BYakc1Om.js";import{d as c}from"./p-D3G5aVLy.js";import{P as o}from"./p-BDUTtU21.js";import{S as f}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import"./p-HMZ8vsvN.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-7MWRbTXI.js";const h={bankAccount:"New bank account",card:"New credit or debit card"},r=class{constructor(a){e(this,a),this.errorEvent=t(this,"error-event"),this.loadedEvent=t(this,"loaded"),this.submitEvent=t(this,"submit-event"),this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.paymentMethodOptions=[],this.savePaymentMethod=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){d(),this.analytics=new i(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}savePaymentMethodChanged(e){this.savePaymentMethod=e.detail}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){this.isSubmitting=!1,console.error("checkout error",e.detail)}paymentMethodOptionSelected(e){s.selectedPaymentMethod=e.detail.id}async fillBillingForm(e){s.billingFormFields=e}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){s.checkoutId=this.checkoutId,s.authToken=this.authToken,s.disableCreditCard=this.disableCreditCard,s.disableBankAccount=this.disableBankAccount,s.disableBnpl=this.disableBnpl,s.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){this.isSubmitting=!0,this.modularCheckoutRef.submitCheckout(s.billingFormFields)}get canSavePaymentMethod(){return s.selectedPaymentMethod===o.card||s.selectedPaymentMethod===o.bankAccount}get showBillingForm(){return s.selectedPaymentMethod===o.card&&!this.hideCardBillingForm||s.selectedPaymentMethod===o.bankAccount&&!this.hideBankAccountBillingForm}get showBillingFormSection(){return s.selectedPaymentMethod===o.card||s.selectedPaymentMethod===o.bankAccount}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}get showPostalCodeForm(){return s.selectedPaymentMethod===o.card&&this.hideCardBillingForm}render(){return a(f,{key:"4fb1d82b065de6c1e4651a246a53f8e58451d6f6"},a("justifi-modular-checkout",{key:"232cf32890422f474cf929b7c7ed7246d7b39c75",ref:e=>this.modularCheckoutRef=e,authToken:this.authToken,checkoutId:this.checkoutId,savePaymentMethod:this.canSavePaymentMethod&&this.savePaymentMethod},a("div",{key:"677ad110b05520be3b729995657086f0f6cbf337",class:"row gy-3 jfi-checkout-core"},a("div",{key:"458c84541dd154dd8b4ad1d0f2320e2308cc1785",class:"col-12",part:c},a("justifi-header",{key:"440a7d1ad7b21da3db66e6c6f1f9afefb434a089",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),a("section",{key:"99bd431a8f70ce6e764cc04da3d0aaae6f0ebcbe"},a("justifi-checkout-summary",{key:"52da663e5bed35f0deb220800c7ede8835a3671b"}))),a("div",{key:"e95b1c6830d20c5af57c558badb04d07d3c48f23",class:"col-12 mt-4"},a("slot",{key:"527d58d4806d2e1bbcba499e97ab65f6c9c7efb9",name:"insurance"})),a("div",{key:"69d1319d1e05852de4f5566ad3be20bc9a6ee499",class:"col-12 mt-4"},a("justifi-header",{key:"1682f909f22172a44da54118aefe428f92908e91",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&a("justifi-header",{key:"7942a12143bea0235705969737e11d59bc5180e1",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),a("div",{key:"497664d455695693c4f9a1a4465c62ad4d5b6bdf",class:"d-flex flex-column"},a("section",{key:"d3da4c18b430e1b36f7b9ba20be517994e763b5e"},a("div",{key:"1cc0f0462a0f70d2acc4c9fdee25fbb2fe953c22"},a("justifi-saved-payment-methods",{key:"576da27df84d67bc69f2d95f00a6c440fa73f7ed"}),a("justifi-sezzle-payment-method",{key:"6544a3a250ee012870a9edce71dd763553d44554"}),!this.disableCreditCard&&a("div",{key:"79050f768d8d76c4d882bed667e85391c230a960"},a("payment-method-option",{key:"5a6c1dc583766707e6215203fdba176bd65b501d",paymentMethodOptionId:o.card,isSelected:s.selectedPaymentMethod===o.card,clickHandler:()=>{s.selectedPaymentMethod=o.card},radioButtonHidden:this.disableCreditCard,label:h[o.card]}),s.selectedPaymentMethod===o.card&&a("div",{key:"5e6f0b854191a9a5db8936b2e30518fba251e478",class:"mt-4 mb-4"},a("justifi-card-form",{key:"6c3f72f27dfe36924fe94ab4f7c79b6b9ff19b47"}))),!this.disableBankAccount&&a("div",{key:"f6a88103b2c30e4dd10e733b19aaa29a7a44430c"},a("payment-method-option",{key:"67ef047a8caad5bc389238d54bb3d7056ca4b9e6",paymentMethodOptionId:o.bankAccount,isSelected:s.selectedPaymentMethod===o.bankAccount,clickHandler:()=>{s.selectedPaymentMethod=o.bankAccount},radioButtonHidden:this.disableBankAccount,label:h[o.bankAccount]}),s.selectedPaymentMethod===o.bankAccount&&a("div",{key:"e67924184fc43811523081711f59865a01d7cf9f",class:"mt-4 mb-4"},a("justifi-bank-account-form",{key:"a01cdfe8be1bc98d4c0f75c2a9f2ca1cce519042"}))))))),this.showBillingFormSection&&a("div",{key:"a15f1202548c7d6c302c2b2827168a6a119f8634",class:"col-12 mt-4"},this.showBillingForm&&a("justifi-header",{key:"ee654c812cb097449937da4253e191de1ee669d5",text:"Billing Address",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPostalCodeForm&&a("justifi-postal-code-form",{key:"2a5736e6da3354f7a9d1a5b8870a2f61c09c2592"}),this.showBillingForm&&a("justifi-billing-information-form",{key:"7dd63931e75d7583b4f51a1f6bb2b1e84a46e078"})),a("div",{key:"54aeb0f07f574ee004ec02cd279265202cffa9bf",class:"col-12"},this.canSavePaymentMethod&&a("justifi-save-new-payment-method",{key:"2e010be22091cee1ebc4353d5dac3b49639175e7"})),a("div",{key:"71df812c8a922ae8b447d647f69675230c092db9",class:"mt-4"},a("justifi-button",{key:"057cd18c6235c73cc69ca85e9cb35a2a614a4d9a",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disableBnpl:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{r as justifi_checkout}
@@ -1 +1 @@
1
- import{r as t,c as s,h as o}from"./p-kpoIU4v_.js";import{P as i}from"./p-Sz-UKsNL.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{C as r,a as e}from"./p-Cjcsf8ku.js";import{P as p}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as a,a as h}from"./p-D2muobcE.js";import{E as n}from"./p-CEYGUVns.js";import{c as m,J as c}from"./p-DgpDYsPj.js";import{m as u}from"./p-DYGIC0QH.js";import"./p-Dj1uo4J3.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D3G5aVLy.js";import"./p-DQw405te.js";const d=class{constructor(o){t(this,o),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new c(this),this.initializeServices()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:o})=>async({onSuccess:i,onError:e})=>{var n;try{const m=await o.fetchPayout(t,s);m.error?e({error:h(m.error),code:a(null===(n=m.error)||void 0===n?void 0:n.code),severity:r.ERROR}):i(new p(m.data))}catch(t){e({error:h(t),code:a(null==t?void 0:t.code),severity:r.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new i}),this.getPayoutCSV=u({authToken:this.authToken,service:new i})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:e.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):o("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_payout_details}
1
+ import{r as t,c as s,h as o}from"./p-kpoIU4v_.js";import{P as i}from"./p-Sz-UKsNL.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{C as r,a as e}from"./p-Cjcsf8ku.js";import{P as p}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as a,a as h}from"./p-D2muobcE.js";import{E as n}from"./p-CEYGUVns.js";import{c as m,J as c}from"./p-CDmdt8BH.js";import{m as u}from"./p-DYGIC0QH.js";import"./p-Dj1uo4J3.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D3G5aVLy.js";import"./p-HMZ8vsvN.js";const d=class{constructor(o){t(this,o),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new c(this),this.initializeServices()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:o})=>async({onSuccess:i,onError:e})=>{var n;try{const m=await o.fetchPayout(t,s);m.error?e({error:h(m.error),code:a(null===(n=m.error)||void 0===n?void 0:n.code),severity:r.ERROR}):i(new p(m.data))}catch(t){e({error:h(t),code:a(null==t?void 0:t.code),severity:r.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new i}),this.getPayoutCSV=u({authToken:this.authToken,service:new i})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:e.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):o("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_payout_details}
@@ -1 +1 @@
1
- import{r as e,c as t,h as s}from"./p-kpoIU4v_.js";import{f as i}from"./p-B7jE0g5_.js";import{z as a,am as r}from"./p-D3G5aVLy.js";import{B as d}from"./p-Cm_ywVHL.js";import{S as c}from"./p-CRFzwZW6.js";import{S as o}from"./p-Bz8JT676.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as l}from"./p-DiWKhLRS.js";import{D as u}from"./p-Bg2SZArf.js";import{c as b,J as y}from"./p-DgpDYsPj.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-DQw405te.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event")}acceptDispute(){m({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"0f1028825a7a96a06e7219518ffed54bc0db1b2b"},this.isLoading&&s("div",{key:"f4b704182a5a7085827854634d38c56423cc2e1b",style:{marginBottom:"8px"}},s(o,{key:"b2062d8b683ab110c26fc30f1600c4500f668d87",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"b5d2afe1fdd2e5ee0ec60048a48778bcfa6c78d3",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"1e87c8936b3f2e26e680786927c5a4609aca0b83",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"49090493e3921353b7a830397795496bb234d112",part:a},s("h1",{key:"fd7b56a7cfeaa6820bf2cc121575314d075b5a83",class:"h4",part:r},"This payment is disputed"),s("p",{key:"72ba296695928baca8f7c5c3b1f858c596efedb2"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"cce733ff1bbca7a9530a442035cbae2995e018e7",class:"h5"},"Dispute details"),s("div",{key:"28b7f081e345112d99c52d05f205734995617253",class:"d-table gap-2"},s("div",{key:"d9476d8d0adfa3c6eccad229e94cd3824a720c7d",class:"d-table-row gap-2"},s("span",{key:"4d9e0714eee778c326ee1d70a32f79d90d3d4b09",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"b227edcf9b4b65b790d8aa98021d2662a12855bc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"b1b1cdaac5482f565a6f26af71c0b526b8c19f4e",class:"d-table-row gap-2"},s("span",{key:"0a479a9de96cce6e42bec90a17affe2c93ced44f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"5d5020dda571f4465e2a358880ad5f20bc6171ea",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"a5f42c3fcbb5d14f8479d0a576d31a50f8fc6441",class:"d-table-row gap-2"},s("span",{key:"280fca5a101eb0e823eb9ccc13c746ac7ed62069",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"4dfc0b9a295ffc804b708d3590358256009e5376",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"654e7baccd08628bc90d050bad108011b49f9972",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"d0817cdb23bf33086c6ce5122f4ed5388027d96c",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"5446bef44a0ca747692d59fd5490409d00a9e285",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"17fbc5902badc4230c5485b326f480180c844768"},s("h1",{key:"fefa0234306588d9e7f56733872bf8c9793f51dd",class:"h4"},"This payment is disputed and under review"),s("p",{key:"eaad72aa8d9f65ca296379a2800180878ec8a7e5"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"ec1b0d728a7518f913c2a69976fa1f5fc8f76c74"},s("h1",{key:"9d42fad15fbeee507e2f364c3a35f143ff7599e2",class:"h4"},"This payment was disputed"),s("p",{key:"3b728a5544fe17a6c58c12f7e8eef290022945b6"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"6d1813508a657265546fbef00bd1e8f46ffaf740"},s("h1",{key:"de981fc2e06e860f47146647975965a903a39b55",class:"h4"},"This payment was disputed"),s("p",{key:"4e57ab86518bd678a3a5402b712d40d573b3a970"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"dbdfd59a21c7e8ea4dfdaecb91f885f82540a27c"},s("justifi-dispute-response-core",{key:"3cff38e5995f0033c45c54fa195ffeebc27e189e","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.stepCompleteEvent=t(this,"complete-form-step-event"),this.submitEvent=t(this,"submit-event"),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"20d075178a9d88cd73be32e52f8df6d3d360f8d7",class:"row gy-3"},s("div",{key:"6c1bc735f1a15709c596b5bea7cc3ce50e9a73f5",class:"col-12"},s("h1",{key:"27a0804924937ee7a8d01265bd0da2d9dd31d301",class:"h4",part:r},"Counter dispute")),s("div",{key:"b60822e91425c5c4af003169f47fd725daf9fb0f",class:"col-12"},this.currentStepComponent),s("div",{key:"d1be3f6be53de37836275067070cf4b5a2eb3e4a",class:"col-12"},s("div",{key:"48c8725d8de8b658e59ccfa851a6af6638e19ca5",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{v as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}
1
+ import{r as e,c as t,h as s}from"./p-kpoIU4v_.js";import{f as i}from"./p-B7jE0g5_.js";import{z as a,am as r}from"./p-D3G5aVLy.js";import{B as d}from"./p-Cm_ywVHL.js";import{S as c}from"./p-CRFzwZW6.js";import{S as o}from"./p-Bz8JT676.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as l}from"./p-DiWKhLRS.js";import{D as u}from"./p-Bg2SZArf.js";import{c as b,J as y}from"./p-CDmdt8BH.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-HMZ8vsvN.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event")}acceptDispute(){m({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"0f1028825a7a96a06e7219518ffed54bc0db1b2b"},this.isLoading&&s("div",{key:"f4b704182a5a7085827854634d38c56423cc2e1b",style:{marginBottom:"8px"}},s(o,{key:"b2062d8b683ab110c26fc30f1600c4500f668d87",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"b5d2afe1fdd2e5ee0ec60048a48778bcfa6c78d3",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"1e87c8936b3f2e26e680786927c5a4609aca0b83",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"49090493e3921353b7a830397795496bb234d112",part:a},s("h1",{key:"fd7b56a7cfeaa6820bf2cc121575314d075b5a83",class:"h4",part:r},"This payment is disputed"),s("p",{key:"72ba296695928baca8f7c5c3b1f858c596efedb2"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"cce733ff1bbca7a9530a442035cbae2995e018e7",class:"h5"},"Dispute details"),s("div",{key:"28b7f081e345112d99c52d05f205734995617253",class:"d-table gap-2"},s("div",{key:"d9476d8d0adfa3c6eccad229e94cd3824a720c7d",class:"d-table-row gap-2"},s("span",{key:"4d9e0714eee778c326ee1d70a32f79d90d3d4b09",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"b227edcf9b4b65b790d8aa98021d2662a12855bc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"b1b1cdaac5482f565a6f26af71c0b526b8c19f4e",class:"d-table-row gap-2"},s("span",{key:"0a479a9de96cce6e42bec90a17affe2c93ced44f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"5d5020dda571f4465e2a358880ad5f20bc6171ea",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"a5f42c3fcbb5d14f8479d0a576d31a50f8fc6441",class:"d-table-row gap-2"},s("span",{key:"280fca5a101eb0e823eb9ccc13c746ac7ed62069",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"4dfc0b9a295ffc804b708d3590358256009e5376",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"654e7baccd08628bc90d050bad108011b49f9972",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"d0817cdb23bf33086c6ce5122f4ed5388027d96c",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"5446bef44a0ca747692d59fd5490409d00a9e285",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"17fbc5902badc4230c5485b326f480180c844768"},s("h1",{key:"fefa0234306588d9e7f56733872bf8c9793f51dd",class:"h4"},"This payment is disputed and under review"),s("p",{key:"eaad72aa8d9f65ca296379a2800180878ec8a7e5"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"ec1b0d728a7518f913c2a69976fa1f5fc8f76c74"},s("h1",{key:"9d42fad15fbeee507e2f364c3a35f143ff7599e2",class:"h4"},"This payment was disputed"),s("p",{key:"3b728a5544fe17a6c58c12f7e8eef290022945b6"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"6d1813508a657265546fbef00bd1e8f46ffaf740"},s("h1",{key:"de981fc2e06e860f47146647975965a903a39b55",class:"h4"},"This payment was disputed"),s("p",{key:"4e57ab86518bd678a3a5402b712d40d573b3a970"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"dbdfd59a21c7e8ea4dfdaecb91f885f82540a27c"},s("justifi-dispute-response-core",{key:"3cff38e5995f0033c45c54fa195ffeebc27e189e","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.stepCompleteEvent=t(this,"complete-form-step-event"),this.submitEvent=t(this,"submit-event"),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"20d075178a9d88cd73be32e52f8df6d3d360f8d7",class:"row gy-3"},s("div",{key:"6c1bc735f1a15709c596b5bea7cc3ce50e9a73f5",class:"col-12"},s("h1",{key:"27a0804924937ee7a8d01265bd0da2d9dd31d301",class:"h4",part:r},"Counter dispute")),s("div",{key:"b60822e91425c5c4af003169f47fd725daf9fb0f",class:"col-12"},this.currentStepComponent),s("div",{key:"d1be3f6be53de37836275067070cf4b5a2eb3e4a",class:"col-12"},s("div",{key:"48c8725d8de8b658e59ccfa851a6af6638e19ca5",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{v as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}
@@ -1 +1 @@
1
- import{r as e,h as t,c as s,H as i,g as o}from"./p-kpoIU4v_.js";import{S as r}from"./p-CRFzwZW6.js";import{B as a}from"./p-Cm_ywVHL.js";import{z as c,r as h}from"./p-D3G5aVLy.js";import{f as n}from"./p-B7jE0g5_.js";import{c as d,o as p}from"./p-BYakc1Om.js";import"./p-CZfYo5-1.js";import{H as l}from"./p-Cc27pPPQ.js";import{H as u,b as m,i as y}from"./p-vHbP4g3Q.js";import{H as f}from"./p-CLjv4frq.js";import{J as v,c as b}from"./p-DgpDYsPj.js";import"./p-9y5MOK55.js";import{C as k,a as j,b as C}from"./p-Cjcsf8ku.js";import{I as g}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as P,a as _}from"./p-D2muobcE.js";import{C as w}from"./p-C0EFqY0W.js";import"./p-7WIgS5RM.js";import"./p-DQw405te.js";import"./p-Dj1uo4J3.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const A=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return t(r,{key:"18d7ab039e1cef7b3e5fea26c0af5f37c36eab14"},t(a,{key:"5ae27b690cf7d7d94cfae966782ff3ff1165f402",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},E=class{constructor(t){e(this,t)}render(){return t(r,{key:"d7aeca995c6793b5b2c12a85eb7c6ce01ab8d025"},t("section",{key:"962bdd1ce83c5464465c41d5b5655b7c1922208e"},t("div",{key:"f8ecf321efae1bfb53cd88c3b32a7b51d0e9bc6a"},t("div",{key:"630c741b4b931e61cad0823eba96f63c7cbdb2e0",part:c},null==d?void 0:d.paymentDescription),t("div",{key:"15be11ce16201a7e3659a01783d9d9b8d5cd5f2b"},t("span",{key:"36e21c27b534551bad9570ccf9628be36ddae05b",part:c},"Total")," ",t("span",{key:"d270040198a56e22f8e14e302166a6235e190c99",part:c},n(+(null==d?void 0:d.totalAmount)))))))}},L=class{constructor(t){e(this,t),this.levels={h1:l,h2:u,h3:f},this.level="h1"}render(){return t(r,{key:"2d95ee91f805c2966eb50c1772ee2e02457ddca5"},t(this.levels[this.level],{key:"6afb5a11c91793a29f4b79e67e3cafe2ce1ff977",text:this.text,class:this.class}))}},M=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event"),this.submitEvent=s(this,"submit-event"),this.paymentMethodChangedEvent=s(this,"payment-method-changed"),this.savePaymentMethod=!1,this.handleApplePayCompleted=e=>{const{success:t,token:s,error:i}=e.detail;t&&s?(this.applePayToken=s,this.submitCheckoutWithApplePay()):(console.error("Apple Pay completed but failed:",i),this.errorEvent.emit({message:(null==i?void 0:i.message)||"Apple Pay payment failed",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR}))},this.handleApplePayError=e=>{const{error:t}=e.detail;console.error("Apple Pay error:",t),this.errorEvent.emit({message:t||"Apple Pay error occurred",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})},this.handleApplePayCancelled=()=>{console.log("Apple Pay cancelled by user"),this.applePayToken=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),d.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new w};this.getCheckout=(({authToken:e,checkoutId:t,service:s})=>async({onSuccess:i,onError:o})=>{var r;try{const a=await s.fetchCheckout(e,t);if(a.error)return o({error:_(a.error),code:P(null===(r=a.error)||void 0===r?void 0:r.code),severity:k.ERROR});i({checkout:a.data})}catch(e){const t=P(null==e?void 0:e.code);return o({error:e.message||e,code:t,severity:k.ERROR})}})(e),this.completeCheckout=(({authToken:e,checkoutId:t,service:s})=>async({payment:i,onSuccess:o,onError:r})=>{var a;try{const c=await s.complete(e,t,i);if(c.error)return r({error:_(c.error),code:P(null===(a=c.error)||void 0===a?void 0:a.code),severity:k.ERROR});o({checkout:c.data})}catch(e){const t=P(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:k.ERROR})}})(e),p("selectedPaymentMethod",(e=>{this.paymentMethodChangedEvent.emit(e)}))}componentWillLoad(){this.authToken&&this.checkoutId?(this.analytics=new v(this),b(),d.authToken=this.authToken,this.fetchCheckout(),m("set",(e=>{void 0!==y[e]&&this.fetchCheckout()}))):this.errorEvent.emit({message:C.NOT_AUTHENTICATED,errorCode:j.NOT_AUTHENTICATED,severity:k.ERROR})}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.getCheckout&&this.getCheckout({onSuccess:({checkout:e})=>{e.status!==g.completed?e.status!==g.expired?this.updateStore(e):this.errorEvent.emit({message:C.CHECKOUT_EXPIRED,errorCode:j.CHECKOUT_EXPIRED,severity:k.ERROR}):this.errorEvent.emit({message:C.CHECKOUT_ALREADY_COMPLETED,errorCode:j.CHECKOUT_ALREADY_COMPLETED,severity:k.ERROR})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.FETCH_ERROR,severity:k.ERROR})}})}updateStore(e){var t,s,i,o;d.accountId=e.account_id,d.paymentMethods=e.payment_methods,d.paymentMethodGroupId=e.payment_method_group_id,d.paymentDescription=e.payment_description,d.totalAmount=e.total_amount,d.paymentAmount=e.payment_amount,d.bnplEnabled=e.payment_settings.bnpl_payments,d.bnplProviderClientId=null===(t=null==e?void 0:e.bnpl)||void 0===t?void 0:t.provider_client_id,d.bnplProviderMode=null===(s=null==e?void 0:e.bnpl)||void 0===s?void 0:s.provider_mode,d.bnplProviderApiVersion=null===(i=null==e?void 0:e.bnpl)||void 0===i?void 0:i.provider_api_version,d.bnplProviderCheckoutUrl=null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.provider_checkout_url}queryFormRefs(){this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form"),this.billingInformationFormRef=this.hostEl.querySelector("justifi-billing-information-form, justifi-postal-code-form"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance"),this.sezzlePaymentMethodRef=this.hostEl.querySelector("justifi-sezzle-payment-method"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async submitCheckoutWithApplePay(){this.applePayToken?this.completeCheckout({payment:{payment_mode:"apple_pay",payment_token:this.applePayToken},onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Apple Pay checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}}):this.errorEvent.emit({message:"No Apple Pay token available",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})}async tokenizePaymentMethod(e){var t,s;const i=null!==(s=await(null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.getValues()))&&void 0!==s?s:{},o=Object.assign(Object.assign({},e),i),r=Object.assign({accountId:d.accountId,payment_method_group_id:void 0},o);return this.savePaymentMethod&&(r.payment_method_group_id=d.paymentMethodGroupId),this.paymentMethodFormRef.tokenize({clientId:this.authToken,paymentMethodMetadata:r,account:d.accountId})}async getPaymentMethod(e){if(this.applePayToken)return"apple_pay_token";if(!this.paymentMethodFormRef)return d.selectedPaymentMethod;const{error:t,id:s}=await this.tokenizePaymentMethod(e);if(!t)return s;this.errorEvent.emit({errorCode:t.code,message:t.message,severity:k.ERROR})}async validate(){var e,t;if(this.applePayToken)return!0;const s=[null===(e=this.paymentMethodFormRef)||void 0===e?void 0:e.validate(),null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.validate()];return this.insuranceFormRef&&s.push(this.insuranceFormRef.validate()),(await Promise.all(s)).every((e=>!1!==(null==e?void 0:e.isValid)))}async submitCheckout(e){var t;if(this.applePayToken)return void await this.submitCheckoutWithApplePay();if(!await this.validate())return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:j.VALIDATION_ERROR,severity:k.ERROR});let s;if("sezzle"===d.selectedPaymentMethod){const e=this.insuranceFormRef?await this.insuranceFormRef.validate():{isValid:!0},i=await this.sezzlePaymentMethodRef.resolvePaymentMethod(e);if(i.error)return void this.errorEvent.emit({message:i.error.message,errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});"success"===(null===(t=i.bnpl)||void 0===t?void 0:t.status)&&(s={payment_mode:"bnpl",payment_token:void 0})}else{const t=await this.getPaymentMethod(e);if(!t)return void this.errorEvent.emit({message:"Payment method tokenization failed.",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});s={payment_mode:"ecom",payment_token:t}}this.completeCheckout({payment:s,onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}})}async setSelectedPaymentMethod(e){d.selectedPaymentMethod=e}render(){return t(i,{key:"307608e8cd41e1c262dbca6cda7b0bfc8855dedf"})}get hostEl(){return o(this)}},D=class{constructor(t){e(this,t)}render(){return t(r,{key:"13d81bf8c38b3f59567a8f3414d3ba77c2f4730c",class:"payment-method"},t("div",{key:"d4636ac2cc75bc6f1688aa5aabb64c427c14634e",class:"radio-list-item p-3",part:h,onClick:this.clickHandler,hidden:this.radioButtonHidden},t("form-control-radio",{key:"2e086a0fd3494695c6cc0d95399a4d6fc8805069",name:"paymentMethodType",value:this.paymentMethodOptionId,checked:this.isSelected,label:this.label})))}};export{A as justifi_button,E as justifi_checkout_summary,L as justifi_header,M as justifi_modular_checkout,D as payment_method_option}
1
+ import{r as e,h as t,c as s,H as i,g as o}from"./p-kpoIU4v_.js";import{S as r}from"./p-CRFzwZW6.js";import{B as a}from"./p-Cm_ywVHL.js";import{z as c,r as h}from"./p-D3G5aVLy.js";import{f as n}from"./p-B7jE0g5_.js";import{c as d,o as l}from"./p-BYakc1Om.js";import"./p-CZfYo5-1.js";import{H as p}from"./p-Cc27pPPQ.js";import{H as u,b as m,i as y}from"./p-vHbP4g3Q.js";import{H as f}from"./p-CLjv4frq.js";import{J as v,c as b}from"./p-CDmdt8BH.js";import"./p-9y5MOK55.js";import{C as k,a as j,b as C}from"./p-Cjcsf8ku.js";import{I as g}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as P,a as _}from"./p-D2muobcE.js";import{C as w}from"./p-C0EFqY0W.js";import"./p-7WIgS5RM.js";import"./p-HMZ8vsvN.js";import"./p-Dj1uo4J3.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const M=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return t(r,{key:"18d7ab039e1cef7b3e5fea26c0af5f37c36eab14"},t(a,{key:"5ae27b690cf7d7d94cfae966782ff3ff1165f402",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},A=class{constructor(t){e(this,t)}render(){return t(r,{key:"d7aeca995c6793b5b2c12a85eb7c6ce01ab8d025"},t("section",{key:"962bdd1ce83c5464465c41d5b5655b7c1922208e"},t("div",{key:"f8ecf321efae1bfb53cd88c3b32a7b51d0e9bc6a"},t("div",{key:"630c741b4b931e61cad0823eba96f63c7cbdb2e0",part:c},null==d?void 0:d.paymentDescription),t("div",{key:"15be11ce16201a7e3659a01783d9d9b8d5cd5f2b"},t("span",{key:"36e21c27b534551bad9570ccf9628be36ddae05b",part:c},"Total")," ",t("span",{key:"d270040198a56e22f8e14e302166a6235e190c99",part:c},n(+(null==d?void 0:d.totalAmount)))))))}},E=class{constructor(t){e(this,t),this.levels={h1:p,h2:u,h3:f},this.level="h1"}render(){return t(r,{key:"2d95ee91f805c2966eb50c1772ee2e02457ddca5"},t(this.levels[this.level],{key:"6afb5a11c91793a29f4b79e67e3cafe2ce1ff977",text:this.text,class:this.class}))}},L=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event"),this.submitEvent=s(this,"submit-event"),this.paymentMethodChangedEvent=s(this,"payment-method-changed"),this.savePaymentMethod=!1,this.handleApplePayCompleted=e=>{const{success:t,token:s,error:i}=e.detail;t&&s?(this.applePayToken=s,this.submitCheckoutWithApplePay()):(console.error("Apple Pay completed but failed:",i),this.errorEvent.emit({message:(null==i?void 0:i.message)||"Apple Pay payment failed",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR}))},this.handleApplePayError=e=>{const{error:t}=e.detail;console.error("Apple Pay error:",t),this.errorEvent.emit({message:t||"Apple Pay error occurred",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})},this.handleApplePayCancelled=()=>{console.log("Apple Pay cancelled by user"),this.applePayToken=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),d.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new w};this.getCheckout=(({authToken:e,checkoutId:t,service:s})=>async({onSuccess:i,onError:o})=>{var r;try{const a=await s.fetchCheckout(e,t);if(a.error)return o({error:_(a.error),code:P(null===(r=a.error)||void 0===r?void 0:r.code),severity:k.ERROR});i({checkout:a.data})}catch(e){const t=P(null==e?void 0:e.code);return o({error:e.message||e,code:t,severity:k.ERROR})}})(e),this.completeCheckout=(({authToken:e,checkoutId:t,service:s})=>async({payment:i,onSuccess:o,onError:r})=>{var a;try{const c=await s.complete(e,t,i);if(c.error)return r({error:_(c.error),code:P(null===(a=c.error)||void 0===a?void 0:a.code),severity:k.ERROR});o({checkout:c.data})}catch(e){const t=P(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:k.ERROR})}})(e),l("selectedPaymentMethod",(e=>{this.paymentMethodChangedEvent.emit(e)}))}componentWillLoad(){this.authToken&&this.checkoutId?(this.analytics=new v(this),b(),d.authToken=this.authToken,this.fetchCheckout(),m("set",(e=>{void 0!==y[e]&&this.fetchCheckout()}))):this.errorEvent.emit({message:C.NOT_AUTHENTICATED,errorCode:j.NOT_AUTHENTICATED,severity:k.ERROR})}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.getCheckout&&this.getCheckout({onSuccess:({checkout:e})=>{e.status!==g.completed?e.status!==g.expired?this.updateStore(e):this.errorEvent.emit({message:C.CHECKOUT_EXPIRED,errorCode:j.CHECKOUT_EXPIRED,severity:k.ERROR}):this.errorEvent.emit({message:C.CHECKOUT_ALREADY_COMPLETED,errorCode:j.CHECKOUT_ALREADY_COMPLETED,severity:k.ERROR})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.FETCH_ERROR,severity:k.ERROR})}})}updateStore(e){var t,s,i,o;d.accountId=e.account_id,d.paymentMethods=e.payment_methods,d.paymentMethodGroupId=e.payment_method_group_id,d.paymentDescription=e.payment_description,d.totalAmount=e.total_amount,d.paymentAmount=e.payment_amount,d.bnplEnabled=e.payment_settings.bnpl_payments,d.bnplProviderClientId=null===(t=null==e?void 0:e.bnpl)||void 0===t?void 0:t.provider_client_id,d.bnplProviderMode=null===(s=null==e?void 0:e.bnpl)||void 0===s?void 0:s.provider_mode,d.bnplProviderApiVersion=null===(i=null==e?void 0:e.bnpl)||void 0===i?void 0:i.provider_api_version,d.bnplProviderCheckoutUrl=null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.provider_checkout_url}queryFormRefs(){this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form"),this.billingInformationFormRef=this.hostEl.querySelector("justifi-billing-information-form, justifi-postal-code-form"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance"),this.sezzlePaymentMethodRef=this.hostEl.querySelector("justifi-sezzle-payment-method"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async submitCheckoutWithApplePay(){this.applePayToken?this.completeCheckout({payment:{payment_mode:"apple_pay",payment_token:this.applePayToken},onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Apple Pay checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}}):this.errorEvent.emit({message:"No Apple Pay token available",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})}async tokenizePaymentMethod(e){var t,s;const i=null!==(s=await(null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.getValues()))&&void 0!==s?s:{},o=Object.assign(Object.assign({},e),i),r=Object.assign({accountId:d.accountId,payment_method_group_id:void 0},o);return this.savePaymentMethod&&(r.payment_method_group_id=d.paymentMethodGroupId),this.paymentMethodFormRef.tokenize({clientId:this.authToken,paymentMethodMetadata:r,account:d.accountId})}async getPaymentMethod(e){if(this.applePayToken)return"apple_pay_token";if(!this.paymentMethodFormRef)return d.selectedPaymentMethod;const{error:t,id:s}=await this.tokenizePaymentMethod(e);if(!t)return s;this.errorEvent.emit({errorCode:t.code,message:t.message,severity:k.ERROR})}async validate(){var e,t;if(this.applePayToken)return!0;const s=[null===(e=this.paymentMethodFormRef)||void 0===e?void 0:e.validate(),null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.validate()];return this.insuranceFormRef&&s.push(this.insuranceFormRef.validate()),(await Promise.all(s)).every((e=>!1!==(null==e?void 0:e.isValid)))}async submitCheckout(e){var t;if(this.applePayToken)return void await this.submitCheckoutWithApplePay();if(!await this.validate())return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:j.VALIDATION_ERROR,severity:k.ERROR});let s;if("sezzle"===d.selectedPaymentMethod){const e=this.insuranceFormRef?await this.insuranceFormRef.validate():{isValid:!0},i=await this.sezzlePaymentMethodRef.resolvePaymentMethod(e);if(i.error)return void this.errorEvent.emit({message:i.error.message,errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});"success"===(null===(t=i.bnpl)||void 0===t?void 0:t.status)&&(s={payment_mode:"bnpl",payment_token:void 0})}else{const t=await this.getPaymentMethod(e);if(!t)return void this.errorEvent.emit({message:"Payment method tokenization failed.",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});s={payment_mode:"ecom",payment_token:t}}this.completeCheckout({payment:s,onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}})}async setSelectedPaymentMethod(e){d.selectedPaymentMethod=e}render(){return t(i,{key:"307608e8cd41e1c262dbca6cda7b0bfc8855dedf"})}get hostEl(){return o(this)}},H=class{constructor(t){e(this,t)}render(){return t(r,{key:"13d81bf8c38b3f59567a8f3414d3ba77c2f4730c",class:"payment-method"},t("div",{key:"d4636ac2cc75bc6f1688aa5aabb64c427c14634e",class:"radio-list-item p-3",part:h,onClick:this.clickHandler,hidden:this.radioButtonHidden},t("form-control-radio",{key:"2e086a0fd3494695c6cc0d95399a4d6fc8805069",name:"paymentMethodType",value:this.paymentMethodOptionId,checked:this.isSelected,label:this.label})))}};export{M as justifi_button,A as justifi_checkout_summary,E as justifi_header,L as justifi_modular_checkout,H as payment_method_option}