@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,298 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './p-fad19d75.js';
2
+ import { a as PaymentMethodTypes } from './p-df21aaad.js';
3
+ import { g as snakeToCamel, f as formatCurrency } from './p-83125497.js';
4
+
5
+ const PaymentMethodTypeLabels = {
6
+ bankAccount: 'New bank account',
7
+ card: 'New credit or debit card',
8
+ };
9
+ const NewPaymentMethod = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
13
+ this.onPaymentMethodOptionClick = () => {
14
+ this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
15
+ };
16
+ this.iframeOrigin = "";
17
+ this.authToken = undefined;
18
+ this.accountId = undefined;
19
+ this.paymentMethodOption = undefined;
20
+ this.paymentMethodGroupId = undefined;
21
+ this.isSelected = undefined;
22
+ this.saveNewPaymentMethodChecked = false;
23
+ }
24
+ componentWillLoad() {
25
+ console.log('NewPaymentMethod: componentWillLoad iframeOrigin', this, this.iframeOrigin);
26
+ }
27
+ handleCheckboxChanged(event) {
28
+ this.saveNewPaymentMethodChecked = event.detail;
29
+ }
30
+ async fillBillingForm(fields) {
31
+ this.billingFormRef.fill(fields);
32
+ }
33
+ async resolvePaymentMethod(insuranceValidation) {
34
+ var _a, _b;
35
+ if (!this.paymentMethodFormRef || !this.billingFormRef)
36
+ return;
37
+ const isValid = await this.validate();
38
+ if (!isValid || !insuranceValidation.isValid) {
39
+ return { validationError: true };
40
+ }
41
+ const tokenizeResponse = await this.tokenize();
42
+ if (tokenizeResponse.error) {
43
+ return { error: tokenizeResponse.error };
44
+ }
45
+ else {
46
+ const tokenizeRessponseData = tokenizeResponse.data;
47
+ return { token: ((_a = tokenizeRessponseData.card) === null || _a === void 0 ? void 0 : _a.token) || ((_b = tokenizeRessponseData.bank_account) === null || _b === void 0 ? void 0 : _b.token) };
48
+ }
49
+ }
50
+ async validate() {
51
+ const billingFormValidation = await this.billingFormRef.validate();
52
+ const paymentMethodFormValidation = await this.paymentMethodFormRef.validate();
53
+ return billingFormValidation.isValid && paymentMethodFormValidation.isValid;
54
+ }
55
+ async tokenize() {
56
+ try {
57
+ const billingFormFieldValues = await this.billingFormRef.getValues();
58
+ let paymentMethodData;
59
+ if (this.saveNewPaymentMethodChecked) {
60
+ paymentMethodData = Object.assign(Object.assign({}, billingFormFieldValues), { payment_method_group_id: this.paymentMethodGroupId });
61
+ }
62
+ else {
63
+ paymentMethodData = Object.assign({}, billingFormFieldValues);
64
+ }
65
+ const clientId = this.authToken;
66
+ const tokenizeResponse = await this.paymentMethodFormRef.tokenize(clientId, paymentMethodData, this.accountId);
67
+ return tokenizeResponse;
68
+ }
69
+ catch (error) {
70
+ return error;
71
+ }
72
+ }
73
+ showNewPaymentMethodForm() {
74
+ var _a;
75
+ return (h("div", { class: "mt-2 pb-4 border-bottom" }, h("div", { class: "mb-3" }, h("justifi-payment-method-form", { ref: (el) => (this.paymentMethodFormRef = el), "payment-method-form-type": (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, "iframe-origin": this.iframeOrigin })), h("h3", { class: "fs-6 fw-bold lh-lg mb-4" }, "Billing address"), h("justifi-billing-form", { ref: (el) => (this.billingFormRef = el) }), h("justifi-save-new-payment-method", { hidden: !this.paymentMethodGroupId })));
76
+ }
77
+ render() {
78
+ var _a, _b, _c, _d;
79
+ return (h("div", { key: 'd597ba8b0ac2a650a14a79d002a91ef3edf604a4', class: "payment-method" }, h("div", { key: 'a287f7ffd480f17f0f1093d71b9d02fe3db39e0f', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: 'f53d08d048cc242414fcf6794614ad2334db81bb', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '01712a80a30df19a7b540434532cffb4cb3b61e8', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, PaymentMethodTypeLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.id])), this.isSelected ? this.showNewPaymentMethodForm() : null));
80
+ }
81
+ };
82
+
83
+ class PaymentMethodOption {
84
+ constructor(paymentMethod) {
85
+ this.id = paymentMethod.id;
86
+ this.brand = paymentMethod.brand;
87
+ this.acct_last_four = paymentMethod.acct_last_four;
88
+ this.type = snakeToCamel(paymentMethod.type);
89
+ }
90
+ }
91
+ var CardBrandLabels;
92
+ (function (CardBrandLabels) {
93
+ CardBrandLabels["american_express"] = "American Express";
94
+ CardBrandLabels["diners_club"] = "Diners Club";
95
+ CardBrandLabels["discover"] = "Discover";
96
+ CardBrandLabels["jcb"] = "JCB";
97
+ CardBrandLabels["mastercard"] = "Mastercard";
98
+ CardBrandLabels["china_unionpay"] = "UnionPay";
99
+ CardBrandLabels["visa"] = "Visa";
100
+ CardBrandLabels["unknown"] = "Unknown";
101
+ })(CardBrandLabels || (CardBrandLabels = {}));
102
+
103
+ const paymentMethodOptionsCss = ":host{display:block}.payment-method-header{cursor:pointer;color:var(--jfi-radio-button-group-color);background-color:var(--jfi-radio-button-group-background-color);border-bottom:var(--jfi-radio-button-group-divider)}.payment-method-header:hover{color:var(--jfi-radio-button-group-color-hover);background-color:var(--jfi-radio-button-group-background-color-hover)}";
104
+ const JustifiPaymentMethodOptionsStyle0 = paymentMethodOptionsCss;
105
+
106
+ 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)}";
107
+ const JustifiPaymentMethodOptionsStyle1 = formCheckInputCss;
108
+
109
+ const PaymentMethodOptions = class {
110
+ constructor(hostRef) {
111
+ registerInstance(this, hostRef);
112
+ this.toggleCreatingNewPaymentMethod = createEvent(this, "toggleCreatingNewPaymentMethod", 7);
113
+ this.showCard = undefined;
114
+ this.showAch = undefined;
115
+ this.showBnpl = undefined;
116
+ this.showSavedPaymentMethods = undefined;
117
+ this.paymentMethodGroupId = undefined;
118
+ this.bnpl = undefined;
119
+ this.insuranceToggled = undefined;
120
+ this.authToken = undefined;
121
+ this.accountId = undefined;
122
+ this.iframeOrigin = "";
123
+ this.savedPaymentMethods = [];
124
+ this.paymentAmount = undefined;
125
+ this.selectedPaymentMethodId = undefined;
126
+ this.paymentMethodOptions = [];
127
+ }
128
+ async fillBillingForm(fields) {
129
+ const newPaymentMethodElement = this.selectedPaymentMethodOptionRef;
130
+ if (newPaymentMethodElement.fillBillingForm) {
131
+ newPaymentMethodElement.fillBillingForm(fields);
132
+ }
133
+ }
134
+ connectedCallback() {
135
+ this.paymentMethodsChanged();
136
+ }
137
+ paymentMethodsChanged() {
138
+ var _a, _b;
139
+ this.paymentMethodOptions = this.savedPaymentMethods
140
+ .map((paymentMethod) => new PaymentMethodOption(paymentMethod))
141
+ .filter((paymentMethod) => {
142
+ // Don't saved card or bank account if they are disabled
143
+ return ((this.showCard || paymentMethod.type !== PaymentMethodTypes.card) &&
144
+ (this.showAch || paymentMethod.type !== PaymentMethodTypes.bankAccount));
145
+ });
146
+ if (this.showBnpl && ((_a = this.bnpl) === null || _a === void 0 ? void 0 : _a.provider) === 'sezzle' && !this.insuranceToggled) {
147
+ this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.sezzle }));
148
+ }
149
+ if (this.showCard) {
150
+ this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.card }));
151
+ }
152
+ if (this.showAch) {
153
+ this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.bankAccount }));
154
+ }
155
+ if (!this.selectedPaymentMethodId) {
156
+ this.selectedPaymentMethodId = (_b = this.paymentMethodOptions[0]) === null || _b === void 0 ? void 0 : _b.id;
157
+ }
158
+ }
159
+ paymentMethodOptionSelected(event) {
160
+ this.selectedPaymentMethodId = event.detail.id;
161
+ }
162
+ async resolvePaymentMethod(insuranceValidation) {
163
+ var _a;
164
+ return await ((_a = this.selectedPaymentMethodOptionRef) === null || _a === void 0 ? void 0 : _a.resolvePaymentMethod(insuranceValidation));
165
+ }
166
+ render() {
167
+ var _a;
168
+ return (h(Host, { key: '7ee40a1bdc9ec15596e870b48cbe7b6bbc20537c' }, (_a = this.paymentMethodOptions) === null || _a === void 0 ? void 0 : _a.map((paymentMethodOption) => {
169
+ const newCard = paymentMethodOption.id === PaymentMethodTypes.card;
170
+ const newBankAccount = paymentMethodOption.id === PaymentMethodTypes.bankAccount;
171
+ const isSelected = this.selectedPaymentMethodId === paymentMethodOption.id;
172
+ const sezzle = paymentMethodOption.id === PaymentMethodTypes.sezzle;
173
+ if (newCard || newBankAccount) {
174
+ return (h("justifi-new-payment-method", { paymentMethodOption: paymentMethodOption, authToken: this.authToken, "account-id": this.accountId, "is-selected": isSelected, paymentMethodGroupId: this.paymentMethodGroupId, ref: (el) => {
175
+ if (isSelected) {
176
+ this.selectedPaymentMethodOptionRef = el;
177
+ }
178
+ } }));
179
+ }
180
+ else if (sezzle) {
181
+ return (h("justifi-sezzle-payment-method", { paymentMethodOption: paymentMethodOption, "is-selected": isSelected, paymentAmount: this.paymentAmount, bnpl: this.bnpl, ref: (el) => {
182
+ if (isSelected) {
183
+ this.selectedPaymentMethodOptionRef = el;
184
+ }
185
+ } }));
186
+ }
187
+ else if (this.showSavedPaymentMethods) {
188
+ return (h("justifi-saved-payment-method", { paymentMethodOption: paymentMethodOption, "is-selected": isSelected, ref: (el) => {
189
+ if (isSelected) {
190
+ this.selectedPaymentMethodOptionRef = el;
191
+ }
192
+ } }));
193
+ }
194
+ })));
195
+ }
196
+ static get watchers() { return {
197
+ "savedPaymentMethods": ["paymentMethodsChanged"]
198
+ }; }
199
+ };
200
+ PaymentMethodOptions.style = JustifiPaymentMethodOptionsStyle0 + JustifiPaymentMethodOptionsStyle1;
201
+
202
+ const SavedPaymentMethod = class {
203
+ constructor(hostRef) {
204
+ registerInstance(this, hostRef);
205
+ this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
206
+ this.onPaymentMethodOptionClick = () => {
207
+ this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
208
+ };
209
+ this.iframeOrigin = "";
210
+ this.paymentMethodOption = undefined;
211
+ this.isSelected = undefined;
212
+ }
213
+ async resolvePaymentMethod(insuranceValidation) {
214
+ var _a;
215
+ if (!insuranceValidation.isValid) {
216
+ return { validationError: true };
217
+ }
218
+ return { token: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id };
219
+ }
220
+ ;
221
+ render() {
222
+ var _a, _b, _c, _d, _e;
223
+ return (h(Fragment, { key: '247dafc3fe4011c5f6a2202690310eedfa5422c8' }, h("div", { key: '9cfb0b6ca9c10e5cc6173832bb8211ddb1d0ae5b', class: "payment-method" }, h("div", { key: 'd247cc4cf9f7bf43d7153134c66a921b5bfc49bc', class: "payment-method-header p-3", onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '180c3aa6c4153bccf7cb620b6df49cc288754cd2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '6ec14d77e8171a1ddb37c686189878a7ebb4b4f4', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, CardBrandLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.brand], " *", (_e = this.paymentMethodOption) === null || _e === void 0 ? void 0 :
224
+ _e.acct_last_four)))));
225
+ }
226
+ };
227
+
228
+ const sezzleLogo = (h("img", { class: "sezzle-smart-button-logo-img", src: "https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg", alt: "Sezzle", style: {
229
+ display: 'inline',
230
+ width: '80px',
231
+ marginLeft: '5px',
232
+ marginTop: '-5px',
233
+ } }));
234
+ const SezzlePaymentMethod = class {
235
+ constructor(hostRef) {
236
+ registerInstance(this, hostRef);
237
+ this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
238
+ this.onPaymentMethodOptionClick = () => {
239
+ this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
240
+ };
241
+ this.initializeSezzleCheckout = () => {
242
+ let resolveSezzlePromise;
243
+ this.sezzlePromise = new Promise((resolve) => { resolveSezzlePromise = resolve; });
244
+ const bnpl = this.bnpl;
245
+ const amount = +this.paymentAmount; // convert to number
246
+ const Checkout = window.Checkout;
247
+ const checkout = new Checkout({
248
+ mode: 'popup',
249
+ publicKey: bnpl.provider_client_id,
250
+ apiMode: bnpl.provider_mode,
251
+ apiVersion: bnpl.provider_api_version,
252
+ });
253
+ checkout.sezzleButtonElement = this.sezzleButtonRef;
254
+ checkout.init({
255
+ onClick: function (event) {
256
+ event.preventDefault();
257
+ checkout.startCheckout({
258
+ checkout_url: bnpl.provider_checkout_url
259
+ });
260
+ },
261
+ onComplete: (event) => resolveSezzlePromise({ bnpl: event.data }),
262
+ onCancel: (event) => resolveSezzlePromise({ bnpl: event.data }),
263
+ onFailure: (event) => resolveSezzlePromise({ bnpl: event.data }),
264
+ });
265
+ this.sezzleCheckout = checkout;
266
+ this.installmentPlan = this.sezzleCheckout.getInstallmentPlan(amount);
267
+ };
268
+ this.iframeOrigin = "";
269
+ this.bnpl = undefined;
270
+ this.clientId = undefined;
271
+ this.accountId = undefined;
272
+ this.paymentMethodOption = undefined;
273
+ this.isSelected = undefined;
274
+ this.paymentAmount = undefined;
275
+ this.installmentPlan = undefined;
276
+ this.sezzleCheckout = undefined;
277
+ this.sezzlePromise = undefined;
278
+ }
279
+ componentDidRender() {
280
+ this.scriptRef.onload = () => {
281
+ this.sezzleButtonRef = document.createElement('button');
282
+ this.initializeSezzleCheckout();
283
+ };
284
+ }
285
+ async resolvePaymentMethod(insuranceValidation) {
286
+ if (!insuranceValidation.isValid) {
287
+ return { validationError: true };
288
+ }
289
+ this.sezzleButtonRef.click();
290
+ return this.sezzlePromise;
291
+ }
292
+ render() {
293
+ var _a, _b, _c, _d, _e;
294
+ return (h("div", { key: '1b4e4a142e1e59465e0db5515ee6b0a0b2aac146', class: "payment-method" }, h("script", { key: 'c835bc94836949e2362974eaeefca1f6a579a1a0', src: "https://checkout-sdk.sezzle.com/checkout.min.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", { key: '051a0392e6353116423f706be48eb266daf12b84', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '6dd0d61f1b8788b45b008f5ac05f8a8b6a6591f2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: 'caf3429bae616a016f58e141ac5c4493174cf3ef', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, h("div", { key: '0e4ea85fc6fc32a1c35fe0dac86f21ab7f86eb0a' }, "Buy now, pay later with ", sezzleLogo), this.installmentPlan && (h("small", { key: '3740565f14b87aa2e4af44b7e2b12d93d6e454c2' }, h("span", { key: 'ca9b6dff0042c41d378b101067d060092234fa7c' }, (_d = this.installmentPlan) === null || _d === void 0 ? void 0 : _d.installments.length), "\u00A0", h("span", { key: '14ab21fd2d9bd612f41d5cd3e175402593012619' }, this.installmentPlan.schedule, " payments of"), "\u00A0", h("span", { key: '25e08c1e711af0979e14bbb911aedb58f59bc180', class: "fw-bold" }, formatCurrency((_e = this.installmentPlan) === null || _e === void 0 ? void 0 : _e.installments[0].amountInCents))))))));
295
+ }
296
+ };
297
+
298
+ export { NewPaymentMethod as justifi_new_payment_method, PaymentMethodOptions as justifi_payment_method_options, SavedPaymentMethod as justifi_saved_payment_method, SezzlePaymentMethod as justifi_sezzle_payment_method };
@@ -1 +1,27 @@
1
- import{h as t}from"./p-fad19d75.js";const a=()=>t("main",{part:"detail-loading-state",class:"p-4 d-flex justify-content-center text-center",style:{fontSize:"1.2rem"}},t("div",{part:"detail-loading-spinner",class:"spinner-border spinner-border-sm",role:"status"},t("span",{class:"visually-hidden"},"Loading..."))),e=a=>t("main",{part:"detail-empty-state",class:"p-4 d-flex justify-content-center text-center",style:{fontSize:"1.2rem"}},t("div",null,a)),l=a=>[t("h5",{part:"detail-section-title",class:"mt-4"},a.sectionTitle),t("hr",null)],s=({title:a,value:e})=>a&&e?t("div",{class:"d-table-row gap-2"},t("span",{part:"detail-section-item-title",class:"fw-bold d-table-cell px-2"},a),t("span",{part:"detail-section-item-data",class:"flex-1 d-table-cell px-2 text-wrap",innerHTML:e})):null,i=({title:a,value:e,classes:l})=>t("div",{part:"detail-head-info-item",class:`d-flex flex-column ${l}`},t("span",{part:"detail-head-info-item-title",class:"fw-bold border-1 border-bottom ps-2 pe-2"},a),t("span",{part:"detail-head-info-item-data",class:"pt-2 ps-2 pe-2"},e)),d=({title:a,slot:e,badge:l},s)=>t("div",{slot:e,part:"detail-head",class:"p-2"},t("div",{class:"d-flex flex-row align-items-center gap-2 mb-2"},t("h1",{class:"m-0",part:"detail-title"},a),l),t("div",{part:"detail-head-info",class:"d-flex flex-row align-items-top"},s)),n=({metadata:a})=>a&&Object.keys(a).length?t("div",{class:"mt-4"},t("pre",{part:"detail-metadata",class:"p-2","aria-label":"metadata content"},t("code",null,JSON.stringify(a,null,2)))):null;export{n as C,l as D,e as E,a as L,d as a,i as b,s as c}
1
+ import { h } from './p-fad19d75.js';
2
+
3
+ const LoadingState = () => (h("main", { part: "detail-loading-state", class: "p-4 d-flex justify-content-center text-center", style: { fontSize: '1.2rem' } },
4
+ h("div", { part: "detail-loading-spinner", class: "spinner-border spinner-border-sm", role: "status" },
5
+ h("span", { class: "visually-hidden" }, "Loading..."))));
6
+ const ErrorState = (errorMessage) => (h("main", { part: "detail-empty-state", class: "p-4 d-flex justify-content-center text-center", style: { fontSize: '1.2rem' } },
7
+ h("div", null, errorMessage)));
8
+ const DetailSectionTitle = (props) => [
9
+ h("h5", { part: "detail-section-title", class: "mt-4" }, props.sectionTitle),
10
+ h("hr", null),
11
+ ];
12
+ const DetailItem = ({ title, value, }) => title && value ? (h("div", { class: "d-table-row gap-2" },
13
+ h("span", { part: "detail-section-item-title", class: "fw-bold d-table-cell px-2" }, title),
14
+ h("span", { part: "detail-section-item-data", class: "flex-1 d-table-cell px-2 text-wrap", innerHTML: value }))) : null;
15
+ const EntityHeadInfoItem = ({ title, value, classes, }) => (h("div", { part: "detail-head-info-item", class: `d-flex flex-column ${classes}` },
16
+ h("span", { part: "detail-head-info-item-title", class: "fw-bold border-1 border-bottom ps-2 pe-2" }, title),
17
+ h("span", { part: "detail-head-info-item-data", class: "pt-2 ps-2 pe-2" }, value)));
18
+ const EntityHeadInfo = ({ title, slot, badge }, children) => (h("div", { slot: slot, part: "detail-head", class: "p-2" },
19
+ h("div", { class: "d-flex flex-row align-items-center gap-2 mb-2" },
20
+ h("h1", { class: "m-0", part: "detail-title" }, title),
21
+ badge),
22
+ h("div", { part: "detail-head-info", class: "d-flex flex-row align-items-top" }, children)));
23
+ const CodeBlock = ({ metadata }) => metadata && Object.keys(metadata).length ? (h("div", { class: 'mt-4' },
24
+ h("pre", { part: "detail-metadata", class: "p-2", "aria-label": "metadata content" },
25
+ h("code", null, JSON.stringify(metadata, null, 2))))) : null;
26
+
27
+ export { CodeBlock as C, DetailSectionTitle as D, ErrorState as E, LoadingState as L, EntityHeadInfo as a, EntityHeadInfoItem as b, DetailItem as c };
@@ -1 +1,120 @@
1
- var t,s,i,h;!function(t){t.automatic="automatic",t.manual="manual"}(t||(t={})),function(t){t.card="card",t.bankAccount="bankAccount",t.sezzle="sezzle",t.saved="saved"}(s||(s={})),function(t){t.pending="pending",t.automatic="automatic",t.authorized="authorized",t.succeeded="succeeded",t.failed="failed",t.disputed="disputed",t.fully_refunded="fully_refunded",t.partially_refunded="partially_refunded"}(i||(i={})),function(t){t.lost="lost",t.open="open"}(h||(h={}));class n{constructor(t){this.card=t.card?new u(t.card):void 0,this.bank_account=t.bank_account?new e(t.bank_account):void 0}get payersName(){return this.card?this.card.name:this.bank_account?this.bank_account.name:null}get lastFourDigits(){return this.card?`**** ${this.card.acct_last_four}`:this.bank_account?`**** ${this.bank_account.acct_last_four}`:null}}class e{constructor(t){this.id=t.id,this.acct_last_four=t.acct_last_four,this.name=t.name,this.brand=t.brand,this.token=t.token,this.created_at=t.created_at,this.updated_at=t.updated_at}}class u{constructor(t){this.id=t.id||"",this.acct_last_four=t.acct_last_four,this.name=t.name,this.brand=t.brand,this.token=t.token,this.created_at=t.created_at,this.updated_at=t.updated_at}}class a{constructor(t){this.id=t.id,this.account_id=t.account_id,this.amount=t.amount,this.amount_disputed=t.amount_disputed,this.amount_refundable=t.amount_refundable,this.amount_refunded=t.amount_refunded,this.balance=t.balance,this.captured=t.captured,this.capture_strategy=t.capture_strategy,this.currency=t.currency,this.description=t.description,this.disputed=t.disputed,this.disputes=t.disputes,this.error_code=t.error_code,this.error_description=t.error_description,this.fee_amount=t.fee_amount,this.is_test=t.is_test,this.metadata=t.metadata,this.payment_method=new n(t.payment_method),this.payment_intent_id=t.payment_intent_id,this.refunded=t.refunded,this.status=t.status,this.created_at=t.created_at,this.updated_at=t.updated_at}get disputedStatus(){const t=this.disputes.some((t=>t.status===h.lost));return this.disputed?t?h.lost:h.open:null}}export{a as P,s as a}
1
+ var CaptureStrategy;
2
+ (function (CaptureStrategy) {
3
+ CaptureStrategy["automatic"] = "automatic";
4
+ CaptureStrategy["manual"] = "manual";
5
+ })(CaptureStrategy || (CaptureStrategy = {}));
6
+ var PaymentMethodTypes;
7
+ (function (PaymentMethodTypes) {
8
+ PaymentMethodTypes["card"] = "card";
9
+ PaymentMethodTypes["bankAccount"] = "bankAccount";
10
+ PaymentMethodTypes["sezzle"] = "sezzle";
11
+ PaymentMethodTypes["saved"] = "saved";
12
+ })(PaymentMethodTypes || (PaymentMethodTypes = {}));
13
+ var PaymentStatuses;
14
+ (function (PaymentStatuses) {
15
+ PaymentStatuses["pending"] = "pending";
16
+ PaymentStatuses["automatic"] = "automatic";
17
+ PaymentStatuses["authorized"] = "authorized";
18
+ PaymentStatuses["succeeded"] = "succeeded";
19
+ PaymentStatuses["failed"] = "failed";
20
+ PaymentStatuses["disputed"] = "disputed";
21
+ PaymentStatuses["fully_refunded"] = "fully_refunded";
22
+ PaymentStatuses["partially_refunded"] = "partially_refunded";
23
+ })(PaymentStatuses || (PaymentStatuses = {}));
24
+ var PaymentDisputedStatuses;
25
+ (function (PaymentDisputedStatuses) {
26
+ // if a dispute is 'won', we don't show a dispute status, just general status
27
+ PaymentDisputedStatuses["lost"] = "lost";
28
+ PaymentDisputedStatuses["open"] = "open";
29
+ })(PaymentDisputedStatuses || (PaymentDisputedStatuses = {}));
30
+ class PaymentMethod {
31
+ constructor(paymentMethod) {
32
+ this.card = paymentMethod.card ? new Card(paymentMethod.card) : undefined;
33
+ this.bank_account = paymentMethod.bank_account
34
+ ? new BankAccount(paymentMethod.bank_account)
35
+ : undefined;
36
+ }
37
+ get payersName() {
38
+ if (this.card) {
39
+ return this.card.name;
40
+ }
41
+ else if (this.bank_account) {
42
+ return this.bank_account.name;
43
+ }
44
+ return null;
45
+ }
46
+ get lastFourDigits() {
47
+ if (this.card) {
48
+ return `**** ${this.card.acct_last_four}`;
49
+ }
50
+ else if (this.bank_account) {
51
+ return `**** ${this.bank_account.acct_last_four}`;
52
+ }
53
+ return null;
54
+ }
55
+ }
56
+ class BankAccount {
57
+ constructor(bankAccount) {
58
+ this.id = bankAccount.id;
59
+ this.acct_last_four = bankAccount.acct_last_four;
60
+ this.name = bankAccount.name;
61
+ this.brand = bankAccount.brand;
62
+ this.token = bankAccount.token;
63
+ this.created_at = bankAccount.created_at;
64
+ this.updated_at = bankAccount.updated_at;
65
+ }
66
+ }
67
+ class Card {
68
+ constructor(card) {
69
+ this.id = card.id || '';
70
+ this.acct_last_four = card.acct_last_four;
71
+ this.name = card.name;
72
+ this.brand = card.brand;
73
+ this.token = card.token;
74
+ this.created_at = card.created_at;
75
+ this.updated_at = card.updated_at;
76
+ }
77
+ }
78
+ class Payment {
79
+ constructor(payment) {
80
+ this.id = payment.id;
81
+ this.account_id = payment.account_id;
82
+ this.amount = payment.amount;
83
+ this.amount_disputed = payment.amount_disputed;
84
+ this.amount_refundable = payment.amount_refundable;
85
+ this.amount_refunded = payment.amount_refunded;
86
+ this.balance = payment.balance;
87
+ this.captured = payment.captured;
88
+ this.capture_strategy = payment.capture_strategy;
89
+ this.currency = payment.currency;
90
+ this.description = payment.description;
91
+ this.disputed = payment.disputed;
92
+ this.disputes = payment.disputes;
93
+ this.error_code = payment.error_code;
94
+ this.error_description = payment.error_description;
95
+ this.fee_amount = payment.fee_amount;
96
+ this.is_test = payment.is_test;
97
+ this.metadata = payment.metadata;
98
+ this.payment_method = new PaymentMethod(payment.payment_method);
99
+ this.payment_intent_id = payment.payment_intent_id;
100
+ this.refunded = payment.refunded;
101
+ this.status = payment.status;
102
+ this.created_at = payment.created_at;
103
+ this.updated_at = payment.updated_at;
104
+ }
105
+ get disputedStatus() {
106
+ const lost = this.disputes.some((dispute) => dispute.status === PaymentDisputedStatuses.lost);
107
+ // if a dispute is 'won', we don't show a dispute status, just general status
108
+ if (!this.disputed) {
109
+ return null;
110
+ }
111
+ else if (lost) {
112
+ return PaymentDisputedStatuses.lost;
113
+ }
114
+ else {
115
+ return PaymentDisputedStatuses.open;
116
+ }
117
+ }
118
+ }
119
+
120
+ export { Payment as P, PaymentMethodTypes as a };
@@ -1 +1,3 @@
1
- const o=()=>{};export{o as g}
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };
@@ -0,0 +1,73 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { J as JustifiAnalytics } from './p-15eafa87.js';
3
+ import { a as ComponentErrorCodes, C as ComponentErrorSeverity } from './p-14c91ffd.js';
4
+ import { m as makeGetBusiness, a as makePostProvisioning } from './p-5968ff8a.js';
5
+ import { B as BusinessService } from './p-0e1bc91e.js';
6
+ import { A as Api } from './p-29c0b182.js';
7
+ import './p-2e8f4937.js';
8
+ import './p-8115b2f4.js';
9
+
10
+ class ProvisionService {
11
+ async postProvisioning(authToken, businessId, product) {
12
+ const endpoint = `entities/provisioning`;
13
+ const payload = {
14
+ business_id: businessId,
15
+ product_category: product,
16
+ };
17
+ return Api({ authToken, apiOrigin: "" }).post(endpoint, JSON.stringify(payload));
18
+ }
19
+ }
20
+
21
+ const PaymentProvisioning = class {
22
+ constructor(hostRef) {
23
+ registerInstance(this, hostRef);
24
+ this.errorEvent = createEvent(this, "error-event", 7);
25
+ this.postProvisioning = undefined;
26
+ this.getBusiness = undefined;
27
+ this.businessId = undefined;
28
+ this.authToken = undefined;
29
+ this.allowOptionalFields = false;
30
+ this.formTitle = 'Business Information';
31
+ }
32
+ propChanged() {
33
+ this.initializeApi();
34
+ }
35
+ componentWillLoad() {
36
+ this.analytics = new JustifiAnalytics(this);
37
+ this.initializeApi();
38
+ }
39
+ disconnectedCallback() {
40
+ this.analytics.cleanup();
41
+ }
42
+ initializeApi() {
43
+ if (this.authToken && this.businessId) {
44
+ this.getBusiness = makeGetBusiness({
45
+ authToken: this.authToken,
46
+ businessId: this.businessId,
47
+ service: new BusinessService()
48
+ });
49
+ this.postProvisioning = makePostProvisioning({
50
+ authToken: this.authToken,
51
+ businessId: this.businessId,
52
+ product: 'payment',
53
+ service: new ProvisionService()
54
+ });
55
+ }
56
+ else {
57
+ this.errorEvent.emit({
58
+ message: 'auth-token and business-id are required',
59
+ errorCode: ComponentErrorCodes.MISSING_PROPS,
60
+ severity: ComponentErrorSeverity.ERROR,
61
+ });
62
+ }
63
+ }
64
+ render() {
65
+ return (h("justifi-payment-provisioning-core", { key: 'a93ee23fabf4bdeb381e924bfdf684ddd183075a', businessId: this.businessId, authToken: this.authToken, allowOptionalFields: this.allowOptionalFields, formTitle: this.formTitle, getBusiness: this.getBusiness, postProvisioning: this.postProvisioning }));
66
+ }
67
+ static get watchers() { return {
68
+ "authToken": ["propChanged"],
69
+ "businessId": ["propChanged"]
70
+ }; }
71
+ };
72
+
73
+ export { PaymentProvisioning as justifi_payment_provisioning };
@@ -1 +1,34 @@
1
- import{h as t}from"./p-fad19d75.js";const e=e=>{const{columnSpan:r,isEmpty:s}=e;return r&&s?t("tr",null,t("td",{class:"empty-state",part:"empty-state",colSpan:r,style:{textAlign:"center"}},"No results")):null},r=e=>{const{columnSpan:r,errorMessage:s}=e;return r&&s?t("tr",null,t("td",{class:"error-state",part:"error-state",colSpan:r,"data-test-id":"table-error-state",style:{textAlign:"center"}},"An unexpected error occurred: ",s)):null},s=e=>{const{columnSpan:r,isLoading:s}=e;return r&&s?t("tr",null,t("td",{class:"loading-state",part:"loading-state-cell",colSpan:r,style:{textAlign:"center"}},t("div",{part:"loading-state-spinner",class:"spinner-border",role:"status"},t("span",{class:"visually-hidden"},"Loading...")))):null};export{s as T,e as a,r as b}
1
+ import { h } from './p-fad19d75.js';
2
+
3
+ const TableEmptyState = (props) => {
4
+ const { columnSpan, isEmpty } = props;
5
+ if (!columnSpan || !isEmpty) {
6
+ return null;
7
+ }
8
+ return (h("tr", null,
9
+ h("td", { class: "empty-state", part: "empty-state", colSpan: columnSpan, style: { textAlign: 'center' } }, "No results")));
10
+ };
11
+
12
+ const TableErrorState = (props) => {
13
+ const { columnSpan, errorMessage } = props;
14
+ if (!columnSpan || !errorMessage) {
15
+ return null;
16
+ }
17
+ return (h("tr", null,
18
+ h("td", { class: "error-state", part: "error-state", colSpan: columnSpan, "data-test-id": "table-error-state", style: { textAlign: 'center' } },
19
+ "An unexpected error occurred: ",
20
+ errorMessage)));
21
+ };
22
+
23
+ const TableLoadingState = (props) => {
24
+ const { columnSpan, isLoading } = props;
25
+ if (!columnSpan || !isLoading) {
26
+ return null;
27
+ }
28
+ return (h("tr", null,
29
+ h("td", { class: "loading-state", part: "loading-state-cell", colSpan: columnSpan, style: { textAlign: 'center' } },
30
+ h("div", { part: "loading-state-spinner", class: "spinner-border", role: "status" },
31
+ h("span", { class: "visually-hidden" }, "Loading...")))));
32
+ };
33
+
34
+ export { TableLoadingState as T, TableEmptyState as a, TableErrorState as b };
@@ -0,0 +1,29 @@
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment } from './p-fad19d75.js';
2
+ import './p-56f6ce4c.js';
3
+ import { a as PaymentMethodTypes } from './p-df21aaad.js';
4
+ import './p-e3fab0e2.js';
5
+
6
+ const paymentMethodSelectorCss = ":host{display:block}.jfi-btn-radio+.jfi-btn-radio-label{color:var(--jfi-radio-button-color);background-color:var(--jfi-radio-button-background-color);border-color:var(--jfi-radio-button-border-color);padding:var(--jfi-radio-button-padding);font-size:var(--jfi-radio-button-font-size)}.jfi-btn-radio:focus+.jfi-btn-radio-label{box-shadow:var(--jfi-box-shadow-focus)}.jfi-btn-radio+.jfi-btn-radio-label:hover{color:var(--jfi-radio-button-color-hover);border-color:var(--jfi-radio-button-border-color-hover);background-color:var(--jfi-radio-button-background-color-hover)}.jfi-btn-radio:checked+.jfi-btn-radio-label:hover{color:var(--jfi-radio-button-color-selected-hover);border-color:var(--jfi-radio-button-border-color-selected-hover);background-color:var(--jfi-radio-button-background-color-selected-hover)}.jfi-btn-radio:checked+.jfi-btn-radio-label{color:var(--jfi-radio-button-color-selected);background-color:var(--jfi-radio-button-background-color-selected);border-color:var(--jfi-radio-button-border-color-selected)}.jfi-btn-radio-group{font-family:var(--jfi-layout-font-family);display:inline-flex;width:var(--jfi-radio-button-group-width)}";
7
+ const JustifiPaymentMethodSelectorStyle0 = paymentMethodSelectorCss;
8
+
9
+ const PaymentMethodLabels = {
10
+ bankAccount: 'Bank Account',
11
+ card: 'Card',
12
+ };
13
+ const PaymentMethodSelector = class {
14
+ constructor(hostRef) {
15
+ registerInstance(this, hostRef);
16
+ this.paymentMethodSelected = createEvent(this, "paymentMethodSelected", 7);
17
+ this.paymentMethodTypes = [PaymentMethodTypes.card, PaymentMethodTypes.bankAccount];
18
+ this.selectedPaymentMethodType = undefined;
19
+ }
20
+ onChangeHandler(event) {
21
+ this.paymentMethodSelected.emit(event.target.value);
22
+ }
23
+ render() {
24
+ return (h("div", { key: 'a0cd592094f7f69955469de84addde1d4bc5af4d', class: "btn-group jfi-btn-radio-group", role: "group", "aria-label": "Radio toggle group for payment method" }, this.paymentMethodTypes.map((paymentMethodType) => (h(Fragment, null, h("input", { id: paymentMethodType, type: "radio", name: "paymentMethodType", value: paymentMethodType, onChange: (event) => this.onChangeHandler(event), checked: this.selectedPaymentMethodType === paymentMethodType, class: "btn-check jfi-btn-radio" }), h("label", { htmlFor: paymentMethodType, class: "btn btn-outline-primary jfi-btn-radio-label" }, PaymentMethodLabels[paymentMethodType]))))));
25
+ }
26
+ };
27
+ PaymentMethodSelector.style = JustifiPaymentMethodSelectorStyle0;
28
+
29
+ export { PaymentMethodSelector as justifi_payment_method_selector };
@@ -1 +1,43 @@
1
- var s,i;!function(s){s.paid="paid",s.failed="failed",s.forwarded="forwarded",s.scheduled="scheduled",s.in_transit="in_transit",s.canceled="canceled"}(s||(s={})),function(s){s.paid="Paid",s.failed="Failed",s.forwarded="Forwarded",s.scheduled="Scheduled",s.in_transit="In Transit",s.canceled="Canceled"}(i||(i={}));class t{constructor(s){this.id=s.id,this.account_id=s.account_id,this.amount=s.amount,this.bank_account=s.bank_account,this.currency=s.currency,this.delivery_method=s.delivery_method||"standard",this.description=s.description,this.deposits_at=s.deposits_at,this.fees_total=s.fees_total,this.refunds_count=s.refunds_count,this.refunds_total=s.refunds_total,this.payments_count=s.payments_count,this.payments_total=s.payments_total,this.payout_type=s.payout_type,this.other_total=s.other_total,this.status=s.status,this.metadata=s.metadata,this.created_at=s.created_at,this.updated_at=s.updated_at}}export{t as P,s as a,i as b}
1
+ var PayoutStatuses;
2
+ (function (PayoutStatuses) {
3
+ PayoutStatuses["paid"] = "paid";
4
+ PayoutStatuses["failed"] = "failed";
5
+ PayoutStatuses["forwarded"] = "forwarded";
6
+ PayoutStatuses["scheduled"] = "scheduled";
7
+ PayoutStatuses["in_transit"] = "in_transit";
8
+ PayoutStatuses["canceled"] = "canceled";
9
+ })(PayoutStatuses || (PayoutStatuses = {}));
10
+ var PayoutStatusesSafeNames;
11
+ (function (PayoutStatusesSafeNames) {
12
+ PayoutStatusesSafeNames["paid"] = "Paid";
13
+ PayoutStatusesSafeNames["failed"] = "Failed";
14
+ PayoutStatusesSafeNames["forwarded"] = "Forwarded";
15
+ PayoutStatusesSafeNames["scheduled"] = "Scheduled";
16
+ PayoutStatusesSafeNames["in_transit"] = "In Transit";
17
+ PayoutStatusesSafeNames["canceled"] = "Canceled";
18
+ })(PayoutStatusesSafeNames || (PayoutStatusesSafeNames = {}));
19
+ class Payout {
20
+ constructor(payout) {
21
+ this.id = payout.id;
22
+ this.account_id = payout.account_id;
23
+ this.amount = payout.amount;
24
+ this.bank_account = payout.bank_account;
25
+ this.currency = payout.currency;
26
+ this.delivery_method = payout.delivery_method || 'standard';
27
+ this.description = payout.description;
28
+ this.deposits_at = payout.deposits_at;
29
+ this.fees_total = payout.fees_total;
30
+ this.refunds_count = payout.refunds_count;
31
+ this.refunds_total = payout.refunds_total;
32
+ this.payments_count = payout.payments_count;
33
+ this.payments_total = payout.payments_total;
34
+ this.payout_type = payout.payout_type;
35
+ this.other_total = payout.other_total;
36
+ this.status = payout.status;
37
+ this.metadata = payout.metadata;
38
+ this.created_at = payout.created_at;
39
+ this.updated_at = payout.updated_at;
40
+ }
41
+ }
42
+
43
+ export { Payout as P, PayoutStatuses as a, PayoutStatusesSafeNames as b };