@justifi/webcomponents 6.1.0-rc.1 → 6.1.0-rc.2

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 (88) hide show
  1. package/dist/cjs/{check-pkg-version-BURRKC_7.js → check-pkg-version-DUDlLDCJ.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 +1 -1
  4. package/dist/cjs/justifi-bank-account-billing-form-simple_9.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-checkout-summary_7.cjs.entry.js +15 -7
  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/{package-Cq0M4ut-.js → package-CFCy2fBx.js} +1 -1
  26. package/dist/collection/api/services/apple-pay.service.js +1 -1
  27. package/dist/collection/components/modular-checkout/modular-checkout.js +13 -5
  28. package/dist/docs.json +1 -1
  29. package/dist/esm/{check-pkg-version-Cd_i8U0d.js → check-pkg-version-B_Pl1uAE.js} +1 -1
  30. package/dist/esm/hidden-input_2.entry.js +1 -1
  31. package/dist/esm/justifi-apple-pay.entry.js +1 -1
  32. package/dist/esm/justifi-bank-account-billing-form-simple_9.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-checkout-summary_7.entry.js +15 -7
  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/{package-BBO3I4s6.js → package-pXjOPQhG.js} +1 -1
  54. package/dist/module/justifi-apple-pay.js +1 -1
  55. package/dist/module/modular-checkout.js +13 -5
  56. package/dist/module/package.js +1 -1
  57. package/dist/webcomponents/p-06b6b61e.entry.js +1 -0
  58. package/dist/webcomponents/{p-1df96001.entry.js → p-1f9f6bdc.entry.js} +1 -1
  59. package/dist/webcomponents/p-2abfee08.entry.js +1 -0
  60. package/dist/webcomponents/{p-176aa079.entry.js → p-3c1d950d.entry.js} +1 -1
  61. package/dist/webcomponents/{p-1efc0d88.entry.js → p-4332962a.entry.js} +1 -1
  62. package/dist/webcomponents/{p-b0a36936.entry.js → p-4466d28d.entry.js} +1 -1
  63. package/dist/webcomponents/{p-acb0f3ae.entry.js → p-46db49dd.entry.js} +1 -1
  64. package/dist/webcomponents/{p-18353682.entry.js → p-629c1d75.entry.js} +1 -1
  65. package/dist/webcomponents/{p-1bc8da98.entry.js → p-718f8b2c.entry.js} +1 -1
  66. package/dist/webcomponents/p-73f88870.entry.js +1 -0
  67. package/dist/webcomponents/{p-e97dee15.entry.js → p-760a5b4f.entry.js} +1 -1
  68. package/dist/webcomponents/{p-a0a0e200.entry.js → p-779e4467.entry.js} +1 -1
  69. package/dist/webcomponents/{p-80b1c65b.entry.js → p-7ef3cb23.entry.js} +1 -1
  70. package/dist/webcomponents/{p-f739a98d.entry.js → p-868ed3b6.entry.js} +1 -1
  71. package/dist/webcomponents/{p-613cf570.entry.js → p-87f598ef.entry.js} +1 -1
  72. package/dist/webcomponents/{p-O-hoT2Oo.js → p-BB5-CJF-.js} +1 -1
  73. package/dist/webcomponents/{p-108209c5.entry.js → p-b4e673fe.entry.js} +1 -1
  74. package/dist/webcomponents/{p-1e87c8ed.entry.js → p-bc902ec2.entry.js} +1 -1
  75. package/dist/webcomponents/p-bf82201a.entry.js +1 -0
  76. package/dist/webcomponents/{p-2687e615.entry.js → p-c685fc33.entry.js} +1 -1
  77. package/dist/webcomponents/{p-c9fef3e4.entry.js → p-d0f93668.entry.js} +1 -1
  78. package/dist/webcomponents/{p-e037cdd1.entry.js → p-d34befd7.entry.js} +1 -1
  79. package/dist/webcomponents/{p-ba5b1c54.entry.js → p-d3f5ff95.entry.js} +1 -1
  80. package/dist/webcomponents/{p-fa14b671.entry.js → p-f6cf3e2b.entry.js} +1 -1
  81. package/dist/webcomponents/p-pXjOPQhG.js +1 -0
  82. package/dist/webcomponents/webcomponents.esm.js +1 -1
  83. package/package.json +1 -1
  84. package/dist/webcomponents/p-1e080811.entry.js +0 -1
  85. package/dist/webcomponents/p-1f971a0f.entry.js +0 -1
  86. package/dist/webcomponents/p-7131211a.entry.js +0 -1
  87. package/dist/webcomponents/p-BBO3I4s6.js +0 -1
  88. package/dist/webcomponents/p-f8c22c77.entry.js +0 -1
@@ -7,7 +7,7 @@ import './event-types-CZfYo5-1.js';
7
7
  import { H as Header1 } from './header-1-zXsamUS3.js';
8
8
  import { H as Header2, b as insuranceValuesOn, h as hasInsuranceValueChanged, i as insuranceValues } from './insurance-state-Dh9f36Qh.js';
9
9
  import { H as Header3 } from './header-3-DVtaUAlf.js';
10
- import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-Cd_i8U0d.js';
10
+ import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-B_Pl1uAE.js';
11
11
  import './config-state-Blo0ywwc.js';
12
12
  import './dinero-HXpYMWUU.js';
13
13
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes, b as ComponentErrorMessages } from './ComponentError-Cjcsf8ku.js';
@@ -21,7 +21,7 @@ import { A as Api } from './Api-D4tj-h4P.js';
21
21
  import { P as PAYMENT_METHODS, a as PaymentMethod, b as PAYMENT_MODE } from './index-DCIW8z1f.js';
22
22
  import { C as CardBrandLabels } from './payment-method-option-utils-lUHAQVFl.js';
23
23
  import './index-ZfXl6Xrm.js';
24
- import './package-BBO3I4s6.js';
24
+ import './package-pXjOPQhG.js';
25
25
  import './helpers-Mu7LQT-w.js';
26
26
  import './state-options-BX8GieXu.js';
27
27
 
@@ -359,11 +359,19 @@ const ModularCheckout = class {
359
359
  }
360
360
  }
