@justifi/webcomponents 5.3.0 → 5.3.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.
- package/dist/cjs/{Api-b0e4be29.js → Api-089e7501.js} +1 -0
- package/dist/cjs/bank-account-form_9.cjs.entry.js +10 -6
- package/dist/cjs/billing-form_3.cjs.entry.js +2 -2
- package/dist/cjs/{business-additional-questions-schema-2f66f025.js → business-additional-questions-schema-2cc0c6f7.js} +1 -1
- package/dist/cjs/{business-identity-schema-be495474.js → business-identity-schema-7d462eb3.js} +1 -1
- package/dist/cjs/{business.service-d575b515.js → business.service-33d7c7f2.js} +1 -1
- package/dist/cjs/{check-pkg-version-1658df6f.js → check-pkg-version-fe4c6467.js} +2 -2
- package/dist/cjs/{checkout.service-057b5a7a.js → checkout.service-d9047ddb.js} +1 -1
- package/dist/cjs/{dispute.service-df9e1830.js → dispute.service-739631c7.js} +1 -1
- package/dist/cjs/{get-payout-csv-527a238c.js → get-payout-csv-bdaff21b.js} +1 -1
- package/dist/cjs/{get-subaccounts-6068c1aa.js → get-subaccounts-2db9fc01.js} +1 -1
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +3 -3
- package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +6 -6
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +7 -6
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +4 -4
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +4 -4
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +19 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-06419e54.js → package-8b04bef0.js} +1 -1
- package/dist/cjs/{payment.service-3eebfe3e.js → payment.service-87924c1a.js} +1 -1
- package/dist/cjs/{schema-validations-cc4e6071.js → schema-validations-f948158d.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/business-forms/schemas/schema-validations.js +1 -1
- package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +25 -1
- package/dist/collection/components/checkout/card-form/card-form.js +25 -1
- package/dist/collection/components/checkout/checkout-core.js +20 -2
- package/dist/collection/components/checkout/checkout.js +22 -2
- package/dist/collection/components/checkout/new-payment-method.js +20 -2
- package/dist/collection/components/checkout/payment-method-options.js +20 -2
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +44 -18
- package/dist/config.js +1 -0
- package/dist/docs.json +176 -20
- package/dist/esm/{Api-0cac5b8a.js → Api-97801a4b.js} +1 -0
- package/dist/esm/bank-account-form_9.entry.js +10 -6
- package/dist/esm/billing-form_3.entry.js +2 -2
- package/dist/esm/{business-additional-questions-schema-212a96ed.js → business-additional-questions-schema-60e9b76a.js} +1 -1
- package/dist/esm/{business-identity-schema-05bd2a5f.js → business-identity-schema-191d85c2.js} +1 -1
- package/dist/esm/{business.service-6a208f8f.js → business.service-45c7df3c.js} +1 -1
- package/dist/esm/{check-pkg-version-bac7eb5e.js → check-pkg-version-e2273f4f.js} +2 -2
- package/dist/esm/{checkout.service-ac067baa.js → checkout.service-36e3355e.js} +1 -1
- package/dist/esm/{dispute.service-26a788a8.js → dispute.service-9b9b87e5.js} +1 -1
- package/dist/esm/{get-payout-csv-684fece6.js → get-payout-csv-80210301.js} +1 -1
- package/dist/esm/{get-subaccounts-b1bed757.js → get-subaccounts-d3eeb85d.js} +1 -1
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +4 -4
- package/dist/esm/justifi-business-form.entry.js +6 -6
- package/dist/esm/justifi-checkout-core.entry.js +3 -2
- package/dist/esm/justifi-checkout.entry.js +7 -6
- package/dist/esm/justifi-checkouts-list.entry.js +5 -5
- package/dist/esm/justifi-dispute-management.entry.js +4 -4
- package/dist/esm/justifi-dispute-notification_3.entry.js +4 -4
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
- package/dist/esm/justifi-owner-form_3.entry.js +4 -4
- package/dist/esm/justifi-payment-details.entry.js +4 -4
- package/dist/esm/justifi-payment-provisioning.entry.js +4 -4
- package/dist/esm/justifi-payments-list.entry.js +4 -4
- package/dist/esm/justifi-payout-details.entry.js +4 -4
- package/dist/esm/justifi-payouts-list.entry.js +5 -5
- package/dist/esm/justifi-refund-form.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
- package/dist/esm/justifi-terminals-list.entry.js +4 -4
- package/dist/esm/justifi-tokenize-payment-method.entry.js +19 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-90ebd343.js → package-a8e8f775.js} +1 -1
- package/dist/esm/{payment.service-2e418da1.js → payment.service-c847c1f6.js} +1 -1
- package/dist/esm/{schema-validations-ccea6a06.js → schema-validations-38e8bc7b.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/bank-account-form2.js +3 -1
- package/dist/module/card-form2.js +3 -1
- package/dist/module/checkout-core.js +4 -2
- package/dist/module/config.js +1 -0
- package/dist/module/justifi-checkout.js +5 -2
- package/dist/module/justifi-tokenize-payment-method.js +17 -8
- package/dist/module/new-payment-method.js +4 -2
- package/dist/module/package.js +1 -1
- package/dist/module/payment-method-options.js +4 -2
- package/dist/module/schema-validations.js +1 -1
- package/dist/types/components/checkout/bank-account-form/bank-account-form.d.ts +1 -0
- package/dist/types/components/checkout/card-form/card-form.d.ts +1 -0
- package/dist/types/components/checkout/checkout-core.d.ts +1 -0
- package/dist/types/components/checkout/checkout.d.ts +1 -0
- package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
- package/dist/types/components/checkout/payment-method-options.d.ts +1 -0
- package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +5 -3
- package/dist/types/components.d.ts +24 -12
- package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +1 -0
- package/dist/webcomponents/p-02d36485.entry.js +1 -0
- package/dist/webcomponents/p-1820fd87.entry.js +1 -0
- package/dist/webcomponents/{p-d07c45e6.entry.js → p-1882d7d6.entry.js} +1 -1
- package/dist/webcomponents/{p-e0db920c.entry.js → p-25c9c88c.entry.js} +1 -1
- package/dist/webcomponents/{p-f5925b1e.entry.js → p-2710884e.entry.js} +1 -1
- package/dist/webcomponents/{p-de13f23c.js → p-27c8ffa2.js} +1 -1
- package/dist/webcomponents/{p-865733bc.js → p-35b00a0d.js} +1 -1
- package/dist/webcomponents/{p-c5ce98b0.entry.js → p-39696abd.entry.js} +1 -1
- package/dist/webcomponents/{p-f9728478.entry.js → p-40eabfca.entry.js} +1 -1
- package/dist/webcomponents/p-4810f227.entry.js +1 -0
- package/dist/webcomponents/{p-ed17e472.entry.js → p-485814d8.entry.js} +1 -1
- package/dist/webcomponents/p-4bad3621.js +1 -0
- package/dist/webcomponents/p-57206dc4.entry.js +1 -0
- package/dist/webcomponents/{p-3d5c8a98.entry.js → p-63a8b08f.entry.js} +1 -1
- package/dist/webcomponents/p-67b75e01.entry.js +1 -0
- package/dist/webcomponents/{p-21cf557e.entry.js → p-68bf1a1d.entry.js} +1 -1
- package/dist/webcomponents/{p-a263a3db.entry.js → p-72992c97.entry.js} +1 -1
- package/dist/webcomponents/{p-0277c1b2.js → p-849c68e5.js} +1 -1
- package/dist/webcomponents/{p-2a136295.js → p-933537ca.js} +1 -1
- package/dist/webcomponents/{p-c470a150.js → p-960a8ec2.js} +1 -1
- package/dist/webcomponents/{p-f706d70e.js → p-a2076a0e.js} +1 -1
- package/dist/webcomponents/p-a47c14cb.entry.js +1 -0
- package/dist/webcomponents/p-b01405ab.entry.js +1 -0
- package/dist/webcomponents/{p-c5c03d88.js → p-b0b40bcd.js} +1 -1
- package/dist/webcomponents/p-b15ad5df.js +1 -0
- package/dist/webcomponents/{p-42047b14.entry.js → p-b2209632.entry.js} +1 -1
- package/dist/webcomponents/{p-c845cb7a.js → p-b2edb944.js} +1 -1
- package/dist/webcomponents/{p-9235b94e.entry.js → p-c75481bf.entry.js} +1 -1
- package/dist/webcomponents/{p-cc4adf97.js → p-dd867d1f.js} +1 -1
- package/dist/webcomponents/{p-abb46c6b.entry.js → p-e22df884.entry.js} +1 -1
- package/dist/webcomponents/{p-3c0b56cd.entry.js → p-e8d0f978.entry.js} +1 -1
- package/dist/webcomponents/{p-f9ac523e.entry.js → p-fbe16023.entry.js} +1 -1
- package/dist/webcomponents/p-fdbcd486.js +1 -0
- package/dist/webcomponents/{p-f1e01bab.entry.js → p-ff955a18.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-0ef9eae6.entry.js +0 -1
- package/dist/webcomponents/p-2d801915.js +0 -1
- package/dist/webcomponents/p-56addd0a.entry.js +0 -1
- package/dist/webcomponents/p-631d54a2.entry.js +0 -1
- package/dist/webcomponents/p-6b0bec46.entry.js +0 -1
- package/dist/webcomponents/p-cdb7fa19.entry.js +0 -1
- package/dist/webcomponents/p-ea105de3.js +0 -1
- package/dist/webcomponents/p-ea5cf135.entry.js +0 -1
- package/dist/webcomponents/p-f9d63d9d.js +0 -1
- package/dist/webcomponents/p-fe0d245f.entry.js +0 -1
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { IAdditionalQuestions, IAddress, IBusiness } from "./api/Business";
|
|
9
|
-
import { ComponentErrorEvent as ComponentErrorEvent1, ComponentFormStepCompleteEvent as ComponentFormStepCompleteEvent1, FileSelectEvent, IApiResponse, IBnpl, ILoadedEventResponse } from "./api";
|
|
9
|
+
import { ComponentErrorCodes, ComponentErrorEvent as ComponentErrorEvent1, ComponentFormStepCompleteEvent as ComponentFormStepCompleteEvent1, ComponentSubmitEvent as ComponentSubmitEvent1, FileSelectEvent, IApiResponse, IBnpl, ILoadedEventResponse } from "./api";
|
|
10
10
|
import { BillingFormFields, PostalFormFields } from "./components/billing-forms/billing-form-schema";
|
|
11
11
|
import { ComponentClickEvent, ComponentErrorEvent, ComponentFormStepCompleteEvent, ComponentSubmitEvent } from "./api/ComponentEvents";
|
|
12
12
|
import { Placement, PositioningStrategy } from "@popperjs/core";
|
|
13
13
|
import { EntityDocumentType, FileSelectEvent as FileSelectEvent1 } from "./api/Document";
|
|
14
|
-
import {
|
|
14
|
+
import { FormController } from "./components";
|
|
15
15
|
import { DisputeEvidenceDocument } from "./api/DisputeEvidenceDocument";
|
|
16
16
|
import { DisputeResponseFormStep } from "./components/dispute-management/dispute-response/dispute-response-form-types";
|
|
17
17
|
import { FormController as FormController1 } from "./ui-components/form/form";
|
|
@@ -20,16 +20,15 @@ import { Dispute, IDispute } from "./api/Dispute";
|
|
|
20
20
|
import { PaymentMethodOption } from "./components/checkout/payment-method-option-utils";
|
|
21
21
|
import { PaymentMethodPayload } from "./components/checkout/payment-method-payload";
|
|
22
22
|
import { RefundFormFields } from "./components/refund-form/refund-form-schema";
|
|
23
|
-
import { ComponentErrorCodes } from "./api/ComponentError";
|
|
24
23
|
import { Identity } from "./api/Identity";
|
|
25
24
|
import { PaginationProps } from "./components/pagination-menu/pagination-menu";
|
|
26
25
|
export { IAdditionalQuestions, IAddress, IBusiness } from "./api/Business";
|
|
27
|
-
export { ComponentErrorEvent as ComponentErrorEvent1, ComponentFormStepCompleteEvent as ComponentFormStepCompleteEvent1, FileSelectEvent, IApiResponse, IBnpl, ILoadedEventResponse } from "./api";
|
|
26
|
+
export { ComponentErrorCodes, ComponentErrorEvent as ComponentErrorEvent1, ComponentFormStepCompleteEvent as ComponentFormStepCompleteEvent1, ComponentSubmitEvent as ComponentSubmitEvent1, FileSelectEvent, IApiResponse, IBnpl, ILoadedEventResponse } from "./api";
|
|
28
27
|
export { BillingFormFields, PostalFormFields } from "./components/billing-forms/billing-form-schema";
|
|
29
28
|
export { ComponentClickEvent, ComponentErrorEvent, ComponentFormStepCompleteEvent, ComponentSubmitEvent } from "./api/ComponentEvents";
|
|
30
29
|
export { Placement, PositioningStrategy } from "@popperjs/core";
|
|
31
30
|
export { EntityDocumentType, FileSelectEvent as FileSelectEvent1 } from "./api/Document";
|
|
32
|
-
export {
|
|
31
|
+
export { FormController } from "./components";
|
|
33
32
|
export { DisputeEvidenceDocument } from "./api/DisputeEvidenceDocument";
|
|
34
33
|
export { DisputeResponseFormStep } from "./components/dispute-management/dispute-response/dispute-response-form-types";
|
|
35
34
|
export { FormController as FormController1 } from "./ui-components/form/form";
|
|
@@ -38,7 +37,6 @@ export { Dispute, IDispute } from "./api/Dispute";
|
|
|
38
37
|
export { PaymentMethodOption } from "./components/checkout/payment-method-option-utils";
|
|
39
38
|
export { PaymentMethodPayload } from "./components/checkout/payment-method-payload";
|
|
40
39
|
export { RefundFormFields } from "./components/refund-form/refund-form-schema";
|
|
41
|
-
export { ComponentErrorCodes } from "./api/ComponentError";
|
|
42
40
|
export { Identity } from "./api/Identity";
|
|
43
41
|
export { PaginationProps } from "./components/pagination-menu/pagination-menu";
|
|
44
42
|
export namespace Components {
|
|
@@ -51,6 +49,7 @@ export namespace Components {
|
|
|
51
49
|
"storeFiles": (e: CustomEvent<FileSelectEvent>) => void;
|
|
52
50
|
}
|
|
53
51
|
interface BankAccountForm {
|
|
52
|
+
"iframeOrigin": string;
|
|
54
53
|
"tokenize": (clientId: string, paymentMethodMetadata: any, account?: string) => Promise<any>;
|
|
55
54
|
"validate": () => Promise<any>;
|
|
56
55
|
}
|
|
@@ -77,6 +76,7 @@ export namespace Components {
|
|
|
77
76
|
"isLoading": boolean;
|
|
78
77
|
}
|
|
79
78
|
interface CardForm {
|
|
79
|
+
"iframeOrigin": string;
|
|
80
80
|
"tokenize": (clientId: string, paymentMethodMetadata: any, account?: string) => Promise<any>;
|
|
81
81
|
"validate": () => Promise<any>;
|
|
82
82
|
}
|
|
@@ -357,6 +357,7 @@ export namespace Components {
|
|
|
357
357
|
"disablePaymentMethodGroup"?: boolean;
|
|
358
358
|
"fillBillingForm": (fields: BillingFormFields | PostalFormFields) => Promise<void>;
|
|
359
359
|
"hideCardBillingForm"?: boolean;
|
|
360
|
+
"iframeOrigin"?: string;
|
|
360
361
|
}
|
|
361
362
|
interface JustifiCheckoutCore {
|
|
362
363
|
"authToken": string;
|
|
@@ -369,6 +370,7 @@ export namespace Components {
|
|
|
369
370
|
"fillBillingForm": (fields: BillingFormFields | PostalFormFields) => Promise<void>;
|
|
370
371
|
"getCheckout": Function;
|
|
371
372
|
"hideCardBillingForm"?: boolean;
|
|
373
|
+
"iframeOrigin": string;
|
|
372
374
|
}
|
|
373
375
|
interface JustifiCheckoutsList {
|
|
374
376
|
"accountId": string;
|
|
@@ -461,6 +463,7 @@ export namespace Components {
|
|
|
461
463
|
"authToken": string;
|
|
462
464
|
"fillBillingForm": (fields: BillingFormFields | PostalFormFields) => Promise<void>;
|
|
463
465
|
"hideCardBillingForm"?: boolean;
|
|
466
|
+
"iframeOrigin": string;
|
|
464
467
|
"isSelected": boolean;
|
|
465
468
|
"paymentMethodGroupId"?: string;
|
|
466
469
|
"paymentMethodOption": PaymentMethodOption;
|
|
@@ -488,6 +491,7 @@ export namespace Components {
|
|
|
488
491
|
"bnpl": IBnpl;
|
|
489
492
|
"fillBillingForm": (fields: BillingFormFields | PostalFormFields) => Promise<void>;
|
|
490
493
|
"hideCardBillingForm"?: boolean;
|
|
494
|
+
"iframeOrigin": string;
|
|
491
495
|
"insuranceToggled": boolean;
|
|
492
496
|
"paymentAmount": number;
|
|
493
497
|
"paymentMethodGroupId"?: string;
|
|
@@ -653,12 +657,13 @@ export namespace Components {
|
|
|
653
657
|
"authToken": string;
|
|
654
658
|
"disableBankAccount"?: boolean;
|
|
655
659
|
"disableCreditCard"?: boolean;
|
|
656
|
-
"fillBillingForm": (fields:
|
|
660
|
+
"fillBillingForm": (fields: BillingFormFields) => Promise<void>;
|
|
657
661
|
"hideCardBillingForm"?: boolean;
|
|
658
662
|
"hideSubmitButton"?: boolean;
|
|
663
|
+
"iframeOrigin"?: string;
|
|
659
664
|
"paymentMethodGroupId": string;
|
|
660
665
|
"submitButtonText": string;
|
|
661
|
-
"tokenizePaymentMethod": (event?: CustomEvent) => Promise<
|
|
666
|
+
"tokenizePaymentMethod": (event?: CustomEvent) => Promise<PaymentMethodPayload>;
|
|
662
667
|
}
|
|
663
668
|
interface LegalAddressDetails {
|
|
664
669
|
"legalAddress": IAddress;
|
|
@@ -2156,8 +2161,8 @@ declare global {
|
|
|
2156
2161
|
new (): HTMLJustifiTerminalsListFiltersElement;
|
|
2157
2162
|
};
|
|
2158
2163
|
interface HTMLJustifiTokenizePaymentMethodElementEventMap {
|
|
2159
|
-
"error-event":
|
|
2160
|
-
"submit-event":
|
|
2164
|
+
"error-event": ComponentErrorEvent1;
|
|
2165
|
+
"submit-event": ComponentSubmitEvent1;
|
|
2161
2166
|
}
|
|
2162
2167
|
interface HTMLJustifiTokenizePaymentMethodElement extends Components.JustifiTokenizePaymentMethod, HTMLStencilElement {
|
|
2163
2168
|
addEventListener<K extends keyof HTMLJustifiTokenizePaymentMethodElementEventMap>(type: K, listener: (this: HTMLJustifiTokenizePaymentMethodElement, ev: JustifiTokenizePaymentMethodCustomEvent<HTMLJustifiTokenizePaymentMethodElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -2440,6 +2445,7 @@ declare namespace LocalJSX {
|
|
|
2440
2445
|
"storeFiles"?: (e: CustomEvent<FileSelectEvent>) => void;
|
|
2441
2446
|
}
|
|
2442
2447
|
interface BankAccountForm {
|
|
2448
|
+
"iframeOrigin"?: string;
|
|
2443
2449
|
}
|
|
2444
2450
|
interface BankAccountFormInputs {
|
|
2445
2451
|
"defaultValue"?: any;
|
|
@@ -2462,6 +2468,7 @@ declare namespace LocalJSX {
|
|
|
2462
2468
|
"isLoading"?: boolean;
|
|
2463
2469
|
}
|
|
2464
2470
|
interface CardForm {
|
|
2471
|
+
"iframeOrigin"?: string;
|
|
2465
2472
|
}
|
|
2466
2473
|
interface CheckoutsListCore {
|
|
2467
2474
|
"columns"?: string;
|
|
@@ -2777,6 +2784,7 @@ declare namespace LocalJSX {
|
|
|
2777
2784
|
"disableCreditCard"?: boolean;
|
|
2778
2785
|
"disablePaymentMethodGroup"?: boolean;
|
|
2779
2786
|
"hideCardBillingForm"?: boolean;
|
|
2787
|
+
"iframeOrigin"?: string;
|
|
2780
2788
|
"onError-event"?: (event: JustifiCheckoutCustomEvent<ComponentErrorEvent>) => void;
|
|
2781
2789
|
"onLoaded"?: (event: JustifiCheckoutCustomEvent<ILoadedEventResponse>) => void;
|
|
2782
2790
|
}
|
|
@@ -2790,6 +2798,7 @@ declare namespace LocalJSX {
|
|
|
2790
2798
|
"disablePaymentMethodGroup"?: boolean;
|
|
2791
2799
|
"getCheckout"?: Function;
|
|
2792
2800
|
"hideCardBillingForm"?: boolean;
|
|
2801
|
+
"iframeOrigin"?: string;
|
|
2793
2802
|
"onError-event"?: (event: JustifiCheckoutCoreCustomEvent<ComponentErrorEvent>) => void;
|
|
2794
2803
|
"onLoaded"?: (event: JustifiCheckoutCoreCustomEvent<ILoadedEventResponse1>) => void;
|
|
2795
2804
|
"onSubmit-event"?: (event: JustifiCheckoutCoreCustomEvent<ComponentSubmitEvent>) => void;
|
|
@@ -2895,6 +2904,7 @@ declare namespace LocalJSX {
|
|
|
2895
2904
|
"accountId"?: string;
|
|
2896
2905
|
"authToken"?: string;
|
|
2897
2906
|
"hideCardBillingForm"?: boolean;
|
|
2907
|
+
"iframeOrigin"?: string;
|
|
2898
2908
|
"isSelected"?: boolean;
|
|
2899
2909
|
"onPaymentMethodOptionSelected"?: (event: JustifiNewPaymentMethodCustomEvent<any>) => void;
|
|
2900
2910
|
"paymentMethodGroupId"?: string;
|
|
@@ -2920,6 +2930,7 @@ declare namespace LocalJSX {
|
|
|
2920
2930
|
"authToken"?: string;
|
|
2921
2931
|
"bnpl"?: IBnpl;
|
|
2922
2932
|
"hideCardBillingForm"?: boolean;
|
|
2933
|
+
"iframeOrigin"?: string;
|
|
2923
2934
|
"insuranceToggled"?: boolean;
|
|
2924
2935
|
"paymentAmount"?: number;
|
|
2925
2936
|
"paymentMethodGroupId"?: string;
|
|
@@ -3097,8 +3108,9 @@ declare namespace LocalJSX {
|
|
|
3097
3108
|
"disableCreditCard"?: boolean;
|
|
3098
3109
|
"hideCardBillingForm"?: boolean;
|
|
3099
3110
|
"hideSubmitButton"?: boolean;
|
|
3100
|
-
"
|
|
3101
|
-
"
|
|
3111
|
+
"iframeOrigin"?: string;
|
|
3112
|
+
"onError-event"?: (event: JustifiTokenizePaymentMethodCustomEvent<ComponentErrorEvent1>) => void;
|
|
3113
|
+
"onSubmit-event"?: (event: JustifiTokenizePaymentMethodCustomEvent<ComponentSubmitEvent1>) => void;
|
|
3102
3114
|
"paymentMethodGroupId"?: string;
|
|
3103
3115
|
"submitButtonText"?: string;
|
|
3104
3116
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s,r as i,c as t}from"./p-2783e363.js";import{c as o,F as e}from"./p-5844a0f0.js";import{b as r,a}from"./p-b0b40bcd.js";import{a as h,i as n}from"./p-849c68e5.js";import{A as l,c}from"./p-4bad3621.js";import"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{B as p,a as m}from"./p-275f2154.js";import{c as d,J as f}from"./p-933537ca.js";import{B as b}from"./p-298e290e.js";import{S as j}from"./p-bfe9748b.js";import{H as u}from"./p-1603fe4d.js";import{S as v}from"./p-aa02cf71.js";import{B as w}from"./p-73f9be7c.js";import"./p-27c8ffa2.js";import"./p-6078a370.js";import"./p-0ea387a2.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-1ff8810b.js";import"./p-b2edb944.js";import"./p-d8c04275.js";const g=o(Object.assign(Object.assign({},r().fields),{legal_address:h(),additional_questions:a(),representative:n("representative")})),x=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(v,{width:"25%"})),s("div",{class:"col-12"},s(v,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(v,{width:"50%"}),s(v,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(v,{width:"65%"}),s(v,{width:"35%"}))),y=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(v,{width:"40%",height:"40px"})),s(x,null),s(x,null),s(x,null)),C=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event",7),this.clickEvent=t(this,"click-event",7),this.instantiateBusiness=s=>{const i=new p(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;try{const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new p(Object.assign(Object.assign({},i),s)).payload,o=await this.api.patch(this.businessEndpoint,t);this.handleReponse(o)}catch(s){this.errorMessage=m.patchData}finally{this.isSaving=!1}},this.fetchData=async()=>{this.isLoading=!0;try{const s=await this.api.get(this.businessEndpoint);this.instantiateBusiness(s.data)}catch(s){this.errorMessage=m.fetchData}finally{this.isLoading=!1}},this.validateAndSubmit=s=>{s.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.isSaving=!1,this.errorMessage=void 0}componentWillLoad(){d(),this.analytics=new f(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 e(g),this.api=l({authToken:this.authToken,apiOrigin:c.proxyApiOrigin}),this.fetchData()}disconnectedCallback(){this.analytics.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}handleReponse(s){s.error&&(this.errorMessage=m.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(j,null,this.isLoading?s(y,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(u,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(b,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:w.submit}),isLoading:this.isSaving},"Submit")))))}};export{C as justifi_business_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as i,h as t}from"./p-2783e363.js";import{f as e}from"./p-2ca5b5e4.js";import{C as d}from"./p-7c31ec70.js";import{C as o}from"./p-14c91ffd.js";import{i as a,v as c,H as r,a as h}from"./p-f694e1c8.js";import{B as n}from"./p-298e290e.js";import{S as l}from"./p-bfe9748b.js";import{t as v,K as f}from"./p-d8c04275.js";import{S as m}from"./p-aa02cf71.js";import{H as p}from"./p-d0bde1cb.js";import"./p-f20b6ce1.js";const u=class{constructor(t){s(this,t),this.submitEvent=i(this,"submit-event",7),this.errorEvent=i(this,"error-event",7),this.loaded=i(this,"loaded",7),this.completeCheckout=async s=>{this.complete({payment:s,onSuccess:this.onSubmitted,onError:this.onError})},this.onSubmitted=s=>{this.submitEvent.emit({response:s}),this.renderState="success"},this.onError=({error:s,code:i,severity:t})=>{this.serverError=s,this.errorEvent.emit({errorCode:i,message:s,severity:t}),this.renderState="error"},this.authToken=void 0,this.getCheckout=void 0,this.complete=void 0,this.checkoutId=void 0,this.iframeOrigin=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.disableBnpl=void 0,this.disablePaymentMethodGroup=void 0,this.hideCardBillingForm=void 0,this.hasLoadedFonts=!1,this.checkout=void 0,this.serverError=void 0,this.renderState="loading",this.creatingNewPaymentMethod=!1,this.insuranceToggled=!1}async fillBillingForm(s){this.paymentMethodOptionsRef.fillBillingForm(s)}componentWillLoad(){this.getCheckout&&(this.fetchData(),a("set",(s=>{const i=h[s];void 0!==i&&(this.insuranceToggled=i,this.fetchData())})))}fetchData(){this.renderState="loading",this.getCheckout({onSuccess:({checkout:s})=>{this.checkout=new d(s);const{status:i}=this.checkout;this.loaded.emit({checkout_status:i}),this.renderState="success"},onError:({error:s,code:i,severity:t})=>{this.serverError=s,this.renderState="error",this.errorEvent.emit({errorCode:i,message:s,severity:t})}})}async submit(s){var i;s.preventDefault(),this.renderState="loading";const t=c(),e=await this.paymentMethodOptionsRef.resolvePaymentMethod(t);e.validationError?this.renderState="error":e.error?(this.renderState="error",this.serverError=e.error.message,this.onError({code:e.error.code,error:e.error.message,severity:o.ERROR})):e.token?this.completeCheckout({payment_mode:"ecom",payment_token:e.token}):"success"===(null===(i=e.bnpl)||void 0===i?void 0:i.status)?this.completeCheckout({payment_mode:"bnpl"}):this.renderState="error"}get isLoading(){return"loading"===this.renderState}get isError(){return"error"===this.renderState}get paymentType(){var s,i,e,d,o;return t("section",null,t("div",{class:!this.isLoading&&"visually-hidden"},t(m,{height:"300px"})),t("div",{class:this.isLoading&&"visually-hidden"},t("justifi-payment-method-options",{ref:s=>this.paymentMethodOptionsRef=s,"show-card":!this.disableCreditCard,"show-ach":!this.disableBankAccount,"show-bnpl":!this.disableBnpl,paymentMethodGroupId:null===(s=this.checkout)||void 0===s?void 0:s.payment_method_group_id,"show-saved-payment-methods":!this.disablePaymentMethodGroup,hideCardBillingForm:this.hideCardBillingForm,bnpl:null===(i=this.checkout)||void 0===i?void 0:i.bnpl,authToken:this.authToken,"account-id":null===(e=this.checkout)||void 0===e?void 0:e.account_id,savedPaymentMethods:(null===(d=this.checkout)||void 0===d?void 0:d.payment_methods)||[],paymentAmount:null===(o=this.checkout)||void 0===o?void 0:o.payment_amount,insuranceToggled:this.insuranceToggled,iframeOrigin:this.iframeOrigin})))}get summary(){var s,i;return t("section",null,t("div",{class:!this.isLoading&&"visually-hidden"},t(m,{height:"24px"})),t("div",{class:this.isLoading&&"visually-hidden"},t("div",{part:v},null===(s=this.checkout)||void 0===s?void 0:s.payment_description),t("div",null,t("span",{part:v},"Total")," ",t("span",{part:v},e(+(null===(i=this.checkout)||void 0===i?void 0:i.total_amount))))))}render(){return t(l,{key:"8f7bb796cec8a51b3a871ecc6f1d040636103503"},t("div",{key:"f616c1705dd8d9da854b496d5b028cebb4c88ce5",class:"row gy-3 jfi-checkout-core"},t("div",{key:"e374110371f020c9de996f4ca3932f7535e208ee",class:"col-12",part:f},t(r,{key:"aa9227b3ff49dc43c6a42d1988ec0669b298cef0",text:"Summary",class:"fs-5 fw-bold pb-3"}),this.summary),t("div",{key:"e8e9cddcc4cb11c6d7c020c1dc18d7b5bfe457c3",class:"col-12"},t("slot",{key:"69e623e8c23aec6f49430b395f86d7134ceeddc9",name:"insurance"})),t("div",{key:"fea072a50acb658433a36d8234b27c1fd8415dc4",class:"col-12 mt-4"},t(r,{key:"9b0a5c9e5e7db31a6d6cfda87cad18786d638bd9",text:"Payment",class:"fs-5 fw-bold pb-3"}),t(p,{key:"2eeae1935b2b238573be4bf1edfc5d80700d9c80",text:"Select payment type",class:"fs-6 fw-bold lh-lg"}),t("div",{key:"5c9fd0558a37ff903ec7137beeb3c49d406bcd1d",class:"d-flex flex-column"},this.paymentType)),t("div",{key:"2538670c227dc2e96c43d878ae09357a72a7e267",class:"col-12"},t("div",{key:"b51e39da64972578815a2cf0cf5342d292edaa45",class:"d-flex justify-content-end"},t(n,{key:"abcb099a4ad152a38d05d99781e02292efd246e0",type:"submit",variant:"primary",onClick:s=>this.submit(s),disabled:this.isLoading,isLoading:this.isLoading,style:{width:"100%"}},"Pay")))))}};export{u as justifi_checkout_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s,r as t,c as e}from"./p-2783e363.js";import{a as i,b as r}from"./p-c5c03d88.js";import{F as o,c as n}from"./p-5844a0f0.js";import{A as a,C as l,R as h,c}from"./p-275f2154.js";import{C as d,P as u}from"./p-525db3e8.js";import{h as m}from"./p-d8c04275.js";import{S as p}from"./p-aa02cf71.js";import{a as v,r as f,s as b,b as y}from"./p-0ea387a2.js";import{a as g,B as w}from"./p-73f9be7c.js";import{z as _,A as x,u as j,B as S,C as T,D as O,E as k,F as C}from"./p-de13f23c.js";import{a as L,C as H}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import{a as E,b as D}from"./p-61f0a2ce.js";import{n as V}from"./p-e3c22aa9.js";import{B as A}from"./p-298e290e.js";import{i as P,a as B}from"./p-0277c1b2.js";import{S as I}from"./p-6078a370.js";import"./p-1ff8810b.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";class W{constructor(s){this.id=s.id,this.account_owner_name=s.account_owner_name,this.full_name=s.full_name,this.account_type=s.account_type,this.account_number=s.account_number,this.acct_last_four=s.acct_last_four,this.account_number_last4=s.account_number_last4,this.routing_number=s.routing_number,this.bank_name=s.bank_name,this.country=s.country,this.currency=s.currency,this.nickname=s.nickname,this.metadata=s.metadata,this.business_id=s.business_id,this.platform_account_id=s.platform_account_id,this.created_at=s.created_at,this.updated_at=s.updated_at}get payload(){return{account_owner_name:this.account_owner_name||"",account_type:this.account_type||"",account_number:this.account_number||"",routing_number:this.routing_number||"",bank_name:this.bank_name||"",nickname:this.nickname||"",business_id:this.business_id||""}}}const F=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(p,{width:"25%"})),s("div",{class:"col-12"},s(p,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(p,{width:"50%"}),s(p,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(p,{width:"65%"}),s(p,{width:"35%"}))),N=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(p,{width:"40%",height:"40px"})),s(F,null),s(F,null),s(F,null)),U=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.additional_questions=new a(s.data.additional_questions||{}),this.formController.setInitialValues(Object.assign({},this.additional_questions))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.additionalQuestions}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t})),this.additional_questions=new a(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.additional_questions={},this.recurringPayments=!1,this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}recurringPaymentsWatcher(s){this.recurringPayments="Yes"===(null==s?void 0:s.business_recurring_payments)}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{additional_questions:new a(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(i(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){var t,e,i,r,o,n,a;const l=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Additional Questions"),s("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-monetary",{name:"business_revenue",label:"What is your business’ estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(t=this.errors)||void 0===t?void 0:t.business_revenue,defaultValue:null==l?void 0:l.business_revenue,maskOptions:d.WHOLE})),s("div",{class:"col-12 col-md-6"},s("form-control-monetary",{name:"business_payment_volume",label:"What is your business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(e=this.errors)||void 0===e?void 0:e.business_payment_volume,defaultValue:null==l?void 0:l.business_payment_volume,maskOptions:d.WHOLE})),s("div",{class:"col-12"},s("form-control-select",{name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(i=this.errors)||void 0===i?void 0:i.business_when_service_received,options:v,defaultValue:null==l?void 0:l.business_when_service_received})),s("div",{class:"col-12"},s("form-control-select",{name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(r=this.errors)||void 0===r?void 0:r.business_recurring_payments,options:f,defaultValue:null==l?void 0:l.business_recurring_payments})),s("div",{class:"col-12",hidden:!this.recurringPayments},s("form-control-text",{name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(o=this.errors)||void 0===o?void 0:o.business_recurring_payments_percentage,defaultValue:null==l?void 0:l.business_recurring_payments_percentage,helpText:"For example: 50% monthly, 50% annual."})),s("div",{class:"col-12"},s("form-control-select",{name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(n=this.errors)||void 0===n?void 0:n.business_seasonal,options:b,defaultValue:null==l?void 0:l.business_seasonal})),s("div",{class:"col-12"},s("form-control-text",{name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business? (optional)",inputHandler:this.inputHandler,errorText:null===(a=this.errors)||void 0===a?void 0:a.business_other_payment_details,defaultValue:null==l?void 0:l.business_other_payment_details})))))}static get watchers(){return{additional_questions:["recurringPaymentsWatcher"]}}},q=(s,t)=>{const e=n({bank_name:_.required("Enter bank name"),nickname:x.required("Enter nickname"),account_owner_name:j.required("Enter account owner name"),account_type:S.required("Select account type"),account_number:T.required("Enter account number"),routing_number:O.required("Enter routing number"),voided_check:k(s,t),bank_statement:C(s,t)}),i=n({bank_name:_.nullable(),nickname:x.nullable(),account_owner_name:j.nullable(),account_type:S.nullable(),account_number:T.nullable(),routing_number:O.nullable(),voided_check:k(s,t),bank_statement:C(s,t)});return t?i:e},R=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.initializeFormController=()=>{this.formController=new o(q(this.existingDocuments,this.allowOptionalFields)),this.formController.setInitialValues(Object.assign({},this.bankAccount)),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.storeFiles=s=>{const t=Array.from(s.detail.fileList),e=s.detail.document_type,i=t.map((s=>new E({file:s,document_type:e},this.businessId)));this.documentData[e]=i},this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{s.data.bank_accounts.length>0?this.bankAccount=new W(s.data.bank_accounts[0]):(this.bankAccount=new W({}),this.bankAccount.business_id=this.businessId),this.existingDocuments=s.data.documents},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.initializeFormController(),this.isLoading=!1}})},this.postDocumentRecordData=async s=>{this.isLoading=!0;const t=s.record_data;return new Promise((e=>{this.postDocumentRecord({payload:t,onSuccess:t=>{e(this.handleDocRecordResponse(s,t))},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({message:s,errorCode:t,severity:i}),e(!1)}})}))},this.handleDocRecordResponse=(s,t)=>t.error?(this.errorEvent.emit({errorCode:L.POST_ERROR,message:t.error.message,severity:H.ERROR,data:t.error}),!1):(s.setPresignedUrl(t.data.presigned_url),!0),this.uploadDocument=async s=>{if(!s.presigned_url)throw new Error("Presigned URL is not set");const t=await fetch(s.presigned_url,{method:"PUT",body:s.fileString});return this.handleUploadResponse(t)},this.handleUploadResponse=s=>!s.error||(this.errorEvent.emit({errorCode:L.POST_ERROR,message:s.error.message,severity:H.ERROR,data:s.error}),!1),this.formController=void 0,this.errors={},this.bankAccount={},this.existingDocuments=[],this.documentData=new D,this.isLoading=!1,this.businessId=void 0,this.getBusiness=void 0,this.postBankAccount=void 0,this.postDocumentRecord=void 0,this.allowOptionalFields=void 0}watchHandler(s){this.formLoading.emit(s)}async validateAndSubmit({onSuccess:s}){this.existingBankAccount?this.sendData(s):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(q(this.existingDocuments,this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get postPayload(){return new W(this.formController.values.getValue()).payload}get existingBankAccount(){var s;return!!(null===(s=this.bankAccount)||void 0===s?void 0:s.id)}async sendData(s){try{if(!this.existingBankAccount&&!await this.postBankAccountData())return;if(!await this.postBusinessDocuments())return;s()}catch(s){this.errorEvent.emit({message:s,errorCode:L.POST_ERROR,severity:H.ERROR})}}async postBankAccountData(){let s;return this.isLoading=!0,new Promise((t=>{let e=!1;this.postBankAccount({payload:this.postPayload,onSuccess:t=>{s=t,e=!0},onError:({error:s,code:t,severity:i})=>{e=!1,this.errorEvent.emit({message:s,errorCode:t,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:s,formStep:g.bankAccount}),this.isLoading=!1,t(e)}})}))}async postBusinessDocuments(){this.isLoading=!0;try{const s=Object.values(this.documentData).flat();return!s.length||!(await Promise.all(s.map((s=>this.postDocumentRecordData(s))))).includes(!1)&&!(await Promise.all(s.map((s=>this.uploadDocument(s))))).includes(!1)}finally{this.isLoading=!1}}render(){const t=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",{class:"mb-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Bank Account Info"),s("form-control-tooltip",{helpText:"This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),s("hr",{class:"mt-2"}),s("bank-account-form-inputs",{defaultValue:t,errors:this.errors,inputHandler:this.inputHandler,formDisabled:this.existingBankAccount})),s("fieldset",{class:"mt-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Document Uploads"),s("form-control-tooltip",{helpText:"These documents are required for underwriting purposes. Various file formats such as PDF, DOC, DOCX, JPEG, and others are accepted. Multiple files can be uploaded for each document category."})),s("hr",{class:"mt-2"}),s("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading}),s("bank-account-document-form-inputs",{inputHandler:this.inputHandler,errors:this.errors,storeFiles:this.storeFiles})))}static get watchers(){return{isLoading:["watchHandler"]}}},Y=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.coreInfo=new l(s.data),this.formController.setInitialValues(Object.assign({},this.coreInfo))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.businessInfo}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.coreInfo={},this.isLoading=!1,this.businessId=void 0,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return new l(this.formController.values.getValue()).payload}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(r(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){const t=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Business Information")),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12"},s("form-control-text",{name:"legal_name",label:"Business Name",defaultValue:t.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)."})),s("div",{class:"col-12"},s("form-control-text",{name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:t.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)"})),s("div",{class:"col-12 col-md-8"},s("form-control-select",{name:"classification",label:"Business Classification",options:y,defaultValue:t.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-4"},s("form-control-date",{name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:t.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"industry",label:"Industry",defaultValue:t.industry,errorText:this.errors.industry,inputHandler:this.inputHandler,helpText:"Describe what you sell"})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"tax_id",label:"Tax ID (EIN or SSN)",defaultValue:t.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,keyDownHandler:V,maxLength:9,helpText:"Employer Identification Numbers (EINs) are nine digits. The federal tax identification number/EIN issued to you by the IRS. It can be found on your tax returns."})),s("div",{class:"col-12"},s("form-control-text",{name:"website_url",label:"Business Website URL",defaultValue:t.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler,helpText:"Don't have a live website? You can use your social media business page, app store link, or staging site URL."})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"email",label:"Business Email Address",defaultValue:t.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-number-masked",{name:"phone",label:"Business Phone Number",defaultValue:t.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:u.US})))))}},z=class{constructor(s){t(this,s),this.clickEvent=e(this,"click-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.matchRef=(s,t)=>{const e=this.refs.findIndex((s=>s===t));-1!==e&&(this.refs[e]=s)},this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{s.data.owners.length?this.ownersPayload=s.data.owners.map((s=>({id:s.id}))):this.addOwnerForm()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1,this.manageRefs()}})},this.sendData=async s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:{owners:this.ownersPayload},onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=s=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],s&&this.clickEvent.emit({name:w.addOwnerForm})},this.removeOwnerForm=s=>{this.ownersPayload=this.ownersPayload.filter((t=>t.id!==s)),this.newFormOpen&&(this.newFormOpen=!1)},this.ownersPayload=[],this.refs=[],this.newFormOpen=void 0,this.isLoading=!1,this.authToken=void 0,this.businessId=void 0,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}get showAddOwnerButton(){return this.ownersPayload.length<4&&!this.newFormOpen}manageRefs(){this.refs=this.ownersPayload.map((s=>s.id))}async validateAndSubmit({onSuccess:s}){const t=this.refs.map((s=>s.validate()));if(!(await Promise.all(t)).every((s=>s)))return;const e=this.refs.map((s=>s.submit()));(await Promise.all(e)).every((s=>s))&&this.sendData(s)}componentWillLoad(){this.getBusiness&&this.getData()}ownersWatcher(){this.manageRefs()}handleOwnerSubmit(s){const t=s.detail,e=this.ownersPayload.map((s=>s.id===t.id?t:s));e.includes(t)||(e[this.ownersPayload.findIndex((s=>!s.id))]=t,this.newFormOpen&&(this.newFormOpen=!1)),this.ownersPayload=e}render(){return this.isLoading?s(N,null):s("div",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Owners"),s("form-control-tooltip",{helpText:"For partnerships, LLCs or privately held corporations, the business is required to apply with all individuals with 25% or more ownership to the application. For charities and registered non-profits, the business is required to apply with 1 individual with substantial control over the entity, such as a board member or director."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},this.ownersPayload.map((t=>s("justifi-owner-form",{key:t.id,authToken:this.authToken,businessId:this.businessId,ownerId:t.id,removeOwner:this.removeOwnerForm,newFormOpen:this.newFormOpen,ownersLength:this.ownersPayload.length,allowOptionalFields:this.allowOptionalFields,ref:s=>this.matchRef(s,t.id)})))),s("div",{class:"d-flex justify-content-start"},s("div",{class:"gap-2"},s(A,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner"))))}static get watchers(){return{ownersPayload:["ownersWatcher"]}}},G=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.representative=new h(s.data.representative||{}),this.formController.setInitialValues(Object.assign({},this.representative))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.representative}),this.formLoading.emit(!1)}})},this.formController=void 0,this.errors={},this.representative={},this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{representative:new h(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(P("representative",this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){return this.isLoading?s(N,null):s("justifi-business-representative-form-inputs",{representativeDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController})}},J=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.legal_address=new c(s.data.legal_address||{}),this.formController.setInitialValues(Object.assign({},this.legal_address))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.legalAddress}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.legal_address={},this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{legal_address:new c(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(B(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){var t,e,i,r,o,n;const a=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Legal Address of your Business"),s("form-control-tooltip",{helpText:"No PO Boxes."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12"},s("form-control-text",{name:"line1",label:"Legal Address",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.line1,errorText:null===(t=this.errors)||void 0===t?void 0:t.line1})),s("div",{class:"col-12"},s("form-control-text",{name:"line2",label:"Address Line 2 (optional)",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.line2,errorText:null===(e=this.errors)||void 0===e?void 0:e.line2})),s("div",{class:"col-12"},s("form-control-text",{name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.city,errorText:null===(i=this.errors)||void 0===i?void 0:i.city})),s("div",{class:"col-12"},s("form-control-select",{name:"state",label:"State",options:I,inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.state,errorText:null===(r=this.errors)||void 0===r?void 0:r.state})),s("div",{class:"col-12"},s("form-control-text",{name:"postal_code",label:"Postal Code",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.postal_code,errorText:null===(o=this.errors)||void 0===o?void 0:o.postal_code,maxLength:5,keyDownHandler:V})),s("div",{class:"col-12"},s("form-control-select",{name:"country",label:"Country",options:[{label:"United States",value:"USA"}],inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.country,errorText:null===(n=this.errors)||void 0===n?void 0:n.country,disabled:!0})))))}};export{U as justifi_additional_questions_form_step_core,R as justifi_business_bank_account_form_step_core,Y as justifi_business_core_info_form_step_core,z as justifi_business_owners_form_step_core,G as justifi_business_representative_form_step_core,J as justifi_legal_address_form_step_core}
|
|
1
|
+
import{h as s,r as t,c as e}from"./p-2783e363.js";import{a as i,b as r}from"./p-b0b40bcd.js";import{F as o,c as n}from"./p-5844a0f0.js";import{A as a,C as l,R as h,c}from"./p-275f2154.js";import{C as d,P as u}from"./p-525db3e8.js";import{h as m}from"./p-d8c04275.js";import{S as p}from"./p-aa02cf71.js";import{a as v,r as f,s as b,b as y}from"./p-0ea387a2.js";import{a as g,B as w}from"./p-73f9be7c.js";import{z as _,A as x,u as j,B as S,C as T,D as O,E as k,F as C}from"./p-27c8ffa2.js";import{a as L,C as H}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import{a as E,b as D}from"./p-61f0a2ce.js";import{n as V}from"./p-e3c22aa9.js";import{B as A}from"./p-298e290e.js";import{i as P,a as B}from"./p-849c68e5.js";import{S as I}from"./p-6078a370.js";import"./p-1ff8810b.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";class W{constructor(s){this.id=s.id,this.account_owner_name=s.account_owner_name,this.full_name=s.full_name,this.account_type=s.account_type,this.account_number=s.account_number,this.acct_last_four=s.acct_last_four,this.account_number_last4=s.account_number_last4,this.routing_number=s.routing_number,this.bank_name=s.bank_name,this.country=s.country,this.currency=s.currency,this.nickname=s.nickname,this.metadata=s.metadata,this.business_id=s.business_id,this.platform_account_id=s.platform_account_id,this.created_at=s.created_at,this.updated_at=s.updated_at}get payload(){return{account_owner_name:this.account_owner_name||"",account_type:this.account_type||"",account_number:this.account_number||"",routing_number:this.routing_number||"",bank_name:this.bank_name||"",nickname:this.nickname||"",business_id:this.business_id||""}}}const F=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(p,{width:"25%"})),s("div",{class:"col-12"},s(p,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(p,{width:"50%"}),s(p,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(p,{width:"65%"}),s(p,{width:"35%"}))),N=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(p,{width:"40%",height:"40px"})),s(F,null),s(F,null),s(F,null)),U=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.additional_questions=new a(s.data.additional_questions||{}),this.formController.setInitialValues(Object.assign({},this.additional_questions))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.additionalQuestions}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t})),this.additional_questions=new a(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.additional_questions={},this.recurringPayments=!1,this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}recurringPaymentsWatcher(s){this.recurringPayments="Yes"===(null==s?void 0:s.business_recurring_payments)}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{additional_questions:new a(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(i(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){var t,e,i,r,o,n,a;const l=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Additional Questions"),s("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-monetary",{name:"business_revenue",label:"What is your business’ estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(t=this.errors)||void 0===t?void 0:t.business_revenue,defaultValue:null==l?void 0:l.business_revenue,maskOptions:d.WHOLE})),s("div",{class:"col-12 col-md-6"},s("form-control-monetary",{name:"business_payment_volume",label:"What is your business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(e=this.errors)||void 0===e?void 0:e.business_payment_volume,defaultValue:null==l?void 0:l.business_payment_volume,maskOptions:d.WHOLE})),s("div",{class:"col-12"},s("form-control-select",{name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(i=this.errors)||void 0===i?void 0:i.business_when_service_received,options:v,defaultValue:null==l?void 0:l.business_when_service_received})),s("div",{class:"col-12"},s("form-control-select",{name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(r=this.errors)||void 0===r?void 0:r.business_recurring_payments,options:f,defaultValue:null==l?void 0:l.business_recurring_payments})),s("div",{class:"col-12",hidden:!this.recurringPayments},s("form-control-text",{name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(o=this.errors)||void 0===o?void 0:o.business_recurring_payments_percentage,defaultValue:null==l?void 0:l.business_recurring_payments_percentage,helpText:"For example: 50% monthly, 50% annual."})),s("div",{class:"col-12"},s("form-control-select",{name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(n=this.errors)||void 0===n?void 0:n.business_seasonal,options:b,defaultValue:null==l?void 0:l.business_seasonal})),s("div",{class:"col-12"},s("form-control-text",{name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business? (optional)",inputHandler:this.inputHandler,errorText:null===(a=this.errors)||void 0===a?void 0:a.business_other_payment_details,defaultValue:null==l?void 0:l.business_other_payment_details})))))}static get watchers(){return{additional_questions:["recurringPaymentsWatcher"]}}},q=(s,t)=>{const e=n({bank_name:_.required("Enter bank name"),nickname:x.required("Enter nickname"),account_owner_name:j.required("Enter account owner name"),account_type:S.required("Select account type"),account_number:T.required("Enter account number"),routing_number:O.required("Enter routing number"),voided_check:k(s,t),bank_statement:C(s,t)}),i=n({bank_name:_.nullable(),nickname:x.nullable(),account_owner_name:j.nullable(),account_type:S.nullable(),account_number:T.nullable(),routing_number:O.nullable(),voided_check:k(s,t),bank_statement:C(s,t)});return t?i:e},R=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.initializeFormController=()=>{this.formController=new o(q(this.existingDocuments,this.allowOptionalFields)),this.formController.setInitialValues(Object.assign({},this.bankAccount)),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.storeFiles=s=>{const t=Array.from(s.detail.fileList),e=s.detail.document_type,i=t.map((s=>new E({file:s,document_type:e},this.businessId)));this.documentData[e]=i},this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{s.data.bank_accounts.length>0?this.bankAccount=new W(s.data.bank_accounts[0]):(this.bankAccount=new W({}),this.bankAccount.business_id=this.businessId),this.existingDocuments=s.data.documents},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.initializeFormController(),this.isLoading=!1}})},this.postDocumentRecordData=async s=>{this.isLoading=!0;const t=s.record_data;return new Promise((e=>{this.postDocumentRecord({payload:t,onSuccess:t=>{e(this.handleDocRecordResponse(s,t))},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({message:s,errorCode:t,severity:i}),e(!1)}})}))},this.handleDocRecordResponse=(s,t)=>t.error?(this.errorEvent.emit({errorCode:L.POST_ERROR,message:t.error.message,severity:H.ERROR,data:t.error}),!1):(s.setPresignedUrl(t.data.presigned_url),!0),this.uploadDocument=async s=>{if(!s.presigned_url)throw new Error("Presigned URL is not set");const t=await fetch(s.presigned_url,{method:"PUT",body:s.fileString});return this.handleUploadResponse(t)},this.handleUploadResponse=s=>!s.error||(this.errorEvent.emit({errorCode:L.POST_ERROR,message:s.error.message,severity:H.ERROR,data:s.error}),!1),this.formController=void 0,this.errors={},this.bankAccount={},this.existingDocuments=[],this.documentData=new D,this.isLoading=!1,this.businessId=void 0,this.getBusiness=void 0,this.postBankAccount=void 0,this.postDocumentRecord=void 0,this.allowOptionalFields=void 0}watchHandler(s){this.formLoading.emit(s)}async validateAndSubmit({onSuccess:s}){this.existingBankAccount?this.sendData(s):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(q(this.existingDocuments,this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get postPayload(){return new W(this.formController.values.getValue()).payload}get existingBankAccount(){var s;return!!(null===(s=this.bankAccount)||void 0===s?void 0:s.id)}async sendData(s){try{if(!this.existingBankAccount&&!await this.postBankAccountData())return;if(!await this.postBusinessDocuments())return;s()}catch(s){this.errorEvent.emit({message:s,errorCode:L.POST_ERROR,severity:H.ERROR})}}async postBankAccountData(){let s;return this.isLoading=!0,new Promise((t=>{let e=!1;this.postBankAccount({payload:this.postPayload,onSuccess:t=>{s=t,e=!0},onError:({error:s,code:t,severity:i})=>{e=!1,this.errorEvent.emit({message:s,errorCode:t,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:s,formStep:g.bankAccount}),this.isLoading=!1,t(e)}})}))}async postBusinessDocuments(){this.isLoading=!0;try{const s=Object.values(this.documentData).flat();return!s.length||!(await Promise.all(s.map((s=>this.postDocumentRecordData(s))))).includes(!1)&&!(await Promise.all(s.map((s=>this.uploadDocument(s))))).includes(!1)}finally{this.isLoading=!1}}render(){const t=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",{class:"mb-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Bank Account Info"),s("form-control-tooltip",{helpText:"This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),s("hr",{class:"mt-2"}),s("bank-account-form-inputs",{defaultValue:t,errors:this.errors,inputHandler:this.inputHandler,formDisabled:this.existingBankAccount})),s("fieldset",{class:"mt-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Document Uploads"),s("form-control-tooltip",{helpText:"These documents are required for underwriting purposes. Various file formats such as PDF, DOC, DOCX, JPEG, and others are accepted. Multiple files can be uploaded for each document category."})),s("hr",{class:"mt-2"}),s("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading}),s("bank-account-document-form-inputs",{inputHandler:this.inputHandler,errors:this.errors,storeFiles:this.storeFiles})))}static get watchers(){return{isLoading:["watchHandler"]}}},Y=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.coreInfo=new l(s.data),this.formController.setInitialValues(Object.assign({},this.coreInfo))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.businessInfo}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.coreInfo={},this.isLoading=!1,this.businessId=void 0,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return new l(this.formController.values.getValue()).payload}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(r(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){const t=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Business Information")),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12"},s("form-control-text",{name:"legal_name",label:"Business Name",defaultValue:t.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)."})),s("div",{class:"col-12"},s("form-control-text",{name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:t.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)"})),s("div",{class:"col-12 col-md-8"},s("form-control-select",{name:"classification",label:"Business Classification",options:y,defaultValue:t.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-4"},s("form-control-date",{name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:t.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"industry",label:"Industry",defaultValue:t.industry,errorText:this.errors.industry,inputHandler:this.inputHandler,helpText:"Describe what you sell"})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"tax_id",label:"Tax ID (EIN or SSN)",defaultValue:t.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,keyDownHandler:V,maxLength:9,helpText:"Employer Identification Numbers (EINs) are nine digits. The federal tax identification number/EIN issued to you by the IRS. It can be found on your tax returns."})),s("div",{class:"col-12"},s("form-control-text",{name:"website_url",label:"Business Website URL",defaultValue:t.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler,helpText:"Don't have a live website? You can use your social media business page, app store link, or staging site URL."})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"email",label:"Business Email Address",defaultValue:t.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-number-masked",{name:"phone",label:"Business Phone Number",defaultValue:t.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:u.US})))))}},z=class{constructor(s){t(this,s),this.clickEvent=e(this,"click-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.matchRef=(s,t)=>{const e=this.refs.findIndex((s=>s===t));-1!==e&&(this.refs[e]=s)},this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{s.data.owners.length?this.ownersPayload=s.data.owners.map((s=>({id:s.id}))):this.addOwnerForm()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1,this.manageRefs()}})},this.sendData=async s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:{owners:this.ownersPayload},onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=s=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],s&&this.clickEvent.emit({name:w.addOwnerForm})},this.removeOwnerForm=s=>{this.ownersPayload=this.ownersPayload.filter((t=>t.id!==s)),this.newFormOpen&&(this.newFormOpen=!1)},this.ownersPayload=[],this.refs=[],this.newFormOpen=void 0,this.isLoading=!1,this.authToken=void 0,this.businessId=void 0,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}get showAddOwnerButton(){return this.ownersPayload.length<4&&!this.newFormOpen}manageRefs(){this.refs=this.ownersPayload.map((s=>s.id))}async validateAndSubmit({onSuccess:s}){const t=this.refs.map((s=>s.validate()));if(!(await Promise.all(t)).every((s=>s)))return;const e=this.refs.map((s=>s.submit()));(await Promise.all(e)).every((s=>s))&&this.sendData(s)}componentWillLoad(){this.getBusiness&&this.getData()}ownersWatcher(){this.manageRefs()}handleOwnerSubmit(s){const t=s.detail,e=this.ownersPayload.map((s=>s.id===t.id?t:s));e.includes(t)||(e[this.ownersPayload.findIndex((s=>!s.id))]=t,this.newFormOpen&&(this.newFormOpen=!1)),this.ownersPayload=e}render(){return this.isLoading?s(N,null):s("div",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Owners"),s("form-control-tooltip",{helpText:"For partnerships, LLCs or privately held corporations, the business is required to apply with all individuals with 25% or more ownership to the application. For charities and registered non-profits, the business is required to apply with 1 individual with substantial control over the entity, such as a board member or director."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},this.ownersPayload.map((t=>s("justifi-owner-form",{key:t.id,authToken:this.authToken,businessId:this.businessId,ownerId:t.id,removeOwner:this.removeOwnerForm,newFormOpen:this.newFormOpen,ownersLength:this.ownersPayload.length,allowOptionalFields:this.allowOptionalFields,ref:s=>this.matchRef(s,t.id)})))),s("div",{class:"d-flex justify-content-start"},s("div",{class:"gap-2"},s(A,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner"))))}static get watchers(){return{ownersPayload:["ownersWatcher"]}}},G=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.representative=new h(s.data.representative||{}),this.formController.setInitialValues(Object.assign({},this.representative))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.representative}),this.formLoading.emit(!1)}})},this.formController=void 0,this.errors={},this.representative={},this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{representative:new h(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(P("representative",this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){return this.isLoading?s(N,null):s("justifi-business-representative-form-inputs",{representativeDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController})}},J=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.legal_address=new c(s.data.legal_address||{}),this.formController.setInitialValues(Object.assign({},this.legal_address))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.legalAddress}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.legal_address={},this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{legal_address:new c(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(B(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){var t,e,i,r,o,n;const a=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Legal Address of your Business"),s("form-control-tooltip",{helpText:"No PO Boxes."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12"},s("form-control-text",{name:"line1",label:"Legal Address",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.line1,errorText:null===(t=this.errors)||void 0===t?void 0:t.line1})),s("div",{class:"col-12"},s("form-control-text",{name:"line2",label:"Address Line 2 (optional)",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.line2,errorText:null===(e=this.errors)||void 0===e?void 0:e.line2})),s("div",{class:"col-12"},s("form-control-text",{name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.city,errorText:null===(i=this.errors)||void 0===i?void 0:i.city})),s("div",{class:"col-12"},s("form-control-select",{name:"state",label:"State",options:I,inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.state,errorText:null===(r=this.errors)||void 0===r?void 0:r.state})),s("div",{class:"col-12"},s("form-control-text",{name:"postal_code",label:"Postal Code",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.postal_code,errorText:null===(o=this.errors)||void 0===o?void 0:o.postal_code,maxLength:5,keyDownHandler:V})),s("div",{class:"col-12"},s("form-control-select",{name:"country",label:"Country",options:[{label:"United States",value:"USA"}],inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.country,errorText:null===(n=this.errors)||void 0===n?void 0:n.country,disabled:!0})))))}};export{U as justifi_additional_questions_form_step_core,R as justifi_business_bank_account_form_step_core,Y as justifi_business_core_info_form_step_core,z as justifi_business_owners_form_step_core,G as justifi_business_representative_form_step_core,J as justifi_legal_address_form_step_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as t,h as r}from"./p-2783e363.js";import{A as o,c as
|
|
1
|
+
import{r as s,c as t,h as r}from"./p-2783e363.js";import{A as o,c as e}from"./p-4bad3621.js";import{C as i,a}from"./p-14c91ffd.js";import{g as n,a as h}from"./p-8115b2f4.js";import{E as c}from"./p-8f25f016.js";import{c as p,J as d}from"./p-933537ca.js";import"./p-d8c04275.js";import"./p-b2edb944.js";class m{async fetchGrossVolumeChartData(s,t){return o({authToken:t,apiOrigin:e.proxyApiOrigin}).get(`account/${s}/reports/gross_volume`)}}const u=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)},this.accountId=void 0,this.authToken=void 0,this.getGrossPayment=void 0,this.errorMessage=null}componentWillLoad(){p(),this.analytics=new d(this),this.initializeGetGrossPayment()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:e})=>{var a;try{const c=await r.fetchGrossVolumeChartData(s,t);c.error?e({error:n(c.error),code:h(null===(a=c.error)||void 0===a?void 0:a.code),severity:i.ERROR}):o(c.data)}catch(s){const t=h(null==s?void 0:s.code);e({error:n(s),code:t,severity:i.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new m}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}render(){return this.errorMessage?c(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_gross_payment_chart}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as s}from"./p-2783e363.js";import{e as i,f as r,g as a}from"./p-f2f2e20e.js";import{I as o}from"./p-
|
|
1
|
+
import{r as e,c as t,h as s}from"./p-2783e363.js";import{e as i,f as r,g as a}from"./p-f2f2e20e.js";import{I as o}from"./p-35b00a0d.js";import{F as d}from"./p-5844a0f0.js";import{O as h}from"./p-275f2154.js";import{i as c}from"./p-849c68e5.js";import{B as n}from"./p-298e290e.js";import{L as f}from"./p-d8c04275.js";import{B as l}from"./p-73f9be7c.js";import{S as b,P as m}from"./p-525db3e8.js";import{u,a as p,b as y}from"./p-7d85af5c.js";import"./p-14c91ffd.js";import"./p-8115b2f4.js";import"./p-4bad3621.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-27c8ffa2.js";import"./p-0ea387a2.js";import"./p-61f0a2ce.js";const v=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 o}),this.patchOwner=r({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.postOwner=a({authToken:this.authToken,service:new o}))}render(){return s("owner-form-core",{key:"9d1b43ef74d1e2d33cc3145c152564eb297b3cee",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.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.formLoading=t(this,"formLoading",7),this.ownerSubmitted=t(this,"ownerSubmitted",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.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1}):this.postOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{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?l.updateOwner:l.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:l.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=new h(this.formController.values.getValue()).payload;return this.ownerId?e: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 d(c("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:"b7fc4c0d0fdf3a5aab0a246daffa59022255e6ae",onSubmit:this.validateAndSubmit},s("fieldset",{key:"eee56a5e2e26184086c1301576695b627a1f2ef4"},s("legend",{key:"b3f75638a502cca01da0ed54ec07660554dcd416",class:"fw-semibold fs-5",part:f},this.formTitle),s("br",{key:"0bc020cc7290615db3d3e1ec2b84d5af99ec86f0"}),s("div",{key:"2e7a09c9f4dffac21f2b3e1efe118542f18d89e8",class:"row gy-3"},s("owner-form-inputs",{key:"78ffd296d4ecf0d5f2e50a06fb392cbefb1c9dc7",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController}),s("div",{key:"73256017645b6987cd96006e5fe080402b0602d2",class:"d-flex gap-2 justify-content-start"},s(n,{key:"e2c288cf27ebc2d4dd9c29b2a2ed8e409d0c7564",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(n,{key:"d3d604b4416c8196181ec4fd34b254a0909b2aff",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"4ad0047c67825990c1e4c02d377901d11a7937fa"})))}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:"f54192149ae925bcd08b8408816fc41295ef00f4",class:"row gy-3"},s("div",{key:"1f70faf2c08ebf277b465cb1532276f7525aa47f",class:"col-12 col-md-8"},s("form-control-text",{key:"7bae6e4b330cbea14e0be40d1b35e804d62f5323",name:"name",label:"Full Name",defaultValue:this.ownerDefaultValue.name,errorText:this.errors.name,inputHandler:this.inputHandler})),s("div",{key:"84cbbbf7cfb0e3c41c37b1194292dcb1f191298e",class:"col-12 col-md-4"},s("form-control-text",{key:"c106ea1b06e69d4b4fe3647cd2d0289185fae2e9",name:"title",label:"Title",defaultValue:this.ownerDefaultValue.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),s("div",{key:"8040bd2c6f6d67763578117c9a46e8e82aa18abf",class:"col-12 col-md-6"},s("form-control-text",{key:"48aea09125f010bc799dc8d0e909f83c33972c3a",name:"email",label:"Email Address",defaultValue:this.ownerDefaultValue.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{key:"00195bf163c16d8052c97de866bda7ac610cb959",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"d02770dcabfc707691ce4262cbca00d30b78a211",name:"phone",label:"Phone Number",defaultValue:this.ownerDefaultValue.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:m.US})),s("div",{key:"c86d87082365b5daebce40e69f98a8813198eefd",class:"col-12 col-md-4"},s("form-control-date",{key:"cd2cfaf3c8a6fbb28719cb85ad4b3954ac2ff059",name:"dob_full",label:"Birth Date",defaultValue:this.ownerDefaultValue.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>y(e,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"f77e5943b8e04dc20cf9c126f6ad8ee67e27ac12",class:"col-12 col-md-8"},s("form-control-number-masked",{key:"3828035484d53d7267c7ce1686658eaba2495147",name:"identification_number",label:"SSN",defaultValue:this.ownerDefaultValue.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:b,helpText:"Enter your full Social Security Number. It is required for Federal OFAC check."})),s("div",{key:"4a67ced4d2a6f2be7f437e59a119ab97ec8c3ffc",class:"col-12"},s("justifi-identity-address-form",{key:"e4fbe8bbd642d623f306236b83be7800db619506",errors:this.errors.address,defaultValues:this.ownerDefaultValue.address,handleFormUpdate:this.onAddressFormUpdate})))}};export{v as justifi_owner_form,k as owner_form_core,w as owner_form_inputs}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as a}from"./p-5844a0f0.js";import{S as t}from"./p-6078a370.js";import{b as s,a as r,r as n,s as c,c as i}from"./p-0ea387a2.js";import{E as l}from"./p-61f0a2ce.js";const o=e=>""===e?null:e,u=/^\d+$/,m=/P\.?\s?O\.?\s?Box|Postal\sBox/i,d=e().email("Enter valid email").transform(o),b=e().matches(/^\d{10}$/,"Enter valid phone number").transform(o),h=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),p=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),v=e().matches(/^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/,"Enter valid website url").transform(o),E=e().oneOf(s.map((e=>e.value)),"Select business classification").transform(o),S=e().min(2,"Industry must be at least 2 characters").max(50,"Industry must be less than 50 characters").transform(o),N=e().matches(u,"Enter valid tax id, SSN, or EIN").test("not-repeat","Enter valid tax id, SSN, or EIN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid tax id, SSN, or EIN",(e=>"123456789"!==e)).transform(o),f=e().test("not-future","Date of incorporation cannot be in the future",(e=>new Date(e)<=new Date)).transform(o),g=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),w=e().min(2,"Title must be at least 2 characters").max(50,"Title must be less than 50 characters").transform(o),y=a=>e().test("min","Enter a valid date",(e=>new Date(e)>=new Date("1902-01-01"))).test("age",`${a} must be at least 18 years old`,(e=>{const a=new Date(e),t=new Date;return t.setFullYear(t.getFullYear()-18),a<=t})).transform(o),x=e().matches(/^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/,"Enter valid SSN").when("ssn_last4",{is:e=>!e||0===e.length,then:e=>e.required("Enter SSN"),otherwise:e=>e.nullable()}).test("not-repeat","Enter valid SSN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid SSN",(e=>"123456789"!==e)).transform(o),A=e().min(5,"Address must be at least 5 characters").max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!m.test(e))).transform(o),$=e().max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!m.test(e))).transform(o),D=e().min(2,"City must be at least 2 characters").max(50,"City must be less than 50 characters").transform(o),P=e().oneOf(t.map((e=>e.value)),"Select state").transform(o),j=e().matches(/^[0-9]{5}$/,"Enter valid postal code").transform(o),B=e().matches(u,"Enter valid revenue").transform(o),I=e().matches(u,"Enter valid payment volume").transform(o),_=e().oneOf(r.map((e=>e.value)),"Select when service is received").transform(o),z=e().oneOf(n.map((e=>e.value)),"Select recurring payments").transform(o),q=e().when("business_recurring_payments",{is:e=>"Yes"===e,then:e=>e.required("Enter recurring payments percentage"),otherwise:e=>e.nullable()}).transform(o),C=e().oneOf(c.map((e=>e.value)),"Select seasonal business").transform(o),O=e().transform(o),T=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(o),Z=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(o),k=e().oneOf(i.map((e=>e.value)),"Select account type").transform(o),F=e().min(
|
|
1
|
+
import{a as e,b as a}from"./p-5844a0f0.js";import{S as t}from"./p-6078a370.js";import{b as s,a as r,r as n,s as c,c as i}from"./p-0ea387a2.js";import{E as l}from"./p-61f0a2ce.js";const o=e=>""===e?null:e,u=/^\d+$/,m=/P\.?\s?O\.?\s?Box|Postal\sBox/i,d=e().email("Enter valid email").transform(o),b=e().matches(/^\d{10}$/,"Enter valid phone number").transform(o),h=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),p=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),v=e().matches(/^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/,"Enter valid website url").transform(o),E=e().oneOf(s.map((e=>e.value)),"Select business classification").transform(o),S=e().min(2,"Industry must be at least 2 characters").max(50,"Industry must be less than 50 characters").transform(o),N=e().matches(u,"Enter valid tax id, SSN, or EIN").test("not-repeat","Enter valid tax id, SSN, or EIN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid tax id, SSN, or EIN",(e=>"123456789"!==e)).transform(o),f=e().test("not-future","Date of incorporation cannot be in the future",(e=>new Date(e)<=new Date)).transform(o),g=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),w=e().min(2,"Title must be at least 2 characters").max(50,"Title must be less than 50 characters").transform(o),y=a=>e().test("min","Enter a valid date",(e=>new Date(e)>=new Date("1902-01-01"))).test("age",`${a} must be at least 18 years old`,(e=>{const a=new Date(e),t=new Date;return t.setFullYear(t.getFullYear()-18),a<=t})).transform(o),x=e().matches(/^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/,"Enter valid SSN").when("ssn_last4",{is:e=>!e||0===e.length,then:e=>e.required("Enter SSN"),otherwise:e=>e.nullable()}).test("not-repeat","Enter valid SSN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid SSN",(e=>"123456789"!==e)).transform(o),A=e().min(5,"Address must be at least 5 characters").max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!m.test(e))).transform(o),$=e().max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!m.test(e))).transform(o),D=e().min(2,"City must be at least 2 characters").max(50,"City must be less than 50 characters").transform(o),P=e().oneOf(t.map((e=>e.value)),"Select state").transform(o),j=e().matches(/^[0-9]{5}$/,"Enter valid postal code").transform(o),B=e().matches(u,"Enter valid revenue").transform(o),I=e().matches(u,"Enter valid payment volume").transform(o),_=e().oneOf(r.map((e=>e.value)),"Select when service is received").transform(o),z=e().oneOf(n.map((e=>e.value)),"Select recurring payments").transform(o),q=e().when("business_recurring_payments",{is:e=>"Yes"===e,then:e=>e.required("Enter recurring payments percentage"),otherwise:e=>e.nullable()}).transform(o),C=e().oneOf(c.map((e=>e.value)),"Select seasonal business").transform(o),O=e().transform(o),T=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(o),Z=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(o),k=e().oneOf(i.map((e=>e.value)),"Select account type").transform(o),F=e().min(4,"Account number must be at least 4 digits").max(17,"Account number must be less than 17 digits").matches(u,"Enter valid account number").test("not-repeat","Enter valid account number",(e=>!/^(\d)\1+$/.test(e))).transform(o),R=e().length(9,"Routing number must be 9 digits").matches(u,"Enter valid routing number").test("not-repeat","Enter valid routing number",(e=>!/^(\d)\1+$/.test(e))).test("valid","Enter valid routing number",(e=>(e=>{if(!e)return!1;const a=Array.from(String(e),Number);return 9===a.length&&0==(3*(a[0]+a[3]+a[6])+7*(a[1]+a[4]+a[7])+(a[2]+a[5]+a[8]))%10})(e))).transform(o),Y=a(),G=(e,a)=>e.some((e=>e.document_type===l.voidedCheck))||a?Y.nullable():Y.required("Please select one or more files"),H=(e,a)=>e.some((e=>e.document_type===l.bankStatement))||a?Y.nullable():Y.required("Please select one or more files");export{Z as A,k as B,F as C,R as D,G as E,H as F,E as a,h as b,f as c,p as d,d as e,I as f,_ as g,z as h,S as i,q as j,$ as k,A as l,D as m,P as n,O as o,b as p,j as q,B as r,C as s,N as t,g as u,w as v,v as w,y as x,x as y,T as z}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as t,c as n}from"./p-
|
|
1
|
+
import{A as t,c as n}from"./p-4bad3621.js";class i{async fetchBusiness(i,s){const e=`entities/business/${i}`;return t({authToken:s,apiOrigin:n.proxyApiOrigin}).get(e)}async patchBusiness(i,s,e){const a=`entities/business/${s}`;return t({authToken:i,apiOrigin:n.proxyApiOrigin}).patch(a,e)}}class s{async fetchIdentity(i,s){const e=`entities/identity/${i}`;return t({authToken:s,apiOrigin:n.proxyApiOrigin}).get(e)}async patchIdentity(i,s,e){const a=`entities/identity/${s}`;return t({authToken:i,apiOrigin:n.proxyApiOrigin}).patch(a,e)}async postIdentity(i,s){return t({authToken:i,apiOrigin:n.proxyApiOrigin}).post("entities/identity",s)}}class e{async postBankAccount(i,s){return t({authToken:i,apiOrigin:n.proxyApiOrigin}).post("entities/bank_accounts",s)}}class a{async postDocumentRecord(i,s){return t({authToken:i,apiOrigin:n.proxyApiOrigin}).post("entities/document",s)}}export{i as B,a as D,s as I,e as a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-2783e363.js";import{m as o,P as
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-2783e363.js";import{m as o,P as e}from"./p-dd867d1f.js";import{C as r,a}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{P as p}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as h,a as d}from"./p-8115b2f4.js";import{E as c}from"./p-8f25f016.js";import{c as n,J as m}from"./p-933537ca.js";import"./p-4bad3621.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-d8c04275.js";import"./p-b2edb944.js";const u=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(){n(),this.analytics=new m(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 a;try{const c=await i.fetchPayout(t,s);c.error?e({error:h(c.error),code:d(null===(a=c.error)||void 0===a?void 0:a.code),severity:r.ERROR}):o(new p(c.data))}catch(t){e({error:h(t),code:d(null==t?void 0:t.code),severity:r.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:a.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?c(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{u as justifi_payout_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as n,H as t,g as i}from"./p-2783e363.js";import{c as o,F as a}from"./p-5844a0f0.js";import{u as r,l as s,k as c,m as d,n as f,q as l}from"./p-de13f23c.js";import{S as u}from"./p-6078a370.js";import{n as h}from"./p-e3c22aa9.js";import{F as m}from"./p-40e23b13.js";import{p as b}from"./p-c845cb7a.js";import{a as w}from"./p-4cc3c7f9.js";import{i as p,b as g,a as y,c as v,l as k}from"./p-d8c04275.js";import"./p-0ea387a2.js";import"./p-275f2154.js";import"./p-1ff8810b.js";import"./p-61f0a2ce.js";import"./p-f20b6ce1.js";const x=o({name:r.required("Enter full name"),address_line1:s.required("Enter street address"),address_line2:c.nullable(),address_city:d.required("Enter city"),address_state:f.required("Select state"),address_postal_code:l.required("Enter postal code")}),j=o({address_postal_code:l.required("Enter postal code")}),I=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new a(x)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return n(t,{key:"2763b7ac25e51e9d206d6a0bc6ed28ec13f54cc3"},n("form",{key:"758b52530cc945e9c3ce5a2ee11838a3776abc6b"},n("fieldset",{key:"2ab7312e043d3cbc03993f11ac5692692319af4b"},this.legend&&n("legend",{key:"8e324a5bb2fabc975742e866341a3434e1950a3c"},this.legend),n("div",{key:"fafd0d9fa2784341dc80fea8c53d081d2c84af5d",class:"row gy-3"},n("div",{key:"3aa18a756f3ea6ff9dcfa061cd845c714cab3540",class:"col-12"},n("form-control-text",{key:"4b75c876eef667f3d353c802376774e7c1af1b84",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),n("div",{key:"dddc81024aef4757c18b31db84204fc9e70f9ab1",class:"col-12"},n("form-control-text",{key:"d9d63301e3d87885de9414164c820df2013cb6ae",name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),n("div",{key:"f96675211a63fc785b9e759aef44f4dd4b22e0a3",class:"col-12"},n("form-control-text",{key:"f2c6a24150d640f9efbfa1748f577e32550b3507",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),n("div",{key:"83cf74afae2c4e899151cc5461a06632fef3c756",class:"col-12"},n("form-control-text",{key:"cbbf7dfac17eb69b2c9e80534051822cd4f94afd",name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),n("div",{key:"9331b691855dc4f9a60b746089552228a5b12942",class:"col-12"},n("form-control-select",{key:"f0f726fe2633ab45754691726a0008c4e50f41ac",name:"address_state",label:"State",options:u,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),n("div",{key:"0d1d00ca86d09a370330cd9f3807783a8cd981a4",class:"col-12"},n("form-control-text",{key:"0e43cfe70ca05a3d795d82f554453d12562b2ec9",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:h}))))))}};var z,O={exports:{}};z=O,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,a=!1,r=7,s="[iFrameSizer]",c=s.length,d=null,f=window.requestAnimationFrame,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},h=null,m=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),b={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){C(t,e)})).end()}):k("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof e&&e.amd?e([],P):z.exports=P(),window.iFrameResize=window.iFrameResize||P()}function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function p(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function y(e){return u[e]?u[e].log:o}function v(e,n){j("log",e,n,y(e))}function k(e,n){j("info",e,n,y(e))}function x(e,n){j("warn",e,n,!0)}function j(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),N((function(){H(_),S(W),m("onResized",_)}),_,"init")}function t(e){var n=Number(u[W]["max"+e]),t=Number(u[W]["min"+e]),i=e.toLowerCase(),o=Number(_[i]);v(W,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,v(W,"Set "+i+" to min value")),o>n&&(o=n,v(W,"Set "+i+" to max value")),_[i]=""+o}function i(e){return C.slice(C.indexOf(":")+r+e)}function o(e,n){var t,i;t=function(){var t,i;V("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=_.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},b[i=n]||(b[i]=setTimeout((function(){b[i]=null,t()}),32))}function a(e){var n=e.getBoundingClientRect();return T(W),{x:Math.floor(Number(n.left)+Number(d.x)),y:Math.floor(Number(n.top)+Number(d.y))}}function f(e){var n=e?a(_.iframe):{x:0,y:0},t={x:Number(_.width)+n.x,y:Number(_.height)+n.y};v(W,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(d=t,l(),v(W,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):x(W,"Unable to scroll to requested position, window.parentIFrame not found")}function l(){!1===m("onScroll",d)?R():S(W)}function h(e){var n={};if(0===Number(_.width)&&0===Number(_.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:_.width,y:_.height};m(e,{iframe:_.iframe,screenX:Number(n.x),screenY:Number(n.y),type:_.type})}function m(e,n){return O(W,e,n)}var w,y,j,I,z,M,C=e.data,_={},W=null;"[iFrameResizerChild]Ready"===C?function(){for(var e in u)V("iFrame requested init",L(e),u[e].iframe,e)}():s===(""+C).slice(0,c)&&C.slice(c).split(":")[0]in u?(I=(j=C.slice(c).split(":"))[1]?parseInt(j[1],10):0,z=u[j[0]]&&u[j[0]].iframe,M=getComputedStyle(z),_={iframe:z,id:j[0],height:I+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(M)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(M),width:j[2],type:j[3]},u[W=_.id]&&(u[W].loaded=!0),(y=_.type in{true:1,false:1,undefined:1})&&v(W,"Ignoring init message from meta parent page"),!y&&function(e){var n=!0;return u[e]||(n=!1,x(_.type+" No settings for "+e+". Message was: "+C)),n}(W)&&(v(W,"Received: "+C),w=!0,null===_.iframe&&(x(W,"IFrame ("+_.id+") not found"),w=!1),w&&function(){var n,t=e.origin,i=u[W]&&u[W].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(v(W,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(v(W,"Checking connection is from: "+(n=u[W]&&u[W].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+_.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[W]&&u[W].firstRun&&u[W]&&(u[W].firstRun=!1),_.type){case"close":F(_.iframe);break;case"message":c=i(6),v(W,"onMessage passed: {iframe: "+_.iframe.id+", message: "+c+"}"),m("onMessage",{iframe:_.iframe,message:JSON.parse(c)}),v(W,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":u[W].autoResize=JSON.parse(i(9));break;case"scrollTo":f(!1);break;case"scrollToOffset":f(!0);break;case"pageInfo":o(u[W]&&u[W].iframe,W),function(){function e(e,i){function a(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){v(t,e+n+" listener for sendPageInfo"),i(window,n,a)}))}function n(){e("Remove ",g)}var t=W;e("Add ",p),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[W]&&u[W].stopPageInfo&&(u[W].stopPageInfo(),delete u[W].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",r=decodeURIComponent(t),(s=document.getElementById(r)||document.getElementsByName(r)[0])?(e=a(s),v(W,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),d={x:e.x,y:e.y},l(),v(W,"--")):window.top===window.self?v(W,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):v(W,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":E(_);break;case"init":n(),m("onInit",_.iframe);break;default:0===Number(_.width)&&0===Number(_.height)?x("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,r,s,c}())):k(W,"Ignored: "+C)}function O(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function M(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==O(t,"onClose",t)){v(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}O(t,"onClosed",t),v(t,"--"),M(e),n&&(n.disconnect(),n=null)}else v(t,"Close iframe cancelled by onClose event")}function T(n){null===d&&v(n,"Get page position: "+(d={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+d.y)}function S(e){null!==d&&(window.scrollTo(d.x,d.y),v(e,"Set page position: "+d.x+","+d.y),R())}function R(){d=null}function E(e){v(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),T(e.id),N((function(){H(e),V("reset","reset",e.iframe,e.id)}),e,"reset")}function H(e){function n(n){a||"0"!==e[n]||(a=!0,v(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&V("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){v("window","Mutation observed: "+n[0].target+" "+n[0].type),_(e,16)}var t,i=w();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",v(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):v("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function N(e,n,t){t!==n.type&&f&&!window.jasmine?(v(n.id,"Requesting animation frame"),f(e)):e()}function V(e,n,t,i,o){var a,r=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(v(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(a=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,a)):x(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||r||(r=!0,x(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function L(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function C(t,a){function r(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],x(d,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,c,d=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=a&&a.id||m.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(a||{}).log,v(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);d in u&&"iFrameResizer"in t?x(d,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[d]=Object.create(null),u[d].iframe=t,u[d].firstRun=!0,u[d].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(r,e),function(e){for(var n in m)Object.prototype.hasOwnProperty.call(m,n)&&(u[d][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:m[n])}(e),u[d]&&(u[d].targetOrigin=!0===u[d].checkOrigin?""===(n=u[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(a),function(){switch(v(d,"IFrame scrolling "+(u[d]&&u[d].scrolling?"enabled":"disabled")+" for "+d),t.style.overflow=!1===(u[d]&&u[d].scrolling)?"hidden":"auto",u[d]&&u[d].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[d]?u[d].scrolling:"no"}}(),function(){function e(e){var n=u[d][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,v(d,"Set "+e+" = "+t.style[e]))}function n(e){if(u[d]["min"+e]>u[d]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[d]&&u[d].bodyMargin)&&"0"!==(u[d]&&u[d].bodyMargin)||(u[d].bodyMarginV1=u[d].bodyMargin,u[d].bodyMargin=u[d].bodyMargin+"px"),s=L(d),(c=w())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),p(t,"load",(function(){V("iFrame.onload",s,t,e,!0),(!u[d]||!u[d].firstRun)&&u[d]&&u[d].heightCalculationMethod in l&&E({iframe:t,height:0,width:0,type:"init"})})),V("init",s,t,e,!0),u[d]&&(u[d].iframe.iFrameResizer={close:F.bind(null,u[d].iframe),removeListeners:M.bind(null,u[d].iframe),resize:V.bind(null,"Window resize","resize",u[d].iframe),moveToAnchor:function(e){V("Move to anchor","moveToAnchor:"+e,u[d].iframe,d)},sendMessage:function(e){V("Send Message","message:"+(e=JSON.stringify(e)),u[d].iframe,d)}}))}function _(e,n){null===h&&(h=setTimeout((function(){h=null,e()}),n))}function W(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visibility change"),_((function(){A("Tab Visible","resize")}),16))}function A(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&V(e,n,u[t].iframe,t)}))}function P(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),C(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!f;e+=1)f=window[n[e]+"RequestAnimationFrame"];f?f=f.bind(window):v("setup","RequestAnimationFrame not supported")}(),p(window,"message",I),p(window,"resize",(function(){v("window","Trigger event: resize"),_((function(){A("Window resize","resize")}),16)})),p(document,"visibilitychange",W),p(document,"-webkit-visibilitychange",W),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&x("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}();const M=O.exports;class F{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const T=class{constructor(n){e(this,n),this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))},this.isFocused=!1,this.isValid=!0,this.errorText=void 0,this.iframeLoaded=!1,this.inputId=void 0,this.label=void 0,this.iframeOrigin=void 0}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:b.version})}initializeFrameCommunicationService(){var e;this.frameService=new F(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?p:this.isValid?this.isFocused?y:v:g}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"00956724f4d6e72b09c2c469613a6362a3c7cdec",class:"form-group d-flex flex-column"},n("div",{key:"e6605bd5ef7356c21701b0856a133758720a36d6",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"f52a782a9f1bbca4a8a6e36da1948611ab834e54",class:"form-label",htmlFor:"",part:k},this.label||""),n("div",{key:"b88199f3de1b52a0aed4d61c0448c293964a7279",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"218aa6d48b12c1fc78f04a1556f0a32738c20df4",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{M({log:!1,onResized:()=>{this.iframeLoaded=!0}},this.iframeElement)}})),n(m,{key:"f6e57608fc771ca78e39618455dfe57cd40a655a",errorText:this.errorText,name:this.inputId})))}get el(){return i(this)}},S=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new a(j)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return n(t,{key:"e798e67c159b53a995e4a60246c6f6d6e872f1ec"},n("form",{key:"24d6980de772a360c0218e9ab50550dcee5786d5"},n("fieldset",{key:"9e990836becccdf5d12a9e15e2eb7f4078f74b08"},this.legend&&n("legend",{key:"12d445b392cf03114dbd2a37391ecc1b87304868"},this.legend),n("div",{key:"2d2fed9cf30b3869633b80b39b7684dfde66f6b7",class:"row gy-3"},n("div",{key:"8ec042863e646d5daffeb3fbb5395336406adcde",class:"col-12"},n("form-control-text",{key:"82a2c18c2a7eef7ba7ac46e53dfc9c975c8d28b7",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:h}))))))}};export{I as billing_form,T as iframe_input,S as postal_form}
|
|
1
|
+
import{r as e,h as n,H as t,g as i}from"./p-2783e363.js";import{c as o,F as a}from"./p-5844a0f0.js";import{u as r,l as s,k as c,m as d,n as f,q as l}from"./p-27c8ffa2.js";import{S as u}from"./p-6078a370.js";import{n as h}from"./p-e3c22aa9.js";import{F as m}from"./p-40e23b13.js";import{p as b}from"./p-b2edb944.js";import{a as w}from"./p-4cc3c7f9.js";import{i as p,b as g,a as y,c as v,l as k}from"./p-d8c04275.js";import"./p-0ea387a2.js";import"./p-275f2154.js";import"./p-1ff8810b.js";import"./p-61f0a2ce.js";import"./p-f20b6ce1.js";const x=o({name:r.required("Enter full name"),address_line1:s.required("Enter street address"),address_line2:c.nullable(),address_city:d.required("Enter city"),address_state:f.required("Select state"),address_postal_code:l.required("Enter postal code")}),j=o({address_postal_code:l.required("Enter postal code")}),I=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new a(x)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return n(t,{key:"2763b7ac25e51e9d206d6a0bc6ed28ec13f54cc3"},n("form",{key:"758b52530cc945e9c3ce5a2ee11838a3776abc6b"},n("fieldset",{key:"2ab7312e043d3cbc03993f11ac5692692319af4b"},this.legend&&n("legend",{key:"8e324a5bb2fabc975742e866341a3434e1950a3c"},this.legend),n("div",{key:"fafd0d9fa2784341dc80fea8c53d081d2c84af5d",class:"row gy-3"},n("div",{key:"3aa18a756f3ea6ff9dcfa061cd845c714cab3540",class:"col-12"},n("form-control-text",{key:"4b75c876eef667f3d353c802376774e7c1af1b84",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),n("div",{key:"dddc81024aef4757c18b31db84204fc9e70f9ab1",class:"col-12"},n("form-control-text",{key:"d9d63301e3d87885de9414164c820df2013cb6ae",name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),n("div",{key:"f96675211a63fc785b9e759aef44f4dd4b22e0a3",class:"col-12"},n("form-control-text",{key:"f2c6a24150d640f9efbfa1748f577e32550b3507",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),n("div",{key:"83cf74afae2c4e899151cc5461a06632fef3c756",class:"col-12"},n("form-control-text",{key:"cbbf7dfac17eb69b2c9e80534051822cd4f94afd",name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),n("div",{key:"9331b691855dc4f9a60b746089552228a5b12942",class:"col-12"},n("form-control-select",{key:"f0f726fe2633ab45754691726a0008c4e50f41ac",name:"address_state",label:"State",options:u,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),n("div",{key:"0d1d00ca86d09a370330cd9f3807783a8cd981a4",class:"col-12"},n("form-control-text",{key:"0e43cfe70ca05a3d795d82f554453d12562b2ec9",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:h}))))))}};var z,O={exports:{}};z=O,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,a=!1,r=7,s="[iFrameSizer]",c=s.length,d=null,f=window.requestAnimationFrame,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},h=null,m=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),b={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){C(t,e)})).end()}):k("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof e&&e.amd?e([],P):z.exports=P(),window.iFrameResize=window.iFrameResize||P()}function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function p(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function y(e){return u[e]?u[e].log:o}function v(e,n){j("log",e,n,y(e))}function k(e,n){j("info",e,n,y(e))}function x(e,n){j("warn",e,n,!0)}function j(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),N((function(){H(_),S(W),m("onResized",_)}),_,"init")}function t(e){var n=Number(u[W]["max"+e]),t=Number(u[W]["min"+e]),i=e.toLowerCase(),o=Number(_[i]);v(W,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,v(W,"Set "+i+" to min value")),o>n&&(o=n,v(W,"Set "+i+" to max value")),_[i]=""+o}function i(e){return C.slice(C.indexOf(":")+r+e)}function o(e,n){var t,i;t=function(){var t,i;V("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=_.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},b[i=n]||(b[i]=setTimeout((function(){b[i]=null,t()}),32))}function a(e){var n=e.getBoundingClientRect();return T(W),{x:Math.floor(Number(n.left)+Number(d.x)),y:Math.floor(Number(n.top)+Number(d.y))}}function f(e){var n=e?a(_.iframe):{x:0,y:0},t={x:Number(_.width)+n.x,y:Number(_.height)+n.y};v(W,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(d=t,l(),v(W,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):x(W,"Unable to scroll to requested position, window.parentIFrame not found")}function l(){!1===m("onScroll",d)?R():S(W)}function h(e){var n={};if(0===Number(_.width)&&0===Number(_.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:_.width,y:_.height};m(e,{iframe:_.iframe,screenX:Number(n.x),screenY:Number(n.y),type:_.type})}function m(e,n){return O(W,e,n)}var w,y,j,I,z,M,C=e.data,_={},W=null;"[iFrameResizerChild]Ready"===C?function(){for(var e in u)V("iFrame requested init",L(e),u[e].iframe,e)}():s===(""+C).slice(0,c)&&C.slice(c).split(":")[0]in u?(I=(j=C.slice(c).split(":"))[1]?parseInt(j[1],10):0,z=u[j[0]]&&u[j[0]].iframe,M=getComputedStyle(z),_={iframe:z,id:j[0],height:I+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(M)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(M),width:j[2],type:j[3]},u[W=_.id]&&(u[W].loaded=!0),(y=_.type in{true:1,false:1,undefined:1})&&v(W,"Ignoring init message from meta parent page"),!y&&function(e){var n=!0;return u[e]||(n=!1,x(_.type+" No settings for "+e+". Message was: "+C)),n}(W)&&(v(W,"Received: "+C),w=!0,null===_.iframe&&(x(W,"IFrame ("+_.id+") not found"),w=!1),w&&function(){var n,t=e.origin,i=u[W]&&u[W].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(v(W,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(v(W,"Checking connection is from: "+(n=u[W]&&u[W].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+_.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[W]&&u[W].firstRun&&u[W]&&(u[W].firstRun=!1),_.type){case"close":F(_.iframe);break;case"message":c=i(6),v(W,"onMessage passed: {iframe: "+_.iframe.id+", message: "+c+"}"),m("onMessage",{iframe:_.iframe,message:JSON.parse(c)}),v(W,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":u[W].autoResize=JSON.parse(i(9));break;case"scrollTo":f(!1);break;case"scrollToOffset":f(!0);break;case"pageInfo":o(u[W]&&u[W].iframe,W),function(){function e(e,i){function a(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){v(t,e+n+" listener for sendPageInfo"),i(window,n,a)}))}function n(){e("Remove ",g)}var t=W;e("Add ",p),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[W]&&u[W].stopPageInfo&&(u[W].stopPageInfo(),delete u[W].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",r=decodeURIComponent(t),(s=document.getElementById(r)||document.getElementsByName(r)[0])?(e=a(s),v(W,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),d={x:e.x,y:e.y},l(),v(W,"--")):window.top===window.self?v(W,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):v(W,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":E(_);break;case"init":n(),m("onInit",_.iframe);break;default:0===Number(_.width)&&0===Number(_.height)?x("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,r,s,c}())):k(W,"Ignored: "+C)}function O(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function M(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==O(t,"onClose",t)){v(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}O(t,"onClosed",t),v(t,"--"),M(e),n&&(n.disconnect(),n=null)}else v(t,"Close iframe cancelled by onClose event")}function T(n){null===d&&v(n,"Get page position: "+(d={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+d.y)}function S(e){null!==d&&(window.scrollTo(d.x,d.y),v(e,"Set page position: "+d.x+","+d.y),R())}function R(){d=null}function E(e){v(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),T(e.id),N((function(){H(e),V("reset","reset",e.iframe,e.id)}),e,"reset")}function H(e){function n(n){a||"0"!==e[n]||(a=!0,v(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&V("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){v("window","Mutation observed: "+n[0].target+" "+n[0].type),_(e,16)}var t,i=w();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",v(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):v("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function N(e,n,t){t!==n.type&&f&&!window.jasmine?(v(n.id,"Requesting animation frame"),f(e)):e()}function V(e,n,t,i,o){var a,r=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(v(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(a=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,a)):x(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||r||(r=!0,x(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function L(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function C(t,a){function r(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],x(d,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,c,d=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=a&&a.id||m.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(a||{}).log,v(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);d in u&&"iFrameResizer"in t?x(d,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[d]=Object.create(null),u[d].iframe=t,u[d].firstRun=!0,u[d].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(r,e),function(e){for(var n in m)Object.prototype.hasOwnProperty.call(m,n)&&(u[d][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:m[n])}(e),u[d]&&(u[d].targetOrigin=!0===u[d].checkOrigin?""===(n=u[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(a),function(){switch(v(d,"IFrame scrolling "+(u[d]&&u[d].scrolling?"enabled":"disabled")+" for "+d),t.style.overflow=!1===(u[d]&&u[d].scrolling)?"hidden":"auto",u[d]&&u[d].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[d]?u[d].scrolling:"no"}}(),function(){function e(e){var n=u[d][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,v(d,"Set "+e+" = "+t.style[e]))}function n(e){if(u[d]["min"+e]>u[d]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[d]&&u[d].bodyMargin)&&"0"!==(u[d]&&u[d].bodyMargin)||(u[d].bodyMarginV1=u[d].bodyMargin,u[d].bodyMargin=u[d].bodyMargin+"px"),s=L(d),(c=w())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),p(t,"load",(function(){V("iFrame.onload",s,t,e,!0),(!u[d]||!u[d].firstRun)&&u[d]&&u[d].heightCalculationMethod in l&&E({iframe:t,height:0,width:0,type:"init"})})),V("init",s,t,e,!0),u[d]&&(u[d].iframe.iFrameResizer={close:F.bind(null,u[d].iframe),removeListeners:M.bind(null,u[d].iframe),resize:V.bind(null,"Window resize","resize",u[d].iframe),moveToAnchor:function(e){V("Move to anchor","moveToAnchor:"+e,u[d].iframe,d)},sendMessage:function(e){V("Send Message","message:"+(e=JSON.stringify(e)),u[d].iframe,d)}}))}function _(e,n){null===h&&(h=setTimeout((function(){h=null,e()}),n))}function W(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visibility change"),_((function(){A("Tab Visible","resize")}),16))}function A(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&V(e,n,u[t].iframe,t)}))}function P(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),C(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!f;e+=1)f=window[n[e]+"RequestAnimationFrame"];f?f=f.bind(window):v("setup","RequestAnimationFrame not supported")}(),p(window,"message",I),p(window,"resize",(function(){v("window","Trigger event: resize"),_((function(){A("Window resize","resize")}),16)})),p(document,"visibilitychange",W),p(document,"-webkit-visibilitychange",W),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&x("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}();const M=O.exports;class F{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const T=class{constructor(n){e(this,n),this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))},this.isFocused=!1,this.isValid=!0,this.errorText=void 0,this.iframeLoaded=!1,this.inputId=void 0,this.label=void 0,this.iframeOrigin=void 0}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:b.version})}initializeFrameCommunicationService(){var e;this.frameService=new F(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?p:this.isValid?this.isFocused?y:v:g}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"00956724f4d6e72b09c2c469613a6362a3c7cdec",class:"form-group d-flex flex-column"},n("div",{key:"e6605bd5ef7356c21701b0856a133758720a36d6",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"f52a782a9f1bbca4a8a6e36da1948611ab834e54",class:"form-label",htmlFor:"",part:k},this.label||""),n("div",{key:"b88199f3de1b52a0aed4d61c0448c293964a7279",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"218aa6d48b12c1fc78f04a1556f0a32738c20df4",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{M({log:!1,onResized:()=>{this.iframeLoaded=!0}},this.iframeElement)}})),n(m,{key:"f6e57608fc771ca78e39618455dfe57cd40a655a",errorText:this.errorText,name:this.inputId})))}get el(){return i(this)}},S=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new a(j)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return n(t,{key:"e798e67c159b53a995e4a60246c6f6d6e872f1ec"},n("form",{key:"24d6980de772a360c0218e9ab50550dcee5786d5"},n("fieldset",{key:"9e990836becccdf5d12a9e15e2eb7f4078f74b08"},this.legend&&n("legend",{key:"12d445b392cf03114dbd2a37391ecc1b87304868"},this.legend),n("div",{key:"2d2fed9cf30b3869633b80b39b7684dfde66f6b7",class:"row gy-3"},n("div",{key:"8ec042863e646d5daffeb3fbb5395336406adcde",class:"col-12"},n("form-control-text",{key:"82a2c18c2a7eef7ba7ac46e53dfc9c975c8d28b7",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:h}))))))}};export{I as billing_form,T as iframe_input,S as postal_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as i,h as t,H as r}from"./p-2783e363.js";import{E as e}from"./p-8f25f016.js";import{B as o}from"./p-35b00a0d.js";import{B as a}from"./p-275f2154.js";import{C as n,a as d}from"./p-14c91ffd.js";import{g as h,a as p}from"./p-8115b2f4.js";import{c,J as m}from"./p-933537ca.js";import"./p-d8c04275.js";import"./p-4bad3621.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-b2edb944.js";const u=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(){c(),this.analytics=new m(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:d.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 d=await t.fetchBusiness(s,i);if(d.error)return e({error:h(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});r({business:new a(d.data)})}catch(s){const i=p(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{u as justifi_business_details}
|