@justifi/webcomponents 4.19.3-rc → 4.19.3-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 (164) hide show
  1. package/dist/cjs/{Analytics-57e3b5a8.js → Analytics-adc90fc6.js} +1 -1
  2. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +2 -2
  3. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  4. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  5. package/dist/cjs/justifi-card-form.cjs.entry.js +2 -2
  6. package/dist/cjs/justifi-checkout-core.cjs.entry.js +2 -1
  7. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  9. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +4 -1
  10. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-payment-form.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
  13. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  18. package/dist/cjs/{package-97b9c902.js → package-22d30c5d.js} +1 -1
  19. package/dist/collection/components/checkout/checkout-core.js +2 -1
  20. package/dist/collection/components/checkout/new-payment-method.js +4 -1
  21. package/dist/docs.json +1 -1
  22. package/dist/esm/{Analytics-7cb9826b.js → Analytics-a8eb7344.js} +1 -1
  23. package/dist/esm/justifi-bank-account-form.entry.js +2 -2
  24. package/dist/esm/justifi-business-details.entry.js +2 -2
  25. package/dist/esm/justifi-business-form.entry.js +2 -2
  26. package/dist/esm/justifi-card-form.entry.js +2 -2
  27. package/dist/esm/justifi-checkout-core.entry.js +2 -1
  28. package/dist/esm/justifi-checkout.entry.js +2 -2
  29. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  30. package/dist/esm/justifi-new-payment-method_4.entry.js +4 -1
  31. package/dist/esm/justifi-payment-details.entry.js +2 -2
  32. package/dist/esm/justifi-payment-form.entry.js +2 -2
  33. package/dist/esm/justifi-payment-method-form.entry.js +1 -1
  34. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  35. package/dist/esm/justifi-payments-list.entry.js +2 -2
  36. package/dist/esm/justifi-payout-details.entry.js +2 -2
  37. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  38. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  39. package/dist/esm/{package-93884871.js → package-ccb774a9.js} +1 -1
  40. package/dist/module/checkout-core.js +2 -1
  41. package/dist/module/new-payment-method.js +4 -1
  42. package/dist/module/package.js +1 -1
  43. package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
  44. package/dist/webcomponents/index.esm.js +1 -0
  45. package/dist/webcomponents/p-01a404ca.entry.js +44 -0
  46. package/dist/webcomponents/p-03d35880.entry.js +130 -0
  47. package/dist/webcomponents/p-06ff0429.entry.js +65 -0
  48. package/dist/webcomponents/p-08b0fb31.js +41 -1
  49. package/dist/webcomponents/p-0e1bc91e.js +28 -1
  50. package/dist/webcomponents/p-10875f3d.entry.js +97 -0
  51. package/dist/webcomponents/p-14c91ffd.js +20 -1
  52. package/dist/webcomponents/p-157acba8.entry.js +98 -0
  53. package/dist/webcomponents/p-15eafa87.js +77 -0
  54. package/dist/webcomponents/p-18fa0479.entry.js +131 -0
  55. package/dist/webcomponents/p-1a5120f4.entry.js +145 -0
  56. package/dist/webcomponents/p-1ad5995e.js +3599 -1
  57. package/dist/webcomponents/p-1ff8810b.js +29 -1
  58. package/dist/webcomponents/p-2338affa.js +213 -1
  59. package/dist/webcomponents/p-24dc023a.entry.js +791 -0
  60. package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
  61. package/dist/webcomponents/p-27d87fe2.entry.js +133 -0
  62. package/dist/webcomponents/p-29c0b182.js +114 -1
  63. package/dist/webcomponents/p-2b6c9c4f.js +7 -1
  64. package/dist/webcomponents/p-2e8f4937.js +79 -0
  65. package/dist/webcomponents/p-2eab3c90.js +3052 -1
  66. package/dist/webcomponents/p-3395e896.entry.js +74 -0
  67. package/dist/webcomponents/p-3fd13ca3.js +52 -1
  68. package/dist/webcomponents/p-47d79529.js +18 -1
  69. package/dist/webcomponents/p-525db3e8.js +22 -1
  70. package/dist/webcomponents/p-53ecc8b9.entry.js +261 -0
  71. package/dist/webcomponents/p-5482d030.entry.js +21 -0
  72. package/dist/webcomponents/p-56f6ce4c.js +10 -1
  73. package/dist/webcomponents/p-576826b1.entry.js +43 -0
  74. package/dist/webcomponents/p-5968ff8a.js +178 -1
  75. package/dist/webcomponents/p-5f835b89.entry.js +606 -0
  76. package/dist/webcomponents/p-6078a370.js +244 -1
  77. package/dist/webcomponents/p-6124b1b3.entry.js +80 -0
  78. package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
  79. package/dist/webcomponents/p-7582b554.entry.js +18 -0
  80. package/dist/webcomponents/p-75fd6367.entry.js +149 -0
  81. package/dist/webcomponents/p-79646550.entry.js +61 -0
  82. package/dist/webcomponents/p-7d85af5c.js +16 -1
  83. package/dist/webcomponents/p-800d31fe.entry.js +162 -0
  84. package/dist/webcomponents/p-8115b2f4.js +28 -1
  85. package/dist/webcomponents/p-83125497.js +4027 -1
  86. package/dist/webcomponents/p-85fc69e5.js +90 -1
  87. package/dist/webcomponents/p-89887332.js +301 -1
  88. package/dist/webcomponents/p-8df7bde8.js +27 -1
  89. package/dist/webcomponents/p-8eb774df.entry.js +54 -0
  90. package/dist/webcomponents/p-9c9c7dac.js +24 -1
  91. package/dist/webcomponents/p-9e17630d.entry.js +1684 -0
  92. package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
  93. package/dist/webcomponents/p-a4e8573e.entry.js +94 -0
  94. package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
  95. package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
  96. package/dist/webcomponents/p-ab4816e1.entry.js +117 -0
  97. package/dist/webcomponents/p-ac086069.entry.js +58 -0
  98. package/dist/webcomponents/p-af244664.js +126 -1
  99. package/dist/webcomponents/p-b4b8b531.js +44 -1
  100. package/dist/webcomponents/p-b82c146f.entry.js +111 -0
  101. package/dist/webcomponents/p-ba4bae6f.js +12 -1
  102. package/dist/webcomponents/p-ba5fae28.js +90 -1
  103. package/dist/webcomponents/p-bd66f9d2.entry.js +101 -0
  104. package/dist/webcomponents/p-cc39384f.entry.js +99 -0
  105. package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
  106. package/dist/webcomponents/p-d89bad72.js +39 -1
  107. package/dist/webcomponents/p-dad3e069.entry.js +298 -0
  108. package/dist/webcomponents/p-dce846bf.js +27 -1
  109. package/dist/webcomponents/p-df21aaad.js +120 -1
  110. package/dist/webcomponents/p-e1255160.js +3 -1
  111. package/dist/webcomponents/p-e1e7525b.entry.js +73 -0
  112. package/dist/webcomponents/p-e333620e.js +34 -1
  113. package/dist/webcomponents/p-e356f280.entry.js +29 -0
  114. package/dist/webcomponents/p-e3fab0e2.js +43 -1
  115. package/dist/webcomponents/p-e9a5cb95.entry.js +94 -0
  116. package/dist/webcomponents/p-ec854a3e.entry.js +11053 -0
  117. package/dist/webcomponents/p-edc37d1f.entry.js +75 -0
  118. package/dist/webcomponents/p-f02b75dc.entry.js +96 -0
  119. package/dist/webcomponents/p-fad19d75.js +1638 -2
  120. package/dist/webcomponents/webcomponents.css +362 -4
  121. package/dist/webcomponents/webcomponents.esm.js +20 -1
  122. package/package.json +1 -1
  123. package/dist/webcomponents/p-03419b17.js +0 -1
  124. package/dist/webcomponents/p-07109641.entry.js +0 -1
  125. package/dist/webcomponents/p-0bbe1f1c.entry.js +0 -1
  126. package/dist/webcomponents/p-0cd89142.entry.js +0 -1
  127. package/dist/webcomponents/p-0f7b9555.entry.js +0 -1
  128. package/dist/webcomponents/p-16887e04.entry.js +0 -1
  129. package/dist/webcomponents/p-17baca7d.entry.js +0 -1
  130. package/dist/webcomponents/p-17e4246f.entry.js +0 -1
  131. package/dist/webcomponents/p-1a43e355.entry.js +0 -19
  132. package/dist/webcomponents/p-1f761d16.entry.js +0 -1
  133. package/dist/webcomponents/p-276cc368.entry.js +0 -1
  134. package/dist/webcomponents/p-30a493cd.entry.js +0 -1
  135. package/dist/webcomponents/p-32211b2f.entry.js +0 -1
  136. package/dist/webcomponents/p-3352353a.entry.js +0 -1
  137. package/dist/webcomponents/p-462dc522.entry.js +0 -1
  138. package/dist/webcomponents/p-487b72a8.entry.js +0 -1
  139. package/dist/webcomponents/p-4a485cce.js +0 -1
  140. package/dist/webcomponents/p-4abc17f0.entry.js +0 -1
  141. package/dist/webcomponents/p-4c849993.entry.js +0 -1
  142. package/dist/webcomponents/p-52021fa1.entry.js +0 -1
  143. package/dist/webcomponents/p-53e64f15.entry.js +0 -1
  144. package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
  145. package/dist/webcomponents/p-83876625.entry.js +0 -1
  146. package/dist/webcomponents/p-8e541a32.entry.js +0 -1
  147. package/dist/webcomponents/p-97272668.entry.js +0 -1
  148. package/dist/webcomponents/p-b1257354.entry.js +0 -1
  149. package/dist/webcomponents/p-b29f5084.entry.js +0 -1
  150. package/dist/webcomponents/p-babd56c3.entry.js +0 -1
  151. package/dist/webcomponents/p-bbed6107.entry.js +0 -1
  152. package/dist/webcomponents/p-be39c802.entry.js +0 -1
  153. package/dist/webcomponents/p-c607f049.entry.js +0 -1
  154. package/dist/webcomponents/p-c9f8f7ec.entry.js +0 -1
  155. package/dist/webcomponents/p-cd37a87e.entry.js +0 -1
  156. package/dist/webcomponents/p-cff82e78.entry.js +0 -1
  157. package/dist/webcomponents/p-d8355f91.entry.js +0 -1
  158. package/dist/webcomponents/p-e2c88817.entry.js +0 -1
  159. package/dist/webcomponents/p-e31f0f3e.entry.js +0 -1
  160. package/dist/webcomponents/p-f0866375.entry.js +0 -1
  161. package/dist/webcomponents/p-f117d1d1.entry.js +0 -1
  162. package/dist/webcomponents/p-f883bf32.entry.js +0 -1
  163. package/dist/webcomponents/p-fb58feb5.entry.js +0 -1
  164. package/dist/webcomponents/p-fe33151d.entry.js +0 -1