361
361
  async submitCheckout(submitCheckoutArgs) {
362
- var _a, _b, _c, _d;
362
+ var _a, _b, _c, _d, _e;
363
363
  const isValid = await this.validate();
364
+ if (!checkoutStore.selectedPaymentMethod) {
365
+ this.errorEvent.emit({
366
+ message: 'No payment method selected.',
367
+ errorCode: ComponentErrorCodes.VALIDATION_ERROR,
368
+ severity: ComponentErrorSeverity.ERROR,
369
+ });
370
+ return;
371
+ }
364
372
  const isNewCard = ((_a = checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === PAYMENT_METHODS.NEW_CARD;
365
373
  const isNewBankAccount = ((_b = checkoutStore.selectedPaymentMethod) === null || _b === void 0 ? void 0 : _b.type) === PAYMENT_METHODS.NEW_BANK_ACCOUNT;
366
- const isPlaid = checkoutStore.selectedPaymentMethod.type === PAYMENT_METHODS.PLAID;
374
+ const isPlaid = ((_c = checkoutStore.selectedPaymentMethod) === null || _c === void 0 ? void 0 : _c.type) === PAYMENT_METHODS.PLAID;
367
375
  const shouldTokenize = isNewCard || isNewBankAccount;
368
376
  if (shouldTokenize) {
369
377
  const tokenizeResult = await this.tokenizePaymentMethod(submitCheckoutArgs);
@@ -399,7 +407,7 @@ const ModularCheckout = class {
399
407
  return;
400
408
  }
401
409
  const paymentMethod = response === null || response === void 0 ? void 0 : response.data;
402
- const token = ((_c = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.bank_account) === null || _c === void 0 ? void 0 : _c.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id);
410
+ const token = ((_d = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.bank_account) === null || _d === void 0 ? void 0 : _d.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id);
403
411
  checkoutStore.paymentToken = token;
404
412
  }
405
413
  catch (err) {
@@ -445,7 +453,7 @@ const ModularCheckout = class {
445
453
  }
446
454
  };
447
455
  payment = {
448
- payment_mode: mapTypeToPaymentMode((_d = checkoutStore.selectedPaymentMethod) === null || _d === void 0 ? void 0 : _d.type),
456
+ payment_mode: mapTypeToPaymentMode((_e = checkoutStore.selectedPaymentMethod) === null || _e === void 0 ? void 0 : _e.type),
449
457
  payment_token: checkoutStore.paymentToken,
450
458
  };
451
459
  this.completeCheckout({
@@ -466,7 +474,7 @@ const ModularCheckout = class {
466
474
  });
467
475
  }
468
476
  render() {
469
- return h(Host, { key: 'f13bda646a7cfcbe339baad474554b38fb0ebae5' });
477
+ return h(Host, { key: 'dbe1fe78f8206fef2e3f4f51628d716786dea858' });
470
478
  }
471
479
  get hostEl() { return getElement(this); }
472
480
  };
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-qipqIMyC.js';
2
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
2
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
3
3
  import { c as checkoutStore } from './checkout.store-DBvS7cVB.js';
4
4
  import { d as checkoutSummary } from './parts-RvUQ__Pq.js';
5
5
  import { S as StyledHost } from './styled-host-CbizlfAU.js';
6
6
  import './event-types-CZfYo5-1.js';
7
7
  import { P as PAYMENT_METHODS } from './index-DCIW8z1f.js';
8
- import './package-BBO3I4s6.js';
8
+ import './package-pXjOPQhG.js';
9
9
  import './Api-D4tj-h4P.js';
10
10
  import './config-state-Blo0ywwc.js';
11
11
  import './index-ZfXl6Xrm.js';
@@ -7,7 +7,7 @@ import './Pagination-CLHwhyvu.js';
7
7
  import './Business-BCoP0TAV.js';
8
8
  import './Dispute-BH0Xfn-F.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-Cd_i8U0d.js';
10
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
11
11
  import { C as CheckoutService } from './checkout.service-BCkQ9pOA.js';
12
12
  import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccounts-VjY6-x_9.js';
13
13
  import { S as StyledHost } from './styled-host-CbizlfAU.js';
@@ -17,7 +17,7 @@ import './index-ZfXl6Xrm.js';
17
17
  import './utils-BscIVFn8.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
19
  import './state-options-BX8GieXu.js';
20
- import './package-BBO3I4s6.js';
20
+ import './package-pXjOPQhG.js';
21
21
  import './Api-D4tj-h4P.js';
22
22
  import './badge-ChwzCNAF.js';
23
23
  import './parts-RvUQ__Pq.js';
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-qipqIMyC.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-Cd_i8U0d.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
4
4
  import { D as Dispute } from './Dispute-BH0Xfn-F.js';
5
5
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
6
6
  import { D as DisputeService } from './dispute.service-CyLtJREK.js';
7
- import './package-BBO3I4s6.js';
7
+ import './package-pXjOPQhG.js';
8
8
  import './Api-D4tj-h4P.js';
9
9
  import './config-state-Blo0ywwc.js';
10
10
  import './index-ZfXl6Xrm.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-CyLtJREK.js';
11
11
  import { D as DisputeManagementClickActions } from './event-types-Bg2SZArf.js';
12
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
12
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
13
13
  import './dinero-HXpYMWUU.js';
14
14
  import './Api-D4tj-h4P.js';
15
15
  import './config-state-Blo0ywwc.js';
@@ -20,7 +20,7 @@ import './Pagination-CLHwhyvu.js';
20
20
  import './Business-BCoP0TAV.js';
21
21
  import './helpers-Mu7LQT-w.js';
22
22
  import './state-options-BX8GieXu.js';
23
- import './package-BBO3I4s6.js';
23
+ import './package-pXjOPQhG.js';
24
24
 
25
25
  const makeUpdateDisputeResponse = ({ authToken, disputeId, service }) => async ({ payload, onSuccess, onError, final = () => { } }) => {
26
26
  var _a;
@@ -7,7 +7,7 @@ import './Business-BCoP0TAV.js';
7
7
  import './Dispute-BH0Xfn-F.js';
8
8
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
9
9
  import { E as ErrorState } from './utils-_ckvHjSW.js';
10
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
10
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
11
11
  import './config-state-Blo0ywwc.js';
12
12
  import './index-ZfXl6Xrm.js';
13
13
  import './utils-BscIVFn8.js';
@@ -15,7 +15,7 @@ import './dinero-HXpYMWUU.js';
15
15
  import './helpers-Mu7LQT-w.js';
16
16
  import './state-options-BX8GieXu.js';
17
17
  import './parts-RvUQ__Pq.js';
18
- import './package-BBO3I4s6.js';
18
+ import './package-pXjOPQhG.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-qipqIMyC.js'
2
2
  import { al as heading5, ai as heading4, ae as buttonPrimary, z as text } from './parts-RvUQ__Pq.js';
3
3
  import { S as StyledHost } from './styled-host-CbizlfAU.js';
4
4
  import './event-types-CZfYo5-1.js';
5
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
5
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
6
6
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
7
7
  import { B as BusinessService } from './business.service-CsbtEDNi.js';
8
8
  import { B as Business } from './Business-BCoP0TAV.js';
@@ -16,7 +16,7 @@ import './Dispute-BH0Xfn-F.js';
16
16
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
17
17
  import { T as TerminalService } from './terminal.service-D2oETGnk.js';
18
18
  import { k as formatPhoneNumber } from './utils-BscIVFn8.js';
19
- import './package-BBO3I4s6.js';
19
+ import './package-pXjOPQhG.js';
20
20
  import './Api-D4tj-h4P.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-QJEmd6Nl.js';
3
3
  import { m as makeGetPaymentDetails } from './get-payment-details-BuT0QNOo.js';
4
4
  import { E as ErrorState } from './utils-_ckvHjSW.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-Cd_i8U0d.js';
6
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
7
7
  import './Api-D4tj-h4P.js';
8
8
  import './config-state-Blo0ywwc.js';
9
9
  import './index-ZfXl6Xrm.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-RvUQ__Pq.js';
20
- import './package-BBO3I4s6.js';
20
+ import './package-pXjOPQhG.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-qipqIMyC.js';
2
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
2
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.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-CsbtEDNi.js';
@@ -8,7 +8,7 @@ import './Refund-Bc5By0lb.js';
8
8
  import './Pagination-CLHwhyvu.js';
9
9
  import './Business-BCoP0TAV.js';
10
10
  import './Dispute-BH0Xfn-F.js';
11
- import './package-BBO3I4s6.js';
11
+ import './package-pXjOPQhG.js';
12
12
  import './utils-BeQLScSm.js';
13
13
  import './config-state-Blo0ywwc.js';
14
14
  import './index-ZfXl6Xrm.js';
@@ -6,7 +6,7 @@ import { f as PaymentBalanceTransaction } from './Refund-Bc5By0lb.js';
6
6
  import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
7
7
  import './Business-BCoP0TAV.js';
8
8
  import './Dispute-BH0Xfn-F.js';
9
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
9
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
10
10
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
11
11
  import { P as PaymentService } from './payment.service-QJEmd6Nl.js';
12
12
  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-DcRHK_sm.js';
@@ -17,7 +17,7 @@ import { N as tableHeadCell, O as getAlternateTableCellPart } from './parts-RvUQ
17
17
  import './index-ZfXl6Xrm.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
19
  import './state-options-BX8GieXu.js';
20
- import './package-BBO3I4s6.js';
20
+ import './package-pXjOPQhG.js';
21
21
  import './Api-D4tj-h4P.js';
22
22
  import './spinner-CIXUVK4F.js';
23
23
 
@@ -8,7 +8,7 @@ import './Pagination-CLHwhyvu.js';
8
8
  import './Business-BCoP0TAV.js';
9
9
  import './Dispute-BH0Xfn-F.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-Cd_i8U0d.js';
11
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
12
12
  import { S as StyledHost } from './styled-host-CbizlfAU.js';
13
13
  import './event-types-CZfYo5-1.js';
14
14
  import { d as defaultColumnsKeys } from './payments-table-De3Jb6rY.js';
@@ -17,7 +17,7 @@ import './utils-BscIVFn8.js';
17
17
  import './index-ZfXl6Xrm.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
19
  import './state-options-BX8GieXu.js';
20
- import './package-BBO3I4s6.js';
20
+ import './package-pXjOPQhG.js';
21
21
  import './payments-status-DDafc8Yr.js';
22
22
  import './badge-ChwzCNAF.js';
23
23
  import './parts-RvUQ__Pq.js';
@@ -9,7 +9,7 @@ import './Business-BCoP0TAV.js';
9
9
  import './Dispute-BH0Xfn-F.js';
10
10
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
11
11
  import { E as ErrorState } from './utils-_ckvHjSW.js';
12
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
12
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
13
13
  import { m as makeGetPayoutCSV } from './get-payout-csv-D-Lnooki.js';
14
14
  import './Api-D4tj-h4P.js';
15
15
  import './utils-BscIVFn8.js';
@@ -17,7 +17,7 @@ import './index-ZfXl6Xrm.js';
17
17
  import './helpers-Mu7LQT-w.js';
18
18
  import './state-options-BX8GieXu.js';
19
19
  import './parts-RvUQ__Pq.js';
20
- import './package-BBO3I4s6.js';
20
+ import './package-pXjOPQhG.js';
21
21
 
22
22
  const makeGetPayoutDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
23
23
  var _a;
@@ -6,7 +6,7 @@ import { g as PayoutBalanceTransaction } from './Refund-Bc5By0lb.js';
6
6
  import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
7
7
  import './Business-BCoP0TAV.js';
8
8
  import './Dispute-BH0Xfn-F.js';
9
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
9
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
10
10
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
11
11
  import { P as PayoutService } from './payout.service-XxyEr0rj.js';
12
12
  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-DcRHK_sm.js';
@@ -17,7 +17,7 @@ import { N as tableHeadCell, O as getAlternateTableCellPart } from './parts-RvUQ
17
17
  import './index-ZfXl6Xrm.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
19
  import './state-options-BX8GieXu.js';
20
- import './package-BBO3I4s6.js';
20
+ import './package-pXjOPQhG.js';
21
21
  import './Api-D4tj-h4P.js';
22
22
  import './spinner-CIXUVK4F.js';
23
23
 
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-qipqIMyC.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-Cd_i8U0d.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
4
4
  import { P as PayoutService } from './payout.service-XxyEr0rj.js';
5
5
  import './config-state-Blo0ywwc.js';
6
6
  import './dinero-HXpYMWUU.js';
@@ -14,7 +14,7 @@ import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccoun
14
14
  import { S as StyledHost } from './styled-host-CbizlfAU.js';
15
15
  import './event-types-CZfYo5-1.js';
16
16
  import { d as defaultColumnsKeys } from './payouts-table-BO-MCzXj.js';
17
- import './package-BBO3I4s6.js';
17
+ import './package-pXjOPQhG.js';
18
18
  import './Api-D4tj-h4P.js';
19
19
  import './utils-BscIVFn8.js';
20
20
  import './index-ZfXl6Xrm.js';
@@ -12,7 +12,7 @@ import { S as StyledHost } from './styled-host-CbizlfAU.js';
12
12
  import './event-types-CZfYo5-1.js';
13
13
  import { P as PaymentService } from './payment.service-QJEmd6Nl.js';
14
14
  import { m as makeGetPaymentDetails } from './get-payment-details-BuT0QNOo.js';
15
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
15
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
16
16
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
17
17
  import { A as Api } from './Api-D4tj-h4P.js';
18
18
  import { S as Skeleton } from './skeleton-DtpkgjZ6.js';
@@ -22,7 +22,7 @@ import './index-ZfXl6Xrm.js';
22
22
  import './helpers-Mu7LQT-w.js';
23
23
  import './state-options-BX8GieXu.js';
24
24
  import './parts-RvUQ__Pq.js';
25
- import './package-BBO3I4s6.js';
25
+ import './package-pXjOPQhG.js';
26
26
 
27
27
  const amountValidation = (maxAmount) => {
28
28
  const max = +maxAmount;
@@ -6,7 +6,7 @@ import './Pagination-CLHwhyvu.js';
6
6
  import './Business-BCoP0TAV.js';
7
7
  import './Dispute-BH0Xfn-F.js';
8
8
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
9
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
9
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
10
10
  import { c as checkoutStore } from './checkout.store-DBvS7cVB.js';
11
11
  import { p as processHTML, f as formatCurrency, r as removeAttribute, i as addAttribute } from './utils-BscIVFn8.js';
12
12
  import { v as validateInsuranceValues, i as insuranceValues, a as insuranceErrors, H as Header2 } from './insurance-state-Dh9f36Qh.js';
@@ -18,7 +18,7 @@ import './config-state-Blo0ywwc.js';
18
18
  import './index-ZfXl6Xrm.js';
19
19
  import './helpers-Mu7LQT-w.js';
20
20
  import './state-options-BX8GieXu.js';
21
- import './package-BBO3I4s6.js';
21
+ import './package-pXjOPQhG.js';
22
22
  import './index-DCIW8z1f.js';
23
23
  import './dinero-HXpYMWUU.js';
24
24
 
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-qipqIMyC.js';
2
2
  import { S as StyledHost } from './styled-host-CbizlfAU.js';
3
3
  import './event-types-CZfYo5-1.js';
4
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cd_i8U0d.js';
4
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
5
5
  import { d as defaultColumnsKeys } from './terminal-orders-table-9nsnrAq8.js';
6
6
  import './config-state-Blo0ywwc.js';
7
7
  import './dinero-HXpYMWUU.js';
@@ -12,7 +12,7 @@ import './Business-BCoP0TAV.js';
12
12
  import './Dispute-BH0Xfn-F.js';
13
13
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
14
14
  import { A as Api } from './Api-D4tj-h4P.js';
15
- import './package-BBO3I4s6.js';
15
+ import './package-pXjOPQhG.js';
16
16
  import './parts-RvUQ__Pq.js';
17
17
  import './utils-BscIVFn8.js';
18
18
  import './badge-ChwzCNAF.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-qipqIMyC.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-Cd_i8U0d.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-B_Pl1uAE.js';
4
4
  import { T as TerminalService } from './terminal.service-D2oETGnk.js';
5
5
  import './config-state-Blo0ywwc.js';
6
6
  import './dinero-HXpYMWUU.js';
@@ -13,7 +13,7 @@ import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccoun
13
13
  import { S as StyledHost } from './styled-host-CbizlfAU.js';
14
14
  import './event-types-CZfYo5-1.js';
15
15
  import { d as defaultColumnsKeys } from './terminals-table-C6NO2m-t.js';
16
- import './package-BBO3I4s6.js';
16
+ import './package-pXjOPQhG.js';
17
17
  import './Api-D4tj-h4P.js';
18
18
  import './utils-BscIVFn8.js';
19
19
  import './index-ZfXl6Xrm.js';
@@ -1,5 +1,5 @@
1
1
  const name = "@justifi/webcomponents";
2
- const version = "6.1.0-rc.1";
2
+ const version = "6.1.0-rc.2";
3
3
  var packageJson = {
4
4
  name: name,
5
5
  version: version};
@@ -250,7 +250,7 @@ class ApplePayService {
250
250
  return reject({
251
251
  success: false,
252
252
  error: {
253
- code: ApplePayServiceErrorCode.APPLE_PAY_UNAVAILABLE,
253
+ code: ApplePayServiceErrorCode.UNAVAILABLE,
254
254
  message: 'ApplePaySession API is not available in this environment',
255
255
  },
256
256
  });
@@ -304,11 +304,19 @@ const ModularCheckout = /*@__PURE__*/ proxyCustomElement(class ModularCheckout e
304
304
  }
305
305
  }
306
306
  async submitCheckout(submitCheckoutArgs) {
307
- var _a, _b, _c, _d;
307
+ var _a, _b, _c, _d, _e;
308
308
  const isValid = await this.validate();
309
+ if (!checkoutStore.selectedPaymentMethod) {
310
+ this.errorEvent.emit({
311
+ message: 'No payment method selected.',
312
+ errorCode: ComponentErrorCodes.VALIDATION_ERROR,
313
+ severity: ComponentErrorSeverity.ERROR,
314
+ });
315
+ return;
316
+ }
309
317
  const isNewCard = ((_a = checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === PAYMENT_METHODS.NEW_CARD;
310
318
  const isNewBankAccount = ((_b = checkoutStore.selectedPaymentMethod) === null || _b === void 0 ? void 0 : _b.type) === PAYMENT_METHODS.NEW_BANK_ACCOUNT;
311
- const isPlaid = checkoutStore.selectedPaymentMethod.type === PAYMENT_METHODS.PLAID;
319
+ const isPlaid = ((_c = checkoutStore.selectedPaymentMethod) === null || _c === void 0 ? void 0 : _c.type) === PAYMENT_METHODS.PLAID;
312
320
  const shouldTokenize = isNewCard || isNewBankAccount;
313
321
  if (shouldTokenize) {
314
322
  const tokenizeResult = await this.tokenizePaymentMethod(submitCheckoutArgs);
@@ -344,7 +352,7 @@ const ModularCheckout = /*@__PURE__*/ proxyCustomElement(class ModularCheckout e
344
352
  return;
345
353
  }
346
354
  const paymentMethod = response === null || response === void 0 ? void 0 : response.data;
347
- const token = ((_c = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.bank_account) === null || _c === void 0 ? void 0 : _c.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id);
355
+ const token = ((_d = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.bank_account) === null || _d === void 0 ? void 0 : _d.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id);
348
356
  checkoutStore.paymentToken = token;
349
357
  }
350
358
  catch (err) {
@@ -390,7 +398,7 @@ const ModularCheckout = /*@__PURE__*/ proxyCustomElement(class ModularCheckout e
390
398
  }
391
399
  };
392
400
  payment = {
393
- payment_mode: mapTypeToPaymentMode((_d = checkoutStore.selectedPaymentMethod) === null || _d === void 0 ? void 0 : _d.type),
401
+ payment_mode: mapTypeToPaymentMode((_e = checkoutStore.selectedPaymentMethod) === null || _e === void 0 ? void 0 : _e.type),
394
402
  payment_token: checkoutStore.paymentToken,
395
403
  };
396
404
  this.completeCheckout({
@@ -411,7 +419,7 @@ const ModularCheckout = /*@__PURE__*/ proxyCustomElement(class ModularCheckout e
411
419
  });
412
420
  }
413
421
  render() {
414
- return h(Host, { key: 'f13bda646a7cfcbe339baad474554b38fb0ebae5' });
422
+ return h(Host, { key: 'dbe1fe78f8206fef2e3f4f51628d716786dea858' });
415
423
  }
416
424
  get hostEl() { return this; }
417
425
  }, [256, "justifi-modular-checkout", {
@@ -1,5 +1,5 @@
1
1
  const name = "@justifi/webcomponents";
2
- const version = "6.1.0-rc.1";
2
+ const version = "6.1.0-rc.2";
3
3
  var webcomponentsPackageJson = {
4
4
  name: name,
5
5
  version: version};
@@ -0,0 +1 @@
1
+ import{r,c as s,h as t}from"./p-qipqIMyC.js";import{S as i}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{c as o,J as e}from"./p-BB5-CJF-.js";import{d as a}from"./p-CaxjN6Uo.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as n,a as p}from"./p-Cjcsf8ku.js";import{h as c}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as m,a as h}from"./p-D2muobcE.js";import{A as d}from"./p-BUa0YOaw.js";import"./p-pXjOPQhG.js";import"./p-RvUQ__Pq.js";import"./p-BHf9IqGw.js";import"./p-D--yCspA.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const l=d();class j{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const f=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=a,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){o(),this.analytics=new e(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:o,onError:e,final:a})=>{var p,d;try{const a=await t.fetchTerminalOrders(r,s,i);if(a.error)return e({error:h(a.error),code:m(null===(d=a.error)||void 0===d?void 0:d.code),severity:n.ERROR});{const r=Object.assign({},a.page_info);o({terminalOrders:(null===(p=a.data)||void 0===p?void 0:p.map((r=>new c(r))))||[],pagingInfo:r})}}catch(r){const s=m(null==r?void 0:r.code);return e({error:r.message||r,code:s,severity:n.ERROR})}finally{return a()}})({id:this.accountId,authToken:this.authToken,service:new j}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return t(i,{key:"55f0bf858787e00c304972c941a477815712df9d"},t("terminal-orders-list-core",{key:"2d47e23bc2157d79254f34dfe0551fb32a9d88cc",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{f as justifi_terminal_orders_list}
@@ -1 +1 @@
1
- import{h as i,r as s,c as t}from"./p-qipqIMyC.js";import{al as e,ai as r,ae as o,z as l}from"./p-RvUQ__Pq.js";import{S as d}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{c as n,J as a}from"./p-O-hoT2Oo.js";import{C as h,a as c}from"./p-Cjcsf8ku.js";import{B as v}from"./p-B4idKqyn.js";import{B as u}from"./p-BlJnA265.js";import{m as p}from"./p-DH8F0bsw.js";import{S as m}from"./p-Xv8DuU3Y.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{i as f,h as w,b}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{g as y,a as x}from"./p-D2muobcE.js";import{T as g}from"./p-CxzFvTgf.js";import{k as j}from"./p-BHf9IqGw.js";import"./p-BBO3I4s6.js";import"./p-BUa0YOaw.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-DsAwPf2y.js";const B=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(m,{width:"25%"})),i("div",{class:"col-12"},i(m,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"50%"}),i(m,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"65%"}),i(m,{width:"35%"}))),k=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(m,{width:"40%",height:"40px"})),i(B,null)),S=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(m,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(m,null),i(m,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(m,{width:"80px",height:"32px"}),i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(m,null),i(m,null)))))),C=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event"),this.submitted=t(this,"submit-event"),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new w({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?b.boardingShipping:b.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",c.MISSING_PROPS,h.ERROR)}initializeGetBusiness(){p({id:this.businessId,authToken:this.authToken,service:new v})({onSuccess:({business:i})=>{this.business=new u(i),this.loading.business=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(i,s);if(a.error)return r({error:x(a.error),code:y(null===(n=a.error)||void 0===n?void 0:n.code),severity:h.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new f(i))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=y(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:h.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new g})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:x(d.error),code:y(null===(l=d.error)||void 0===l?void 0:l.code),severity:h.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=y(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:h.ERROR})}})({authToken:this.authToken,service:new g});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(k,null),this.loading.terminals&&i("div",{class:"mt-5"},i(S,null),i(S,null),i(S,null)))}renderBusinessDetails(){var s,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),i("div",null,j(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"3ea6cebd4ab6bc47090056581482dab8502175c1"},i("div",{key:"383dc710920b5119841d5cf6f1b596ebc349fd5a",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{C as justifi_order_terminals}
1
+ import{h as i,r as s,c as t}from"./p-qipqIMyC.js";import{al as e,ai as r,ae as o,z as l}from"./p-RvUQ__Pq.js";import{S as d}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{c as n,J as a}from"./p-BB5-CJF-.js";import{C as h,a as c}from"./p-Cjcsf8ku.js";import{B as v}from"./p-B4idKqyn.js";import{B as u}from"./p-BlJnA265.js";import{m as p}from"./p-DH8F0bsw.js";import{S as m}from"./p-Xv8DuU3Y.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{i as f,h as w,b}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{g as y,a as x}from"./p-D2muobcE.js";import{T as g}from"./p-CxzFvTgf.js";import{k as j}from"./p-BHf9IqGw.js";import"./p-pXjOPQhG.js";import"./p-BUa0YOaw.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-DsAwPf2y.js";const B=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(m,{width:"25%"})),i("div",{class:"col-12"},i(m,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"50%"}),i(m,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"65%"}),i(m,{width:"35%"}))),k=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(m,{width:"40%",height:"40px"})),i(B,null)),C=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(m,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(m,null),i(m,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(m,{width:"80px",height:"32px"}),i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(m,null),i(m,null)))))),S=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event"),this.submitted=t(this,"submit-event"),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new w({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?b.boardingShipping:b.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",c.MISSING_PROPS,h.ERROR)}initializeGetBusiness(){p({id:this.businessId,authToken:this.authToken,service:new v})({onSuccess:({business:i})=>{this.business=new u(i),this.loading.business=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(i,s);if(a.error)return r({error:x(a.error),code:y(null===(n=a.error)||void 0===n?void 0:n.code),severity:h.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new f(i))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=y(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:h.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new g})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:x(d.error),code:y(null===(l=d.error)||void 0===l?void 0:l.code),severity:h.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=y(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:h.ERROR})}})({authToken:this.authToken,service:new g});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(k,null),this.loading.terminals&&i("div",{class:"mt-5"},i(C,null),i(C,null),i(C,null)))}renderBusinessDetails(){var s,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),i("div",null,j(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"3ea6cebd4ab6bc47090056581482dab8502175c1"},i("div",{key:"383dc710920b5119841d5cf6f1b596ebc349fd5a",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{S as justifi_order_terminals}
@@ -0,0 +1 @@
1
+ import{h as e,r as t,c as n}from"./p-qipqIMyC.js";import{A as s}from"./p-BUa0YOaw.js";import{S as i}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{S as o}from"./p-Xv8DuU3Y.js";import{c as a}from"./p-CrQgyTRz.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-RvUQ__Pq.js";import"./p-DCIW8z1f.js";var l,r,p,c,h;!function(e){e.STATUS_SUCCESS="STATUS_SUCCESS",e.STATUS_FAILURE="STATUS_FAILURE"}(l||(l={})),function(e){e.PLAIN="plain",e.BUY="buy",e.SET_UP="set-up",e.DONATE="donate",e.CHECK_OUT="check-out",e.BOOK="book",e.SUBSCRIBE="subscribe"}(r||(r={})),function(e){e.BLACK="black",e.WHITE="white",e.WHITE_OUTLINE="white-outline"}(p||(p={})),function(e){e.SUPPORTS_3DS="supports3DS",e.SUPPORTS_EMV="supportsEMV",e.SUPPORTS_CREDIT="supportsCredit",e.SUPPORTS_DEBIT="supportsDebit"}(c||(c={}));class d{constructor(e){this.merchantIdentifier=e.merchantIdentifier,this.displayName=e.displayName,this.initiative=e.initiative,this.initiativeContext=e.initiativeContext,this.buttonType=e.buttonType||r.PLAIN,this.buttonStyle=e.buttonStyle||p.BLACK,this.buttonLocale=e.buttonLocale||"en-US"}get isValid(){return!!(this.merchantIdentifier&&this.displayName&&this.initiative&&this.initiativeContext)}}class y{constructor(e){this.countryCode=e.countryCode,this.currencyCode=e.currencyCode,this.merchantCapabilities=e.merchantCapabilities,this.supportedNetworks=e.supportedNetworks,this.total=e.total,this.lineItems=e.lineItems,this.shippingMethods=e.shippingMethods,this.applicationData=e.applicationData,this.supportedCountries=e.supportedCountries}get isValid(){var e,t,n,s;return!!(this.countryCode&&this.currencyCode&&(null===(e=this.merchantCapabilities)||void 0===e?void 0:e.length)&&(null===(t=this.supportedNetworks)||void 0===t?void 0:t.length)&&(null===(n=this.total)||void 0===n?void 0:n.label)&&(null===(s=this.total)||void 0===s?void 0:s.amount))}}class u{static isApplePaySupported(){var e;return"undefined"!=typeof window&&"ApplePaySession"in window&&(null===(e=window.ApplePaySession)||void 0===e?void 0:e.supportsVersion(3))}static canMakePayments(){var e;return this.isApplePaySupported()&&(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())||!1}static async canMakePaymentsWithActiveCard(e){var t;if(!this.isApplePaySupported())return!1;try{return await(null===(t=window.ApplePaySession)||void 0===t?void 0:t.canMakePaymentsWithActiveCard(e))||!1}catch(e){return console.error("Error checking Apple Pay active card:",e),!1}}static formatAmount(e){return(e/100).toFixed(2)}static parseAmount(e){return Math.round(100*parseFloat(e))}static createLineItem(e,t,n="final"){return{label:e,amount:this.formatAmount(t),type:n}}static getDefaultSupportedNetworks(){return["amex","discover","masterCard","visa"]}static getDefaultMerchantCapabilities(){return[c.SUPPORTS_3DS,c.SUPPORTS_EMV,c.SUPPORTS_CREDIT,c.SUPPORTS_DEBIT]}}!function(e){e.UNAVAILABLE="UNAVAILABLE",e.SESSION_ERROR="SESSION_ERROR",e.MERCHANT_VALIDATION_ERROR="MERCHANT_VALIDATION_ERROR",e.PAYMENT_PROCESSING_ERROR="PAYMENT_PROCESSING_ERROR",e.USER_CANCELLED="USER_CANCELLED"}(h||(h={}));class v{constructor(){this.api=s()}initialize(e){if(this.applePayConfig=new d(e),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(e,t){try{return await this.api.post({endpoint:"apple_pay/merchant_session",authToken:e,headers:{"Sub-Account":t}})}catch(e){throw console.error("Backend validation failed:",e),new Error("Merchant validation failed")}}async processPayment(e,t,n){const s=await this.api.post({endpoint:"apple_pay/process_token",authToken:e,body:n,headers:{"Sub-Account":t}});return{success:s.id&&!!s.data.token,data:s}}isAvailable(){return u.isApplePaySupported()&&u.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await u.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(e,t,n){if(console.groupCollapsed("[ApplePayService] startPaymentSession called"),console.log("[ApplePayService] raw paymentRequest:",JSON.stringify(e,null,2)),console.log("[ApplePayService] has authToken:",Boolean(t)),console.log("[ApplePayService] accountId:",n),console.log("[ApplePayService] has config:",Boolean(this.applePayConfig)),!this.applePayConfig)throw console.error("[ApplePayService] Missing applePayConfig. Did you call initialize()?"),console.groupEnd(),new Error("Apple Pay not initialized. Call initialize() first.");const s=new y(e);if(console.log("[ApplePayService] created ApplePayPaymentRequest:",s),!s.isValid){const e=[];throw s.countryCode||e.push("countryCode"),s.currencyCode||e.push("currencyCode"),s.merchantCapabilities&&0!==s.merchantCapabilities.length||e.push("merchantCapabilities"),s.supportedNetworks&&0!==s.supportedNetworks.length||e.push("supportedNetworks"),s.total&&s.total.label&&s.total.amount||e.push("total"),console.error("[ApplePayService] Payment request is invalid. Missing/invalid:",e),console.groupEnd(),new Error("Invalid payment request provided")}return this.currentPaymentRequest=s,new Promise(((e,i)=>{try{if(console.log("[ApplePayService] About to instantiate ApplePaySession"),"undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),console.groupEnd(),i({success:!1,error:{code:h.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,s),console.log("[ApplePayService] ApplePaySession instantiated:",this.currentSession),this.setupSessionEventHandlers(e,i,t,n),console.log("[ApplePayService] Event handlers set. Beginning session..."),this.currentSession.begin(),console.log("[ApplePayService] Session.begin() called"),console.groupEnd()}catch(e){console.error("[ApplePayService] Exception while starting session:",e),console.groupEnd(),i({success:!1,error:{code:h.SESSION_ERROR,message:e instanceof Error?e.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(e,t,n,s){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest?(this.currentSession.onvalidatemerchant=async()=>{console.groupCollapsed("[ApplePayService] onvalidatemerchant");try{if(console.log("[ApplePayService] accountId:",s),!n)throw console.error("[ApplePayService] Missing authToken for merchant validation"),new Error("Authentication token not provided.");const e=await this.validateMerchant(n,s);console.log("[ApplePayService] merchantSession received");try{this.currentSession.completeMerchantValidation(e),console.log("[ApplePayService] completeMerchantValidation called")}catch(e){throw console.error("Error calling completeMerchantValidation:",e),e}}catch(e){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",e),e&&e.stack&&console.error("Error stack:",e.stack),this.currentSession.abort(),t({success:!1,error:{code:h.MERCHANT_VALIDATION_ERROR,message:e instanceof Error?e.message:"Merchant validation failed"}})}console.groupEnd()},this.currentSession.onpaymentauthorized=async i=>{var o;console.groupCollapsed("[ApplePayService] onpaymentauthorized");try{const a=i.payment;console.log("[ApplePayService] payment payload snapshot:",{hasToken:Boolean(null==a?void 0:a.token),tokenType:(null===(o=null==a?void 0:a.token)||void 0===o?void 0:o.paymentData)?"paymentData":"raw"});const r=Object.assign(Object.assign({},a.token),{product_details:{name:this.currentPaymentRequest.total.label,price:u.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}});console.log("[ApplePayService] paymentPayload prepared");const p=await this.processPayment(n,s,r);console.log("[ApplePayService] processPayment result:",p),p.success?(this.currentSession.completePayment({status:l.STATUS_SUCCESS}),console.log("[ApplePayService] Payment success; resolving"),e({success:!0,token:a.token,paymentMethodId:p.data.id})):(console.error("PSP reported payment failure:",p.data),this.currentSession.completePayment({status:l.STATUS_FAILURE}),t({success:!1,error:{code:h.PAYMENT_PROCESSING_ERROR,message:"Payment processing failed"}}))}catch(e){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",e),e&&e.stack&&console.error("Error stack:",e.stack),this.currentSession.completePayment({status:l.STATUS_FAILURE}),t({success:!1,error:{code:h.PAYMENT_PROCESSING_ERROR,message:e instanceof Error?e.message:"Payment processing failed"}})}finally{console.log("[ApplePayService] Cleaning up session state"),this.currentSession=void 0,this.currentPaymentRequest=void 0}console.groupEnd()},this.currentSession.onpaymentmethodselected=()=>{console.groupCollapsed("[ApplePayService] onpaymentmethodselected");const e={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(e),console.log("[ApplePayService] completePaymentMethodSelection called")}catch(e){console.error("Error completing payment method selection:",e),this.currentSession.abort()}console.groupEnd()},this.currentSession.onshippingmethodselected=()=>{console.groupCollapsed("[ApplePayService] onshippingmethodselected"),this.currentSession.completeShippingMethodSelection({status:l.STATUS_SUCCESS,newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]}),console.log("[ApplePayService] completeShippingMethodSelection called"),console.groupEnd()},this.currentSession.oncancel=e=>{if(console.groupCollapsed("[ApplePayService] oncancel"),e.sessionError)switch(console.error(e.sessionError),e.sessionError.code){case"unknown":console.error("Unknown error - likely merchant validation issue"),console.error("This usually means:"),console.error("1. Merchant certificate is invalid or expired"),console.error("2. Merchant identifier mismatch"),console.error("3. Backend validation endpoint issues");break;case"invalidMerchantSession":console.error("Invalid merchant session provided"),console.error("Check that the merchant session from backend is valid");break;case"userCancel":console.error("User cancelled the payment");break;default:console.error("Other error code:",e.sessionError.code)}this.currentSession=void 0,this.currentPaymentRequest=void 0,t({success:!1,error:{code:h.USER_CANCELLED,message:"User cancelled the Apple Pay session"}}),console.groupEnd()},"onerror"in this.currentSession&&(this.currentSession.onerror=e=>{console.groupCollapsed("[ApplePayService] onerror"),console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",e),this.currentSession=void 0,this.currentPaymentRequest=void 0,t({success:!1,error:{code:h.SESSION_ERROR,message:"Apple Pay session error occurred"}}),console.groupEnd()})):console.error("[ApplePayService] setupSessionEventHandlers called without required state",{hasSession:Boolean(this.currentSession),hasConfig:Boolean(this.applePayConfig),hasPaymentRequest:Boolean(this.currentPaymentRequest)})}static createPaymentRequest(e,t,n="US",s="USD"){return{countryCode:n,currencyCode:s,merchantCapabilities:u.getDefaultMerchantCapabilities(),supportedNetworks:u.getDefaultSupportedNetworks(),total:u.createLineItem(t,e)}}getApplePayConfig(){return this.applePayConfig}}const m=t=>{const{isLoading:n}=t;return n?e("div",{class:"container-fluid p-0"},e("div",{class:"row mb-3"},e("div",{class:"col-12 align-content-center"},e(o,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},P=t=>e("div",{class:"apple-pay-button-container"},e("button",Object.assign({class:(()=>{let e="apple-pay-button";switch(t.buttonStyle){case p.WHITE:e+=" apple-pay-button-white";break;case p.WHITE_OUTLINE:e+=" apple-pay-button-white-outline";break;default:e+=" apple-pay-button-black"}switch(t.buttonType){case r.BUY:e+=" apple-pay-button-type-buy";break;case r.DONATE:e+=" apple-pay-button-type-donate";break;default:e+=" apple-pay-button-type-plain"}return(t.disabled||t.isProcessing||!t.isAvailable)&&(e+=" disabled"),e})(),style:{width:t.width||"200px",height:t.height||"48px"},onClick:()=>{!t.disabled&&!t.isProcessing&&t.isAvailable&&t.clickHandler&&t.clickHandler()},disabled:t.disabled||t.isProcessing||!t.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},t),t.isProcessing&&e("div",{class:"processing-overlay"},e("div",{class:"spinner"}),e("span",null,"Processing..."))),e("style",null,"\n .apple-pay-button-container {\n display: inline-block;\n position: relative;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),b=class{constructor(e){t(this,e),this.applePayStarted=n(this,"applePayStarted"),this.applePayCompleted=n(this,"applePayCompleted"),this.applePayCancelled=n(this,"applePayCancelled"),this.applePayError=n(this,"applePayError"),this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=r.PLAIN,this.buttonStyle=p.BLACK,this.disabled=!1,this.showSkeleton=!0,this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.isConfigValid=!0,this.error=null,this.handleApplePayClick=async()=>{var e,t;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit(),console.groupCollapsed("[ApplePay Component] handleApplePayClick"),console.log("[ApplePay Component] click context:",{isProcessing:this.isProcessing,disabled:this.disabled,isAvailable:this.isAvailable,canMakePayments:this.canMakePayments,hasService:Boolean(this.applePayService)});const n={countryCode:this.countryCode,currencyCode:a.paymentCurrency,merchantCapabilities:[c.SUPPORTS_3DS,c.SUPPORTS_CREDIT,c.SUPPORTS_DEBIT],supportedNetworks:u.getDefaultSupportedNetworks(),total:u.createLineItem(a.paymentDescription,a.paymentAmount)};console.log("[ApplePay Component] paymentRequest",n),console.log("[ApplePay Component] identifiers snapshot:",{authTokenLength:a.authToken?String(a.authToken).length:0,accountId:a.accountId});const s=await this.applePayService.startPaymentSession(n,a.authToken,a.accountId);console.log("[ApplePay Component] startPaymentSession result",s),s.success?this.applePayCompleted.emit({success:!0,token:s.token,paymentMethodId:s.paymentMethodId}):(this.applePayCompleted.emit({success:!1,error:s.error}),this.applePayError.emit({error:(null===(e=s.error)||void 0===e?void 0:e.message)||"Payment failed",code:(null===(t=s.error)||void 0===t?void 0:t.code)||b.ErrorCode.PAYMENT_FAILED}))}catch(e){const t=e instanceof Error?e.message:"Payment failed";this.error=t,this.applePayError.emit({error:t,code:b.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:t})}finally{this.isProcessing=!1,console.groupEnd()}}}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,console.groupCollapsed("[ApplePay Component] initializeApplePay"),console.log("[ApplePay Component] checkout state snapshot:",{paymentAmount:a.paymentAmount,paymentCurrency:a.paymentCurrency,hasAuthToken:Boolean(a.authToken),accountId:a.accountId}),!(Boolean(a.paymentAmount)&&Boolean(a.paymentCurrency)&&Boolean(a.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,console.error("Apple Pay config error: missing required values",{paymentAmount:a.paymentAmount,paymentCurrency:a.paymentCurrency,hasAuthToken:Boolean(a.authToken),accountId:a.accountId}),this.applePayError.emit({error:this.error,code:b.ErrorCode.CONFIG_ERROR}),this.isLoading=!1,void console.groupEnd();if(this.isAvailable=u.isApplePaySupported(),this.canMakePayments=u.canMakePayments(),console.log("[ApplePay Component] support check:",{isAvailable:this.isAvailable,canMakePayments:this.canMakePayments,hasApplePaySessionOnWindow:"undefined"!=typeof window&&"ApplePaySession"in window}),!this.isAvailable)return this.error="Apple Pay is not supported on this device",console.error(this.error),this.applePayError.emit({error:this.error,code:b.ErrorCode.NOT_SUPPORTED}),this.isLoading=!1,void console.groupEnd();if(!this.canMakePayments)return this.error="Apple Pay is not available",console.error(this.error),this.applePayError.emit({error:this.error,code:b.ErrorCode.NOT_AVAILABLE}),this.isLoading=!1,void console.groupEnd();const e={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};console.log("[ApplePay Component] initializing service with config:",e),this.applePayService=new v,this.applePayService.initialize(e),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(e){console.error("Apple Pay initialization error:",e),this.error=e instanceof Error?e.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:b.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1,console.groupEnd()}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?u.getDefaultSupportedNetworks():[]}async abort(){this.applePayService.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){const t=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return e(i,{key:"6ffd1642666316916be6c263d6e79c44fb2d26cf"},a.checkoutLoaded&&e("script",{key:"d3cea0c2fea2b9e51fd926f581dce118a7b0cc00",async:!0,src:"https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",onLoad:()=>{console.log("[ApplePay Component] Apple Pay SDK script loaded"),this.initializeApplePay()}}),e("div",{key:"4a2ee3cb9a98746be1a10c3836833bb408d0896b",class:"apple-pay-container"},e(m,{key:"e804a3d42e4632d224a780c2313da4fd40a35281",isLoading:this.isLoading}),t&&e(P,{key:"82c8caa32e8857797dc3071a7404d9418fcd2274",buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick})),e("style",{key:"022d4942b34097987ca8fe956bb6e02174a488b9"},"\n .apple-pay-container {\n width: 100%;\n }\n "))}};b.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};export{b as justifi_apple_pay}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import{c as e,J as p}from"./p-O-hoT2Oo.js";import{T as a}from"./p-CxzFvTgf.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{e as n}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m,S as u}from"./p-C1xGBPma.js";import{S as d}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-BdLLGV9t.js";import"./p-BBO3I4s6.js";import"./p-BUa0YOaw.js";import"./p-BHf9IqGw.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D--yCspA.js";import"./p-RvUQ__Pq.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=l,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:s,service:i})=>async({params:o,onSuccess:e,onError:p})=>{var a,m;try{const u=await i.fetchTerminals(t,s,o);if(u.error)return p({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},u.page_info);e({terminals:(null===(a=u.data)||void 0===a?void 0:a.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:r.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new a}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u}))}render(){return i(d,{key:"705ee40711e90c28a6b1699f450befa7c5b5529b"},i("terminals-list-core",{key:"3d54a1519e5299eb83d16bf2034711fc0dd0cc18",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_terminals_list}
1
+ import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{C as r,a as e}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-BB5-CJF-.js";import{T as a}from"./p-CxzFvTgf.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{e as n}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m,S as u}from"./p-C1xGBPma.js";import{S as d}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{d as j}from"./p-BdLLGV9t.js";import"./p-pXjOPQhG.js";import"./p-BUa0YOaw.js";import"./p-BHf9IqGw.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D--yCspA.js";import"./p-RvUQ__Pq.js";const l=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=j,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:s,service:i})=>async({params:e,onSuccess:o,onError:p})=>{var a,m;try{const u=await i.fetchTerminals(t,s,e);if(u.error)return p({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},u.page_info);o({terminals:(null===(a=u.data)||void 0===a?void 0:a.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:r.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new a}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u}))}render(){return i(d,{key:"705ee40711e90c28a6b1699f450befa7c5b5529b"},i("terminals-list-core",{key:"3d54a1519e5299eb83d16bf2034711fc0dd0cc18",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{l as justifi_terminals_list}
@@ -1 +1 @@
1
- import{h as s,r as i,c as t}from"./p-qipqIMyC.js";import{c as r,F as e}from"./p-CR9D6mKt.js";import{b as o,a}from"./p-DSP8qjHL.js";import{i as p,a as h}from"./p-PgEzcvI6.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as n,a as l}from"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import{B as m,b as c}from"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as d,J as j}from"./p-O-hoT2Oo.js";import{B as u}from"./p-D6XirF21.js";import{S as f}from"./p-CLQx9p9q.js";import{H as v}from"./p-CQeex56P.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-Xv8DuU3Y.js";import{B as w}from"./p-XYgDHrVL.js";import{m as g,b as C}from"./p-5aA7gjr5.js";import{B}from"./p-B4idKqyn.js";import"./p-BFTU3MAI.js";import"./p-CYBR4K2p.js";import"./p-BX8GieXu.js";import"./p-yH3TC3ZQ.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-Dt-vy9Le.js";import"./p-BBO3I4s6.js";import"./p-BUa0YOaw.js";import"./p-RvUQ__Pq.js";import"./p-D2muobcE.js";const y=r(Object.assign(Object.assign({},o().fields),{legal_address:h(),additional_questions:a(),representative:p("representative")})),q=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"25%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"50%"}),s(b,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"65%"}),s(b,{width:"35%"}))),x=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(b,{width:"40%",height:"40px"})),s(q,null),s(q,null),s(q,null)),O=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event"),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.isLoading=!1,this.isSaving=!1,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new m(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new m(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){d(),this.analytics=new j(this),this.formController=new e(y),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=g({authToken:this.authToken,businessId:this.businessId,service:new B}),this.patchBusiness=C({authToken:this.authToken,businessId:this.businessId,service:new B}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:l.MISSING_PROPS,severity:n.ERROR})}handleReponse(s){s.error&&(this.errorMessage=c.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(f,null,this.isLoading?s(x,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(v,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(u,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:w.submit}),isLoading:this.isSaving},"Submit")))))}};export{O as justifi_business_form}
1
+ import{h as s,r as i,c as t}from"./p-qipqIMyC.js";import{c as r,F as e}from"./p-CR9D6mKt.js";import{b as o,a}from"./p-DSP8qjHL.js";import{i as p,a as h}from"./p-PgEzcvI6.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as n,a as l}from"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import{B as m,b as c}from"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as d,J as j}from"./p-BB5-CJF-.js";import{B as u}from"./p-D6XirF21.js";import{S as f}from"./p-CLQx9p9q.js";import{H as v}from"./p-CQeex56P.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-Xv8DuU3Y.js";import{B as w}from"./p-XYgDHrVL.js";import{m as C,b as g}from"./p-5aA7gjr5.js";import{B}from"./p-B4idKqyn.js";import"./p-BFTU3MAI.js";import"./p-CYBR4K2p.js";import"./p-BX8GieXu.js";import"./p-yH3TC3ZQ.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-Dt-vy9Le.js";import"./p-pXjOPQhG.js";import"./p-BUa0YOaw.js";import"./p-RvUQ__Pq.js";import"./p-D2muobcE.js";const y=r(Object.assign(Object.assign({},o().fields),{legal_address:h(),additional_questions:a(),representative:p("representative")})),q=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"25%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"50%"}),s(b,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"65%"}),s(b,{width:"35%"}))),x=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(b,{width:"40%",height:"40px"})),s(q,null),s(q,null),s(q,null)),D=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event"),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.isLoading=!1,this.isSaving=!1,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new m(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new m(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){d(),this.analytics=new j(this),this.formController=new e(y),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=C({authToken:this.authToken,businessId:this.businessId,service:new B}),this.patchBusiness=g({authToken:this.authToken,businessId:this.businessId,service:new B}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:l.MISSING_PROPS,severity:n.ERROR})}handleReponse(s){s.error&&(this.errorMessage=c.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(f,null,this.isLoading?s(x,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(v,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(u,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:w.submit}),isLoading:this.isSaving},"Submit")))))}};export{D as justifi_business_form}