@justifi/webcomponents 4.19.1-rc → 4.19.1-rc-4

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 (224) hide show
  1. package/dist/cjs/{Analytics-0b3db49d.js → Analytics-985bc298.js} +2 -3
  2. package/dist/cjs/{business.service-c384784d.js → business.service-6bb7ac82.js} +5 -6
  3. package/dist/cjs/{get-payout-csv-51a02be7.js → get-payout-csv-1391ff3e.js} +3 -4
  4. package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +7 -8
  5. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +4 -5
  6. package/dist/cjs/justifi-business-details.cjs.entry.js +3 -4
  7. package/dist/cjs/justifi-business-form.cjs.entry.js +4 -5
  8. package/dist/cjs/justifi-card-form.cjs.entry.js +4 -5
  9. package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
  10. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -5
  11. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -4
  12. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +11 -9
  13. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +1 -2
  14. package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -4
  15. package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -6
  16. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
  17. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -6
  18. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -4
  19. package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -4
  20. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -4
  21. package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -3
  22. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +4 -5
  23. package/dist/cjs/{package-39dc73ed.js → package-cbc08fe3.js} +2 -4
  24. package/dist/cjs/{payment.service-2dbfb83d.js → payment.service-dfcfa19b.js} +2 -3
  25. package/dist/collection/api/services/analytics.service.js +1 -2
  26. package/dist/collection/api/services/business.service.js +5 -6
  27. package/dist/collection/api/services/checkout.service.js +2 -3
  28. package/dist/collection/api/services/insurance.service.js +2 -3
  29. package/dist/collection/api/services/payment.service.js +2 -3
  30. package/dist/collection/api/services/payout.service.js +3 -4
  31. package/dist/collection/api/services/provision.service.js +2 -4
  32. package/dist/collection/api/services/reports.service.js +1 -2
  33. package/dist/collection/components/bank-account-form/bank-account-form.js +3 -4
  34. package/dist/collection/components/business-forms/business-form/business-form.js +2 -3
  35. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -3
  36. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +2 -3
  37. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -3
  38. package/dist/collection/components/card-form/card-form.js +3 -4
  39. package/dist/collection/components/checkout/checkout-core.js +4 -4
  40. package/dist/collection/components/checkout/new-payment-method.js +6 -4
  41. package/dist/collection/components/checkout/payment-method-options.js +3 -4
  42. package/dist/collection/components/checkout/saved-payment-method.js +3 -4
  43. package/dist/collection/components/checkout/sezzle-payment-method.js +3 -4
  44. package/dist/collection/components/payment-form/payment-form.js +3 -4
  45. package/dist/collection/components/refund-form/refund-form.js +2 -3
  46. package/dist/docs.json +8 -8
  47. package/dist/esm/{Analytics-37556050.js → Analytics-79e20e2d.js} +2 -3
  48. package/dist/esm/{business.service-eee46ab1.js → business.service-f45decfc.js} +5 -6
  49. package/dist/esm/{get-payout-csv-4d6b29d8.js → get-payout-csv-e784a2ab.js} +3 -4
  50. package/dist/esm/justifi-additional-questions-form-step_10.entry.js +7 -8
  51. package/dist/esm/justifi-bank-account-form.entry.js +4 -5
  52. package/dist/esm/justifi-business-details.entry.js +3 -4
  53. package/dist/esm/justifi-business-form.entry.js +4 -5
  54. package/dist/esm/justifi-card-form.entry.js +4 -5
  55. package/dist/esm/justifi-checkout-core.entry.js +3 -3
  56. package/dist/esm/justifi-checkout.entry.js +4 -5
  57. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -4
  58. package/dist/esm/justifi-new-payment-method_4.entry.js +11 -9
  59. package/dist/esm/justifi-owner-form_3.entry.js +1 -2
  60. package/dist/esm/justifi-payment-details.entry.js +3 -4
  61. package/dist/esm/justifi-payment-form.entry.js +5 -6
  62. package/dist/esm/justifi-payment-method-form.entry.js +1 -1
  63. package/dist/esm/justifi-payment-provisioning.entry.js +5 -6
  64. package/dist/esm/justifi-payments-list.entry.js +3 -4
  65. package/dist/esm/justifi-payout-details.entry.js +3 -4
  66. package/dist/esm/justifi-payouts-list.entry.js +3 -4
  67. package/dist/esm/justifi-refund-form.entry.js +2 -3
  68. package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -5
  69. package/dist/esm/{package-e2a7aa3f.js → package-cf64a48c.js} +2 -4
  70. package/dist/esm/{payment.service-9005a501.js → payment.service-dad5153b.js} +2 -3
  71. package/dist/globals.d.ts +2 -0
  72. package/dist/module/Analytics.js +1 -2
  73. package/dist/module/business-bank-account-form-step.js +2 -3
  74. package/dist/module/business-document-upload-form-step.js +2 -3
  75. package/dist/module/business-terms-conditions-form-step.js +2 -3
  76. package/dist/module/business.service.js +5 -6
  77. package/dist/module/checkout-core.js +3 -3
  78. package/dist/module/get-payout-csv.js +3 -4
  79. package/dist/module/justifi-bank-account-form.js +2 -3
  80. package/dist/module/justifi-business-form.js +2 -3
  81. package/dist/module/justifi-card-form.js +2 -3
  82. package/dist/module/justifi-checkout.js +2 -3
  83. package/dist/module/justifi-gross-payment-chart.js +1 -2
  84. package/dist/module/justifi-payment-form.js +3 -4
  85. package/dist/module/justifi-payment-provisioning.js +2 -3
  86. package/dist/module/justifi-refund-form.js +2 -3
  87. package/dist/module/justifi-season-interruption-insurance.js +2 -3
  88. package/dist/module/new-payment-method.js +5 -3
  89. package/dist/module/package.js +2 -4
  90. package/dist/module/payment-method-options.js +2 -3
  91. package/dist/module/payment.service.js +2 -3
  92. package/dist/module/saved-payment-method.js +2 -3
  93. package/dist/module/sezzle-payment-method.js +2 -3
  94. package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
  95. package/dist/webcomponents/index.esm.js +1 -0
  96. package/dist/webcomponents/p-01a404ca.entry.js +44 -0
  97. package/dist/webcomponents/p-02c58e00.entry.js +97 -0
  98. package/dist/webcomponents/p-03d35880.entry.js +130 -0
  99. package/dist/webcomponents/p-05f46d63.entry.js +99 -0
  100. package/dist/webcomponents/p-06ff0429.entry.js +65 -0
  101. package/dist/webcomponents/p-08b0fb31.js +41 -1
  102. package/dist/webcomponents/p-14c91ffd.js +20 -1
  103. package/dist/webcomponents/p-1ad5995e.js +3599 -1
  104. package/dist/webcomponents/p-1ff8810b.js +29 -1
  105. package/dist/webcomponents/p-2338affa.js +213 -1
  106. package/dist/webcomponents/p-258b1ee2.entry.js +149 -0
  107. package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
  108. package/dist/webcomponents/p-29c0b182.js +114 -1
  109. package/dist/webcomponents/p-2b6c9c4f.js +7 -1
  110. package/dist/webcomponents/p-2eab3c90.js +3052 -1
  111. package/dist/webcomponents/p-3e9ef4a8.js +28 -0
  112. package/dist/webcomponents/p-3fd13ca3.js +52 -1
  113. package/dist/webcomponents/p-492588bf.js +79 -0
  114. package/dist/webcomponents/p-525db3e8.js +22 -1
  115. package/dist/webcomponents/p-5482d030.entry.js +21 -0
  116. package/dist/webcomponents/p-56f6ce4c.js +10 -1
  117. package/dist/webcomponents/p-576826b1.entry.js +43 -0
  118. package/dist/webcomponents/p-5968ff8a.js +178 -1
  119. package/dist/webcomponents/p-5cb3f0b2.entry.js +261 -0
  120. package/dist/webcomponents/p-5f835b89.entry.js +606 -0
  121. package/dist/webcomponents/p-6053809a.entry.js +80 -0
  122. package/dist/webcomponents/p-6078a370.js +244 -1
  123. package/dist/webcomponents/p-66e4869f.entry.js +75 -0
  124. package/dist/webcomponents/p-6f1c56d4.entry.js +94 -0
  125. package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
  126. package/dist/webcomponents/p-7582b554.entry.js +18 -0
  127. package/dist/webcomponents/p-79646550.entry.js +61 -0
  128. package/dist/webcomponents/p-7a70ff09.entry.js +133 -0
  129. package/dist/webcomponents/p-7bbf73bd.entry.js +117 -0
  130. package/dist/webcomponents/p-7d85af5c.js +16 -1
  131. package/dist/webcomponents/p-800d31fe.entry.js +162 -0
  132. package/dist/webcomponents/p-8115b2f4.js +28 -1
  133. package/dist/webcomponents/p-83125497.js +4027 -1
  134. package/dist/webcomponents/p-85fc69e5.js +90 -1
  135. package/dist/webcomponents/p-890088fc.entry.js +298 -0
  136. package/dist/webcomponents/p-89887332.js +301 -1
  137. package/dist/webcomponents/p-8df7bde8.js +27 -1
  138. package/dist/webcomponents/p-8eb774df.entry.js +54 -0
  139. package/dist/webcomponents/p-9282eab8.js +77 -0
  140. package/dist/webcomponents/p-96c12fef.entry.js +73 -0
  141. package/dist/webcomponents/p-9c9c7dac.js +24 -1
  142. package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
  143. package/dist/webcomponents/p-9fd108be.entry.js +74 -0
  144. package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
  145. package/dist/webcomponents/p-a5c5821e.entry.js +101 -0
  146. package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
  147. package/dist/webcomponents/p-a6d04afc.js +44 -0
  148. package/dist/webcomponents/p-ac086069.entry.js +58 -0
  149. package/dist/webcomponents/p-acbac8b8.entry.js +131 -0
  150. package/dist/webcomponents/p-adc30a61.entry.js +145 -0
  151. package/dist/webcomponents/p-af244664.js +126 -1
  152. package/dist/webcomponents/p-b6e3d7ed.entry.js +94 -0
  153. package/dist/webcomponents/p-b82c146f.entry.js +111 -0
  154. package/dist/webcomponents/p-ba4bae6f.js +12 -1
  155. package/dist/webcomponents/p-ba5fae28.js +90 -1
  156. package/dist/webcomponents/p-c636f563.entry.js +791 -0
  157. package/dist/webcomponents/p-cb26f708.js +18 -0
  158. package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
  159. package/dist/webcomponents/p-d89bad72.js +39 -1
  160. package/dist/webcomponents/p-dce846bf.js +27 -1
  161. package/dist/webcomponents/p-df21aaad.js +120 -1
  162. package/dist/webcomponents/p-e1255160.js +3 -1
  163. package/dist/webcomponents/p-e333620e.js +34 -1
  164. package/dist/webcomponents/p-e356f280.entry.js +29 -0
  165. package/dist/webcomponents/p-e3e5f95f.entry.js +98 -0
  166. package/dist/webcomponents/p-e3fab0e2.js +43 -1
  167. package/dist/webcomponents/p-eb5dbd23.entry.js +1684 -0
  168. package/dist/webcomponents/p-ec854a3e.entry.js +11053 -0
  169. package/dist/webcomponents/p-f02b75dc.entry.js +96 -0
  170. package/dist/webcomponents/p-fad19d75.js +1638 -2
  171. package/dist/webcomponents/webcomponents.css +362 -4
  172. package/dist/webcomponents/webcomponents.esm.js +20 -1
  173. package/package.json +2 -4
  174. package/dist/cjs/config-037e67d0.js +0 -15
  175. package/dist/config.js +0 -11
  176. package/dist/esm/config-58e393e2.js +0 -13
  177. package/dist/module/config.js +0 -13
  178. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +0 -11
  179. package/dist/webcomponents/p-023779ee.entry.js +0 -1
  180. package/dist/webcomponents/p-037763f4.entry.js +0 -1
  181. package/dist/webcomponents/p-07109641.entry.js +0 -1
  182. package/dist/webcomponents/p-0f7b9555.entry.js +0 -1
  183. package/dist/webcomponents/p-17e4246f.entry.js +0 -1
  184. package/dist/webcomponents/p-1a43e355.entry.js +0 -19
  185. package/dist/webcomponents/p-1f6afff9.entry.js +0 -1
  186. package/dist/webcomponents/p-246a6c6a.entry.js +0 -1
  187. package/dist/webcomponents/p-2d3b1692.entry.js +0 -1
  188. package/dist/webcomponents/p-30a493cd.entry.js +0 -1
  189. package/dist/webcomponents/p-32286934.js +0 -1
  190. package/dist/webcomponents/p-3f5e7e86.js +0 -1
  191. package/dist/webcomponents/p-462dc522.entry.js +0 -1
  192. package/dist/webcomponents/p-487b72a8.entry.js +0 -1
  193. package/dist/webcomponents/p-4abc17f0.entry.js +0 -1
  194. package/dist/webcomponents/p-52021fa1.entry.js +0 -1
  195. package/dist/webcomponents/p-53e64f15.entry.js +0 -1
  196. package/dist/webcomponents/p-57e1f2fd.js +0 -1
  197. package/dist/webcomponents/p-5f095525.entry.js +0 -1
  198. package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
  199. package/dist/webcomponents/p-69faef3f.entry.js +0 -1
  200. package/dist/webcomponents/p-6c078cd1.js +0 -1
  201. package/dist/webcomponents/p-8e541a32.entry.js +0 -1
  202. package/dist/webcomponents/p-8f325782.entry.js +0 -1
  203. package/dist/webcomponents/p-987b5de2.entry.js +0 -1
  204. package/dist/webcomponents/p-a63fc384.entry.js +0 -1
  205. package/dist/webcomponents/p-a8220709.entry.js +0 -1
  206. package/dist/webcomponents/p-ae530971.entry.js +0 -1
  207. package/dist/webcomponents/p-b7cf49f4.entry.js +0 -1
  208. package/dist/webcomponents/p-b87b27ba.js +0 -1
  209. package/dist/webcomponents/p-bbed6107.entry.js +0 -1
  210. package/dist/webcomponents/p-be39c802.entry.js +0 -1
  211. package/dist/webcomponents/p-c28db166.js +0 -1
  212. package/dist/webcomponents/p-c9f8f7ec.entry.js +0 -1
  213. package/dist/webcomponents/p-d8355f91.entry.js +0 -1
  214. package/dist/webcomponents/p-e2c88817.entry.js +0 -1
  215. package/dist/webcomponents/p-e31f0f3e.entry.js +0 -1
  216. package/dist/webcomponents/p-edac2b43.entry.js +0 -1
  217. package/dist/webcomponents/p-ef23c091.entry.js +0 -1
  218. package/dist/webcomponents/p-f06910aa.entry.js +0 -1
  219. package/dist/webcomponents/p-f0866375.entry.js +0 -1
  220. package/dist/webcomponents/p-f0a06884.entry.js +0 -1
  221. package/dist/webcomponents/p-f2f94d9f.entry.js +0 -1
  222. package/dist/webcomponents/p-f49b7170.entry.js +0 -1
  223. package/dist/webcomponents/p-fb58feb5.entry.js +0 -1
  224. 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,74 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { J as JustifiAnalytics } from './p-9282eab8.js';
