@justifi/webcomponents 4.19.1-rc → 4.19.2-rc
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.
- package/dist/cjs/{Analytics-0b3db49d.js → Analytics-66574423.js} +2 -3
- package/dist/cjs/{business.service-c384784d.js → business.service-090a21e1.js} +5 -6
- package/dist/cjs/{get-payout-csv-51a02be7.js → get-payout-csv-238e839a.js} +3 -4
- package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +7 -8
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-business-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-card-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +2 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +4 -5
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -4
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +8 -9
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +1 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -6
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -6
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -4
- package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -3
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +4 -5
- package/dist/cjs/{package-39dc73ed.js → package-0b65a049.js} +2 -4
- package/dist/cjs/{payment.service-2dbfb83d.js → payment.service-c92635c8.js} +2 -3
- package/dist/collection/api/services/analytics.service.js +1 -2
- package/dist/collection/api/services/business.service.js +5 -6
- package/dist/collection/api/services/checkout.service.js +2 -3
- package/dist/collection/api/services/insurance.service.js +2 -3
- package/dist/collection/api/services/payment.service.js +2 -3
- package/dist/collection/api/services/payout.service.js +3 -4
- package/dist/collection/api/services/provision.service.js +2 -4
- package/dist/collection/api/services/reports.service.js +1 -2
- package/dist/collection/components/bank-account-form/bank-account-form.js +3 -4
- package/dist/collection/components/business-forms/business-form/business-form.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -3
- package/dist/collection/components/card-form/card-form.js +3 -4
- package/dist/collection/components/checkout/checkout-core.js +3 -4
- package/dist/collection/components/checkout/new-payment-method.js +3 -4
- package/dist/collection/components/checkout/payment-method-options.js +3 -4
- package/dist/collection/components/checkout/saved-payment-method.js +3 -4
- package/dist/collection/components/checkout/sezzle-payment-method.js +3 -4
- package/dist/collection/components/payment-form/payment-form.js +3 -4
- package/dist/collection/components/refund-form/refund-form.js +2 -3
- package/dist/docs.json +8 -8
- package/dist/esm/{Analytics-37556050.js → Analytics-6f321899.js} +2 -3
- package/dist/esm/{business.service-eee46ab1.js → business.service-37d0cc72.js} +5 -6
- package/dist/esm/{get-payout-csv-4d6b29d8.js → get-payout-csv-a702a0d9.js} +3 -4
- package/dist/esm/justifi-additional-questions-form-step_10.entry.js +7 -8
- package/dist/esm/justifi-bank-account-form.entry.js +4 -5
- package/dist/esm/justifi-business-details.entry.js +3 -4
- package/dist/esm/justifi-business-form.entry.js +4 -5
- package/dist/esm/justifi-card-form.entry.js +4 -5
- package/dist/esm/justifi-checkout-core.entry.js +2 -3
- package/dist/esm/justifi-checkout.entry.js +4 -5
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -4
- package/dist/esm/justifi-new-payment-method_4.entry.js +8 -9
- package/dist/esm/justifi-owner-form_3.entry.js +1 -2
- package/dist/esm/justifi-payment-details.entry.js +3 -4
- package/dist/esm/justifi-payment-form.entry.js +5 -6
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +5 -6
- package/dist/esm/justifi-payments-list.entry.js +3 -4
- package/dist/esm/justifi-payout-details.entry.js +3 -4
- package/dist/esm/justifi-payouts-list.entry.js +3 -4
- package/dist/esm/justifi-refund-form.entry.js +2 -3
- package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -5
- package/dist/esm/{package-e2a7aa3f.js → package-9f727069.js} +2 -4
- package/dist/esm/{payment.service-9005a501.js → payment.service-9359fe15.js} +2 -3
- package/dist/globals.d.ts +2 -0
- package/dist/module/Analytics.js +1 -2
- package/dist/module/business-bank-account-form-step.js +2 -3
- package/dist/module/business-document-upload-form-step.js +2 -3
- package/dist/module/business-terms-conditions-form-step.js +2 -3
- package/dist/module/business.service.js +5 -6
- package/dist/module/checkout-core.js +2 -3
- package/dist/module/get-payout-csv.js +3 -4
- package/dist/module/justifi-bank-account-form.js +2 -3
- package/dist/module/justifi-business-form.js +2 -3
- package/dist/module/justifi-card-form.js +2 -3
- package/dist/module/justifi-checkout.js +2 -3
- package/dist/module/justifi-gross-payment-chart.js +1 -2
- package/dist/module/justifi-payment-form.js +3 -4
- package/dist/module/justifi-payment-provisioning.js +2 -3
- package/dist/module/justifi-refund-form.js +2 -3
- package/dist/module/justifi-season-interruption-insurance.js +2 -3
- package/dist/module/new-payment-method.js +2 -3
- package/dist/module/package.js +2 -4
- package/dist/module/payment-method-options.js +2 -3
- package/dist/module/payment.service.js +2 -3
- package/dist/module/saved-payment-method.js +2 -3
- package/dist/module/sezzle-payment-method.js +2 -3
- package/dist/webcomponents/p-04a61500.entry.js +1 -0
- package/dist/webcomponents/p-0e1bc91e.js +1 -0
- package/dist/webcomponents/{p-ae530971.entry.js → p-14fdc01c.entry.js} +1 -1
- package/dist/webcomponents/p-2b79f265.entry.js +1 -0
- package/dist/webcomponents/p-32211b2f.entry.js +1 -0
- package/dist/webcomponents/p-3352353a.entry.js +1 -0
- package/dist/webcomponents/p-3c6a8a36.entry.js +1 -0
- package/dist/webcomponents/p-47d79529.js +1 -0
- package/dist/webcomponents/p-72d42a01.entry.js +1 -0
- package/dist/webcomponents/p-77cf6f75.entry.js +1 -0
- package/dist/webcomponents/p-7c0002c6.js +1 -0
- package/dist/webcomponents/p-85960c15.entry.js +1 -0
- package/dist/webcomponents/p-8a038cd9.js +1 -0
- package/dist/webcomponents/p-8e7d4df4.entry.js +1 -0
- package/dist/webcomponents/p-b29f5084.entry.js +1 -0
- package/dist/webcomponents/p-b4b8b531.js +1 -0
- package/dist/webcomponents/p-bd2ecd23.entry.js +1 -0
- package/dist/webcomponents/p-c8c3a97d.entry.js +1 -0
- package/dist/webcomponents/p-cd37a87e.entry.js +1 -0
- package/dist/webcomponents/{p-a63fc384.entry.js → p-d23e1960.entry.js} +1 -1
- package/dist/webcomponents/p-e14c133e.entry.js +1 -0
- package/dist/webcomponents/p-e789152a.entry.js +1 -0
- package/dist/webcomponents/p-ecdf60f6.entry.js +1 -0
- package/dist/webcomponents/p-f117d1d1.entry.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -4
- package/dist/cjs/config-037e67d0.js +0 -15
- package/dist/config.js +0 -11
- package/dist/esm/config-58e393e2.js +0 -13
- package/dist/module/config.js +0 -13
- package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +0 -11
- package/dist/webcomponents/p-023779ee.entry.js +0 -1
- package/dist/webcomponents/p-037763f4.entry.js +0 -1
- package/dist/webcomponents/p-1f6afff9.entry.js +0 -1
- package/dist/webcomponents/p-246a6c6a.entry.js +0 -1
- package/dist/webcomponents/p-2d3b1692.entry.js +0 -1
- package/dist/webcomponents/p-32286934.js +0 -1
- package/dist/webcomponents/p-3f5e7e86.js +0 -1
- package/dist/webcomponents/p-57e1f2fd.js +0 -1
- package/dist/webcomponents/p-5f095525.entry.js +0 -1
- package/dist/webcomponents/p-69faef3f.entry.js +0 -1
- package/dist/webcomponents/p-6c078cd1.js +0 -1
- package/dist/webcomponents/p-8f325782.entry.js +0 -1
- package/dist/webcomponents/p-987b5de2.entry.js +0 -1
- package/dist/webcomponents/p-a8220709.entry.js +0 -1
- package/dist/webcomponents/p-b7cf49f4.entry.js +0 -1
- package/dist/webcomponents/p-b87b27ba.js +0 -1
- package/dist/webcomponents/p-c28db166.js +0 -1
- package/dist/webcomponents/p-edac2b43.entry.js +0 -1
- package/dist/webcomponents/p-ef23c091.entry.js +0 -1
- package/dist/webcomponents/p-f06910aa.entry.js +0 -1
- package/dist/webcomponents/p-f0a06884.entry.js +0 -1
- package/dist/webcomponents/p-f2f94d9f.entry.js +0 -1
- package/dist/webcomponents/p-f49b7170.entry.js +0 -1
|
@@ -9,7 +9,6 @@ import './Pagination.js';
|
|
|
9
9
|
import './Payment.js';
|
|
10
10
|
import './Payout.js';
|
|
11
11
|
import { a as parseBusiness } from './payload-parsers.js';
|
|
12
|
-
import { c as config } from './config.js';
|
|
13
12
|
import { a as BusinessFormServerErrors, b as BusinessFormClickActions } from './business-form-types.js';
|
|
14
13
|
import { a as Business } from './Business.js';
|
|
15
14
|
import { J as JustifiAnalytics } from './Analytics.js';
|
|
@@ -95,7 +94,7 @@ const BusinessForm = /*@__PURE__*/ proxyCustomElement(class BusinessForm extends
|
|
|
95
94
|
if (!this.businessId)
|
|
96
95
|
console.error(missingBusinessIdMessage);
|
|
97
96
|
this.formController = new FormController(businessFormSchema);
|
|
98
|
-
this.api = Api({ authToken: this.authToken, apiOrigin:
|
|
97
|
+
this.api = Api({ authToken: this.authToken, apiOrigin: "" });
|
|
99
98
|
this.fetchData();
|
|
100
99
|
}
|
|
101
100
|
disconnectedCallback() {
|
|
@@ -123,7 +122,7 @@ const BusinessForm = /*@__PURE__*/ proxyCustomElement(class BusinessForm extends
|
|
|
123
122
|
this.instantiateBusiness(response.data);
|
|
124
123
|
}
|
|
125
124
|
render() {
|
|
126
|
-
return (h(StyledHost, { key: '
|
|
125
|
+
return (h(StyledHost, { key: '8fb79d577c13246fcf3ec1ee8460713fee07d01a', exportparts: "label,input,input-invalid" }, h("form", { key: '1fe23a8cc8714aee257b6c73c6b7b096d684ea1c', onSubmit: this.validateAndSubmit }, h("div", { key: 'e501f6963ed5bfd9eb80f67df13108289db6eba7', class: "row gap-3" }, h("h1", { key: 'f81f22704bda1480c467b872cd3fd309505b0e94' }, this.title), h("form-alert", { key: '15b2ff75d4db6447bfd1892542e8e972ede0ac7e', text: this.errorMessage, hideAlert: this.hideErrors }), h("div", { key: 'fd6a375fd187426940df3f28262be7aec3fedbe5', class: "col-12 mb-4" }, h("justifi-business-core-info", { key: 'd16818a2124cb04dd5a5e84ea40639991fb04a80', formController: this.formController })), h("div", { key: 'd48b04718cf938484cf65cc956bf798f44ed17a7', class: "col-12 mb-4" }, h("justifi-legal-address-form", { key: '3a2bc6babfe8a0a265b2a7f9e7bea1abebd3eb43', formController: this.formController })), h("div", { key: '5c4d5d1fa1e2aba32f42c2bb9e97c0d796ecf709', class: "col-12 mb-4" }, h("justifi-additional-questions", { key: 'c888fb627380d05302cb106c5642e39b1f2652fa', formController: this.formController })), h("div", { key: '623e94d84976cfe29f4501a781c750d1bb537605', class: "col-12 mb-4" }, h("justifi-business-representative", { key: '594c893c0976b58a309679a031f6f1c787e66f48', formController: this.formController })), h("div", { key: '9fbc36ed183b1ebf171da14276092195c7aaf3a9', class: "col-12 d-flex flex-row-reverse" }, h("button", { key: 'a60da6fdda5193d3c41c589b00b040c05ae425ac', type: "submit", class: "btn btn-primary jfi-submit-button", disabled: this.disabledState, onClick: () => this.fireClickEvents({ name: BusinessFormClickActions.submit }) }, this.isLoading ? 'Loading...' : 'Submit'))))));
|
|
127
126
|
}
|
|
128
127
|
static get style() { return JustifiBusinessFormStyle0; }
|
|
129
128
|
}, [1, "justifi-business-form", {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as config } from './config.js';
|
|
3
2
|
import { J as JustifiAnalytics } from './Analytics.js';
|
|
4
3
|
import { d as defineCustomElement$2 } from './payment-method-form.js';
|
|
5
4
|
|
|
@@ -12,7 +11,7 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class CardForm extends HTMLEle
|
|
|
12
11
|
this.cardFormTokenized = createEvent(this, "cardFormTokenize", 7);
|
|
13
12
|
this.cardFormValidated = createEvent(this, "cardFormValidate", 7);
|
|
14
13
|
this.validationMode = undefined;
|
|
15
|
-
this.iframeOrigin =
|
|
14
|
+
this.iframeOrigin = "";
|
|
16
15
|
this.singleLine = false;
|
|
17
16
|
this.internalStyleOverrides = undefined;
|
|
18
17
|
}
|
|
@@ -65,7 +64,7 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class CardForm extends HTMLEle
|
|
|
65
64
|
return this.childRef.resize();
|
|
66
65
|
}
|
|
67
66
|
render() {
|
|
68
|
-
return (h("justifi-payment-method-form", { key: '
|
|
67
|
+
return (h("justifi-payment-method-form", { key: 'cc0ad5d8a262ff5c8422d247caed469a8dea3488', ref: el => {
|
|
69
68
|
if (el) {
|
|
70
69
|
this.childRef = el;
|
|
71
70
|
}
|
|
@@ -5,7 +5,6 @@ import { A as Api } from './Api.js';
|
|
|
5
5
|
import './Pagination.js';
|
|
6
6
|
import './Payment.js';
|
|
7
7
|
import './Payout.js';
|
|
8
|
-
import { c as config } from './config.js';
|
|
9
8
|
import { J as JustifiAnalytics } from './Analytics.js';
|
|
10
9
|
import { d as defineCustomElement$d } from './form-control-error-text2.js';
|
|
11
10
|
import { d as defineCustomElement$c } from './form-control-help-text2.js';
|
|
@@ -77,7 +76,7 @@ const makeCheckoutComplete = ({ authToken, checkoutId, service }) => async ({ pa
|
|
|
77
76
|
class CheckoutService {
|
|
78
77
|
async fetchCheckout(authToken, checkoutId) {
|
|
79
78
|
const endpoint = `checkouts/${checkoutId}`;
|
|
80
|
-
return Api({ authToken, apiOrigin:
|
|
79
|
+
return Api({ authToken, apiOrigin: "" }).get(endpoint);
|
|
81
80
|
}
|
|
82
81
|
async complete(authToken, checkoutId, payment) {
|
|
83
82
|
const endpoint = `checkouts/${checkoutId}/complete`;
|
|
@@ -87,7 +86,7 @@ class CheckoutService {
|
|
|
87
86
|
if (payment.payment_token) {
|
|
88
87
|
payload.payment_token = payment.payment_token;
|
|
89
88
|
}
|
|
90
|
-
return Api({ authToken, apiOrigin:
|
|
89
|
+
return Api({ authToken, apiOrigin: "" }).post(endpoint, JSON.stringify(payload));
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
92
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as config } from './config.js';
|
|
3
2
|
import { A as Api } from './Api.js';
|
|
4
3
|
import { a as ComponentErrorSeverity, C as ComponentErrorCodes } from './ComponentError.js';
|
|
5
4
|
import { g as getErrorMessage, a as getErrorCode } from './utils3.js';
|
|
@@ -9,7 +8,7 @@ import { d as defineCustomElement$2 } from './gross-payment-chart-core2.js';
|
|
|
9
8
|
|
|
10
9
|
class ReportsService {
|
|
11
10
|
async fetchGrossVolumeChartData(accountId, authToken) {
|
|
12
|
-
const api = Api({ authToken: authToken, apiOrigin:
|
|
11
|
+
const api = Api({ authToken: authToken, apiOrigin: "" });
|
|
13
12
|
const endpoint = `account/${accountId}/reports/gross_volume`;
|
|
14
13
|
return api.get(endpoint);
|
|
15
14
|
}
|
|
@@ -3,7 +3,6 @@ import './Pagination.js';
|
|
|
3
3
|
import { P as PaymentMethodTypes } from './Payment.js';
|
|
4
4
|
import './Payout.js';
|
|
5
5
|
import { l as loadFontsOnParent } from './utils2.js';
|
|
6
|
-
import { c as config } from './config.js';
|
|
7
6
|
import { C as ComponentErrorCodes, a as ComponentErrorSeverity } from './ComponentError.js';
|
|
8
7
|
import { g as getErrorMessage } from './utils3.js';
|
|
9
8
|
import { J as JustifiAnalytics } from './Analytics.js';
|
|
@@ -125,15 +124,15 @@ const PaymentForm = /*@__PURE__*/ proxyCustomElement(class PaymentForm extends H
|
|
|
125
124
|
}
|
|
126
125
|
}
|
|
127
126
|
render() {
|
|
128
|
-
return (h(StyledHost, { key: '
|
|
127
|
+
return (h(StyledHost, { key: '8cb6e3903a0045fbffed5f17dc29aacc6b57ad7f' }, h("form", { key: '4e8f00c3d29c0db0bc99fd79da46abe7c40e3e30', class: "row gy-3" }, this.showPaymentMethodTypeSelector() && (h("div", { key: '344a1356f6f482493a35015c32f8e9a9b4cc8a80', class: "col-12" }, h("justifi-payment-method-selector", { key: '36b9dd7a9bc8336b4bef0d12f56c811effbc0a0b', selectedPaymentMethodType: this.getSelectedPaymentMethodType(), onPaymentMethodSelected: event => this.paymentMethodSelectedHandler(event) }))), h("div", { key: '225a260f817f9dd02a7f0a5b25562179ab80f7de', class: "col-12" }, h("justifi-payment-method-form", { key: '52e2bf20b265cc96ab556571a323370cc27ac278', "payment-method-form-type": this.getSelectedPaymentMethodType(), iframeOrigin: "", ref: el => {
|
|
129
128
|
if (el) {
|
|
130
129
|
this.paymentMethodFormRef = el;
|
|
131
130
|
}
|
|
132
|
-
} })), h("div", { key: '
|
|
131
|
+
} })), h("div", { key: '433a8ac42c0eec9180e37da222da1dbb1112e48e', class: "col-12" }, h("justifi-billing-form", { key: '4f24f1c8b4083e2d9e5bb2272d32d20bb5cc225d', legend: "Billing Info", ref: el => {
|
|
133
132
|
if (el) {
|
|
134
133
|
this.billingFormRef = el;
|
|
135
134
|
}
|
|
136
|
-
} })), h("slot", { key: '
|
|
135
|
+
} })), h("slot", { key: '9397ae7fdd2677cd61a425fcf5818ae14fabbed0', name: 'insurance' }), h("div", { key: 'db9131f6f35165e69d3b59da7fa25b95f1e46168', class: "col-12" }, h(Button, { key: 'c280836cf6445a7132ff9202a09b6fdac8e29f77', variant: "primary", type: "submit", onClick: event => this.submit(event), disabled: !this.submitButtonEnabled || this.isLoading, isLoading: this.isLoading, "data-testid": "submit-button", style: { width: '100%' } }, this.submitButtonText || 'Submit')))));
|
|
137
136
|
}
|
|
138
137
|
static get style() { return JustifiPaymentFormStyle0; }
|
|
139
138
|
}, [1, "justifi-payment-form", {
|
|
@@ -3,7 +3,6 @@ import { J as JustifiAnalytics } from './Analytics.js';
|
|
|
3
3
|
import { C as ComponentErrorCodes, a as ComponentErrorSeverity } from './ComponentError.js';
|
|
4
4
|
import { m as makeGetBusiness, e as makePostProvisioning } from './payment-provisioning-actions.js';
|
|
5
5
|
import { B as BusinessService } from './business.service.js';
|
|
6
|
-
import { c as config } from './config.js';
|
|
7
6
|
import { A as Api } from './Api.js';
|
|
8
7
|
import { d as defineCustomElement$y } from './form-control-checkbox2.js';
|
|
9
8
|
import { d as defineCustomElement$x } from './form-control-date2.js';
|
|
@@ -44,9 +43,9 @@ class ProvisionService {
|
|
|
44
43
|
const endpoint = `entities/provisioning`;
|
|
45
44
|
const payload = {
|
|
46
45
|
business_id: businessId,
|
|
47
|
-
product_category: product
|
|
46
|
+
product_category: product,
|
|
48
47
|
};
|
|
49
|
-
return Api({ authToken, apiOrigin:
|
|
48
|
+
return Api({ authToken, apiOrigin: "" }).post(endpoint, JSON.stringify(payload));
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -4,7 +4,6 @@ import { A as Api } from './Api.js';
|
|
|
4
4
|
import './Pagination.js';
|
|
5
5
|
import './Payment.js';
|
|
6
6
|
import './Payout.js';
|
|
7
|
-
import { c as config } from './config.js';
|
|
8
7
|
import { C as CURRENCY_MASK } from './form-input-masks.js';
|
|
9
8
|
import { S as StyledHost } from './styled-host.js';
|
|
10
9
|
import { d as defineCustomElement$5 } from './form-control-error-text2.js';
|
|
@@ -96,11 +95,11 @@ const RefundForm = /*@__PURE__*/ proxyCustomElement(class RefundForm extends HTM
|
|
|
96
95
|
if (!this.authToken) {
|
|
97
96
|
console.warn('Warning: Missing auth-token.');
|
|
98
97
|
}
|
|
99
|
-
this.api = Api({ authToken: this.authToken, apiOrigin:
|
|
98
|
+
this.api = Api({ authToken: this.authToken, apiOrigin: "" });
|
|
100
99
|
}
|
|
101
100
|
render() {
|
|
102
101
|
var _a;
|
|
103
|
-
return (h(StyledHost, { key: '
|
|
102
|
+
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))))));
|
|
104
103
|
}
|
|
105
104
|
static get style() { return JustifiRefundFormStyle0; }
|
|
106
105
|
}, [1, "justifi-refund-form", {
|
|
@@ -3,7 +3,6 @@ import { A as Api } from './Api.js';
|
|
|
3
3
|
import './Pagination.js';
|
|
4
4
|
import './Payment.js';
|
|
5
5
|
import './Payout.js';
|
|
6
|
-
import { c as config } from './config.js';
|
|
7
6
|
import { g as getErrorMessage, a as getErrorCode } from './utils3.js';
|
|
8
7
|
import { a as ComponentErrorSeverity, C as ComponentErrorCodes } from './ComponentError.js';
|
|
9
8
|
import { J as JustifiAnalytics } from './Analytics.js';
|
|
@@ -12,11 +11,11 @@ import { d as defineCustomElement$2 } from './season-interruption-insurance-core
|
|
|
12
11
|
class InsuranceService {
|
|
13
12
|
async fetchQuote(authToken, payload) {
|
|
14
13
|
const endpoint = 'insurance/quotes';
|
|
15
|
-
return Api({ authToken, apiOrigin:
|
|
14
|
+
return Api({ authToken, apiOrigin: "" }).post(endpoint, JSON.stringify(payload));
|
|
16
15
|
}
|
|
17
16
|
async toggleCoverage(authToken, quoteId, payload) {
|
|
18
17
|
const endpoint = `insurance/quotes/${quoteId}/toggle`;
|
|
19
|
-
return Api({ authToken, apiOrigin:
|
|
18
|
+
return Api({ authToken, apiOrigin: "" }).post(endpoint, JSON.stringify(payload));
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as config } from './config.js';
|
|
3
2
|
import { d as defineCustomElement$7 } from './form-control-error-text2.js';
|
|
4
3
|
import { d as defineCustomElement$6 } from './form-control-help-text2.js';
|
|
5
4
|
import { d as defineCustomElement$5 } from './form-control-select2.js';
|
|
@@ -20,7 +19,7 @@ const NewPaymentMethod = /*@__PURE__*/ proxyCustomElement(class NewPaymentMethod
|
|
|
20
19
|
this.onPaymentMethodOptionClick = () => {
|
|
21
20
|
this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
|
|
22
21
|
};
|
|
23
|
-
this.iframeOrigin =
|
|
22
|
+
this.iframeOrigin = "";
|
|
24
23
|
this.authToken = undefined;
|
|
25
24
|
this.accountId = undefined;
|
|
26
25
|
this.paymentMethodOption = undefined;
|
|
@@ -80,7 +79,7 @@ const NewPaymentMethod = /*@__PURE__*/ proxyCustomElement(class NewPaymentMethod
|
|
|
80
79
|
}
|
|
81
80
|
render() {
|
|
82
81
|
var _a, _b, _c, _d;
|
|
83
|
-
return (h("div", { key: '
|
|
82
|
+
return (h("div", { key: '55a43467070e4981a6fda7b529f329122f33dda8', class: "payment-method" }, h("div", { key: 'b86a20d2e51883dab9f2c46e6787417d498af17e', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '900b836be24e83816d1e6c915855b11ba3b605ee', 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: 'b1976293de17845cba7671606c50698b90878bcb', 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));
|
|
84
83
|
}
|
|
85
84
|
}, [0, "justifi-new-payment-method", {
|
|
86
85
|
"iframeOrigin": [1025, "iframe-origin"],
|
package/dist/module/package.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const name = "@justifi/webcomponents";
|
|
2
|
-
const version = "4.19.
|
|
2
|
+
const version = "4.19.2-rc";
|
|
3
3
|
const description = "JustiFi Web Components";
|
|
4
4
|
const collection = "dist/collection/collection-manifest.json";
|
|
5
5
|
const main = "dist/index.cjs.js";
|
|
@@ -24,7 +24,6 @@ const scripts = {
|
|
|
24
24
|
generate: "stencil generate",
|
|
25
25
|
test: "TZ=utc stencil test --spec",
|
|
26
26
|
"test:watch": "TZ=utc stencil test --spec --watchAll",
|
|
27
|
-
"test:e2e": "stencil test --e2e",
|
|
28
27
|
"test:file": "stencil test --spec --watch --"
|
|
29
28
|
};
|
|
30
29
|
const dependencies = {
|
|
@@ -45,16 +44,15 @@ const devDependencies = {
|
|
|
45
44
|
"@babel/preset-env": "^7.21.5",
|
|
46
45
|
"@babel/preset-react": "^7.18.6",
|
|
47
46
|
"@babel/preset-typescript": "^7.21.5",
|
|
47
|
+
"@rollup/plugin-replace": "^5.0.7",
|
|
48
48
|
"@stencil/sass": "^3.0.1",
|
|
49
49
|
"@types/jest": "27.0.3",
|
|
50
|
-
"@types/node": "^20.1.4",
|
|
51
50
|
"@types/react": "^18.0.37",
|
|
52
51
|
"@types/react-dom": "^18.0.11",
|
|
53
52
|
dotenv: "^16.3.1",
|
|
54
53
|
jest: "^29.7.0",
|
|
55
54
|
"jest-cli": "^29.7.0",
|
|
56
55
|
"jest-environment-node": "^29.7.0",
|
|
57
|
-
puppeteer: "^21.0.0",
|
|
58
56
|
"ts-jest": "^29.1.2"
|
|
59
57
|
};
|
|
60
58
|
const license = "MIT";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as config } from './config.js';
|
|
3
2
|
import { P as PaymentMethodTypes } from './Payment.js';
|
|
4
3
|
import { d as defineCustomElement$2, P as PaymentMethodOption } from './saved-payment-method.js';
|
|
5
4
|
import { d as defineCustomElement$a } from './form-control-error-text2.js';
|
|
@@ -32,7 +31,7 @@ const PaymentMethodOptions = /*@__PURE__*/ proxyCustomElement(class PaymentMetho
|
|
|
32
31
|
this.insuranceToggled = undefined;
|
|
33
32
|
this.authToken = undefined;
|
|
34
33
|
this.accountId = undefined;
|
|
35
|
-
this.iframeOrigin =
|
|
34
|
+
this.iframeOrigin = "";
|
|
36
35
|
this.savedPaymentMethods = [];
|
|
37
36
|
this.paymentAmount = undefined;
|
|
38
37
|
this.selectedPaymentMethodId = undefined;
|
|
@@ -78,7 +77,7 @@ const PaymentMethodOptions = /*@__PURE__*/ proxyCustomElement(class PaymentMetho
|
|
|
78
77
|
}
|
|
79
78
|
render() {
|
|
80
79
|
var _a;
|
|
81
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: '7ee40a1bdc9ec15596e870b48cbe7b6bbc20537c' }, (_a = this.paymentMethodOptions) === null || _a === void 0 ? void 0 : _a.map((paymentMethodOption) => {
|
|
82
81
|
const newCard = paymentMethodOption.id === PaymentMethodTypes.card;
|
|
83
82
|
const newBankAccount = paymentMethodOption.id === PaymentMethodTypes.bankAccount;
|
|
84
83
|
const isSelected = this.selectedPaymentMethodId === paymentMethodOption.id;
|
|
@@ -2,17 +2,16 @@ import { A as Api } from './Api.js';
|
|
|
2
2
|
import './Pagination.js';
|
|
3
3
|
import './Payment.js';
|
|
4
4
|
import './Payout.js';
|
|
5
|
-
import { c as config } from './config.js';
|
|
6
5
|
|
|
7
6
|
class PaymentService {
|
|
8
7
|
async fetchPayments(accountId, authToken, params) {
|
|
9
|
-
const api = Api({ authToken, apiOrigin:
|
|
8
|
+
const api = Api({ authToken, apiOrigin: "" });
|
|
10
9
|
const endpoint = `account/${accountId}/payments`;
|
|
11
10
|
return api.get(endpoint, params);
|
|
12
11
|
}
|
|
13
12
|
async fetchPayment(paymentId, authToken) {
|
|
14
13
|
const endpoint = `payments/${paymentId}`;
|
|
15
|
-
return Api({ authToken, apiOrigin:
|
|
14
|
+
return Api({ authToken, apiOrigin: "" }).get(endpoint);
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
17
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as config } from './config.js';
|
|
3
2
|
import { j as snakeToCamel } from './utils2.js';
|
|
4
3
|
|
|
5
4
|
class PaymentMethodOption {
|
|
@@ -30,7 +29,7 @@ const SavedPaymentMethod = /*@__PURE__*/ proxyCustomElement(class SavedPaymentMe
|
|
|
30
29
|
this.onPaymentMethodOptionClick = () => {
|
|
31
30
|
this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
|
|
32
31
|
};
|
|
33
|
-
this.iframeOrigin =
|
|
32
|
+
this.iframeOrigin = "";
|
|
34
33
|
this.paymentMethodOption = undefined;
|
|
35
34
|
this.isSelected = undefined;
|
|
36
35
|
}
|
|
@@ -44,7 +43,7 @@ const SavedPaymentMethod = /*@__PURE__*/ proxyCustomElement(class SavedPaymentMe
|
|
|
44
43
|
;
|
|
45
44
|
render() {
|
|
46
45
|
var _a, _b, _c, _d, _e;
|
|
47
|
-
return (h(Fragment, { key: '
|
|
46
|
+
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 :
|
|
48
47
|
_e.acct_last_four)))));
|
|
49
48
|
}
|
|
50
49
|
}, [0, "justifi-saved-payment-method", {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as config } from './config.js';
|
|
3
2
|
import { a as formatCurrency } from './utils2.js';
|
|
4
3
|
|
|
5
4
|
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: {
|
|
@@ -43,7 +42,7 @@ const SezzlePaymentMethod = /*@__PURE__*/ proxyCustomElement(class SezzlePayment
|
|
|
43
42
|
this.sezzleCheckout = checkout;
|
|
44
43
|
this.installmentPlan = this.sezzleCheckout.getInstallmentPlan(amount);
|
|
45
44
|
};
|
|
46
|
-
this.iframeOrigin =
|
|
45
|
+
this.iframeOrigin = "";
|
|
47
46
|
this.bnpl = undefined;
|
|
48
47
|
this.clientId = undefined;
|
|
49
48
|
this.accountId = undefined;
|
|
@@ -69,7 +68,7 @@ const SezzlePaymentMethod = /*@__PURE__*/ proxyCustomElement(class SezzlePayment
|
|
|
69
68
|
}
|
|
70
69
|
render() {
|
|
71
70
|
var _a, _b, _c, _d, _e;
|
|
72
|
-
return (h("div", { key: '
|
|
71
|
+
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))))))));
|
|
73
72
|
}
|
|
74
73
|
}, [0, "justifi-sezzle-payment-method", {
|
|
75
74
|
"iframeOrigin": [1025, "iframe-origin"],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-fad19d75.js";import{m as o,P as e}from"./p-b4b8b531.js";import"./p-56f6ce4c.js";import"./p-df21aaad.js";import{P as r}from"./p-e3fab0e2.js";import{C as a,a as h}from"./p-14c91ffd.js";import{g as p,a as d}from"./p-8115b2f4.js";import{E as n}from"./p-dce846bf.js";import{J as c}from"./p-8a038cd9.js";import"./p-29c0b182.js";import"./p-7c0002c6.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.payoutId=void 0,this.authToken=void 0,this.getPayout=void 0,this.getPayoutCSV=void 0,this.errorMessage=null}componentWillLoad(){this.analytics=new c(this),this.initializeServices()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:i})=>async({onSuccess:o,onError:e})=>{var h;try{const n=await i.fetchPayout(t,s);n.error?e({error:p(n.error),code:d(null===(h=n.error)||void 0===h?void 0:h.code),severity:a.ERROR}):o(new r(n.data))}catch(t){e({error:p(t),code:d(null==t?void 0:t.code),severity:a.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new e}),this.getPayoutCSV=o({authToken:this.authToken,service:new e})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:h.MISSING_PROPS,severity:a.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):i("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payout_details}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as t}from"./p-29c0b182.js";class i{async fetchBusiness(i,n){const s=`entities/business/${i}`;return t({authToken:n,apiOrigin:""}).get(s)}async patchBusiness(i,n,s){const e=`entities/business/${n}`;return t({authToken:i,apiOrigin:""}).patch(e,s)}}class n{async fetchIdentity(i,n){const s=`entities/identity/${i}`;return t({authToken:n,apiOrigin:""}).get(s)}async patchIdentity(i,n,s){const e=`entities/identity/${n}`;return t({authToken:i,apiOrigin:""}).patch(e,s)}async postIdentity(i,n){return t({authToken:i,apiOrigin:""}).post("entities/identity",n)}}export{i as B,n as I}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-fad19d75.js";import{C as s,a as o}from"./p-14c91ffd.js";import{g as
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-fad19d75.js";import{C as s,a as o}from"./p-14c91ffd.js";import{g as c,a as r}from"./p-8115b2f4.js";import{A as a}from"./p-29c0b182.js";import"./p-56f6ce4c.js";import"./p-df21aaad.js";import"./p-e3fab0e2.js";import{J as h}from"./p-8a038cd9.js";import"./p-7c0002c6.js";class n{async fetchCheckout(e,t){const i=`checkouts/${t}`;return a({authToken:e,apiOrigin:""}).get(i)}async complete(e,t,i){const s=`checkouts/${t}/complete`,o={payment_mode:i.payment_mode};return i.payment_token&&(o.payment_token=i.payment_token),a({authToken:e,apiOrigin:""}).post(s,JSON.stringify(o))}}const d=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event",7),this.loadedEvent=t(this,"loaded",7),this.iframeOrigin=void 0,this.authToken=void 0,this.checkoutId=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.disableBnpl=void 0,this.disablePaymentMethodGroup=void 0,this.getCheckout=void 0,this.complete=void 0,this.errorMessage=""}componentWillLoad(){this.analytics=new h(this),this.initializeGetCheckout()}disconnectedCallback(){this.analytics.cleanup()}initializeGetCheckout(){this.authToken&&this.checkoutId?(this.getCheckout=(({authToken:e,checkoutId:t,service:i})=>async({onSuccess:o,onError:a})=>{var h;try{const n=await i.fetchCheckout(e,t);if(n.error)return a({error:c(n.error),code:r(null===(h=n.error)||void 0===h?void 0:h.code),severity:s.ERROR});o({checkout:n.data})}catch(e){const t=r(null==e?void 0:e.code);return a({error:e.message||e,code:t,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new n}),this.complete=(({authToken:e,checkoutId:t,service:i})=>async({payment:o,onSuccess:a,onError:h})=>{var n;try{const d=await i.complete(e,t,o);if(d.error)return h({error:c(d.error),code:r(null===(n=d.error)||void 0===n?void 0:n.code),severity:s.ERROR});a(d)}catch(e){const t=r(null==e?void 0:e.code);return h({error:e.message||e,code:t,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new n})):this.errorEvent.emit({message:"auth-token and checkout-id are required",errorCode:o.MISSING_PROPS,severity:s.ERROR})}propChanged(){this.initializeGetCheckout()}async fillBillingForm(e){this.checkoutCoreRef.fillBillingForm(e)}render(){return i("justifi-checkout-core",{key:"d2f6bfed1be767edcf4ba21cddc503ff5efbec1a",getCheckout:this.getCheckout,authToken:this.authToken,complete:this.complete,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,disableBnpl:this.disableBnpl,disablePaymentMethodGroup:this.disablePaymentMethodGroup,ref:e=>{e&&(this.checkoutCoreRef=e)}},i("div",{key:"45ac1bea74ca8ef7999211b51fe7791225d61f00",slot:"insurance"},i("slot",{key:"13e051844cc7cb4aed98076ccd64954b2dd68228",name:"insurance"})))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"]}}};export{d as justifi_checkout}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as r,h as t}from"./p-fad19d75.js";import"./p-56f6ce4c.js";import{a as i}from"./p-df21aaad.js";import"./p-e3fab0e2.js";import{l as a}from"./p-83125497.js";import{a as e,C as s}from"./p-14c91ffd.js";import{g as f}from"./p-8115b2f4.js";import{J as c}from"./p-8a038cd9.js";import{B as b}from"./p-9c9c7dac.js";import{S as d}from"./p-ba4bae6f.js";import"./p-7c0002c6.js";import"./p-29c0b182.js";const n=class{constructor(t){o(this,t),this.submitted=r(this,"submitted",7),this.errorEvent=r(this,"error-event",7),this.bankAccount=void 0,this.card=void 0,this.email=void 0,this.clientId=void 0,this.authToken=void 0,this.accountId=void 0,this.submitButtonText=void 0,this.submitButtonEnabled=!0,this.isLoading=!1,this.selectedPaymentMethodType=i.card}componentWillLoad(){this.analytics=new c(this),this.validateProps()||(this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:"clientId or authToken is required",severity:s.ERROR}),this.submitButtonEnabled=!1)}connectedCallback(){a()}disconnectedCallback(){this.analytics.cleanup()}async fillBillingForm(o){this.billingFormRef.fill(o)}async enableSubmitButton(){this.submitButtonEnabled=!0}async disableSubmitButton(){this.submitButtonEnabled=!1}showPaymentMethodTypeSelector(){return this.card&&this.bankAccount}getSelectedPaymentMethodType(){return this.showPaymentMethodTypeSelector()?this.selectedPaymentMethodType:this.card?i.card:this.bankAccount?i.bankAccount:i.card}paymentMethodSelectedHandler(o){this.selectedPaymentMethodType=o.detail}validateProps(){return!(!this.clientId&&!this.authToken)}getToken(){return this.authToken||this.clientId}async submit(o){if(o.preventDefault(),!this.paymentMethodFormRef||!this.billingFormRef)return;const r=await this.billingFormRef.validate(),t=await this.paymentMethodFormRef.validate();if(r.isValid&&t.isValid){this.isLoading=!0;try{const o=await this.billingFormRef.getValues(),r=Object.assign({email:this.email},o),t=await this.paymentMethodFormRef.tokenize(this.getToken(),r,this.accountId);t.error&&this.errorEvent.emit({errorCode:e.TOKENIZE_ERROR,message:t.error.message,severity:s.ERROR}),this.submitted.emit(t)}catch(o){this.errorEvent.emit({errorCode:e.UNKNOWN_ERROR,message:f(o),severity:s.ERROR})}finally{this.isLoading=!1}}}render(){return t(d,{key:"8cb6e3903a0045fbffed5f17dc29aacc6b57ad7f"},t("form",{key:"4e8f00c3d29c0db0bc99fd79da46abe7c40e3e30",class:"row gy-3"},this.showPaymentMethodTypeSelector()&&t("div",{key:"344a1356f6f482493a35015c32f8e9a9b4cc8a80",class:"col-12"},t("justifi-payment-method-selector",{key:"36b9dd7a9bc8336b4bef0d12f56c811effbc0a0b",selectedPaymentMethodType:this.getSelectedPaymentMethodType(),onPaymentMethodSelected:o=>this.paymentMethodSelectedHandler(o)})),t("div",{key:"225a260f817f9dd02a7f0a5b25562179ab80f7de",class:"col-12"},t("justifi-payment-method-form",{key:"52e2bf20b265cc96ab556571a323370cc27ac278","payment-method-form-type":this.getSelectedPaymentMethodType(),iframeOrigin:"",ref:o=>{o&&(this.paymentMethodFormRef=o)}})),t("div",{key:"433a8ac42c0eec9180e37da222da1dbb1112e48e",class:"col-12"},t("justifi-billing-form",{key:"4f24f1c8b4083e2d9e5bb2272d32d20bb5cc225d",legend:"Billing Info",ref:o=>{o&&(this.billingFormRef=o)}})),t("slot",{key:"9397ae7fdd2677cd61a425fcf5818ae14fabbed0",name:"insurance"}),t("div",{key:"db9131f6f35165e69d3b59da7fa25b95f1e46168",class:"col-12"},t(b,{key:"c280836cf6445a7132ff9202a09b6fdac8e29f77",variant:"primary",type:"submit",onClick:o=>this.submit(o),disabled:!this.submitButtonEnabled||this.isLoading,isLoading:this.isLoading,"data-testid":"submit-button",style:{width:"100%"}},this.submitButtonText||"Submit"))))}};n.style=":host{display:block}justifi-payment-method-form{display:block;margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){font-family:var(--jfi-layout-font-family);background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}.jfi-submit-button{font-family:var(--jfi-layout-font-family);color:var(--jfi-submit-button-color);background-color:var(--jfi-submit-button-background-color);border-color:var(--jfi-submit-button-border-color);padding:var(--jfi-submit-button-padding);font-size:var(--jfi-submit-button-font-size);border-radius:var(--jfi-submit-button-border-radius);width:var(--jfi-submit-button-width);box-shadow:var(--jfi-submit-button-box-shadow)}.jfi-submit-button:hover{color:var(--jfi-submit-button-color-hover);background-color:var(--jfi-submit-button-background-color-hover);border-color:var(--jfi-submit-button-border-color-hover)}.jfi-submit-button:focus{color:var(--jfi-submit-button-color-focus);background-color:var(--jfi-submit-button-background-color-focus);border-color:var(--jfi-submit-button-border-color-focus)}.btn.jfi-submit-button:active{color:var(--jfi-submit-button-color-active);background-color:var(--jfi-submit-button-background-color-active);border-color:var(--jfi-submit-button-border-color-active)}.btn.jfi-submit-button-loading{min-width:75px;color:var(--jfi-submit-button-color-loading);background-color:var(--jfi-submit-button-background-color-loading);border-color:var(--jfi-submit-button-border-color-loading)}.btn.jfi-submit-button-loading .spinner-border{border-top-color:var(--jfi-submit-button-color-loading);border-bottom-color:var(--jfi-submit-button-color-loading);border-left-color:var(--jfi-submit-button-color-loading)}";export{n as justifi_payment_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,H as o,F as s}from"./p-fad19d75.js";import{a}from"./p-df21aaad.js";import{g as d,f as h}from"./p-83125497.js";const n={bankAccount:"New bank account",card:"New credit or debit card"},r=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected",7),this.onPaymentMethodOptionClick=()=>{this.paymentMethodOptionSelected.emit(this.paymentMethodOption)},this.iframeOrigin="",this.authToken=void 0,this.accountId=void 0,this.paymentMethodOption=void 0,this.paymentMethodGroupId=void 0,this.isSelected=void 0,this.saveNewPaymentMethodChecked=!1}handleCheckboxChanged(t){this.saveNewPaymentMethodChecked=t.detail}async fillBillingForm(t){this.billingFormRef.fill(t)}async resolvePaymentMethod(t){var i,e;if(!this.paymentMethodFormRef||!this.billingFormRef)return;if(!await this.validate()||!t.isValid)return{validationError:!0};const o=await this.tokenize();if(o.error)return{error:o.error};{const t=o.data;return{token:(null===(i=t.card)||void 0===i?void 0:i.token)||(null===(e=t.bank_account)||void 0===e?void 0:e.token)}}}async validate(){const t=await this.billingFormRef.validate(),i=await this.paymentMethodFormRef.validate();return t.isValid&&i.isValid}async tokenize(){try{const t=await this.billingFormRef.getValues();let i;i=this.saveNewPaymentMethodChecked?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupId}):Object.assign({},t);const e=this.authToken;return await this.paymentMethodFormRef.tokenize(e,i,this.accountId)}catch(t){return t}}showNewPaymentMethodForm(){var t;return e("div",{class:"mt-2 pb-4 border-bottom"},e("div",{class:"mb-3"},e("justifi-payment-method-form",{ref:t=>this.paymentMethodFormRef=t,"payment-method-form-type":null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,"iframe-origin":this.iframeOrigin})),e("h3",{class:"fs-6 fw-bold lh-lg mb-4"},"Billing address"),e("justifi-billing-form",{ref:t=>this.billingFormRef=t}),e("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupId}))}render(){var t,i,o,s;return e("div",{key:"55a43467070e4981a6fda7b529f329122f33dda8",class:"payment-method"},e("div",{key:"b86a20d2e51883dab9f2c46e6787417d498af17e",class:"payment-method-header p-3",onClick:()=>this.onPaymentMethodOptionClick()},e("input",{key:"900b836be24e83816d1e6c915855b11ba3b605ee",type:"radio",name:"paymentMethodType",id:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,value:null===(i=this.paymentMethodOption)||void 0===i?void 0:i.id,onClick:t=>t.preventDefault(),checked:this.isSelected,class:"form-check-input me-2"}),e("label",{key:"b1976293de17845cba7671606c50698b90878bcb",htmlFor:null===(o=this.paymentMethodOption)||void 0===o?void 0:o.id,class:"form-check-label"},n[null===(s=this.paymentMethodOption)||void 0===s?void 0:s.id])),this.isSelected?this.showNewPaymentMethodForm():null)}};class c{constructor(t){this.id=t.id,this.brand=t.brand,this.acct_last_four=t.acct_last_four,this.type=d(t.type)}}var l;!function(t){t.american_express="American Express",t.diners_club="Diners Club",t.discover="Discover",t.jcb="JCB",t.mastercard="Mastercard",t.china_unionpay="UnionPay",t.visa="Visa",t.unknown="Unknown"}(l||(l={}));const b=class{constructor(e){t(this,e),this.toggleCreatingNewPaymentMethod=i(this,"toggleCreatingNewPaymentMethod",7),this.showCard=void 0,this.showAch=void 0,this.showBnpl=void 0,this.showSavedPaymentMethods=void 0,this.paymentMethodGroupId=void 0,this.bnpl=void 0,this.insuranceToggled=void 0,this.authToken=void 0,this.accountId=void 0,this.iframeOrigin="",this.savedPaymentMethods=[],this.paymentAmount=void 0,this.selectedPaymentMethodId=void 0,this.paymentMethodOptions=[]}async fillBillingForm(t){const i=this.selectedPaymentMethodOptionRef;i.fillBillingForm&&i.fillBillingForm(t)}connectedCallback(){this.paymentMethodsChanged()}paymentMethodsChanged(){var t,i;this.paymentMethodOptions=this.savedPaymentMethods.map((t=>new c(t))).filter((t=>(this.showCard||t.type!==a.card)&&(this.showAch||t.type!==a.bankAccount))),this.showBnpl&&"sezzle"===(null===(t=this.bnpl)||void 0===t?void 0:t.provider)&&!this.insuranceToggled&&this.paymentMethodOptions.push(new c({id:a.sezzle})),this.showCard&&this.paymentMethodOptions.push(new c({id:a.card})),this.showAch&&this.paymentMethodOptions.push(new c({id:a.bankAccount})),this.selectedPaymentMethodId||(this.selectedPaymentMethodId=null===(i=this.paymentMethodOptions[0])||void 0===i?void 0:i.id)}paymentMethodOptionSelected(t){this.selectedPaymentMethodId=t.detail.id}async resolvePaymentMethod(t){var i;return await(null===(i=this.selectedPaymentMethodOptionRef)||void 0===i?void 0:i.resolvePaymentMethod(t))}render(){var t;return e(o,{key:"7ee40a1bdc9ec15596e870b48cbe7b6bbc20537c"},null===(t=this.paymentMethodOptions)||void 0===t?void 0:t.map((t=>{const i=this.selectedPaymentMethodId===t.id,o=t.id===a.sezzle;return t.id===a.card||t.id===a.bankAccount?e("justifi-new-payment-method",{paymentMethodOption:t,authToken:this.authToken,"account-id":this.accountId,"is-selected":i,paymentMethodGroupId:this.paymentMethodGroupId,ref:t=>{i&&(this.selectedPaymentMethodOptionRef=t)}}):o?e("justifi-sezzle-payment-method",{paymentMethodOption:t,"is-selected":i,paymentAmount:this.paymentAmount,bnpl:this.bnpl,ref:t=>{i&&(this.selectedPaymentMethodOptionRef=t)}}):this.showSavedPaymentMethods?e("justifi-saved-payment-method",{paymentMethodOption:t,"is-selected":i,ref:t=>{i&&(this.selectedPaymentMethodOptionRef=t)}}):void 0})))}static get watchers(){return{savedPaymentMethods:["paymentMethodsChanged"]}}};b.style=":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)}.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)}";const v=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected",7),this.onPaymentMethodOptionClick=()=>{this.paymentMethodOptionSelected.emit(this.paymentMethodOption)},this.iframeOrigin="",this.paymentMethodOption=void 0,this.isSelected=void 0}async resolvePaymentMethod(t){var i;return t.isValid?{token:null===(i=this.paymentMethodOption)||void 0===i?void 0:i.id}:{validationError:!0}}render(){var t,i,o,a,d;return e(s,{key:"247dafc3fe4011c5f6a2202690310eedfa5422c8"},e("div",{key:"9cfb0b6ca9c10e5cc6173832bb8211ddb1d0ae5b",class:"payment-method"},e("div",{key:"d247cc4cf9f7bf43d7153134c66a921b5bfc49bc",class:"payment-method-header p-3",onClick:()=>this.onPaymentMethodOptionClick()},e("input",{key:"180c3aa6c4153bccf7cb620b6df49cc288754cd2",type:"radio",name:"paymentMethodType",id:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,value:null===(i=this.paymentMethodOption)||void 0===i?void 0:i.id,onClick:t=>t.preventDefault(),checked:this.isSelected,class:"form-check-input me-2"}),e("label",{key:"6ec14d77e8171a1ddb37c686189878a7ebb4b4f4",htmlFor:null===(o=this.paymentMethodOption)||void 0===o?void 0:o.id,class:"form-check-label"},l[null===(a=this.paymentMethodOption)||void 0===a?void 0:a.brand]," *",null===(d=this.paymentMethodOption)||void 0===d?void 0:d.acct_last_four))))}},u=e("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),m=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected",7),this.onPaymentMethodOptionClick=()=>{this.paymentMethodOptionSelected.emit(this.paymentMethodOption)},this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((i=>{t=i}));const i=this.bnpl,e=+this.paymentAmount,o=new(0,window.Checkout)({mode:"popup",publicKey:i.provider_client_id,apiMode:i.provider_mode,apiVersion:i.provider_api_version});o.sezzleButtonElement=this.sezzleButtonRef,o.init({onClick:function(t){t.preventDefault(),o.startCheckout({checkout_url:i.provider_checkout_url})},onComplete:i=>t({bnpl:i.data}),onCancel:i=>t({bnpl:i.data}),onFailure:i=>t({bnpl:i.data})}),this.sezzleCheckout=o,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)},this.iframeOrigin="",this.bnpl=void 0,this.clientId=void 0,this.accountId=void 0,this.paymentMethodOption=void 0,this.isSelected=void 0,this.paymentAmount=void 0,this.installmentPlan=void 0,this.sezzleCheckout=void 0,this.sezzlePromise=void 0}componentDidRender(){this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()}}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}render(){var t,i,o,s,a;return e("div",{key:"1b4e4a142e1e59465e0db5515ee6b0a0b2aac146",class:"payment-method"},e("script",{key:"c835bc94836949e2362974eaeefca1f6a579a1a0",src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),e("div",{key:"051a0392e6353116423f706be48eb266daf12b84",class:"payment-method-header p-3",onClick:()=>this.onPaymentMethodOptionClick()},e("input",{key:"6dd0d61f1b8788b45b008f5ac05f8a8b6a6591f2",type:"radio",name:"paymentMethodType",id:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,value:null===(i=this.paymentMethodOption)||void 0===i?void 0:i.id,onClick:t=>t.preventDefault(),checked:this.isSelected,class:"form-check-input me-2"}),e("label",{key:"caf3429bae616a016f58e141ac5c4493174cf3ef",htmlFor:null===(o=this.paymentMethodOption)||void 0===o?void 0:o.id,class:"form-check-label"},e("div",{key:"0e4ea85fc6fc32a1c35fe0dac86f21ab7f86eb0a"},"Buy now, pay later with ",u),this.installmentPlan&&e("small",{key:"3740565f14b87aa2e4af44b7e2b12d93d6e454c2"},e("span",{key:"ca9b6dff0042c41d378b101067d060092234fa7c"},null===(s=this.installmentPlan)||void 0===s?void 0:s.installments.length)," ",e("span",{key:"14ab21fd2d9bd612f41d5cd3e175402593012619"},this.installmentPlan.schedule," payments of")," ",e("span",{key:"25e08c1e711af0979e14bbb911aedb58f59bc180",class:"fw-bold"},h(null===(a=this.installmentPlan)||void 0===a?void 0:a.installments[0].amountInCents))))))}};export{r as justifi_new_payment_method,b as justifi_payment_method_options,v as justifi_saved_payment_method,m as justifi_sezzle_payment_method}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as s}from"./p-fad19d75.js";import{c as i,d as a,e as r}from"./p-5968ff8a.js";import{I as d}from"./p-0e1bc91e.js";import{F as o}from"./p-2eab3c90.js";import{O as h}from"./p-af244664.js";import{a as c}from"./p-d89bad72.js";import{c as n,i as f}from"./p-85fc69e5.js";import{B as b}from"./p-9c9c7dac.js";import{S as l,P as m}from"./p-525db3e8.js";import{u,a as p,b as v}from"./p-7d85af5c.js";import"./p-14c91ffd.js";import"./p-8115b2f4.js";import"./p-29c0b182.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-89887332.js";import"./p-ba5fae28.js";const y=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.getOwner=void 0,this.patchOwner=void 0,this.postOwner=void 0,this.authToken=void 0,this.ownerId=void 0,this.businessId=void 0,this.allowOptionalFields=void 0,this.removeOwner=void 0,this.newFormOpen=void 0,this.ownersLength=void 0}async validate(){return this.coreComponent.validate()}async submit(){return this.coreComponent.submit()}async validateAndSubmit({onSuccess:e}){this.coreComponent.validateAndSubmit({onSuccess:e})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&(this.getOwner=i({authToken:this.authToken,identityId:this.ownerId,service:new d}),this.patchOwner=a({authToken:this.authToken,identityId:this.ownerId,service:new d}),this.postOwner=r({authToken:this.authToken,service:new d}))}render(){return s("owner-form-core",{key:"332d1e77d01886f13aba09b32b2d5f2199131619",ownerId:this.ownerId,businessId:this.businessId,getOwner:this.getOwner,patchOwner:this.patchOwner,postOwner:this.postOwner,allowOptionalFields:this.allowOptionalFields,removeOwner:this.removeOwner,newFormOpen:this.newFormOpen,ownersLength:this.ownersLength,ref:e=>this.coreComponent=e})}},k=class{loadingWatcher(){this.formLoading.emit(this.isLoading)}constructor(s){e(this,s),this.submitted=t(this,"submitted",7),this.ownerSubmitted=t(this,"ownerSubmitted",7),this.clickEvent=t(this,"click-event",7),this.formLoading=t(this,"formLoading",7),this.errorEvent=t(this,"error-event",7),this.getData=()=>{this.isLoading=!0,this.getOwner({onSuccess:e=>{this.instantiateOwner(e.data)},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({message:e,errorCode:t,severity:s})},final:()=>this.isLoading=!1})},this.sendData=()=>(this.isLoading=!0,new Promise((e=>{this.ownerId?this.patchOwner({payload:this.payload,onSuccess:t=>{this.submitted.emit({data:t,metadata:{ownerID:t.data.id}}),this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.submitted.emit({data:{error:t}}),this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1}):this.postOwner({payload:this.payload,onSuccess:t=>{this.submitted.emit({data:t,metadata:{ownerID:t.data.id}}),this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.submitted.emit({data:{error:t}}),this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1})}))),this.instantiateOwner=async e=>{this.owner=Object.assign({},new h(e)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?c.updateOwner:c.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:c.removeOwner})},this.isLoading=!1,this.formController=void 0,this.errors={},this.owner={},this.ownerId=void 0,this.businessId=void 0,this.getOwner=void 0,this.patchOwner=void 0,this.postOwner=void 0,this.allowOptionalFields=void 0,this.removeOwner=void 0,this.newFormOpen=void 0,this.ownersLength=void 0,this.validate=this.validate.bind(this),this.submit=this.submit.bind(this),this.validateAndSubmit=this.validateAndSubmit.bind(this)}async returnOwnerData(){return this.ownerId}async validate(){return this.formController.validate()}async submit(){if(await this.validate())return this.sendData()}async validateAndSubmit(e){e.preventDefault(),await this.validate()&&this.submit()}get payload(){let e=n(this.formController.values.getValue());return this.ownerId?JSON.stringify(e):JSON.stringify(Object.assign(Object.assign({},e),{business_id:this.businessId}))}get formTitle(){return this.ownerId?"Edit Business Owner":"Add Business Owner"}get submitButtonText(){return this.ownerId?"Update":"Add"}get showRemoveButton(){return!(this.ownersLength<=1)&&(!(this.ownerId||!this.newFormOpen)||!(!this.ownerId||this.newFormOpen)||void 0)}componentWillLoad(){this.formController=new o(f("owner",this.allowOptionalFields)),this.ownerId?this.getData():this.instantiateOwner({})}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e)))}render(){return s("form",{key:"b2e2aaced859260e9d2ef59bc3f8a0763d05872c",onSubmit:this.validateAndSubmit},s("fieldset",{key:"2a93ddb4c945be0ec081ce31d6d9eff4b302d622"},s("legend",{key:"ea9859e55099e3f8263024d884edfb48b3666eaa",class:"fw-semibold fs-5"},this.formTitle),s("br",{key:"f646c1ecc544c358d87e701aba8e151fcb96c54e"}),s("div",{key:"874bf4ebd7cef0afbdee96fa4d5679b6d683b0f0",class:"row gy-3"},s("owner-form-inputs",{key:"866dbf0002ec1ac70d7942c6011c67f8cd144960",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController}),s("div",{key:"15d907270ecf3d16769cedea39ba279d7ffb0748",class:"d-flex gap-2 justify-content-start"},s(b,{key:"84c09ef594e7fa387e64a09014de81ed713cc765",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(b,{key:"1dafd97aa7b84644c9d011224a152ad7f99ce620",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"f1f31da4d147afcd01ef96acd01d63ee9497dd6b"})))}static get watchers(){return{isLoading:["loadingWatcher"]}}},w=class{constructor(t){e(this,t),this.inputHandler=(e,t)=>{u(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{p(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))},this.ownerDefaultValue=void 0,this.errors=void 0,this.formController=void 0}render(){return s("div",{key:"6fcc165d4bc75b92403d9031ad98f05f6b1dcd34",class:"row gy-3"},s("div",{key:"74f1e42a13892e95497a99684ba9de64719edb72",class:"col-12 col-md-6"},s("form-control-text",{key:"29caea2b0b0a62822cc20c99e697f3db7c22a541",name:"name",label:"Full Name",defaultValue:this.ownerDefaultValue.name,errorText:this.errors.name,inputHandler:this.inputHandler})),s("div",{key:"5b0f8da9a0512de70558baa9cb188b4d5e773dc2",class:"col-12 col-md-4"},s("form-control-text",{key:"5967094f115a64876f8dc943a273f5a22b193f1c",name:"title",label:"Title",defaultValue:this.ownerDefaultValue.title,errorText:this.errors.title,inputHandler:this.inputHandler})),s("div",{key:"6c05fec9b87f8ba5e3be9ce74ef727a1e4b14905",class:"col-12 col-md-6"},s("form-control-text",{key:"8c5b2839b6de605915d8e7c14a0ba22d3f440bda",name:"email",label:"Email Address",defaultValue:this.ownerDefaultValue.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{key:"d7eae882aea84b8562e459e66bc1ba885c4be3c7",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"2d6b33f47e4008745fd65c5ef3cb60dd92b85eba",name:"phone",label:"Phone Number",defaultValue:this.ownerDefaultValue.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:m.US})),s("div",{key:"92b825163aedf052bdb89721397da69c717e595d",class:"col-12 col-md-4"},s("form-control-date",{key:"cd884b773ef0eb60effc61e8cfbf42b21620cd1c",name:"dob_full",label:"Birth Date",defaultValue:this.ownerDefaultValue.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>v(e,this.formController)})),s("div",{key:"614ba65972946645ba5c7a299c00efd0e85abf5e",class:"col-12 col-md-8"},s("form-control-number-masked",{key:"7cd9fe7a1b56d351942a0b962f3c7227459406ae",name:"identification_number",label:"SSN",defaultValue:this.ownerDefaultValue.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:l})),s("div",{key:"ce08f35a16de4b9be65377cde0a9daa5b4cbe876",class:"col-12"},s("justifi-identity-address-form",{key:"79a7f5e8c08fc57383c1975145a6b06bd4e615dd",errors:this.errors.address,defaultValues:this.ownerDefaultValue.address,handleFormUpdate:this.onAddressFormUpdate})))}};export{y as justifi_owner_form,k as owner_form_core,w as owner_form_inputs}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-fad19d75.js";import{P as r}from"./p-47d79529.js";import"./p-56f6ce4c.js";import{P as e}from"./p-df21aaad.js";import"./p-e3fab0e2.js";import{C as o,a}from"./p-14c91ffd.js";import{g as n,a as c}from"./p-8115b2f4.js";import{E as h}from"./p-dce846bf.js";import{J as p}from"./p-8a038cd9.js";import"./p-29c0b182.js";import"./p-7c0002c6.js";const d=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.accountId=void 0,this.authToken=void 0,this.getPayments=void 0,this.errorMessage=null}componentWillLoad(){this.analytics=new p(this),this.initializeGetPayments()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPayments()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:t,authToken:s,service:i})=>async({params:r,onSuccess:a,onError:h})=>{var p,d;try{const m=await i.fetchPayments(t,s,r);if(m.error)return h({error:n(m.error),code:c(null===(d=m.error)||void 0===d?void 0:d.code),severity:o.ERROR});{const t=Object.assign({},m.page_info);a({payments:(null===(p=m.data)||void 0===p?void 0:p.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return h({error:t.message||t,code:s,severity:o.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new r}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}render(){return this.errorMessage?h(this.errorMessage):i("payments-list-core",{getPayments:this.getPayments,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_payments_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as a}from"./p-29c0b182.js";import"./p-56f6ce4c.js";import"./p-df21aaad.js";import"./p-e3fab0e2.js";class t{async fetchPayments(t,e,n){return a({authToken:e,apiOrigin:""}).get(`account/${t}/payments`,n)}async fetchPayment(t,e){const n=`payments/${t}`;return a({authToken:e,apiOrigin:""}).get(n)}}export{t as P}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as o}from"./p-fad19d75.js";import{J as a}from"./p-8a038cd9.js";import"./p-7c0002c6.js";import"./p-29c0b182.js";const r=class{constructor(o){e(this,o),this.bankAccountFormReady=t(this,"bankAccountFormReady",7),this.ready=t(this,"ready",7),this.bankAccountFormTokenized=t(this,"bankAccountFormTokenize",7),this.bankAccountFormValidated=t(this,"bankAccountFormValidate",7),this.validationMode=void 0,this.iframeOrigin="",this.internalStyleOverrides=void 0}readyHandler(e){console.warn("The 'bankAccountFormReady' event is deprecated in the next major release and will be renamed to 'ready'"),this.bankAccountFormReady.emit(e),this.ready.emit(e)}tokenizeHandler(e){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."),this.bankAccountFormTokenized.emit(e)}validateHandler(e){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."),this.bankAccountFormValidated.emit(e)}componentWillLoad(){this.analytics=new a(this)}disconnectedCallback(){this.analytics.cleanup()}async tokenize(...e){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...e)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}async resize(){if(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."),!this.childRef)throw new Error("Cannot call validate");return this.childRef.resize()}render(){return o("justifi-payment-method-form",{key:"646e392c1a9ed38e73780ed6a01b6f019767794c",ref:e=>{e&&(this.childRef=e)},"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"})}};export{r as justifi_bank_account_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as r,h as t}from"./p-fad19d75.js";import{c as i,F as a}from"./p-2eab3c90.js";import{b as e,a as s}from"./p-3fd13ca3.js";import{a as f,i as b,p as c}from"./p-85fc69e5.js";import{A as n}from"./p-29c0b182.js";import"./p-56f6ce4c.js";import"./p-df21aaad.js";import"./p-e3fab0e2.js";import{B as d,a as l}from"./p-d89bad72.js";import{B as m}from"./p-af244664.js";import{J as h}from"./p-8a038cd9.js";import{S as u}from"./p-ba4bae6f.js";import"./p-89887332.js";import"./p-6078a370.js";import"./p-ba5fae28.js";import"./p-1ff8810b.js";import"./p-7c0002c6.js";const j=i(Object.assign(Object.assign({},e().fields),{legal_address:f(),additional_questions:s(),representative:b("representative")})),v=class{constructor(t){o(this,t),this.submitted=r(this,"submitted",7),this.clickEventNew=r(this,"click-event",7),this.clickEventOld=r(this,"clickEvent",7),this.instantiateBusiness=o=>{const r=new m(o);this.formController.setInitialValues(Object.assign({},r))},this.sendData=async()=>{this.isLoading=!0;try{const o=this.formController.values.getValue(),r=this.formController.getInitialValues(),t=c(o,r),i=await this.api.patch(this.businessEndpoint,JSON.stringify(t));this.handleReponse(i)}catch(o){this.errorMessage=d.patchData}finally{this.isLoading=!1}},this.fetchData=async()=>{this.isLoading=!0;try{const o=await this.api.get(this.businessEndpoint);this.instantiateBusiness(o.data)}catch(o){this.errorMessage=d.fetchData}finally{this.isLoading=!1}},this.validateAndSubmit=o=>{o.preventDefault(),this.formController.validateAndSubmit(this.sendData)},this.authToken=void 0,this.businessId=void 0,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.isLoading=!1,this.errorMessage=void 0}componentWillLoad(){this.analytics=new h(this),this.authToken||console.error("Warning: Missing auth-token. The form will not be functional without it."),this.businessId||console.error("Warning: Missing business-id. The form requires an existing business-id to function."),this.formController=new a(j),this.api=n({authToken:this.authToken,apiOrigin:""}),this.fetchData()}disconnectedCallback(){this.analytics.cleanup()}fireClickEvents(o){console.warn("`clickEvent` is deprecated and will be removed in the next major release. Please use `click-event` instead."),this.clickEventNew.emit(o),this.clickEventOld.emit(o)}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isLoading}get businessEndpoint(){return`entities/business/${this.businessId}`}handleReponse(o){o.error&&(this.errorMessage=d.patchData),this.submitted.emit({data:o}),this.instantiateBusiness(o.data)}render(){return t(u,{key:"8fb79d577c13246fcf3ec1ee8460713fee07d01a",exportparts:"label,input,input-invalid"},t("form",{key:"1fe23a8cc8714aee257b6c73c6b7b096d684ea1c",onSubmit:this.validateAndSubmit},t("div",{key:"e501f6963ed5bfd9eb80f67df13108289db6eba7",class:"row gap-3"},t("h1",{key:"f81f22704bda1480c467b872cd3fd309505b0e94"},this.title),t("form-alert",{key:"15b2ff75d4db6447bfd1892542e8e972ede0ac7e",text:this.errorMessage,hideAlert:this.hideErrors}),t("div",{key:"fd6a375fd187426940df3f28262be7aec3fedbe5",class:"col-12 mb-4"},t("justifi-business-core-info",{key:"d16818a2124cb04dd5a5e84ea40639991fb04a80",formController:this.formController})),t("div",{key:"d48b04718cf938484cf65cc956bf798f44ed17a7",class:"col-12 mb-4"},t("justifi-legal-address-form",{key:"3a2bc6babfe8a0a265b2a7f9e7bea1abebd3eb43",formController:this.formController})),t("div",{key:"5c4d5d1fa1e2aba32f42c2bb9e97c0d796ecf709",class:"col-12 mb-4"},t("justifi-additional-questions",{key:"c888fb627380d05302cb106c5642e39b1f2652fa",formController:this.formController})),t("div",{key:"623e94d84976cfe29f4501a781c750d1bb537605",class:"col-12 mb-4"},t("justifi-business-representative",{key:"594c893c0976b58a309679a031f6f1c787e66f48",formController:this.formController})),t("div",{key:"9fbc36ed183b1ebf171da14276092195c7aaf3a9",class:"col-12 d-flex flex-row-reverse"},t("button",{key:"a60da6fdda5193d3c41c589b00b040c05ae425ac",type:"submit",class:"btn btn-primary jfi-submit-button",disabled:this.disabledState,onClick:()=>this.fireClickEvents({name:l.submit})},this.isLoading?"Loading...":"Submit")))))}};v.style=":host{display:block}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){font-family:var(--jfi-layout-font-family);background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-checkbox){font-family:var(--jfi-layout-font-family);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);line-height:var(--jfi-form-control-line-height)}*::part(input-checkbox):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-checkbox-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-checkbox-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}.jfi-submit-button{font-family:var(--jfi-layout-font-family);color:var(--jfi-submit-button-color);background-color:var(--jfi-submit-button-background-color);border-color:var(--jfi-submit-button-border-color);padding:var(--jfi-submit-button-padding);font-size:var(--jfi-submit-button-font-size);border-radius:var(--jfi-submit-button-border-radius);width:var(--jfi-submit-button-width);box-shadow:var(--jfi-submit-button-box-shadow)}.jfi-submit-button:hover{color:var(--jfi-submit-button-color-hover);background-color:var(--jfi-submit-button-background-color-hover);border-color:var(--jfi-submit-button-border-color-hover)}.jfi-submit-button:focus{color:var(--jfi-submit-button-color-focus);background-color:var(--jfi-submit-button-background-color-focus);border-color:var(--jfi-submit-button-border-color-focus)}.btn.jfi-submit-button:active{color:var(--jfi-submit-button-color-active);background-color:var(--jfi-submit-button-background-color-active);border-color:var(--jfi-submit-button-border-color-active)}.btn.jfi-submit-button-loading{min-width:75px;color:var(--jfi-submit-button-color-loading);background-color:var(--jfi-submit-button-background-color-loading);border-color:var(--jfi-submit-button-border-color-loading)}.btn.jfi-submit-button-loading .spinner-border{border-top-color:var(--jfi-submit-button-color-loading);border-bottom-color:var(--jfi-submit-button-color-loading);border-left-color:var(--jfi-submit-button-color-loading)}";export{v as justifi_business_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={name:"@justifi/webcomponents",version:"4.19.2-rc",description:"JustiFi Web Components",collection:"dist/collection/collection-manifest.json",main:"dist/index.cjs.js",module:"dist/module/index.js",types:"dist/module/index.d.ts",repository:{type:"git",url:"git+https://github.com/justifi-tech/web-component-library.git"},homepage:"https://storybook.justifi.ai/?path=/docs/introduction--docs",publishConfig:{registry:"https://registry.npmjs.org"},files:["dist/"],scripts:{build:"stencil build --docs",dev:"stencil build --watch",lint:"eslint . --max-warnings 0",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",generate:"stencil generate",test:"TZ=utc stencil test --spec","test:watch":"TZ=utc stencil test --spec --watchAll","test:file":"stencil test --spec --watch --"},dependencies:{"@stencil/core":"^4.0.5","@stencil/store":"^2.0.8",bootstrap:"^5.2.3","chart.js":"^4.4.1","date-fns":"^2.29.3","dinero.js":"^1.9.1","iframe-resizer":"^4.3.7",imask:"^7.6.0",rxjs:"^7.8.1","ts-dedent":"^2.2.0",uuid:"^9.0.0",yup:"^1.0.0"},devDependencies:{"@babel/preset-env":"^7.21.5","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.5","@rollup/plugin-replace":"^5.0.7","@stencil/sass":"^3.0.1","@types/jest":"27.0.3","@types/react":"^18.0.37","@types/react-dom":"^18.0.11",dotenv:"^16.3.1",jest:"^29.7.0","jest-cli":"^29.7.0","jest-environment-node":"^29.7.0","ts-jest":"^29.1.2"},license:"MIT",gitHead:"507bac1d941eae6e1f56e185ecd9bc9d22637783"};export{e as p}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as i,h as t,H as r}from"./p-fad19d75.js";import{E as e}from"./p-dce846bf.js";import{B as o}from"./p-0e1bc91e.js";import{B as a}from"./p-af244664.js";import{C as n,a as c}from"./p-14c91ffd.js";import{g as d,a as h}from"./p-8115b2f4.js";import{J as p}from"./p-8a038cd9.js";import"./p-29c0b182.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-7c0002c6.js";const m=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.businessId=void 0,this.authToken=void 0,this.errorMessage=void 0,this.getBusiness=void 0}componentWillLoad(){this.analytics=new p(this),this.initializeGetBusiness()}disconnectedCallback(){this.analytics.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:c.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR});this.getBusiness=(({id:s,authToken:i,service:t})=>async({onSuccess:r,onError:e})=>{var o;try{const c=await t.fetchBusiness(s,i);if(c.error)return e({error:d(c.error),code:h(null===(o=c.error)||void 0===o?void 0:o.code),severity:n.ERROR});r({business:new a(c.data)})}catch(s){const i=h(null==s?void 0:s.code);return e({error:s.message||s,code:i,severity:n.ERROR})}})({id:this.businessId,authToken:this.authToken,service:new o})}render(){return t(r,null,this.errorMessage?e(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness}))}};export{m as justifi_business_details}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t}from"./p-7c0002c6.js";import{A as i}from"./p-29c0b182.js";class s{async record(t){return i({apiOrigin:""}).post("analytics",JSON.stringify(t))}}class e{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},this.service=new s,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents()}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submitted","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(i=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:i.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}export{e as J}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-fad19d75.js";import{A as s}from"./p-29c0b182.js";import"./p-56f6ce4c.js";import"./p-df21aaad.js";import"./p-e3fab0e2.js";import{g as r,a as o}from"./p-8115b2f4.js";import{C as a,a as n}from"./p-14c91ffd.js";import{J as d}from"./p-8a038cd9.js";import"./p-7c0002c6.js";class c{async fetchQuote(t,i){return s({authToken:t,apiOrigin:""}).post("insurance/quotes",JSON.stringify(i))}async toggleCoverage(t,i,e){const r=`insurance/quotes/${i}/toggle`;return s({authToken:t,apiOrigin:""}).post(r,JSON.stringify(e))}}const h=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event",7),this.authToken=void 0,this.checkoutId=void 0,this.primaryIdentityFirstName=void 0,this.primaryIdentityLastName=void 0,this.primaryIdentityState=void 0,this.primaryIdentityPostalCode=void 0,this.primaryIdentityCountry=void 0,this.primaryIdentityEmailAddress=void 0,this.policyAttributesInsurableAmount=void 0,this.policyAttributesStartDate=void 0,this.policyAttributesEndDate=void 0,this.coveredIdentityFirstName=void 0,this.coveredIdentityLastName=void 0,this.getQuote=void 0,this.toggleCoverage=void 0,this.quote=void 0}async validate(){return this.seasonInterruptionCoreRef.validate()}componentWillLoad(){this.analytics=new d(this),this.initializeServiceMethods()}disconnectedCallback(){this.analytics.cleanup()}initializeServiceMethods(){this.authToken?(this.getQuote=(({authToken:t,service:i})=>async({payload:e,onSuccess:s,onError:n})=>{var d;try{const c=await i.fetchQuote(t,e);if(c.error)return n({error:r(c.error),code:o(null===(d=c.error)||void 0===d?void 0:d.code),severity:a.ERROR});s({quote:c.data})}catch(t){const i=o(null==t?void 0:t.code);return n({error:t.message||t,code:i,severity:a.ERROR})}})({authToken:this.authToken,service:new c}),this.toggleCoverage=(({authToken:t,service:i})=>async({quoteId:e,payload:s,onSuccess:n,onError:d})=>{var c;try{const h=await i.toggleCoverage(t,e,s);if(h.error)return d({error:r(h.error),code:o(null===(c=h.error)||void 0===c?void 0:c.code),severity:a.ERROR});n({quote:h.data})}catch(t){const i=o(null==t?void 0:t.code);return d({error:t.message||t,code:i,severity:a.ERROR})}})({authToken:this.authToken,service:new c})):this.errorEvent.emit({errorCode:n.MISSING_PROPS,message:"Missing authToken",severity:a.ERROR})}render(){return e("justifi-season-interruption-insurance-core",{key:"256d45d39c5d297abb7f955229b0e0e9fbc9504a",ref:t=>this.seasonInterruptionCoreRef=t,"checkout-id":this.checkoutId,getQuote:this.getQuote,toggleCoverage:this.toggleCoverage,"primary-identity-first-name":this.primaryIdentityFirstName,"primary-identity-last-name":this.primaryIdentityLastName,"primary-identity-state":this.primaryIdentityState,"primary-identity-postal-code":this.primaryIdentityPostalCode,"primary-identity-country":this.primaryIdentityCountry,"primary-identity-email-address":this.primaryIdentityEmailAddress,"policy-attributes-insurable-amount":this.policyAttributesInsurableAmount,"policy-attributes-start-date":this.policyAttributesStartDate,"policy-attributes-end-date":this.policyAttributesEndDate,"covered-identity-first-name":this.coveredIdentityFirstName,"covered-identity-last-name":this.coveredIdentityLastName})}};export{h as justifi_season_interruption_insurance}
|