@@ -0,0 +1,118 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { f as formatCurrency } from './p-83125497.js';
3
+ import { v as validateInsuranceValues, a as insuranceValues, b as insuranceErrors } from './p-2338affa.js';
4
+ import { S as StyledHost } from './p-ba4bae6f.js';
5
+
6
+ const seasonInterruptionInsuranceCoreCss = ":host{display:block}a{color:var(--jfi-body-color) !important}";
7
+ const JustifiSeasonInterruptionInsuranceCoreStyle0 = seasonInterruptionInsuranceCoreCss;
8
+
9
+ const formCheckInputCss = ".form-check-input,label{cursor:pointer}.form-check-input{background-color:var(--jfi-radio-button-background-color);border-color:var(--jfi-radio-button-border-color)}.form-check-input:checked,.form-check-input:checked:focus{background-color:var(--jfi-radio-button-background-color-selected);border-color:var(--jfi-radio-button-border-color-selected)}.form-check-input:focus{border-color:var(--jfi-radio-button-border-color-focus);box-shadow:var(--jfi-radio-button-box-shadow-focus)}";
10
+ const JustifiSeasonInterruptionInsuranceCoreStyle1 = formCheckInputCss;
11
+
12
+ const headerCss = ".jfi-header{color:var(--jfi-header-color);border-bottom:var(--jfi-header-border)}";
13
+ const JustifiSeasonInterruptionInsuranceCoreStyle2 = headerCss;
14
+
15
+ const SeasonInterruptionInsuranceCore = class {
16
+ constructor(hostRef) {
17
+ registerInstance(this, hostRef);
18
+ this.insuranceUpdated = createEvent(this, "insurance-updated", 7);
19
+ this.errorEvent = createEvent(this, "error-event", 7);
20
+ this.checkoutId = undefined;
21
+ this.getQuote = undefined;
22
+ this.toggleCoverage = undefined;
23
+ this.primaryIdentityFirstName = undefined;
24
+ this.primaryIdentityLastName = undefined;
25
+ this.primaryIdentityState = undefined;
26
+ this.primaryIdentityPostalCode = undefined;
27
+ this.primaryIdentityCountry = undefined;
28
+ this.primaryIdentityEmailAddress = undefined;
29
+ this.policyAttributesInsurableAmount = undefined;
30
+ this.policyAttributesStartDate = undefined;
31
+ this.policyAttributesEndDate = undefined;
32
+ this.coveredIdentityFirstName = undefined;
33
+ this.coveredIdentityLastName = undefined;
34
+ this.quote = undefined;
35
+ this.isLoading = true;
36
+ this.accepted = undefined;
37
+ }
38
+ async validate() {
39
+ return validateInsuranceValues();
40
+ }
41
+ componentWillLoad() {
42
+ if (this.getQuote) {
43
+ this.fetchData();
44
+ }
45
+ }
46
+ ;
47
+ fetchData() {
48
+ this.isLoading = true;
49
+ this.getQuote({
50
+ payload: {
51
+ checkout_id: this.checkoutId,
52
+ policy_type: "season_interruption",
53
+ primary_identity: {
54
+ state: this.primaryIdentityState,
55
+ email: this.primaryIdentityEmailAddress,
56
+ first_name: this.primaryIdentityFirstName,
57
+ last_name: this.primaryIdentityLastName,
58
+ postal_code: this.primaryIdentityPostalCode,
59
+ country: this.primaryIdentityCountry
60
+ },
61
+ policy_attributes: {
62
+ insurable_amount: this.policyAttributesInsurableAmount,
63
+ start_date: this.policyAttributesStartDate,
64
+ end_date: this.policyAttributesEndDate,
65
+ covered_identity: {
66
+ first_name: this.coveredIdentityFirstName,
67
+ last_name: this.coveredIdentityLastName
68
+ }
69
+ }
70
+ },
71
+ onSuccess: ({ quote }) => {
72
+ this.quote = quote;
73
+ insuranceValues[quote.policy_type] = quote.accepted;
74
+ this.isLoading = false;
75
+ },
76
+ onError: ({ error, code, severity }) => {
77
+ this.isLoading = false;
78
+ this.errorEvent.emit({
79
+ errorCode: code,
80
+ message: error,
81
+ severity,
82
+ });
83
+ }
84
+ });
85
+ }
86
+ ;
87
+ onChangeHandler(event) {
88
+ this.accepted = event.target.value;
89
+ insuranceErrors[this.quote.policy_type] = false;
90
+ this.toggleCoverage({
91
+ quoteId: this.quote.id,
92
+ payload: { accepted: this.accepted },
93
+ onSuccess: () => {
94
+ this.insuranceUpdated.emit();
95
+ insuranceValues[this.quote.policy_type] = this.accepted;
96
+ },
97
+ onError: ({ error, code, severity }) => {
98
+ this.errorEvent.emit({
99
+ errorCode: code,
100
+ message: error,
101
+ severity,
102
+ });
103
+ }
104
+ });
105
+ }
106
+ get error() {
107
+ var _a;
108
+ return insuranceErrors[(_a = this.quote) === null || _a === void 0 ? void 0 : _a.policy_type];
109
+ }
110
+ render() {
111
+ var _a, _b, _c, _d;
112
+ return (h(StyledHost, { key: '7b1384ddbc83b5f92d3a2c4f8e544c8bd06fa716' }, !this.isLoading &&
113
+ h("div", { key: 'd94a61158ceb79c30d81ee5186195d3454c01323' }, h("h2", { key: '05d5b1499cf7de28823ec98ebd2c220eca7471f1', class: "fs-5 fw-bold pb-3 jfi-header" }, (_a = this.quote) === null || _a === void 0 ? void 0 : _a.product.title), h("small", { key: 'fa26cf97a06a9910d7f4cb04d149bbcd9f30d103', innerHTML: (_b = this.quote) === null || _b === void 0 ? void 0 : _b.product.description }), h("div", { key: '287de8ed4ca603b3162b4158d18d7e8a53e3b453' }, h("input", { key: '59adbc8ac892e572bc1aa68f3c626beab76af282', id: "accept", type: "radio", name: "opt-in", value: "true", onChange: (event) => this.onChangeHandler(event), class: this.error ? 'form-check-input me-2 is-invalid' : 'form-check-input me-2' }), h("label", { key: '469ac2622be0c76564de8102a499d3d3790380b2', htmlFor: "accept" }, "Accept coverage for ", formatCurrency((_c = this.quote) === null || _c === void 0 ? void 0 : _c.total_cents))), h("div", { key: '7a8827c4261d5978ecca31fc42397f233b3e37fc', class: "mb-2" }, h("input", { key: 'e25994c491ca5d74d20ec5f5787ff88ee9575ca0', id: "decline", type: "radio", name: "opt-in", value: "false", onChange: (event) => this.onChangeHandler(event), class: this.error ? 'form-check-input me-2 is-invalid' : 'form-check-input me-2' }), h("label", { key: '0a5f13213a19e13258c72ccbbe7a2e148daf1750', htmlFor: "decline" }, "Decline coverage")), h("div", { key: '33a190aa52dfefd6accf77a9e00598563a8f5e6c', class: "invalid-feedback", style: { display: this.error ? 'block' : 'none' } }, "Please select an option"), h("small", { key: 'f10e4ebd9a896fc792bb3d18d6014100013cb0b7', innerHTML: (_d = this.quote) === null || _d === void 0 ? void 0 : _d.product.legal_disclaimer }))));
114
+ }
115
+ };
116
+ SeasonInterruptionInsuranceCore.style = JustifiSeasonInterruptionInsuranceCoreStyle0 + (JustifiSeasonInterruptionInsuranceCoreStyle1 + JustifiSeasonInterruptionInsuranceCoreStyle2);
117
+
118
+ export { SeasonInterruptionInsuranceCore as justifi_season_interruption_insurance_core };
@@ -0,0 +1,94 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { P as PaymentService } from './p-47d79529.js';
3
+ import './p-56f6ce4c.js';
4
+ import { P as Payment } from './p-df21aaad.js';
5
+ import './p-e3fab0e2.js';
6
+ import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
7
+ import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
8
+ import { E as ErrorState } from './p-dce846bf.js';
9
+ import { J as JustifiAnalytics } from './p-15eafa87.js';
10
+ import './p-29c0b182.js';
11
+ import './p-2e8f4937.js';
12
+
13
+ const makeGetPayments = ({ id, authToken, service }) => async ({ params, onSuccess, onError }) => {
14
+ var _a, _b;
15
+ try {
16
+ const response = await service.fetchPayments(id, authToken, params);
17
+ if (!response.error) {
18
+ const pagingInfo = Object.assign({}, response.page_info);
19
+ const payments = ((_a = response.data) === null || _a === void 0 ? void 0 : _a.map((dataItem) => new Payment(dataItem))) || [];
20
+ onSuccess({ payments, pagingInfo });
21
+ }
22
+ else {
23
+ const responseError = getErrorMessage(response.error);
24
+ const code = getErrorCode((_b = response.error) === null || _b === void 0 ? void 0 : _b.code);
25
+ return onError({
26
+ error: responseError,
27
+ code,
28
+ severity: ComponentErrorSeverity.ERROR,
29
+ });
30
+ }
31
+ }
32
+ catch (error) {
33
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
34
+ return onError({
35
+ error: error.message || error,
36
+ code,
37
+ severity: ComponentErrorSeverity.ERROR,
38
+ });
39
+ }
40
+ };
41
+
42
+ const PaymentsList = class {
43
+ constructor(hostRef) {
44
+ registerInstance(this, hostRef);
45
+ this.errorEvent = createEvent(this, "error-event", 7);
46
+ this.handleErrorEvent = (event) => {
47
+ this.errorMessage = event.detail.message;
48
+ this.errorEvent.emit(event.detail);
49
+ };
50
+ this.accountId = undefined;
51
+ this.authToken = undefined;
52
+ this.getPayments = undefined;
53
+ this.errorMessage = null;
54
+ }
55
+ componentWillLoad() {
56
+ this.analytics = new JustifiAnalytics(this);
57
+ this.initializeGetPayments();
58
+ }
59
+ disconnectedCallback() {
60
+ this.analytics.cleanup();
61
+ }
62
+ propChanged() {
63
+ this.initializeGetPayments();
64
+ }
65
+ initializeGetPayments() {
66
+ if (this.accountId && this.authToken) {
67
+ this.getPayments = makeGetPayments({
68
+ id: this.accountId,
69
+ authToken: this.authToken,
70
+ service: new PaymentService(),
71
+ });
72
+ }
73
+ else {
74
+ this.errorMessage = 'Account ID and Auth Token are required';
75
+ this.errorEvent.emit({
76
+ errorCode: ComponentErrorCodes.MISSING_PROPS,
77
+ message: this.errorMessage,
78
+ severity: ComponentErrorSeverity.ERROR,
79
+ });
80
+ }
81
+ }
82
+ render() {
83
+ if (this.errorMessage) {
84
+ return ErrorState(this.errorMessage);
85
+ }
86
+ return (h("payments-list-core", { getPayments: this.getPayments, "onError-event": this.handleErrorEvent }));
87
+ }
88
+ static get watchers() { return {
89
+ "accountId": ["propChanged"],
90
+ "authToken": ["propChanged"]
91
+ }; }
92
+ };
93
+
94
+ export { PaymentsList as justifi_payments_list };
@@ -0,0 +1,125 @@
1
+ import { r as registerInstance, h, H as Host } from './p-fad19d75.js';
2
+ import { a as businessServiceReceivedOptions, r as recurringPaymentsOptions, s as seasonalBusinessOptions, b as businessClassificationOptions } from './p-ba5fae28.js';
3
+ import { C as CURRENCY_MASK, T as TAX_ID_MASKS, P as PHONE_MASKS, S as SSN_MASK } from './p-525db3e8.js';
4
+ import { C as CoreBusinessInfo } from './p-af244664.js';
5
+ import { d as deconstructDate } from './p-1ff8810b.js';
6
+ import { S as StateOptions } from './p-6078a370.js';
7
+ import { n as numberOnlyHandler } from './p-8df7bde8.js';
8
+
9
+ const FormAlert = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.text = undefined;
13
+ this.hideAlert = undefined;
14
+ }
15
+ render() {
16
+ if (!this.text) {
17
+ return null;
18
+ }
19
+ if (this.hideAlert) {
20
+ return null;
21
+ }
22
+ return (h("div", { class: 'alert alert-danger d-flex align-items-center', role: 'alert' }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "currentColor", class: "bi bi-exclamation-triangle-fill flex-shrink-0 me-2", viewBox: "0 0 16 16", role: "img", "aria-label": "Warning:" }, h("path", { d: "M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z" })), h("div", null, this.text)));
23
+ }
24
+ };
25
+
26
+ const AdditionalQuestions = class {
27
+ constructor(hostRef) {
28
+ registerInstance(this, hostRef);
29
+ this.formController = undefined;
30
+ this.errors = {};
31
+ this.additional_questions = {};
32
+ this.inputHandler = this.inputHandler.bind(this);
33
+ }
34
+ componentDidLoad() {
35
+ this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
36
+ this.formController.values.subscribe(values => (this.additional_questions = Object.assign({}, values.additional_questions)));
37
+ }
38
+ inputHandler(name, value) {
39
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { additional_questions: Object.assign(Object.assign({}, this.formController.values.getValue().additional_questions), { [name]: value }) }));
40
+ }
41
+ render() {
42
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
43
+ const additionalQuestionsDefaultValue = this.formController.getInitialValues().additional_questions;
44
+ return (h(Host, { key: '61cc057bc6c5776e27de37de03fd89c11e222b48', exportparts: "label,input,input-invalid" }, h("fieldset", { key: 'b979a8632db229a28fe4c7e209963d9750cb3af3' }, h("legend", { key: 'f0228638af05f24d265ff3ff08da34d9026b8bc8' }, "Additional Questions"), h("hr", { key: '985908ab74473185e4f63edf8d2ae67d21aa2c4c' }), h("div", { key: '3e5b107b36d8f02d1a7ec7f5be04cc7560dacb9b', class: "row gy-3" }, h("div", { key: '7bca3143f0e7c813b02b08bf685ed7d83a6f17d3', class: "col-12 col-md-6" }, h("form-control-monetary", { key: '7b96fb49733b41cb4a100d9fbdf85054409d46d8', name: "business_revenue", label: "What is the business' estimated annual revenue from its primary business activities?", inputHandler: this.inputHandler, errorText: (_b = (_a = this.errors) === null || _a === void 0 ? void 0 : _a.additional_questions) === null || _b === void 0 ? void 0 : _b.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: '3103b2355eccb404733e25b1a812faf7d33643de', class: "col-12 col-md-6" }, h("form-control-monetary", { key: '2bd4f9de5e18f8e9f7337e09b20ef2027f8efe10', name: "business_payment_volume", label: "What is the business' annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, errorText: (_d = (_c = this.errors) === null || _c === void 0 ? void 0 : _c.additional_questions) === null || _d === void 0 ? void 0 : _d.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: '3947678da024eacc36a4895dc82133543904ec10', class: "col-12" }, h("form-control-select", { key: 'cb6473c4ca9b410e1f73fb6821a1e6a9c4e8ba3c', name: 'business_when_service_received', label: 'On average, how long after paying will your customers typically receive their goods or services?', inputHandler: this.inputHandler, errorText: (_f = (_e = this.errors) === null || _e === void 0 ? void 0 : _e.additional_questions) === null || _f === void 0 ? void 0 : _f.business_when_service_received, options: businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), h("div", { key: '3ba6b5469e8b55fdf9607458ea82db534060b4da', class: "col-12" }, h("form-control-select", { key: '9239ce8bf9b5f54847dcd946b70b84cb2b188476', name: 'business_recurring_payments', label: 'Does your business offer recurring payments?', inputHandler: this.inputHandler, errorText: (_h = (_g = this.errors) === null || _g === void 0 ? void 0 : _g.additional_questions) === null || _h === void 0 ? void 0 : _h.business_recurring_payments, options: recurringPaymentsOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments })), h("div", { key: '3acb380a8932d9df99c1bec4bf77806d23f16376', class: "col-12" }, h("form-control-text", { key: '71a01a5936b25f95ecd1d7a4ae926c34f0ab8f42', name: 'business_recurring_payments_percentage', label: 'What percent of revenue is generated from each recurring payment type offered?', inputHandler: this.inputHandler, errorText: (_k = (_j = this.errors) === null || _j === void 0 ? void 0 : _j.additional_questions) === null || _k === void 0 ? void 0 : _k.business_recurring_payments_percentage, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments_percentage })), h("div", { key: 'e31135b0483e5ab0e71ad4126bed49c2ce8e2f2d', class: "col-12" }, h("form-control-select", { key: '00c4567411859e568ac6c8663476d8a35e11dd59', name: 'business_seasonal', label: 'Is this business seasonal?', inputHandler: this.inputHandler, errorText: (_m = (_l = this.errors) === null || _l === void 0 ? void 0 : _l.additional_questions) === null || _m === void 0 ? void 0 : _m.business_seasonal, options: seasonalBusinessOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_seasonal })), h("div", { key: 'f30fdb514b300844feb0a0c1bb2492d234f5f050', class: "col-12" }, h("form-control-text", { key: '6d7cf0947be6991725bee50c2fcad1298677d5e3', name: 'business_other_payment_details', label: 'Is there anything else you would like us to know about how your customers pay the business?', inputHandler: this.inputHandler, errorText: (_p = (_o = this.errors) === null || _o === void 0 ? void 0 : _o.additional_questions) === null || _p === void 0 ? void 0 : _p.business_other_payment_details, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_other_payment_details }))))));
45
+ }
46
+ };
47
+
48
+ const BusinessCoreInfo = class {
49
+ constructor(hostRef) {
50
+ registerInstance(this, hostRef);
51
+ this.formController = undefined;
52
+ this.errors = {};
53
+ this.coreInfo = {};
54
+ this.inputHandler = this.inputHandler.bind(this);
55
+ }
56
+ componentDidLoad() {
57
+ this.formController.values.subscribe(values => (this.coreInfo = Object.assign({}, new CoreBusinessInfo(values))));
58
+ this.formController.errors.subscribe(errors => {
59
+ this.errors = Object.assign({}, errors);
60
+ });
61
+ }
62
+ inputHandler(name, value) {
63
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
64
+ }
65
+ render() {
66
+ const coreInfoDefaultValue = this.formController.getInitialValues();
67
+ return (h(Host, { key: '59fa8a9a4bef1875845633b66b60ebf2350fe61e', exportparts: "label,input,input-invalid" }, h("fieldset", { key: '7b6c58d55cf2ed0f5020f043e164c63423d9ee4f' }, h("legend", { key: '5be18bc86f27541d7c6bb4ea4e05e3df4c9d87c0' }, "General Info"), h("hr", { key: '33747ac14e24ef2ecf9e84970cd8924b9f5a5c53' }), h("div", { key: '3d550cac878b9676d620fbea3c14dacf4db4e72f', class: "row gy-3" }, h("div", { key: 'd2226f4bdbbd87169d1ef75f9ffc1d7f6a6acba7', class: "col-12" }, h("form-control-text", { key: '4367c1eeec808b9b134c880be587f58327778bb2', name: "legal_name", label: "Legal Name", defaultValue: coreInfoDefaultValue.legal_name, errorText: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { key: '455cacee1c69e28fc447e893bf648ff30946f66f', class: "col-12" }, h("form-control-text", { key: '1ea37fac67414741edab132c0b8d70c84cb4f1db', name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, errorText: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { key: '3da63dd018d2503a9b47a2b0950f95ce887ba38d', class: "col-12 col-md-8" }, h("form-control-select", { key: 'a059c7fda30418c4338ac58630170104d616c0f2', name: "classification", label: "Business Classification", options: businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), h("div", { key: '9157cac7c6999b25c8acf4e698d082a0fcbffe9d', class: "col-12 col-md-4" }, h("form-control-date", { key: '0726e93b8f6b2bd792102bb131c13e0806717f82', name: "date_of_incorporation", label: "Date of Incorporation", defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { key: 'f3391ac0166116ef685c6d26e6d0705d087fa83d', class: "col-12 col-md-6" }, h("form-control-text", { key: '682a18784fab9410002c7949a7cfa606f3ec5784', name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler })), h("div", { key: '4a2d95cc422ebc882e2a47237f5b1324a7660b36', class: "col-12 col-md-6" }, h("form-control-number-masked", { key: '0d138b6bafde2b5fc7c45f9d4d51746e5f91baaa', name: "tax_id", label: "Tax ID", defaultValue: coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, mask: TAX_ID_MASKS.US })), h("div", { key: 'a895244496b196804a16931589f6f353c49476e8', class: "col-12" }, h("form-control-text", { key: '68375469c212b97e76861e5b8590dd502533a35a', name: "website_url", label: "Website URL", defaultValue: coreInfoDefaultValue.website_url, errorText: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { key: '84d1a7f2b51b6dae3283bbd6d0f5aca81a0da07b', class: "col-12 col-md-6" }, h("form-control-text", { key: '27f9dd986a431fa14028f1faa3997bbdb623574e', name: "email", label: "Email Address", defaultValue: coreInfoDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: '0902cff0a887d5f19c5326ce135fed5f54d6643a', class: "col-12 col-md-6" }, h("form-control-number-masked", { key: 'bbce92814cbf42f17a0a9e1e1df194d3ea3a15b0', name: "phone", label: "Phone Number", defaultValue: coreInfoDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US }))))));
68
+ }
69
+ };
70
+
71
+ const BusinessRepresentative = class {
72
+ constructor(hostRef) {
73
+ registerInstance(this, hostRef);
74
+ this.inputHandler = (name, value) => {
75
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { [name]: value }) }));
76
+ };
77
+ this.onAddressFormUpdate = (values) => {
78
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { address: Object.assign(Object.assign({}, this.formController.values.getValue().representative.address), values) }) }));
79
+ };
80
+ this.onDateOfBirthUpdate = (event) => {
81
+ const dob_values = deconstructDate(event.detail);
82
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { dob_day: dob_values.dob_day, dob_month: dob_values.dob_month, dob_year: dob_values.dob_year }) }));
83
+ };
84
+ this.formController = undefined;
85
+ this.errors = {};
86
+ this.representative = {};
87
+ }
88
+ get identificationNumberLabel() {
89
+ return this.representative.ssn_last4 ? 'Update SSN (optional)' : 'SSN';
90
+ }
91
+ componentDidLoad() {
92
+ this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors.representative)));
93
+ this.formController.values.subscribe(values => (this.representative = Object.assign({}, values.representative)));
94
+ }
95
+ render() {
96
+ const representativeDefaultValue = this.formController.getInitialValues().representative;
97
+ return (h(Host, { key: '857634ffd34ea218dce687fb0eaa95830a58bfb1', exportparts: "label,input,input-invalid" }, h("fieldset", { key: 'b3b073dc456e58c4fa67182ea3518581038419e3' }, h("legend", { key: '3c1997f718c340b5dd32e4cdbe9400d64eecf577' }, "Representative"), h("hr", { key: 'd51e5d797106af2050b884fc09802c497a180e1d' }), h("div", { key: '7e5631f8eb5c28f0a5c4193ece3039a3adc35d0a', class: "row gy-3" }, h("div", { key: '399a1f505781ed0b82fa85366ca66580e977f3e5', class: "col-12 col-md-8" }, h("form-control-text", { key: '0820b8e0b6178b997ba1938efc045ad334f061d3', name: "name", label: "Full Name", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.name, errorText: this.errors.name, inputHandler: this.inputHandler })), h("div", { key: '2bb15a86304ce8755e1183835c0ed7c310a0e8b2', class: "col-12 col-md-4" }, h("form-control-text", { key: '2cc405cea169ec1bd5d72b110ce403101d029fff', name: "title", label: "Title", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.title, errorText: this.errors.title, inputHandler: this.inputHandler })), h("div", { key: 'd2927f863bd374c38b8028a148568068144294d7', class: "col-12 col-md-6" }, h("form-control-text", { key: '0fa24fa492e060978facf23aac2b151595bb129c', name: "email", label: "Email Address", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: '8c9f75ebc3c5d87fafaff48e489ad5dc091fbca4', class: "col-12 col-md-6" }, h("form-control-number-masked", { key: 'f060196556cd11d9f68dab3aa7e87cba24e38afe', name: "phone", label: "Phone Number", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })), h("div", { key: '19f7bcd2a18ef1f8c937a90602bdd9f0ac8f91e5', class: "col-12 col-md-4" }, h("form-control-date", { key: '5392a1ce2cbb43a88c2d90981b56ef55ba4fdb31', name: "dob_full", label: "Birth Date", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_full, errorText: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: this.onDateOfBirthUpdate })), h("div", { key: '36203f898451d610b34afabc4bac9e20f01e53f7', class: "col-12 col-md-8" }, h("form-control-number-masked", { key: '4d4b9e4dcc0f5829068d4916d7373f6506ee9e74', name: "identification_number", label: this.identificationNumberLabel, defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: SSN_MASK })), h("div", { key: '560e1dabe186e54a201ad02fb9054505ab5bb84c', class: "col-12" }, h("justifi-identity-address-form", { key: 'b47b48c19ca88248a9609c0e1858ba649f44c2da', errors: this.errors.address, defaultValues: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.address, handleFormUpdate: this.onAddressFormUpdate }))))));
98
+ }
99
+ };
100
+
101
+ const LegalAddressForm = class {
102
+ constructor(hostRef) {
103
+ registerInstance(this, hostRef);
104
+ this.formController = undefined;
105
+ this.errors = {};
106
+ this.legal_address = undefined;
107
+ this.inputHandler = this.inputHandler.bind(this);
108
+ }
109
+ componentDidLoad() {
110
+ this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
111
+ this.formController.values.subscribe(values => (this.legal_address = Object.assign({}, values.legal_address)));
112
+ }
113
+ inputHandler(name, value) {
114
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { legal_address: Object.assign(Object.assign({}, this.formController.values.getValue().legal_address), { [name]: value }) }));
115
+ }
116
+ render() {
117
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
118
+ const legalAddressDefaultValue = this.formController.getInitialValues().legal_address;
119
+ return (h(Host, { key: '794669fd0c563f54abde94146df007b114c30465', exportparts: "label,input,input-invalid" }, h("fieldset", { key: '34cf40bcf68c4b0af97363700ede8d5ef778c38c' }, h("legend", { key: 'deb0acfa3da0128a9337ddddd76592d7569685c6' }, "Business Legal Address"), h("hr", { key: '1d01aa0b9577c47c24af4e85728828d41164c5ee' }), h("div", { key: '2199ba800c530bb9a5704431103660a39bdf70fb', class: "row gy-3" }, h("div", { key: '811fa71f919e62d6ecf44fd97e5940473bdb2a51', class: "col-12" }, h("form-control-text", { key: '06305b11aecb6b49bc8d3c0b39b8652f3968083e', name: "line1", label: "Legal Address", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line1, errorText: (_b = (_a = this.errors) === null || _a === void 0 ? void 0 : _a.legal_address) === null || _b === void 0 ? void 0 : _b.line1 })), h("div", { key: 'c1a2aad7893ac8f5aed57e662ce0704a4e0ed2fa', class: "col-12" }, h("form-control-text", { key: '858e3e7be65828a89b07f954e82033c76f4ab350', name: "line2", label: "Address Line 2", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line2, errorText: (_d = (_c = this.errors) === null || _c === void 0 ? void 0 : _c.legal_address) === null || _d === void 0 ? void 0 : _d.line2 })), h("div", { key: '641805ddb44395c77020e708b60ff2a09ffc5d5b', class: "col-12" }, h("form-control-text", { key: '6d881c0aacf9a689305a15f353d376917a6e8aff', name: "city", label: "City", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.city, errorText: (_f = (_e = this.errors) === null || _e === void 0 ? void 0 : _e.legal_address) === null || _f === void 0 ? void 0 : _f.city })), h("div", { key: '6bab46c2823b9da84ac66496b80a4f98d237ccfe', class: "col-12" }, h("form-control-select", { key: '0cc60022e6862884df786ea7414cf4cae4c45728', name: "state", label: "State", options: StateOptions, inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.state, errorText: (_h = (_g = this.errors) === null || _g === void 0 ? void 0 : _g.legal_address) === null || _h === void 0 ? void 0 : _h.state })), h("div", { key: 'ff349be7524f3b3fc7a3adee03259f7b8bf10390', class: "col-12" }, h("form-control-text", { key: '015277e0bde6a15077744f9d09bc016a0db4b465', name: "postal_code", label: "Postal Code", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.postal_code, errorText: (_k = (_j = this.errors) === null || _j === void 0 ? void 0 : _j.legal_address) === null || _k === void 0 ? void 0 : _k.postal_code, maxLength: 5, keyDownHandler: numberOnlyHandler })), h("div", { key: 'd6097ef782c0d47a2d93c4624635e7f820dac95d', class: "col-12" }, h("form-control-select", { key: '396a8c6bc10f288bde9289b7177c161e42f60b7e', name: "country", label: "Country", options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.country, errorText: (_m = (_l = this.errors) === null || _l === void 0 ? void 0 : _l.legal_address) === null || _m === void 0 ? void 0 : _m.country,
120
+ // just for now so we skip handling country specificities
121
+ disabled: true }))))));
122
+ }
123
+ };
124
+
125
+ export { FormAlert as form_alert, AdditionalQuestions as justifi_additional_questions, BusinessCoreInfo as justifi_business_core_info, BusinessRepresentative as justifi_business_representative, LegalAddressForm as justifi_legal_address_form };
@@ -0,0 +1,131 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { p as pagingDefaults } from './p-56f6ce4c.js';
3
+ import './p-df21aaad.js';
4
+ import './p-e3fab0e2.js';
5
+ import { b as formatDate, c as formatTime, f as formatCurrency, M as MapPaymentStatusToBadge } from './p-83125497.js';
6
+ import { t as tableExportedParts } from './p-2b6c9c4f.js';
7
+ import { S as StyledHost } from './p-ba4bae6f.js';
8
+ import { T as TableLoadingState, a as TableEmptyState, b as TableErrorState } from './p-e333620e.js';
9
+
10
+ const PaymentsListCore = class {
11
+ constructor(hostRef) {
12
+ registerInstance(this, hostRef);
13
+ this.rowClicked = createEvent(this, "payment-row-clicked", 7);
14
+ this.errorEvent = createEvent(this, "error-event", 7);
15
+ this.handleClickPrevious = (beforeCursor) => {
16
+ const newParams = Object.assign({}, this.params);
17
+ delete newParams.after_cursor;
18
+ this.params = Object.assign(Object.assign({}, newParams), { before_cursor: beforeCursor });
19
+ };
20
+ this.handleClickNext = (afterCursor) => {
21
+ const newParams = Object.assign({}, this.params);
22
+ delete newParams.before_cursor;
23
+ this.params = Object.assign(Object.assign({}, newParams), { after_cursor: afterCursor });
24
+ };
25
+ this.rowClickHandler = (e) => {
26
+ const clickedPaymentID = e.target.closest('tr').dataset.rowEntityId;
27
+ if (!clickedPaymentID)
28
+ return;
29
+ this.rowClicked.emit(this.payments.find((payment) => payment.id === clickedPaymentID));
30
+ };
31
+ this.handleDateChange = (name, value) => {
32
+ this.params = Object.assign(Object.assign({}, this.params), { [name]: value });
33
+ };
34
+ this.getPayments = undefined;
35
+ this.payments = [];
36
+ this.loading = true;
37
+ this.errorMessage = undefined;
38
+ this.paging = pagingDefaults;
39
+ this.params = undefined;
40
+ }
41
+ updateOnPropChange() {
42
+ this.fetchData();
43
+ }
44
+ componentWillLoad() {
45
+ if (this.getPayments) {
46
+ this.fetchData();
47
+ }
48
+ }
49
+ fetchData() {
50
+ this.loading = true;
51
+ this.getPayments({
52
+ params: this.params,
53
+ onSuccess: ({ payments, pagingInfo }) => {
54
+ this.payments = payments;
55
+ this.paging = pagingInfo;
56
+ this.loading = false;
57
+ },
58
+ onError: ({ error, code, severity }) => {
59
+ this.errorMessage = error;
60
+ this.errorEvent.emit({
61
+ errorCode: code,
62
+ message: error,
63
+ severity,
64
+ });
65
+ this.loading = false;
66
+ },
67
+ });
68
+ }
69
+ get entityId() {
70
+ return this.payments.map((payment) => payment.id);
71
+ }
72
+ get columnData() {
73
+ return [
74
+ ['Made On', 'The date and time each payment was made'],
75
+ ['Amount', 'The dollar amount of each payment'],
76
+ ['Description', 'The payment description, if you provided one'],
77
+ ['Cardholder', 'The name associated with the payment method'],
78
+ ['Payment Method', 'The brand and last 4 digits of the payment method'],
79
+ ['Status', 'The current status of each payment'],
80
+ ['Payment ID', 'The unique identifier of each payment'],
81
+ ];
82
+ }
83
+ get rowData() {
84
+ return this.payments.map((payment) => [
85
+ {
86
+ type: 'head',
87
+ value: `
88
+ <div class='fw-bold'>${formatDate(payment.created_at)}</div>
89
+ <div class='fw-bold'>${formatTime(payment.created_at)}</div>
90
+ `,
91
+ },
92
+ formatCurrency(payment.amount),
93
+ payment.description,
94
+ payment.payment_method.payersName,
95
+ payment.payment_method.lastFourDigits,
96
+ {
97
+ type: 'inner',
98
+ value: MapPaymentStatusToBadge(payment.status),
99
+ },
100
+ payment.id,
101
+ ]);
102
+ }
103
+ get showEmptyState() {
104
+ return !this.loading && !this.errorMessage && this.rowData.length < 1;
105
+ }
106
+ get showErrorState() {
107
+ return !this.loading && !!this.errorMessage;
108
+ }
109
+ get showRowData() {
110
+ return !this.showEmptyState && !this.showErrorState;
111
+ }
112
+ render() {
113
+ var _a, _b;
114
+ return (h(StyledHost, { key: 'e4a4b64b2927a009f7ad4e9e2ebb4c020401423c', exportparts: tableExportedParts }, h("div", { key: '6ac1c84338b84972ca9b001ecd2b90134c99de6b', class: "row gy-3 mb-4" }, h("div", { key: '1d279ec66bc0755b876e29f06ac24d51baa77caa', class: "col-2" }, h("form-control-date", { key: '65b29c031021f3f782c9a4597167dc5e3a44e7da', name: "created_after", label: "Start Date", inputHandler: this.handleDateChange })), h("div", { key: 'a032497a94cc8108fda6efbb741069407e1a5afe', class: "col-2" }, h("form-control-date", { key: '5dd62ebdbf3836567a9ccb03dec850ebe675cb79', name: "created_before", label: "End Date", inputHandler: this.handleDateChange }))), h("div", { key: 'be4094afd3aec1d742d9d3245c2f6fc50cb95fa0', class: "table-wrapper" }, h("table", { key: 'ed493e35f2bddd59d1034dffe2bcd8b54a6390d6', class: "table table-hover" }, h("thead", { key: 'fae77bda1ffc35ac5414743ab51c2fe1dfbbc29e', class: "table-head sticky-top", part: "table-head" }, h("tr", { key: '5be3b1e9883d337046c386046565fb6ac3366324', class: "table-light text-nowrap", part: "table-head-row" }, (_a = this.columnData) === null || _a === void 0 ? void 0 : _a.map((column) => (h("th", { part: "table-head-cell", scope: "col", title: Array.isArray(column) ? column[1] : '' }, !Array.isArray(column) ? column : column[0]))))), h("tbody", { key: 'ba950a1da1ec0dffd7bc8457cdb3ce65d0f8b69b', class: "table-body", part: "table-body" }, h(TableLoadingState, { key: '8d13d8f6b64377f560d06410c09d24293708b6a8', columnSpan: this.columnData.length, isLoading: this.loading }), h(TableEmptyState, { key: 'c75d61977b26ca5d4aa3711bae1ce6e571b3e3b2', isEmpty: this.showEmptyState, columnSpan: this.columnData.length }), h(TableErrorState, { key: '08e3f88116de5783f018a0c06d21d0d9cc4f5feb', columnSpan: this.columnData.length, errorMessage: this.errorMessage }), this.showRowData &&
115
+ this.rowData.map((data, index) => (h("tr", { "data-test-id": "table-row", "data-row-entity-id": this.entityId[index], onClick: this.rowClickHandler, part: `table-row ${index % 2 ? 'table-row-even' : 'table-row-odd'}` }, data.map((dataEntry) => {
116
+ let nestedHtml = dataEntry === null || dataEntry === void 0 ? void 0 : dataEntry.type;
117
+ if (nestedHtml) {
118
+ return h("td", { part: "table-cell", innerHTML: dataEntry.value });
119
+ }
120
+ else {
121
+ return h("td", { part: "table-cell" }, dataEntry);
122
+ }
123
+ }))))), this.paging && (h("tfoot", { key: '728f671ab03923c90e11901a0d3aac4bc30e72a7', class: "sticky-bottom" }, h("tr", { key: 'd0df9b7c857287eec9568157ecf8f547a01f2fc5', class: "table-light align-middle" }, h("td", { key: 'e0de54912240b3e812f37ea675b2eef50d9545c4', part: "pagination-bar", colSpan: (_b = this.columnData) === null || _b === void 0 ? void 0 : _b.length }, h("pagination-menu", { key: 'f2d7846030a5aaa0c2311cad61f4d5865440a904', paging: Object.assign(Object.assign({}, this.paging), { handleClickPrevious: this.handleClickPrevious, handleClickNext: this.handleClickNext }), params: this.params })))))))));
124
+ }
125
+ static get watchers() { return {
126
+ "params": ["updateOnPropChange"],
127
+ "getPayments": ["updateOnPropChange"]
128
+ }; }
129
+ };
130
+
131
+ export { PaymentsListCore as payments_list_core };
@@ -0,0 +1,117 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { c as create$3, F as FormController } from './p-2eab3c90.js';
3
+ import { b as businessCoreInfoSchema, a as additionalQuestionsSchema } from './p-3fd13ca3.js';
4
+ import { a as addressSchema, i as identitySchema, p as parseBusiness } from './p-85fc69e5.js';
5
+ import { A as Api } from './p-29c0b182.js';
6
+ import './p-56f6ce4c.js';
7
+ import './p-df21aaad.js';
8
+ import './p-e3fab0e2.js';
9
+ import { B as BusinessFormServerErrors, a as BusinessFormClickActions } from './p-d89bad72.js';
10
+ import { B as Business } from './p-af244664.js';
11
+ import { J as JustifiAnalytics } from './p-15eafa87.js';
12
+ import { S as StyledHost } from './p-ba4bae6f.js';
13
+ import './p-89887332.js';
14
+ import './p-6078a370.js';
15
+ import './p-ba5fae28.js';
16
+ import './p-1ff8810b.js';
17
+ import './p-2e8f4937.js';
18
+
19
+ const businessFormSchema = create$3(Object.assign(Object.assign({}, businessCoreInfoSchema().fields), { legal_address: addressSchema(), additional_questions: additionalQuestionsSchema(), representative: identitySchema('representative') }));
20
+
21
+ const businessFormCss = ":host{display:block}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){font-family:var(--jfi-layout-font-family);background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-checkbox){font-family:var(--jfi-layout-font-family);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);line-height:var(--jfi-form-control-line-height)}*::part(input-checkbox):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-checkbox-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-checkbox-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}.jfi-submit-button{font-family:var(--jfi-layout-font-family);color:var(--jfi-submit-button-color);background-color:var(--jfi-submit-button-background-color);border-color:var(--jfi-submit-button-border-color);padding:var(--jfi-submit-button-padding);font-size:var(--jfi-submit-button-font-size);border-radius:var(--jfi-submit-button-border-radius);width:var(--jfi-submit-button-width);box-shadow:var(--jfi-submit-button-box-shadow)}.jfi-submit-button:hover{color:var(--jfi-submit-button-color-hover);background-color:var(--jfi-submit-button-background-color-hover);border-color:var(--jfi-submit-button-border-color-hover)}.jfi-submit-button:focus{color:var(--jfi-submit-button-color-focus);background-color:var(--jfi-submit-button-background-color-focus);border-color:var(--jfi-submit-button-border-color-focus)}.btn.jfi-submit-button:active{color:var(--jfi-submit-button-color-active);background-color:var(--jfi-submit-button-background-color-active);border-color:var(--jfi-submit-button-border-color-active)}.btn.jfi-submit-button-loading{min-width:75px;color:var(--jfi-submit-button-color-loading);background-color:var(--jfi-submit-button-background-color-loading);border-color:var(--jfi-submit-button-border-color-loading)}.btn.jfi-submit-button-loading .spinner-border{border-top-color:var(--jfi-submit-button-color-loading);border-bottom-color:var(--jfi-submit-button-color-loading);border-left-color:var(--jfi-submit-button-color-loading)}";
22
+ const JustifiBusinessFormStyle0 = businessFormCss;
23
+
24
+ const BusinessForm = class {
25
+ constructor(hostRef) {
26
+ registerInstance(this, hostRef);
27
+ this.submitted = createEvent(this, "submitted", 7);
28
+ this.clickEventNew = createEvent(this, "click-event", 7);
29
+ this.clickEventOld = createEvent(this, "clickEvent", 7);
30
+ this.instantiateBusiness = (data) => {
31
+ const business = new Business(data);
32
+ this.formController.setInitialValues(Object.assign({}, business));
33
+ };
34
+ this.sendData = async () => {
35
+ this.isLoading = true;
36
+ try {
37
+ const values = this.formController.values.getValue();
38
+ const initialValues = this.formController.getInitialValues();
39
+ const payload = parseBusiness(values, initialValues);
40
+ const response = await this.api.patch(this.businessEndpoint, JSON.stringify(payload));
41
+ this.handleReponse(response);
42
+ }
43
+ catch (error) {
44
+ this.errorMessage = BusinessFormServerErrors.patchData;
45
+ }
46
+ finally {
47
+ this.isLoading = false;
48
+ }
49
+ };
50
+ this.fetchData = async () => {
51
+ this.isLoading = true;
52
+ try {
53
+ const response = await this.api.get(this.businessEndpoint);
54
+ this.instantiateBusiness(response.data);
55
+ }
56
+ catch (error) {
57
+ this.errorMessage = BusinessFormServerErrors.fetchData;
58
+ }
59
+ finally {
60
+ this.isLoading = false;
61
+ }
62
+ };
63
+ this.validateAndSubmit = (event) => {
64
+ event.preventDefault();
65
+ this.formController.validateAndSubmit(this.sendData);
66
+ };
67
+ this.authToken = undefined;
68
+ this.businessId = undefined;
69
+ this.hideErrors = false;
70
+ this.formTitle = 'Business Information';
71
+ this.removeTitle = false;
72
+ this.isLoading = false;
73
+ this.errorMessage = undefined;
74
+ }
75
+ componentWillLoad() {
76
+ this.analytics = new JustifiAnalytics(this);
77
+ const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
78
+ const missingBusinessIdMessage = 'Warning: Missing business-id. The form requires an existing business-id to function.';
79
+ if (!this.authToken)
80
+ console.error(missingAuthTokenMessage);
81
+ if (!this.businessId)
82
+ console.error(missingBusinessIdMessage);
83
+ this.formController = new FormController(businessFormSchema);
84
+ this.api = Api({ authToken: this.authToken, apiOrigin: "" });
85
+ this.fetchData();
86
+ }
87
+ disconnectedCallback() {
88
+ this.analytics.cleanup();
89
+ }
90
+ fireClickEvents(event) {
91
+ console.warn('`clickEvent` is deprecated and will be removed in the next major release. Please use `click-event` instead.');
92
+ this.clickEventNew.emit(event);
93
+ this.clickEventOld.emit(event);
94
+ }
95
+ get title() {
96
+ return this.removeTitle ? '' : this.formTitle;
97
+ }
98
+ get disabledState() {
99
+ return this.isLoading;
100
+ }
101
+ get businessEndpoint() {
102
+ return `entities/business/${this.businessId}`;
103
+ }
104
+ handleReponse(response) {
105
+ if (response.error) {
106
+ this.errorMessage = BusinessFormServerErrors.patchData;
107
+ }
108
+ this.submitted.emit({ data: response });
109
+ this.instantiateBusiness(response.data);
110
+ }
111
+ render() {
112
+ return (h(StyledHost, { key: '8fb79d577c13246fcf3ec1ee8460713fee07d01a', exportparts: "label,input,input-invalid" }, h("form", { key: '1fe23a8cc8714aee257b6c73c6b7b096d684ea1c', onSubmit: this.validateAndSubmit }, h("div", { key: 'e501f6963ed5bfd9eb80f67df13108289db6eba7', class: "row gap-3" }, h("h1", { key: 'f81f22704bda1480c467b872cd3fd309505b0e94' }, this.title), h("form-alert", { key: '15b2ff75d4db6447bfd1892542e8e972ede0ac7e', text: this.errorMessage, hideAlert: this.hideErrors }), h("div", { key: 'fd6a375fd187426940df3f28262be7aec3fedbe5', class: "col-12 mb-4" }, h("justifi-business-core-info", { key: 'd16818a2124cb04dd5a5e84ea40639991fb04a80', formController: this.formController })), h("div", { key: 'd48b04718cf938484cf65cc956bf798f44ed17a7', class: "col-12 mb-4" }, h("justifi-legal-address-form", { key: '3a2bc6babfe8a0a265b2a7f9e7bea1abebd3eb43', formController: this.formController })), h("div", { key: '5c4d5d1fa1e2aba32f42c2bb9e97c0d796ecf709', class: "col-12 mb-4" }, h("justifi-additional-questions", { key: 'c888fb627380d05302cb106c5642e39b1f2652fa', formController: this.formController })), h("div", { key: '623e94d84976cfe29f4501a781c750d1bb537605', class: "col-12 mb-4" }, h("justifi-business-representative", { key: '594c893c0976b58a309679a031f6f1c787e66f48', formController: this.formController })), h("div", { key: '9fbc36ed183b1ebf171da14276092195c7aaf3a9', class: "col-12 d-flex flex-row-reverse" }, h("button", { key: 'a60da6fdda5193d3c41c589b00b040c05ae425ac', type: "submit", class: "btn btn-primary jfi-submit-button", disabled: this.disabledState, onClick: () => this.fireClickEvents({ name: BusinessFormClickActions.submit }) }, this.isLoading ? 'Loading...' : 'Submit'))))));
113
+ }
114
+ };
115
+ BusinessForm.style = JustifiBusinessFormStyle0;
116
+
117
+ export { BusinessForm as justifi_business_form };