3
+ import './p-492588bf.js';
4
+ import './p-29c0b182.js';
5
+
6
+ const BankAccountForm = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.bankAccountFormReady = createEvent(this, "bankAccountFormReady", 7);
10
+ this.ready = createEvent(this, "ready", 7);
11
+ this.bankAccountFormTokenized = createEvent(this, "bankAccountFormTokenize", 7);
12
+ this.bankAccountFormValidated = createEvent(this, "bankAccountFormValidate", 7);
13
+ this.validationMode = undefined;
14
+ this.iframeOrigin = undefined;
15
+ this.internalStyleOverrides = undefined;
16
+ }
17
+ readyHandler(event) {
18
+ console.warn(`The 'bankAccountFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);
19
+ this.bankAccountFormReady.emit(event);
20
+ this.ready.emit(event);
21
+ }
22
+ tokenizeHandler(event) {
23
+ console.warn(`The 'bankAccountFormTokenized' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`);
24
+ this.bankAccountFormTokenized.emit(event);
25
+ }
26
+ validateHandler(event) {
27
+ console.warn(`The 'bankAccountFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`);
28
+ this.bankAccountFormValidated.emit(event);
29
+ }
30
+ componentWillLoad() {
31
+ this.analytics = new JustifiAnalytics(this);
32
+ }
33
+ disconnectedCallback() {
34
+ this.analytics.cleanup();
35
+ }
36
+ /**
37
+ * Makes a tokenization request to the iframe
38
+ */
39
+ async tokenize(...args) {
40
+ if (!this.childRef) {
41
+ throw new Error('Cannot call tokenize');
42
+ }
43
+ return this.childRef.tokenize(...args);
44
+ }
45
+ /**
46
+ * Runs a validation on the form and shows errors if any
47
+ */
48
+ async validate() {
49
+ if (!this.childRef) {
50
+ throw new Error('Cannot call validate');
51
+ }
52
+ return this.childRef.validate();
53
+ }
54
+ /**
55
+ * Manually resizes the iframe to fit the contents of the iframe
56
+ * @deprecated This method will be removed in future releases.
57
+ */
58
+ async resize() {
59
+ console.warn(`The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach.`);
60
+ if (!this.childRef) {
61
+ throw new Error('Cannot call validate');
62
+ }
63
+ return this.childRef.resize();
64
+ }
65
+ render() {
66
+ return (h("justifi-payment-method-form", { key: '646e392c1a9ed38e73780ed6a01b6f019767794c', ref: el => {
67
+ if (el) {
68
+ this.childRef = el;
69
+ }
70
+ }, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "bankAccount", "payment-method-form-ready": this.bankAccountFormReady, "payment-method-form-validated": this.bankAccountFormValidated, "payment-method-form-tokenize": this.bankAccountFormTokenized, "payment-method-form-validation-mode": this.validationMode || 'onSubmit' }));
71
+ }
72
+ };
73
+
74
+ export { BankAccountForm as justifi_bank_account_form };
@@ -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,101 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { c as create$3, d as create$5, F as FormController } from './p-2eab3c90.js';
3
+ import { A as Api } from './p-29c0b182.js';
4
+ import './p-56f6ce4c.js';
5
+ import './p-df21aaad.js';
6
+ import './p-e3fab0e2.js';
7
+ import { C as CURRENCY_MASK } from './p-525db3e8.js';
8
+ import { S as StyledHost } from './p-ba4bae6f.js';
9
+
10
+ const RefundFormSchema = create$3().shape({
11
+ amount: create$5()
12
+ .required('Amount is required')
13
+ .typeError('Amount must be a number')
14
+ .positive('Amount must be positive')
15
+ .test('amount', 'Refund amount cannot be more than the original payment amount', function (value) {
16
+ return value <= this.options.context.amount;
17
+ })
18
+ .nullable(),
19
+ });
20
+
21
+ const refundFormCss = ":host{display:block}*::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)}.btn{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)}.btn: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)}.btn: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: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)}";
22
+ const JustifiRefundFormStyle0 = refundFormCss;
23
+
24
+ const RefundForm = class {
25
+ constructor(hostRef) {
26
+ registerInstance(this, hostRef);
27
+ this.submitted = createEvent(this, "submitted", 7);
28
+ this.authToken = undefined;
29
+ this.paymentId = undefined;
30
+ this.amount = 0;
31
+ this.submitButtonText = 'Submit';
32
+ this.withButton = undefined;
33
+ this.refundInfoText = undefined;
34
+ this.errors = {};
35
+ this.isSubmitting = false;
36
+ }
37
+ componentWillLoad() {
38
+ this.formController = new FormController(RefundFormSchema);
39
+ this.formController.setInitialValues({
40
+ amount: this.amount,
41
+ message: '',
42
+ });
43
+ this.initializeApi();
44
+ }
45
+ componentDidLoad() {
46
+ this.formController.errors.subscribe(errors => {
47
+ this.errors = Object.assign({}, errors);
48
+ });
49
+ }
50
+ /**
51
+ * Handles the form submission.
52
+ * Prevents the default form action, validates the form, and emits the 'submitted' event.
53
+ */
54
+ async handleSubmit(event) {
55
+ event.preventDefault();
56
+ this.formController.validateAndSubmit(this.submitRefund.bind(this), {
57
+ amount: this.amount,
58
+ });
59
+ }
60
+ /**
61
+ * Submits the refund request to the API.
62
+ */
63
+ async submitRefund() {
64
+ this.isSubmitting = true;
65
+ const refundFields = this.formController.values.getValue();
66
+ try {
67
+ await this.api.post(`payments/${this.paymentId}/refunds`, refundFields);
68
+ this.submitted.emit(refundFields);
69
+ }
70
+ catch (error) {
71
+ console.error('Error submitting refund:', error);
72
+ this.submitted.emit(error);
73
+ }
74
+ finally {
75
+ this.isSubmitting = false;
76
+ }
77
+ }
78
+ /**
79
+ * Handles input changes, updating the refundFields state.
80
+ */
81
+ handleInput(field, value) {
82
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [field]: value }));
83
+ }
84
+ /**
85
+ * Initializes the API with the given authentication token.
86
+ * Logs a warning if the auth token is missing.
87
+ */
88
+ initializeApi() {
89
+ if (!this.authToken) {
90
+ console.warn('Warning: Missing auth-token.');
91
+ }
92
+ this.api = Api({ authToken: this.authToken, apiOrigin: undefined });
93
+ }
94
+ render() {
95
+ var _a;
96
+ return (h(StyledHost, { key: '8d31f1a9bf936c9e11f8eca1dc55e614b9fa5939' }, h("h1", { key: 'be589740535ee8a5ab6d4af7151d7ae026f08002' }, "Refund"), this.refundInfoText && (h("div", { key: 'b1d40507dec53bac422f99a3d62678c78c0c2038', class: "d-flex align-items-center flex-row gap-4 border-top border-bottom my-4 p-3", role: "alert" }, h("img", { key: 'cc76014eef0d826bec5ec09355dc5fc747fd2070', src: "/info-icon.svg", alt: "Information", height: "30", width: "30" }), h("p", { key: 'c2efa0f2acdf3faaa6e2974d0535f48799e3cbbd', class: "m-0", innerHTML: this.refundInfoText }))), h("form", { key: '68220114781378f6507651414c87532171bebb31', onSubmit: e => this.handleSubmit(e), class: "d-grid gap-4" }, h("div", { key: '075545e9837316fe160760e0dba9a5104654dd2b', class: "form-group" }, h("form-control-monetary", { key: 'c8ff8a822d2b74b2f80b33cd6cd2b42ceebbff11', name: "amount", label: "Refund Amount", defaultValue: ((_a = this.amount) === null || _a === void 0 ? void 0 : _a.toString()) || '', maskOptions: CURRENCY_MASK.DECIMAL, inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.amount })), h("div", { key: '92093284e763466be5138ea6d788145d5d47bd87', class: "form-group" }, h("form-control-text", { key: 'ddf9e221d43d84ad7436261c5755e673224aa82e', name: "notes", label: "Additional Notes", inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.notes })), this.withButton && (h("div", { key: '58abbbabce09d82da4032ef0e08e6cfac1433153', class: "form-group d-flex flex-row-reverse" }, h("button", { key: '3e703ef633e0d45ba70425dc6d58bcd2d590ce1b', type: "submit", disabled: !!this.isSubmitting, class: "btn btn-primary ml-auto" }, this.submitButtonText))))));
97
+ }
98
+ };
99
+ RefundForm.style = JustifiRefundFormStyle0;
100
+
101
+ export { RefundForm as justifi_refund_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,44 @@
1
+ import { A as Api } from './p-29c0b182.js';
2
+ import './p-56f6ce4c.js';
3
+ import './p-df21aaad.js';
4
+ import './p-e3fab0e2.js';
5
+ import { C as ComponentErrorSeverity } from './p-14c91ffd.js';
6
+ import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
7
+
8
+ class PayoutService {
9
+ async fetchPayouts(accountId, authToken, params) {
10
+ const api = Api({ authToken, apiOrigin: undefined });
11
+ const endpoint = `account/${accountId}/payouts`;
12
+ return api.get(endpoint, params);
13
+ }
14
+ async fetchPayout(payoutId, authToken) {
15
+ const api = Api({ authToken, apiOrigin: undefined });
16
+ const endpoint = `payouts/${payoutId}`;
17
+ return api.get(endpoint);
18
+ }
19
+ async fetchCSV(payoutId, authToken) {
20
+ const api = Api({ authToken, apiOrigin: undefined });
21
+ const endpoint = `reports/payouts/${payoutId}`;
22
+ return api.get(endpoint);
23
+ }
24
+ }
25
+
26
+ const makeGetPayoutCSV = ({ authToken, service }) => async ({ payoutId, onError }) => {
27
+ try {
28
+ const { data } = await service.fetchCSV(payoutId, authToken);
29
+ const a = document.createElement('a');
30
+ a.href = data.csv_url;
31
+ a.click();
32
+ }
33
+ catch (error) {
34
+ const errorMessage = getErrorMessage(error);
35
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
36
+ onError({
37
+ error: errorMessage,
38
+ code,
39
+ severity: ComponentErrorSeverity.ERROR,
40
+ });
41
+ }
42
+ };
43
+
44
+ export { PayoutService as P, makeGetPayoutCSV as m };