@justifi/webcomponents 6.10.2 → 6.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -2
- package/dist/cjs/{badge-Cl6qJPK_.js → badge-Bd6H9TX2.js} +1 -1
- package/dist/cjs/bank-account-document-form-inputs_9.cjs.entry.js +7 -13
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/business-details-core.cjs.entry.js +3 -3
- package/dist/cjs/button-DAbSQPoU.js +43 -0
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-axrC8Ato.js → check-pkg-version-Mv0ez8Cf.js} +1 -1
- package/dist/cjs/checkouts-list-core.cjs.entry.js +5 -5
- package/dist/cjs/{checkouts-table-CXgizBib.js → checkouts-table-KuNixae0.js} +2 -2
- package/dist/cjs/custom-popper_2.cjs.entry.js +1 -1
- package/dist/cjs/form-alert_5.cjs.entry.js +1 -1
- package/dist/cjs/form-control-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/form-control-date.cjs.entry.js +2 -2
- package/dist/cjs/{form-control-error-text-6-HeM6bw.js → form-control-error-text-C4Wqr79O.js} +1 -1
- package/dist/cjs/form-control-file-v2_2.cjs.entry.js +2 -2
- package/dist/cjs/{form-control-help-text-D0LaZkGk.js → form-control-help-text-Bo9d_mCH.js} +1 -1
- package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +3 -3
- package/dist/cjs/form-control-monetary.cjs.entry.js +3 -3
- package/dist/cjs/form-control-number-masked_3.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number_3.cjs.entry.js +4 -4
- package/dist/cjs/form-control-radio.cjs.entry.js +1 -1
- package/dist/cjs/form-control-select_2.cjs.entry.js +2 -2
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +3 -3
- package/dist/cjs/{header-1-BOijdmPN.js → header-1-DR-eAlp1.js} +1 -1
- package/dist/cjs/{header-3-FeTJjrR1.js → header-3-kgnQtxEu.js} +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +3 -3
- package/dist/cjs/{insurance-state-DIV_moDI.js → insurance-state-CRhLwPxQ.js} +1 -1
- package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +5 -5
- package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +73 -65
- package/dist/cjs/justifi-additional-statement_8.cjs.entry.js +1 -1
- package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +26 -19
- package/dist/cjs/justifi-bank-account-billing-form-simple_3.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.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +5 -5
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -4
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payments-list.cjs.entry.js +6 -6
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +6 -6
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +5 -5
- package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -5
- package/dist/cjs/justifi-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +5 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-CAxc3X25.js → package-OpgJzVo3.js} +1 -1
- package/dist/cjs/pagination-menu.cjs.entry.js +1 -1
- package/dist/cjs/{parts-C0AyF3nd.js → parts-WjOn_TIy.js} +16 -0
- package/dist/cjs/payment-details-core.cjs.entry.js +5 -5
- package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
- package/dist/cjs/{payment-provisioning-loading-CbcFPETB.js → payment-provisioning-loading-BHAFHTuI.js} +1 -1
- package/dist/cjs/payments-list-core.cjs.entry.js +6 -6
- package/dist/cjs/{payments-status-EZ95BQex.js → payments-status-BngaUiWA.js} +1 -1
- package/dist/cjs/{payments-table-D5Hw3JDe.js → payments-table-DFOF8yrM.js} +2 -2
- package/dist/cjs/payout-details-core.cjs.entry.js +9 -9
- package/dist/cjs/payouts-list-core.cjs.entry.js +6 -6
- package/dist/cjs/{payouts-status-D1IbE3-c.js → payouts-status-CP5T9uAc.js} +1 -1
- package/dist/cjs/{payouts-table-DmVthJLU.js → payouts-table-CHNRLZ3K.js} +2 -2
- package/dist/cjs/plaid.service-DvbLnuph.js +43 -0
- package/dist/cjs/{skeleton-C9Aio7v_.js → skeleton-BfN_sjaY.js} +1 -1
- package/dist/cjs/{spinner-oLSXKwxU.js → spinner-51BOfCoS.js} +1 -1
- package/dist/cjs/{table-CEW0_wq-.js → table-CimkSek7.js} +2 -2
- package/dist/cjs/table-filters-menu.cjs.entry.js +2 -2
- package/dist/cjs/terminal-orders-list-core.cjs.entry.js +5 -5
- package/dist/cjs/{terminal-orders-table-DPHz95-0.js → terminal-orders-table-DDLvv83x.js} +2 -2
- package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
- package/dist/cjs/terminals-list-core.cjs.entry.js +5 -5
- package/dist/cjs/{terminals-table-C6rm50Mk.js → terminals-table-BU73whCF.js} +2 -2
- package/dist/cjs/{utils-Vwo0VR7n.js → utils-CowQ4GdN.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +71 -64
- package/dist/collection/components/business-forms/payment-provisioning/plaid-verification/plaid-verification.js +1 -8
- package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +14 -9
- package/dist/collection/components/payout-details/payout-details-core.js +3 -3
- package/dist/collection/styles/parts.js +7 -0
- package/dist/collection/ui-components/button.js +27 -3
- package/dist/docs.json +14 -14
- package/dist/esm/additional-questions-details_5.entry.js +2 -2
- package/dist/esm/{badge-AZ7Z3PKH.js → badge-BfWXAKIJ.js} +1 -1
- package/dist/esm/bank-account-document-form-inputs_9.entry.js +6 -12
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/business-details-core.entry.js +3 -3
- package/dist/esm/button-DoF-zpiW.js +41 -0
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-BVLXSZXz.js → check-pkg-version-QOngucT4.js} +1 -1
- package/dist/esm/checkouts-list-core.entry.js +5 -5
- package/dist/esm/{checkouts-table-C5aYyqpX.js → checkouts-table-XjFiAWCw.js} +2 -2
- package/dist/esm/custom-popper_2.entry.js +1 -1
- package/dist/esm/form-alert_5.entry.js +1 -1
- package/dist/esm/form-control-checkbox.entry.js +3 -3
- package/dist/esm/form-control-date.entry.js +2 -2
- package/dist/esm/{form-control-error-text-xEskXF-M.js → form-control-error-text-D5B0Wy4Q.js} +1 -1
- package/dist/esm/form-control-file-v2_2.entry.js +2 -2
- package/dist/esm/{form-control-help-text-Dgnv4IId.js → form-control-help-text-XuRclELV.js} +1 -1
- package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
- package/dist/esm/form-control-monetary.entry.js +3 -3
- package/dist/esm/form-control-number-masked_3.entry.js +2 -2
- package/dist/esm/form-control-number_3.entry.js +4 -4
- package/dist/esm/form-control-radio.entry.js +1 -1
- package/dist/esm/form-control-select_2.entry.js +2 -2
- package/dist/esm/gross-payment-chart-core.entry.js +3 -3
- package/dist/esm/{header-1-xlSavD5o.js → header-1-BIaO3iDb.js} +1 -1
- package/dist/esm/{header-3-egutsoDI.js → header-3-UswhFvUr.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +3 -3
- package/dist/esm/{insurance-state-jZTKdt60.js → insurance-state-MpA7uaXF.js} +1 -1
- package/dist/esm/internal-tokenize-payment-method_7.entry.js +5 -5
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +73 -65
- package/dist/esm/justifi-additional-statement_8.entry.js +1 -1
- package/dist/esm/justifi-apple-pay_8.entry.js +23 -16
- package/dist/esm/justifi-bank-account-billing-form-simple_3.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.entry.js +3 -3
- package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
- package/dist/esm/justifi-checkouts-list.entry.js +5 -5
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +2 -2
- package/dist/esm/justifi-dispute-notification_3.entry.js +5 -5
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
- package/dist/esm/justifi-order-terminals.entry.js +4 -4
- package/dist/esm/justifi-payment-details.entry.js +4 -4
- package/dist/esm/justifi-payment-provisioning-core.entry.js +4 -4
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payment-transactions-list.entry.js +5 -5
- package/dist/esm/justifi-payments-list-filters.entry.js +1 -1
- package/dist/esm/justifi-payments-list.entry.js +6 -6
- package/dist/esm/justifi-payout-details.entry.js +4 -4
- package/dist/esm/justifi-payout-transactions-list.entry.js +5 -5
- package/dist/esm/justifi-payouts-list-filters.entry.js +1 -1
- package/dist/esm/justifi-payouts-list.entry.js +6 -6
- package/dist/esm/justifi-refund-payment.entry.js +5 -5
- package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +5 -5
- package/dist/esm/justifi-skeleton.entry.js +2 -2
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list.entry.js +5 -5
- package/dist/esm/justifi-terminals-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminals-list.entry.js +5 -5
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-Bjv3eJBk.js → package-Cc6518FT.js} +1 -1
- package/dist/esm/pagination-menu.entry.js +1 -1
- package/dist/esm/{parts-C4FLe2pT.js → parts-c8J1gsDg.js} +9 -1
- package/dist/esm/payment-details-core.entry.js +5 -5
- package/dist/esm/payment-method-option.entry.js +1 -1
- package/dist/esm/{payment-provisioning-loading-D_VKtlLm.js → payment-provisioning-loading-DRFgrvp1.js} +1 -1
- package/dist/esm/payments-list-core.entry.js +6 -6
- package/dist/esm/{payments-status-D4XkcfLU.js → payments-status-Dkt38hpB.js} +1 -1
- package/dist/esm/{payments-table-BDaiD836.js → payments-table-ghXGJ-N6.js} +2 -2
- package/dist/esm/payout-details-core.entry.js +9 -9
- package/dist/esm/payouts-list-core.entry.js +6 -6
- package/dist/esm/{payouts-status-BR1vd6-D.js → payouts-status-B4iry-1w.js} +1 -1
- package/dist/esm/{payouts-table-B4nuJlpC.js → payouts-table-CBsTdL9_.js} +2 -2
- package/dist/esm/plaid.service-C59iS7tB.js +41 -0
- package/dist/esm/{skeleton-C162KC3u.js → skeleton-DzBAY0bs.js} +1 -1
- package/dist/esm/{spinner-BfjGGaND.js → spinner-DQpyMqKv.js} +1 -1
- package/dist/esm/{table-hHARNoRM.js → table-BwxLvetJ.js} +2 -2
- package/dist/esm/table-filters-menu.entry.js +2 -2
- package/dist/esm/terminal-orders-list-core.entry.js +5 -5
- package/dist/esm/{terminal-orders-table-B-xs6ocO.js → terminal-orders-table-Cy0qV96Y.js} +2 -2
- package/dist/esm/terminal-quantity-selector.entry.js +1 -1
- package/dist/esm/terminals-list-core.entry.js +5 -5
- package/dist/esm/{terminals-table-CnKH-UOw.js → terminals-table-BQQs_JoR.js} +2 -2
- package/dist/esm/{utils-BSpK1eMX.js → utils-BGbtbDiV.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/additional-statement.js +1 -1
- package/dist/module/apple-pay.js +13 -8
- package/dist/module/business-bank-account-form-step.js +71 -64
- package/dist/module/button.js +27 -3
- package/dist/module/cancellation-policy.js +1 -1
- package/dist/module/checkout.store.js +1 -1
- package/dist/module/checkouts-list-core2.js +1 -1
- package/dist/module/customer-details.js +1 -1
- package/dist/module/duplicate-charge.js +1 -1
- package/dist/module/electronic-evidence.js +1 -1
- package/dist/module/justifi-checkout.js +1 -1
- package/dist/module/justifi-checkouts-list-filters.js +1 -1
- package/dist/module/justifi-order-terminals.js +1 -1
- package/dist/module/justifi-payment-transactions-list.js +1 -1
- package/dist/module/justifi-payments-list-filters.js +1 -1
- package/dist/module/justifi-payout-transactions-list.js +1 -1
- package/dist/module/justifi-payouts-list-filters.js +1 -1
- package/dist/module/justifi-terminal-orders-list-filters.js +1 -1
- package/dist/module/justifi-terminals-list-filters.js +1 -1
- package/dist/module/modular-checkout.js +1 -1
- package/dist/module/package.js +1 -1
- package/dist/module/parts.js +9 -1
- package/dist/module/payments-list-core2.js +1 -1
- package/dist/module/payout-details-core2.js +3 -3
- package/dist/module/payouts-list-core2.js +1 -1
- package/dist/module/plaid-payment-method.js +3 -2
- package/dist/module/plaid-verification2.js +1 -8
- package/dist/module/product-or-service.js +1 -1
- package/dist/module/refund-policy.js +1 -1
- package/dist/module/shipping-details.js +1 -1
- package/dist/module/table-filters-menu2.js +1 -1
- package/dist/module/table.js +1 -1
- package/dist/module/terminal-orders-list-core2.js +1 -1
- package/dist/module/terminals-list-core2.js +1 -1
- package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +10 -3
- package/dist/types/styles/parts.d.ts +7 -0
- package/dist/types/ui-components/button.d.ts +2 -1
- package/dist/webcomponents/{p-52dc271f.entry.js → p-01a84bc8.entry.js} +1 -1
- package/dist/webcomponents/p-02cf51ab.entry.js +1 -0
- package/dist/webcomponents/p-0559b9c1.entry.js +1 -0
- package/dist/webcomponents/{p-b61080bd.entry.js → p-06af9f9f.entry.js} +1 -1
- package/dist/webcomponents/{p-8e631781.entry.js → p-09401e56.entry.js} +1 -1
- package/dist/webcomponents/{p-05d11c40.entry.js → p-2531ee6c.entry.js} +1 -1
- package/dist/webcomponents/{p-8a42d4fe.entry.js → p-27518699.entry.js} +1 -1
- package/dist/webcomponents/{p-282134de.entry.js → p-277bc549.entry.js} +1 -1
- package/dist/webcomponents/{p-1b973781.entry.js → p-2b60c926.entry.js} +1 -1
- package/dist/webcomponents/{p-ec933218.entry.js → p-319ac08d.entry.js} +1 -1
- package/dist/webcomponents/p-32bf8202.entry.js +1 -0
- package/dist/webcomponents/p-3469a272.entry.js +1 -0
- package/dist/webcomponents/{p-19f1e643.entry.js → p-37407a7f.entry.js} +1 -1
- package/dist/webcomponents/{p-b54bf8da.entry.js → p-392c431d.entry.js} +1 -1
- package/dist/webcomponents/{p-11402020.entry.js → p-3cfc202a.entry.js} +1 -1
- package/dist/webcomponents/{p-BqpQa748.js → p-3kNggPyP.js} +1 -1
- package/dist/webcomponents/{p-6486555d.entry.js → p-43c70ddf.entry.js} +1 -1
- package/dist/webcomponents/{p-bcba5950.entry.js → p-4556535d.entry.js} +1 -1
- package/dist/webcomponents/{p-402ba9aa.entry.js → p-559ff95b.entry.js} +1 -1
- package/dist/webcomponents/p-56362fb6.entry.js +1 -0
- package/dist/webcomponents/{p-c7930f9a.entry.js → p-5895654d.entry.js} +1 -1
- package/dist/webcomponents/{p-154efb83.entry.js → p-5d4e607a.entry.js} +1 -1
- package/dist/webcomponents/{p-c72c5b99.entry.js → p-5d5e26f7.entry.js} +1 -1
- package/dist/webcomponents/{p-643f1616.entry.js → p-64d78daf.entry.js} +1 -1
- package/dist/webcomponents/{p-d36725a3.entry.js → p-654573c2.entry.js} +1 -1
- package/dist/webcomponents/p-6986bd9d.entry.js +1 -0
- package/dist/webcomponents/{p-0f1c100d.entry.js → p-6b6195c9.entry.js} +1 -1
- package/dist/webcomponents/{p-a105de67.entry.js → p-6b6d8263.entry.js} +1 -1
- package/dist/webcomponents/p-71b6fdd9.entry.js +1 -0
- package/dist/webcomponents/p-77CuiIig.js +1 -0
- package/dist/webcomponents/{p-c6aee723.entry.js → p-79975b5d.entry.js} +1 -1
- package/dist/webcomponents/{p-808bf425.entry.js → p-79d76cd4.entry.js} +1 -1
- package/dist/webcomponents/{p-2d39358b.entry.js → p-81b3f90f.entry.js} +1 -1
- package/dist/webcomponents/{p-e8f9b081.entry.js → p-91bf7445.entry.js} +1 -1
- package/dist/webcomponents/{p-c0592f5f.entry.js → p-91ee58e0.entry.js} +1 -1
- package/dist/webcomponents/{p-f1b99b0d.entry.js → p-941eac67.entry.js} +1 -1
- package/dist/webcomponents/{p-8dc8ad9a.entry.js → p-9438f755.entry.js} +1 -1
- package/dist/webcomponents/{p-d7bd9d76.entry.js → p-95b78da8.entry.js} +1 -1
- package/dist/webcomponents/{p-9a11f17b.entry.js → p-98a1b12a.entry.js} +1 -1
- package/dist/webcomponents/{p-5206cd09.entry.js → p-9eeaf2f9.entry.js} +1 -1
- package/dist/webcomponents/p-BBNT9yj5.js +1 -0
- package/dist/webcomponents/p-BMqYkvp1.js +1 -0
- package/dist/webcomponents/p-BnVuFEgH.js +1 -0
- package/dist/webcomponents/{p-DAZtHA62.js → p-BylxH1fV.js} +1 -1
- package/dist/webcomponents/{p-DyJ1zSHJ.js → p-C47u26qr.js} +1 -1
- package/dist/webcomponents/{p-CIh-k9yP.js → p-CMq8FpAG.js} +1 -1
- package/dist/webcomponents/{p-CGJ_mnry.js → p-CV5ZI_qC.js} +1 -1
- package/dist/webcomponents/{p-DsT0m0mo.js → p-CVa33GsE.js} +1 -1
- package/dist/webcomponents/p-CVkk7TvR.js +1 -0
- package/dist/webcomponents/p-Cc6518FT.js +1 -0
- package/dist/webcomponents/p-CmRrs0bo.js +1 -0
- package/dist/webcomponents/p-CmYy5XDp.js +1 -0
- package/dist/webcomponents/p-CncaMWc8.js +1 -0
- package/dist/webcomponents/{p-CJZ09QNH.js → p-CtxSp8dd.js} +1 -1
- package/dist/webcomponents/{p-5mt2ek0H.js → p-DL3PPUGZ.js} +1 -1
- package/dist/webcomponents/p-DmrpBh4P.js +1 -0
- package/dist/webcomponents/p-DrSNQm-e.js +1 -0
- package/dist/webcomponents/{p-HfLk4CG0.js → p-DvptzT44.js} +1 -1
- package/dist/webcomponents/{p-C3kbpEIZ.js → p-PtJwUDIK.js} +1 -1
- package/dist/webcomponents/p-a0134f5a.entry.js +1 -0
- package/dist/webcomponents/{p-cb9abd2c.entry.js → p-a6d56b36.entry.js} +1 -1
- package/dist/webcomponents/{p-c6a9410d.entry.js → p-a75bc18b.entry.js} +1 -1
- package/dist/webcomponents/{p-21620dd2.entry.js → p-abc769fa.entry.js} +1 -1
- package/dist/webcomponents/{p-4fc5ffda.entry.js → p-b3675b20.entry.js} +1 -1
- package/dist/webcomponents/{p-DYEXDs2k.js → p-b4MDVEve.js} +1 -1
- package/dist/webcomponents/{p-e71e4c49.entry.js → p-b9248f88.entry.js} +1 -1
- package/dist/webcomponents/p-bafe9deb.entry.js +1 -0
- package/dist/webcomponents/p-bb4da414.entry.js +1 -0
- package/dist/webcomponents/{p-4ebaafe3.entry.js → p-c5540693.entry.js} +1 -1
- package/dist/webcomponents/p-c8J1gsDg.js +1 -0
- package/dist/webcomponents/{p-9d69ae9f.entry.js → p-d07748fa.entry.js} +4 -4
- package/dist/webcomponents/{p-5862236f.entry.js → p-d0abe57d.entry.js} +1 -1
- package/dist/webcomponents/p-d47909f1.entry.js +1 -0
- package/dist/webcomponents/p-d6bf1592.entry.js +1 -0
- package/dist/webcomponents/{p-fbfe6211.entry.js → p-dbf2ba9e.entry.js} +1 -1
- package/dist/webcomponents/{p-7e14f6ac.entry.js → p-df110446.entry.js} +1 -1
- package/dist/webcomponents/{p-540e2ef2.entry.js → p-e0cca91e.entry.js} +1 -1
- package/dist/webcomponents/{p-479e4baf.entry.js → p-e4ef4a19.entry.js} +1 -1
- package/dist/webcomponents/{p-ff4d485f.entry.js → p-ec9f527d.entry.js} +1 -1
- package/dist/webcomponents/{p-7f3dcd42.entry.js → p-ee06f2fa.entry.js} +1 -1
- package/dist/webcomponents/{p-88c6713a.entry.js → p-f01cdb9f.entry.js} +1 -1
- package/dist/webcomponents/{p-eeee370f.entry.js → p-f2110cd2.entry.js} +1 -1
- package/dist/webcomponents/p-f9f0a5c8.entry.js +1 -0
- package/dist/webcomponents/{p-e89d0f36.entry.js → p-fa876b02.entry.js} +1 -1
- package/dist/webcomponents/{p-7e3030c2.entry.js → p-fe0feef1.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +4 -2
- package/dist/cjs/button-Cr3iHpyf.js +0 -19
- package/dist/cjs/plaid-icon-DiZrP1DM.js +0 -46
- package/dist/esm/button-DOkTCYSa.js +0 -17
- package/dist/esm/plaid-icon-B7a1QC7F.js +0 -43
- package/dist/module/plaid-icon.js +0 -3
- package/dist/webcomponents/p--Kvji7o2.js +0 -1
- package/dist/webcomponents/p-0588173b.entry.js +0 -1
- package/dist/webcomponents/p-1a4d5f16.entry.js +0 -1
- package/dist/webcomponents/p-21b5240d.entry.js +0 -1
- package/dist/webcomponents/p-35d1be0f.entry.js +0 -1
- package/dist/webcomponents/p-4d6031dd.entry.js +0 -1
- package/dist/webcomponents/p-62f9c008.entry.js +0 -1
- package/dist/webcomponents/p-6c503a00.entry.js +0 -1
- package/dist/webcomponents/p-6d565cd6.entry.js +0 -1
- package/dist/webcomponents/p-7318981d.entry.js +0 -1
- package/dist/webcomponents/p-7d122d5b.entry.js +0 -1
- package/dist/webcomponents/p-7dc5995e.entry.js +0 -1
- package/dist/webcomponents/p-8c55dac0.entry.js +0 -1
- package/dist/webcomponents/p-Bjv3eJBk.js +0 -1
- package/dist/webcomponents/p-BoO2BHR_.js +0 -1
- package/dist/webcomponents/p-BtFe5yQU.js +0 -1
- package/dist/webcomponents/p-C4FLe2pT.js +0 -1
- package/dist/webcomponents/p-CI11WF1E.js +0 -1
- package/dist/webcomponents/p-DFiTyYE9.js +0 -1
- package/dist/webcomponents/p-DO4RBao8.js +0 -1
- package/dist/webcomponents/p-DqVU8ohH.js +0 -1
- package/dist/webcomponents/p-DyETkJs3.js +0 -1
- package/dist/webcomponents/p-EaBIgUj8.js +0 -1
- package/dist/webcomponents/p-Jz9qdPhR.js +0 -1
- package/dist/webcomponents/p-ccb0a84a.entry.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justifi/webcomponents",
|
|
3
|
-
"version": "6.10.
|
|
3
|
+
"version": "6.10.4",
|
|
4
4
|
"description": "JustiFi Web Components",
|
|
5
5
|
"collection": "dist/collection/collection-manifest.json",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://storybook.justifi.ai/?path=/docs/introduction--docs",
|
|
25
25
|
"publishConfig": {
|
|
26
|
-
"registry": "https://registry.npmjs.org"
|
|
26
|
+
"registry": "https://registry.npmjs.org",
|
|
27
|
+
"access": "public",
|
|
28
|
+
"provenance": true
|
|
27
29
|
},
|
|
28
30
|
"files": [
|
|
29
31
|
"dist/"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-p7cvUYAE.js');
|
|
4
|
-
var parts = require('./parts-C0AyF3nd.js');
|
|
5
|
-
|
|
6
|
-
const ButtonSpinner = () => (index.h("div", { class: "spinner-border spinner-border-sm", role: "status", part: "button-spinner" }, index.h("span", { class: "visually-hidden" }, "Loading...")));
|
|
7
|
-
|
|
8
|
-
const Button = (props, children) => {
|
|
9
|
-
const variantToButton = {
|
|
10
|
-
primary: parts.buttonPrimary,
|
|
11
|
-
secondary: parts.buttonSecondary,
|
|
12
|
-
};
|
|
13
|
-
const getCSSParts = () => {
|
|
14
|
-
return `${variantToButton[props.variant]} ${(props.isLoading) ? parts.buttonLoading : ''}`;
|
|
15
|
-
};
|
|
16
|
-
return (index.h("button", Object.assign({ class: `btn btn-${props.variant}`, onClick: props.clickHandler, part: getCSSParts() }, props), props.isLoading ? ButtonSpinner() : children));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
exports.Button = Button;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var Api = require('./Api-Bukk55YZ.js');
|
|
4
|
-
require('./ComponentError-D4OLnOkg.js');
|
|
5
|
-
require('./Plaid-B_UkFjIV.js');
|
|
6
|
-
require('./Pagination-Dediz133.js');
|
|
7
|
-
require('./Business-oBifyXkW.js');
|
|
8
|
-
require('./Dispute-CruQTF6_.js');
|
|
9
|
-
|
|
10
|
-
const api = Api.Api();
|
|
11
|
-
class PlaidService {
|
|
12
|
-
async getLinkToken(authToken, accountId, checkoutId, signal) {
|
|
13
|
-
const endpoint = `plaid/${accountId}/link`;
|
|
14
|
-
const body = { checkout_id: checkoutId };
|
|
15
|
-
return api.post({ endpoint, body, authToken, signal });
|
|
16
|
-
}
|
|
17
|
-
async getLinkTokenForVerification(authToken, businessId, signal) {
|
|
18
|
-
const endpoint = `entities/plaid/${businessId}/link_token`;
|
|
19
|
-
const body = {};
|
|
20
|
-
return api.post({ endpoint, body, authToken, signal });
|
|
21
|
-
}
|
|
22
|
-
async getBankAccountData(authToken, businessId, signal) {
|
|
23
|
-
const endpoint = `entities/plaid/${businessId}/bank_account`;
|
|
24
|
-
return api.get({ endpoint, authToken, signal });
|
|
25
|
-
}
|
|
26
|
-
async postPlaidVerifiedBankAccountData(authToken, businessId, payload, signal) {
|
|
27
|
-
const endpoint = `entities/plaid/${businessId}/bank_account`;
|
|
28
|
-
return api.post({ endpoint, body: payload, authToken, signal });
|
|
29
|
-
}
|
|
30
|
-
async tokenizeBankAccount(authToken, accountId, publicToken, linkTokenId, paymentMethodGroupId, signal) {
|
|
31
|
-
const endpoint = `plaid/${accountId}/tokenize`;
|
|
32
|
-
const body = { public_token: publicToken };
|
|
33
|
-
if (linkTokenId) {
|
|
34
|
-
body.link_token_id = linkTokenId;
|
|
35
|
-
}
|
|
36
|
-
if (paymentMethodGroupId) {
|
|
37
|
-
body.payment_method_group_id = paymentMethodGroupId;
|
|
38
|
-
}
|
|
39
|
-
return api.post({ endpoint, body, authToken, signal });
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const plaidIconSvg = 'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=';
|
|
44
|
-
|
|
45
|
-
exports.PlaidService = PlaidService;
|
|
46
|
-
exports.plaidIconSvg = plaidIconSvg;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { h } from './index-CV0Pyo1O.js';
|
|
2
|
-
import { am as buttonSecondary, an as buttonPrimary, ao as buttonLoading } from './parts-C4FLe2pT.js';
|
|
3
|
-
|
|
4
|
-
const ButtonSpinner = () => (h("div", { class: "spinner-border spinner-border-sm", role: "status", part: "button-spinner" }, h("span", { class: "visually-hidden" }, "Loading...")));
|
|
5
|
-
|
|
6
|
-
const Button = (props, children) => {
|
|
7
|
-
const variantToButton = {
|
|
8
|
-
primary: buttonPrimary,
|
|
9
|
-
secondary: buttonSecondary,
|
|
10
|
-
};
|
|
11
|
-
const getCSSParts = () => {
|
|
12
|
-
return `${variantToButton[props.variant]} ${(props.isLoading) ? buttonLoading : ''}`;
|
|
13
|
-
};
|
|
14
|
-
return (h("button", Object.assign({ class: `btn btn-${props.variant}`, onClick: props.clickHandler, part: getCSSParts() }, props), props.isLoading ? ButtonSpinner() : children));
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { Button as B };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { A as Api } from './Api-CLZVsXZg.js';
|
|
2
|
-
import './ComponentError-Cjcsf8ku.js';
|
|
3
|
-
import './Plaid-Cmyilr-q.js';
|
|
4
|
-
import './Pagination-CLHwhyvu.js';
|
|
5
|
-
import './Business-BcNb9bVO.js';
|
|
6
|
-
import './Dispute-BH0Xfn-F.js';
|
|
7
|
-
|
|
8
|
-
const api = Api();
|
|
9
|
-
class PlaidService {
|
|
10
|
-
async getLinkToken(authToken, accountId, checkoutId, signal) {
|
|
11
|
-
const endpoint = `plaid/${accountId}/link`;
|
|
12
|
-
const body = { checkout_id: checkoutId };
|
|
13
|
-
return api.post({ endpoint, body, authToken, signal });
|
|
14
|
-
}
|
|
15
|
-
async getLinkTokenForVerification(authToken, businessId, signal) {
|
|
16
|
-
const endpoint = `entities/plaid/${businessId}/link_token`;
|
|
17
|
-
const body = {};
|
|
18
|
-
return api.post({ endpoint, body, authToken, signal });
|
|
19
|
-
}
|
|
20
|
-
async getBankAccountData(authToken, businessId, signal) {
|
|
21
|
-
const endpoint = `entities/plaid/${businessId}/bank_account`;
|
|
22
|
-
return api.get({ endpoint, authToken, signal });
|
|
23
|
-
}
|
|
24
|
-
async postPlaidVerifiedBankAccountData(authToken, businessId, payload, signal) {
|
|
25
|
-
const endpoint = `entities/plaid/${businessId}/bank_account`;
|
|
26
|
-
return api.post({ endpoint, body: payload, authToken, signal });
|
|
27
|
-
}
|
|
28
|
-
async tokenizeBankAccount(authToken, accountId, publicToken, linkTokenId, paymentMethodGroupId, signal) {
|
|
29
|
-
const endpoint = `plaid/${accountId}/tokenize`;
|
|
30
|
-
const body = { public_token: publicToken };
|
|
31
|
-
if (linkTokenId) {
|
|
32
|
-
body.link_token_id = linkTokenId;
|
|
33
|
-
}
|
|
34
|
-
if (paymentMethodGroupId) {
|
|
35
|
-
body.payment_method_group_id = paymentMethodGroupId;
|
|
36
|
-
}
|
|
37
|
-
return api.post({ endpoint, body, authToken, signal });
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const plaidIconSvg = 'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=';
|
|
42
|
-
|
|
43
|
-
export { PlaidService as P, plaidIconSvg as p };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const plaidIconSvg = 'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=';
|
|
2
|
-
|
|
3
|
-
export { plaidIconSvg as p };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as r}from"./p-CV0Pyo1O.js";import{a1 as t}from"./p-C4FLe2pT.js";const o=o=>{const{errorText:e,name:s}=o;return e?r("small",{class:"form-text text-danger",id:`form-error-text-${s}`,part:t},e):null};export{o as F}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,c as t,h as r}from"./p-CV0Pyo1O.js";import{A as o}from"./p-55QcjheA.js";import{C as e,a as i}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as a,a as p}from"./p-D2muobcE.js";import{E as n}from"./p-DAZtHA62.js";import{c as h,J as c}from"./p-BqpQa748.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-C4FLe2pT.js";import"./p-Bjv3eJBk.js";const m=o();class u{async fetchGrossVolumeChartData(s,t){return m.get({endpoint:`account/${s}/reports/gross_volume`,authToken:t})}}const d=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event",7),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new c(this),this.initializeGetGrossPayment()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:i})=>{var n;try{const h=await r.fetchGrossVolumeChartData(s,t);h.error?i({error:p(h.error),code:a(null===(n=h.error)||void 0===n?void 0:n.code),severity:e.ERROR}):o(h.data)}catch(s){const t=a(null==s?void 0:s.code);i({error:p(s),code:t,severity:e.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new u}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:i.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_gross_payment_chart}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as s,r as i,c as t}from"./p-CV0Pyo1O.js";import{c as e,F as r}from"./p-CKiAlBsU.js";import{b as o,a,c as h}from"./p-BovgIz83.js";import{i as n,a as p,b as l,c as m}from"./p-D8EGHc_m.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as c,a as d}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import{C as j,B as u,b as f}from"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as v,J as b}from"./p-BqpQa748.js";import{B as w}from"./p-DFiTyYE9.js";import{S as B}from"./p-BqNNwq6C.js";import{H as g}from"./p-BoO2BHR_.js";import"./p-CZfYo5-1.js";import{S as C}from"./p-DqVU8ohH.js";import{B as y}from"./p-XYgDHrVL.js";import{m as D,b as _}from"./p-R0FDNhyd.js";import{B as k}from"./p-DqtDbB8E.js";import"./p-BFTU3MAI.js";import"./p-HT_4DkD0.js";import"./p-_-2E_vYf.js";import"./p-Bt4GjEWL.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-Bjv3eJBk.js";import"./p-55QcjheA.js";import"./p-C4FLe2pT.js";import"./p-D2muobcE.js";const O=e(Object.assign(Object.assign({},o().fields),{legal_address:p(),additional_questions:a(),representative:n("representative")}));e(Object.assign(Object.assign({},h().fields),{legal_address:m(),additional_questions:a(),representative:l("representative")}));const q=O,E=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(C,{width:"25%"})),s("div",{class:"col-12"},s(C,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(C,{width:"50%"}),s(C,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(C,{width:"65%"}),s(C,{width:"35%"}))),H=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(C,{width:"40%",height:"40px"})),s(E,null),s(E,null),s(E,null)),x=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event",7),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.isLoading=!1,this.isSaving=!1,this.country=j.USA,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new u(s);this.country=i.country_of_establishment,this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new u(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){v(),this.analytics=new b(this),this.formController=new r(q),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=D({authToken:this.authToken,businessId:this.businessId,service:new k}),this.patchBusiness=_({authToken:this.authToken,businessId:this.businessId,service:new k}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:d.MISSING_PROPS,severity:c.ERROR})}handleReponse(s){s.error&&(this.errorMessage=f.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(B,null,this.isLoading?s(H,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(g,{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,country:this.country})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController,country:this.country})),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,country:this.country})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(w,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:y.submit}),isLoading:this.isSaving},"Submit")))))}};export{x as justifi_business_form}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,H as a,c as i,g as s}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as l}from"./p-Cjcsf8ku.js";import{E as o,m as n,n as r,o as c}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{a as d}from"./p-Bt4GjEWL.js";import"./p-XYgDHrVL.js";import{n as h}from"./p-BnjCmwMr.js";import{H as u,a5 as f,J as b,av as m,V as p,aE as v,_ as y,$ as k,X as g,Y as x,Z as T,am as _,an as w}from"./p-C4FLe2pT.js";import{s as N,e as j,d as E}from"./p-MeSAYDNh.js";import{S as A}from"./p-DqVU8ohH.js";import"./p-CZfYo5-1.js";import{F as C}from"./p--Kvji7o2.js";import{u as H,a as V,b as D}from"./p-C6o0liMT.js";import{P as I,I as O}from"./p-CVaOFfrI.js";import{c as F}from"./p-_-2E_vYf.js";import{c as L,d as P,e as B}from"./p-R0FDNhyd.js";import{I as R}from"./p-DqtDbB8E.js";import{B as S}from"./p-DFiTyYE9.js";import{S as M}from"./p-BqNNwq6C.js";import{P as Y,p as q}from"./p-Jz9qdPhR.js";import"./p-D8GTwl9v.js";import"./p-D2muobcE.js";import"./p-55QcjheA.js";const U=class{constructor(t){e(this,t)}render(){return t("div",{key:"7f9ea576aad16f3c2ea45c987a38878ea65f2df2",class:"row gy-3"},t("div",{key:"316fe3f20df7c7dce2b8903e6073e0fe7920e5e8",class:"col-12"},t("form-control-file",{key:"320d6b7f3de2cfeeb30eb1e08ca4122123854ffd",name:"voided_check",label:"Voided Check",documentType:o.voidedCheck,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.voided_check,multiple:!0})),t("div",{key:"f33a936c61c14c701e40d375e4dfc4c554b8293c",class:"col-12"},t("form-control-file",{key:"1e160d8211a71175d6a45b10590fb2c8774f61e1",name:"bank_statement",label:"Bank Statement",documentType:o.bankStatement,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.bank_statement,multiple:!0})))}},$=class{constructor(t){e(this,t)}render(){var e,a,i,s,l,o;return t("div",{key:"5dc7139f54d11979410d0d67ca29e65b02f30200",class:"row gy-3"},t("div",{key:"118f15bf02855b24baec5ce2a2c3cf5b241b3da4",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Bank Name",value:null===(e=this.defaultValue)||void 0===e?void 0:e.bank_name}):t("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),t("div",{key:"db03eccee03ec4b7d0de637306315982a2cd770d",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Nickname",value:null===(a=this.defaultValue)||void 0===a?void 0:a.nickname}):t("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),t("div",{key:"217120e0052b8ee41cac8f901ac4d9742b0c6ea9",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):t("form-control-text",{name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler})),t("div",{key:"f589511545d6262966a6fa2888cb78babacfb770",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Type",value:null===(s=this.defaultValue)||void 0===s?void 0:s.account_type}):t("form-control-select",{name:"account_type",label:"Account Type",options:d,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),t("div",{key:"24df83bb2666cee381c266608c43f3fd729db4cf",class:"col-6"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Number",value:(null===(l=this.defaultValue)||void 0===l?void 0:l.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):t("form-control-text",{name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"Please copy the account number as shown on your statement/check. Do not include spaces or dashes."})),t("div",{key:"75fe11d71e57707d088f8a90a250621fce82647f",class:"col-6"},this.formDisabled?t("bank-account-read-only-value",{label:"Routing Number",value:(null===(o=this.defaultValue)||void 0===o?void 0:o.routing_number)||""}):t("form-control-text",{name:"routing_number",label:"Routing Number",defaultValue:this.defaultValue.routing_number,maxLength:9,errorText:this.errors.routing_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))}},z=class{constructor(t){e(this,t)}render(){var e,a,i,s,l,o,n;return t("div",{key:"34cbf10449df73748095fd7122d0ae1355a83e13",class:"row gy-3"},t("div",{key:"607cc5cbc70fdd2d5a325bef7002a44740394282",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Bank Name",value:null===(e=this.defaultValue)||void 0===e?void 0:e.bank_name}):t("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),t("div",{key:"f57f4cd733f2dd439d6d83f32078371618f5fa06",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Nickname",value:null===(a=this.defaultValue)||void 0===a?void 0:a.nickname}):t("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),t("div",{key:"b92dface0116321ea990bfcaf1b036b5629385db",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):t("form-control-text",{name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler})),t("div",{key:"45d68efa47de76ee420cedfb97e82f498a2de97b",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Type",value:null===(s=this.defaultValue)||void 0===s?void 0:s.account_type}):t("form-control-select",{name:"account_type",label:"Account Type",options:d,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),t("div",{key:"8419925e8470d63d506e1f7e82ccdf1a1132ecc0",class:"col-3"},this.formDisabled?t("bank-account-read-only-value",{label:"Transit Number",value:(null===(l=this.defaultValue)||void 0===l?void 0:l.transit_number)||""}):t("form-control-text",{name:"transit_number",label:"Transit Number",defaultValue:this.defaultValue.transit_number,maxLength:5,errorText:this.errors.transit_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"5 digits"})),t("div",{key:"aa6e83c409e0cf93f1903394f63c0b719ec8808e",class:"col-3"},this.formDisabled?t("bank-account-read-only-value",{label:"Institution Number",value:(null===(o=this.defaultValue)||void 0===o?void 0:o.institution_number)||""}):t("form-control-text",{name:"institution_number",label:"Institution Number",defaultValue:this.defaultValue.institution_number,maxLength:3,errorText:this.errors.institution_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"3 digits"})),t("div",{key:"029058c023daca9d0488f45478af6edafe359df7",class:"col-6"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Number",value:(null===(n=this.defaultValue)||void 0===n?void 0:n.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):t("form-control-text",{name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"Please copy the account number as shown on your statement. Do not include spaces or dashes."})))}},X=class{constructor(t){e(this,t)}render(){return t("div",{key:"ad9eadcf49dbc67e51cd814d3ded334a587cc17c"},t("label",{key:"b8ba3d8b7ef9fc33e0e0870f71b7df5dbfae4759",class:"form-label",part:u},this.label),t("div",{key:"1839bdadb96b3c814c73991530497f9a7be6a10d",part:u},this.value||""))}},G=class{constructor(t){e(this,t),this.documents=[],this.isLoading=!1}render(){return this.isLoading?t(A,{height:"50px"}):this.documents.length?t(a,null,t("div",{class:"card",part:f},t("div",{class:"card-body"},t("h5",{class:"card-title",part:b},"Documents Already on File"),t("div",{class:"table-responsive"},t("table",{class:"table table-sm table-borderless",part:m},t("thead",null,t("tr",null,t("th",{style:{width:"25%"},part:p,scope:"col"},"File Name"),t("th",{style:{width:"25%"},part:p,scope:"col"},"File Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Document Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Date Uploaded"))),t("tbody",null,this.documents.sort(((e,t)=>e.document_type.localeCompare(t.document_type))).map(((e,a)=>t("tr",{class:0===a?"border-bottom border-top":"border-bottom"},t("td",{part:v},e.file_name),t("td",{part:v},e.file_type),t("td",{part:v},N(e.document_type)),t("td",{part:v},`${j(e.created_at)} - ${E(e.created_at)}`))))))))),t("hr",null)):null}},J=class{constructor(t){e(this,t),this.formControlInput=i(this,"formControlInput",7),this.formControlBlur=i(this,"formControlBlur",7),this.fileSelected=i(this,"fileSelected",7),this.isFocused=!1,this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=e=>{const t=e.target,a=t.getAttribute("name");this.inputHandler(a,t.value),this.formControlInput.emit({name:a,value:t.value})},this.changeHandler=()=>{const e=this.fileInput.files;e&&this.fileSelected.emit({fileList:e,document_type:this.documentType})}}componentDidLoad(){this.fileInput=this.el.querySelector("input")}get part(){let e=y;return this.errorText&&(e=g),this.disabled&&(e=x),this.isFocused&&(e=T),e}render(){return t(a,{key:"8172f7df27c42c6d5211d29ef595dd2e4dbd9def"},t("div",{key:"99740d980c280502242ee1cdcee2a3df6ba53146",class:"form-group d-flex flex-column"},t("div",{key:"5fb94f2b710d5fd734172ee91b59621d736e129b",class:"d-flex align-items-start gap-2"},t("label",{key:"12fedf016c7d789fad8692c7ae03975481964005",part:k,class:"form-label",htmlFor:this.name},this.label),t("form-control-tooltip",{key:"6d59be5a27d3c9a171292244fc9e9bb598b9ecce",helpText:this.helpText})),t("input",{key:"64c7d9eaa46f95714d5527cf94d28c206065a411",ref:e=>this.fileInput=e,type:"file",name:this.name,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onChange:this.changeHandler,onInput:this.handleFormControlInput,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()}}),t(C,{key:"9610c0676934fd616fbdac08e98a102240773084",errorText:this.errorText,name:this.name})))}get el(){return s(this)}},W=class{constructor(t){e(this,t),this.isEditingIdentification=!1,this.inputHandler=(e,t)=>{H(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{V(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))}}render(){var e,a,i,s,l,o,n,r,c;return t("form",{key:"a9c0f6332bf302d5eb9f93c4ca045d572a40468f"},t("fieldset",{key:"115c564826335a9c7b670bbc0409912c3eb7a4aa"},t("div",{key:"6de8909b4b2f3c7d8ec4665aad77ef59cdf035b4",class:"d-flex align-items-center gap-2"},t("legend",{key:"bb8b5a3775eae450a866356a9e149a0bf57b5699",class:"mb-0",part:b},"Representative"),t("form-control-tooltip",{key:"a0296d4a3c35a039525f39501e117ee6fdd12257",helpText:"The representative for your business needs to be someone who has significant control over managing your business’s finance. You will have an opportunity to add owners later in the form."})),t("hr",{key:"abbee22f5664275f27dd8eeb2b12c87b059ff024",class:"mt-2"}),t("div",{key:"e165ff125df62dc1d22b7329fe7fe2ff200cbbb3",class:"row gy-3"},t("div",{key:"114ff752eeda3ffa90529ff6bc675b874f543336",class:"col-12 col-md-8"},t("form-control-text",{key:"8b6ce9f4a327ca5282aa32c226f671945aa10404",name:"name",label:"Full Name",defaultValue:null===(e=this.representativeDefaultValue)||void 0===e?void 0:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),t("div",{key:"bce864367883c6bbf7bd0841114a3dbb39db692b",class:"col-12 col-md-4"},t("form-control-text",{key:"ec3e72dc3f84c0daee2c6509f7dbf2bad22f5db6",name:"title",label:"Title",defaultValue:null===(a=this.representativeDefaultValue)||void 0===a?void 0:a.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),t("div",{key:"200ae959d897d9d22016553d3c586cf3f0438dd9",class:"col-12 col-md-6"},t("form-control-text",{key:"4f77d6ca6c3c85edabc11af6f5703ab1327f05e7",name:"email",label:"Email Address",defaultValue:null===(i=this.representativeDefaultValue)||void 0===i?void 0:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),t("div",{key:"cf642ee73f7ae8b254920a3f781c23dc456f16ae",class:"col-12 col-md-6"},t("form-control-number-masked",{key:"df609213bec728f17b2527a2e99ff3e0e69604aa",name:"phone",label:"Phone Number",defaultValue:null===(s=this.representativeDefaultValue)||void 0===s?void 0:s.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:I.US})),t("div",{key:"2e4565c06976723ae4e497a5305cea7468bac2f4",class:"col-12 col-md-4"},t("form-control-date",{key:"ca7d4bf05c32d1d9983df430d338cc3433015957",name:"dob_full",label:"Birth Date",defaultValue:null===(l=this.representativeDefaultValue)||void 0===l?void 0:l.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>D(e,this.formController),helpText:"Must be 18 or older."})),t("div",{key:"f6cbe1b7f4e5575f626e6d73f31b4a1a09ac33e3",class:"col-12 col-md-8"},!(null===(o=this.representativeDefaultValue)||void 0===o?void 0:o.ssn_last4)||this.isEditingIdentification?t("form-control-number-masked",{name:"identification_number",label:F[this.country].idNumberLabel,defaultValue:this.isEditingIdentification?"":null===(n=this.representativeDefaultValue)||void 0===n?void 0:n.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:O[this.country],helpText:F[this.country].identityHelpText}):t("div",null,t("label",{class:"form-label",part:k},F[this.country].idNumberLabel),t("div",{class:"input-group mb-3"},t("input",{type:"text",class:"form-control",part:x,value:`****${null===(r=this.representativeDefaultValue)||void 0===r?void 0:r.ssn_last4}`,disabled:!0}),t("button",{class:"btn btn-secondary",type:"button",part:_,onClick:()=>{this.isEditingIdentification=!0,H(this.formController,{identification_number:"",ssn_last4:null})}},"Change")))),t("div",{key:"e3fa556dece2feaf5eb175ae3734c2319777ef48",class:"col-12"},t("justifi-identity-address-form",{key:"fe3d349371d11b8a246b9c31aebd7d9c84e03f8e",errors:this.errors.address,defaultValues:null===(c=this.representativeDefaultValue)||void 0===c?void 0:c.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},K=class{constructor(t){e(this,t),this.errorEvent=i(this,"error-event",7)}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=L({authToken:this.authToken,identityId:this.ownerId,service:new R}),this.patchOwner=P({authToken:this.authToken,identityId:this.ownerId,service:new R}),this.postOwner=B({authToken:this.authToken,service:new R}))}render(){return t("owner-form-core",{key:"47c36dfc76ac8a108950e17770d1a0fb06fe4e42",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,country:this.country,ref:e=>this.coreComponent=e})}},Q=class{constructor(t){e(this,t),this.plaidVerificationSuccess=i(this,"plaidVerificationSuccess",7),this.plaidVerificationError=i(this,"plaidVerificationError",7),this.linkToken=null,this.linkTokenId=null,this.plaidLink=null,this.isAuthenticating=!1,this.isSuccess=!1,this.error=null,this.isLoading=!1,this.plaidService=new Y,this.abortController=null,this.timeoutId=null,this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:c.PLAID_SDK_LOAD_FAILED,message:r[c.PLAID_SDK_LOAD_FAILED],severity:n[c.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:c.PLAID_LINK_TOKEN_FAILED,message:r[c.PLAID_LINK_TOKEN_FAILED],severity:n[c.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const e=window.Plaid;this.plaidLink=e.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(e){this.handleError({code:c.PLAID_LINK_INIT_FAILED,message:r[c.PLAID_LINK_INIT_FAILED],severity:n[c.PLAID_LINK_INIT_FAILED],originalError:e,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var e,t,a,i;try{if(!this.authToken||!this.accountId)return void this.handleError({code:c.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please provide authToken and accountId.",severity:l.ERROR,retryable:!1,userAction:"Provide required props"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var e;null===(e=this.abortController)||void 0===e||e.abort()}),3e4);const e=await this.plaidService.getLinkTokenForVerification(this.authToken,this.businessId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),e.error)throw new Error("string"==typeof e.error?e.error:e.error.message||"Failed to get link token");this.linkToken=e.data.link_token,this.linkTokenId=e.data.id}catch(s){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let l=c.PLAID_LINK_TOKEN_FAILED,o=r[l],d=!0;"AbortError"===s.name?(l=c.PLAID_TIMEOUT,o=r[l],d=!0):(null===(e=s.message)||void 0===e?void 0:e.includes("network"))||(null===(t=s.message)||void 0===t?void 0:t.includes("fetch"))?(l=c.PLAID_NETWORK_ERROR,o=r[l],d=!0):((null===(a=s.message)||void 0===a?void 0:a.includes("401"))||(null===(i=s.message)||void 0===i?void 0:i.includes("unauthorized")))&&(l=c.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please check your credentials.",d=!1),this.handleError({code:l,message:o,severity:n[l],originalError:s,retryable:d,userAction:d?"Click to try again":"Check your credentials"})}},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=async e=>{var t;this.isAuthenticating=!1,this.isLoading=!0,this.clearError();try{const a=await this.plaidService.postPlaidVerifiedBankAccountData(this.authToken,this.businessId,{public_token:e,link_token_id:this.linkTokenId},null===(t=this.abortController)||void 0===t?void 0:t.signal);if(a.error)throw new Error("string"==typeof a.error?a.error:a.error.message||"Failed to verify bank account");this.isSuccess=!0,this.isLoading=!1,this.plaidVerificationSuccess.emit({publicToken:e,bankAccount:a.data})}catch(e){this.isLoading=!1,this.handleError({code:c.PLAID_AUTHENTICATION_FAILED,message:(null==e?void 0:e.message)||"Failed to verify bank account",severity:n[c.PLAID_AUTHENTICATION_FAILED],originalError:e,retryable:!0,userAction:"Click to try again"})}},this.handlePlaidExit=e=>{this.isAuthenticating=!1,e&&this.handlePlaidError(e)},this.handlePlaidEvent=(e,t)=>{switch(e){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(t)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=e=>{let t=c.PLAID_AUTHENTICATION_FAILED,a=r[t],i=!0,s="Click to try again";if(e.error_code)switch(e.error_code){case"INVALID_CREDENTIALS":t=c.PLAID_INVALID_CREDENTIALS,a=r[t],i=!0;break;case"ITEM_LOGIN_REQUIRED":t=c.PLAID_INVALID_CREDENTIALS,a="Your bank requires re-authentication. Please try again.",i=!0;break;case"ITEM_LOCKED":t=c.PLAID_ACCOUNT_LOCKED,a=r[t],i=!1,s="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":t=c.PLAID_MAINTENANCE,a=r[t],i=!0;break;case"RATE_LIMIT_EXCEEDED":t=c.PLAID_RATE_LIMITED,a=r[t],i=!0;break;default:e.error_message&&(a=e.error_message)}this.handleError({code:t,message:a,severity:n[t],originalError:e,retryable:i,userAction:s}),this.isAuthenticating=!1},this.handleError=e=>{this.error=e,this.isLoading=!1,this.plaidVerificationError.emit(e),console.error("Plaid verification error:",e)},this.clearError=()=>{this.error&&(this.error=null)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.initializePlaidLink()},this.scriptRef.onerror=()=>{this.handleError({code:c.PLAID_SDK_LOAD_FAILED,message:r[c.PLAID_SDK_LOAD_FAILED],severity:n[c.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}disconnectedCallback(){this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){const e=t("img",{class:"plaid-logo-img",src:q,alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return t(M,null,t("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:e=>this.scriptRef=e}),t("div",null,t("div",{class:"mb-3"},t(S,{variant:"primary",type:"button",onClick:e=>{e.preventDefault(),this.openPlaidLink()},disabled:this.isLoading,part:w},"Connect with Plaid ",e," (instant verification)")),(()=>this.error?t("div",{class:(this.error.severity===l.ERROR?"text-danger":this.error.severity===l.WARNING?"text-warning":"text-info")+" mt-2"},t("small",null,this.error.message),t("br",null),this.error.userAction&&t("small",{class:"text-muted"},this.error.userAction)):null)(),(()=>this.error?null:this.isLoading?t("div",{class:"text-info mt-2"},t("small",null,"Verifying bank account...")):this.isSuccess?t("div",{class:"text-success mt-2"},t("small",null,"✓ Bank account verified successfully")):this.isAuthenticating?t("div",{class:"text-info mt-2"},t("small",null,"Connecting to your bank...")):null)()))}};export{U as bank_account_document_form_inputs,$ as bank_account_form_inputs,z as bank_account_form_inputs_canada,X as bank_account_read_only_value,G as business_documents_on_file,J as form_control_file,W as justifi_business_representative_form_inputs,K as justifi_owner_form,Q as plaid_verification}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,c as t,h as e,H as i}from"./p-CV0Pyo1O.js";import{C as r,a as n}from"./p-Cjcsf8ku.js";import{m as o,b as a,f as h,g as c}from"./p-R0FDNhyd.js";import{B as l,a as d,D as u}from"./p-DqtDbB8E.js";import{a as m,c as p,b}from"./p-BovgIz83.js";import{F as f,c as v,a as y,b as g,d as w}from"./p-CKiAlBsU.js";import{A as k,C as _,e as j,R as C,f as T}from"./p-BcNb9bVO.js";import{C as O,P as x}from"./p-CVaOFfrI.js";import{J as S,a4 as E,am as I,$ as L,Y as A,aG as D}from"./p-C4FLe2pT.js";import{P as B}from"./p-C3kbpEIZ.js";import{b as P,c as H}from"./p-Bt4GjEWL.js";import{a as V,B as F}from"./p-XYgDHrVL.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{E as q,p as W,q as Y}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{A as M,B as N,v as U,C as z,D as R,E as G,F as X}from"./p-HT_4DkD0.js";import{B as J}from"./p-DFiTyYE9.js";import"./p-CZfYo5-1.js";import{c as $}from"./p-_-2E_vYf.js";import{d as Q,e as Z}from"./p-D8EGHc_m.js";import{A as K}from"./p-55QcjheA.js";import"./p-D2muobcE.js";import"./p-BFTU3MAI.js";import"./p-DqVU8ohH.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";class ss{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.institution_number=s.institution_number,this.transit_number=s.transit_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||"",institution_number:this.institution_number||"",transit_number:this.transit_number||"",bank_name:this.bank_name||"",nickname:this.nickname||"",business_id:this.business_id||""}}}const ts=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.additional_questions={},this.recurringPayments=!1,this.isLoading=!1,this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.additional_questions=new k(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:V.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 k(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}propChanged(){this.initializeApi()}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 k(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new f(m(this.allowOptionalFields))}componentDidLoad(){this.getBusiness&&this.getData(),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){var s,t,i,r,n;const o=this.formController.getInitialValues();return this.isLoading?e(B,null):e("form",null,e("fieldset",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Additional Questions"),e("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),e("hr",{class:"mt-2"}),e("div",{class:"row gy-3"},e("div",{class:"col-12 col-md-6"},e("form-control-monetary-provisioning",{name:"business_revenue",label:"What is your business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(s=this.errors)||void 0===s?void 0:s.business_revenue,defaultValue:null==o?void 0:o.business_revenue,maskOptions:O.WHOLE})),e("div",{class:"col-12 col-md-6"},e("form-control-monetary-provisioning",{name:"business_payment_volume",label:"What is your business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(t=this.errors)||void 0===t?void 0:t.business_payment_volume,defaultValue:null==o?void 0:o.business_payment_volume,maskOptions:O.WHOLE})),e("div",{class:"col-12"},e("form-control-text",{name:"business_average_transaction_amount",label:"What is your average transaction size?",inputHandler:this.inputHandler,errorText:null===(i=this.errors)||void 0===i?void 0:i.business_average_transaction_amount,defaultValue:null==o?void 0:o.business_average_transaction_amount})),e("div",{class:"col-12"},e("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===(r=this.errors)||void 0===r?void 0:r.business_when_service_received,options:P,defaultValue:null==o?void 0:o.business_when_service_received})),e("div",{class:"col-12"},e("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===(n=this.errors)||void 0===n?void 0:n.business_other_payment_details,defaultValue:null==o?void 0:o.business_other_payment_details})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],additional_questions:["recurringPaymentsWatcher"]}}},es=(s,t)=>s.some((s=>s.document_type===t)),is=s=>s?{bank_name:R.nullable(),nickname:z.nullable(),account_owner_name:U.nullable(),account_type:N.nullable(),account_number:M.nullable()}:{bank_name:R.required("Enter bank name"),nickname:z.required("Enter nickname"),account_owner_name:U.required("Enter account owner name"),account_type:N.required("Select account type"),account_number:M.required("Enter account number")},rs=(s,t)=>{if(t)return{voided_check:g().nullable(),bank_statement:g().nullable()};const e=es(s,q.voidedCheck),i=es(s,q.bankStatement),r=e||i,n="Please upload either a voided check or a bank statement. Only one is required.";return{voided_check:g().when("bank_statement",{is:s=>!s&&!r,then:s=>s.required(n),otherwise:s=>s.notRequired()}),bank_statement:g().when("voided_check",{is:s=>!s&&!r,then:s=>s.required(n),otherwise:s=>s.notRequired()})}},ns={[_.USA]:(s,t=[])=>((s,t)=>{const e=Object.assign(Object.assign(Object.assign({},is(t)),(s=>s?{routing_number:X.nullable()}:{routing_number:X.required("Enter routing number")})(t)),rs(s,t));return v().shape(e,[["voided_check","bank_statement"]])})(t,s),[_.CAN]:(s,t=[])=>((s,t)=>{const e=Object.assign(Object.assign(Object.assign({},is(t)),(s=>{const t=y().length(3,"Institution number must be 3 digits").matches(G,"Enter valid institution number"),e=y().length(5,"Transit number must be 5 digits").matches(G,"Enter valid transit number");return s?{institution_number:t.nullable(),transit_number:e.nullable()}:{institution_number:t.required("Enter institution number"),transit_number:e.required("Enter transit number")}})(t)),rs(s,t));return v().shape(e,[["voided_check","bank_statement"]])})(t,s)},os=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.bankAccount={},this.existingDocuments=[],this.documentData=new W,this.isLoading=!1,this.isAddingNewBankAccount=!0,this.bankAccountVerification=!1,this.platformAccountId=null,this.usePlaidVerification=!0,this.getSchema=()=>(0,ns[this.country])(this.allowOptionalFields,this.existingDocuments),this.initializeFormController=()=>{this.formController=new f(this.getSchema()),this.formController.setInitialValues(this.isAddingNewBankAccount?{business_id:this.businessId}: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 Y({file:s,document_type:e},this.businessId)));this.documentData[e]=i},this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{if(s.data.bank_accounts.length>0){const t=s.data.bank_accounts;this.bankAccount=new ss(t[t.length-1]),this.isAddingNewBankAccount=!1}else this.bankAccount=new ss({}),this.bankAccount.business_id=this.businessId;this.existingDocuments=s.data.documents,this.bankAccountVerification=!0===s.data.settings.bank_account_verification,this.platformAccountId=s.data.platform_account_id},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.initializeFormController(),this.isLoading=!1}})},this.handleChangeBankAccount=()=>{this.isAddingNewBankAccount=!0,this.documentData=new W,this.usePlaidVerification=this.bankAccountVerification&&!!this.platformAccountId,this.initializeFormController()},this.handleCancel=()=>{this.isAddingNewBankAccount=!1,this.documentData=new W,this.usePlaidVerification=!0,this.initializeFormController()},this.handleToggleToManualEntry=()=>{this.usePlaidVerification=!1},this.handleToggleToPlaidVerification=()=>{this.usePlaidVerification=!0},this.handleSaveBankAccount=async()=>{this.formController.validateAndSubmit((()=>{this.sendData((()=>{}))}))},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:n.POST_ERROR,message:t.error.message,severity:r.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 s.getFileData(),e=await fetch(s.presigned_url,{method:"PUT",body:t});return this.handleUploadResponse(e)},this.handleUploadResponse=s=>!s.error||(this.errorEvent.emit({errorCode:n.POST_ERROR,message:s.error.message,severity:r.ERROR,data:s.error}),!1)}propChanged(){this.initializeApi()}watchHandler(s){this.formLoading.emit(s)}async validateAndSubmit({onSuccess:s}){this.existingBankAccount&&!this.isAddingNewBankAccount?this.sendData(s):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData(),this.formController=new f(this.getSchema())}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.postBankAccount=h({authToken:this.authToken,service:new d}),this.postDocumentRecord=c({authToken:this.authToken,service:new u})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}get postPayload(){const s=this.formController.values.getValue();return new ss(s).payload}get existingBankAccount(){var s;return!!(null===(s=this.bankAccount)||void 0===s?void 0:s.id)}get showReadOnlyView(){return this.existingBankAccount&&!this.isAddingNewBankAccount}async sendData(s){try{if(this.isAddingNewBankAccount&&!await this.postBankAccountData())return;if(!await this.postBusinessDocuments())return;this.isAddingNewBankAccount&&(this.isAddingNewBankAccount=!1,await this.refreshBankAccountData()),s()}catch(s){this.errorEvent.emit({message:s,errorCode:n.POST_ERROR,severity:r.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:V.bankAccount}),this.isLoading=!1,t(e)}})}))}async refreshBankAccountData(){return new Promise((s=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{const{data:t}=s,{bank_accounts:e,documents:i,settings:r,platform_account_id:n}=t;e.length>0&&(this.bankAccount=new ss(e[e.length-1])),this.existingDocuments=i,this.bankAccountVerification=!0===r.bank_account_verification,this.platformAccountId=n,this.initializeFormController()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.isLoading=!1,s()}})}))}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 s=this.formController.getInitialValues(),t=this.bankAccountVerification&&this.platformAccountId;return this.isLoading?e(B,null):e("form",null,e("fieldset",{class:"mb-4"},e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Bank Account Info"),e("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."})),e("hr",{class:"mt-2"}),t&&this.usePlaidVerification&&!this.showReadOnlyView&&e("div",{class:"mt-3"},e("plaid-verification",{authToken:this.authToken,accountId:this.platformAccountId,businessId:this.businessId,onPlaidVerificationSuccess:()=>{this.isAddingNewBankAccount=!1,this.refreshBankAccountData()}}),e("div",{class:"mt-3"},e(J,{type:"button",variant:"link",onClick:this.handleToggleToManualEntry,disabled:this.isLoading,part:E},"Enter bank details manually (document upload required)"))),(!this.usePlaidVerification||this.showReadOnlyView)&&e("div",null,t&&!this.usePlaidVerification&&!this.showReadOnlyView&&e("div",{class:"mb-3"},e(J,{type:"button",variant:"secondary",onClick:this.handleToggleToPlaidVerification,disabled:this.isLoading,part:I},"Link bank account with Plaid instead")),e(this.country===_.CAN?"bank-account-form-inputs-canada":"bank-account-form-inputs",{defaultValue:s,errors:this.errors,inputHandler:this.inputHandler,formDisabled:this.showReadOnlyView})),this.showReadOnlyView&&e("div",{class:"mt-3"},e(J,{variant:"secondary",type:"button",onClick:this.handleChangeBankAccount,disabled:this.isLoading,part:I},"Change Bank Account")),(!this.existingBankAccount||this.isAddingNewBankAccount)&&!this.usePlaidVerification&&e("div",{class:"mt-3 d-flex gap-2"},this.isAddingNewBankAccount&&e(J,{variant:"secondary",type:"button",onClick:this.handleCancel,disabled:this.isLoading,part:I},"Cancel"),e(J,{variant:"primary",type:"button",onClick:this.handleSaveBankAccount,disabled:this.isLoading,isLoading:this.isLoading},"Save Bank Account"))),(!this.usePlaidVerification||this.showReadOnlyView)&&e("fieldset",{class:"mt-4"},e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Document Uploads"),e("form-control-tooltip",{helpText:"One document (voided check or bank statement) is required for underwriting purposes. It needs to visibly show the name tied to the account and the account number. Various file formats such as PDF, DOC, DOCX, JPEG are accepted. Multiple files can be uploaded for each document category."})),e("hr",{class:"mt-2"}),e("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading}),e("bank-account-document-form-inputs",{inputHandler:this.inputHandler,errors:this.errors,storeFiles:this.storeFiles})))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],isLoading:["watchHandler"]}}},as=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.coreInfo={},this.isLoading=!1,this.isEditingTaxId=!1,this.getData=()=>{this.getBusiness&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.coreInfo=new j(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(),this.isEditingTaxId=!1},onError:({error:s,code:e,severity:i,rawError:r})=>{t=s,r&&"object"==typeof r&&r.param&&this.formController.setFieldError(r.param,r.message),this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.businessInfo}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.errors[s]&&this.formController.clearFieldError(s),this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return new j(this.formController.values.getValue()).payload}componentWillLoad(){this.initializeApi();const s=this.country===_.CAN?p(this.allowOptionalFields):b(this.allowOptionalFields);this.formController=new f(s),this.getData()}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){var s,t;const i=this.formController.getInitialValues();return this.isLoading?e(B,null):e("form",null,e("fieldset",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Business Information")),e("hr",{class:"mt-2"}),e("div",{class:"row gy-3"},e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"legal_name",label:"Business Name",defaultValue:i.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)."})),e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:i.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)"})),e("div",{class:"col-12 col-md-8"},e("form-control-select",{name:"classification",label:"Business Classification",options:H,defaultValue:i.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),e("div",{class:"col-12 col-md-4"},e("form-control-date",{name:"date_of_incorporation",label:"Date of Registration",defaultValue:i.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"industry",label:"Industry",defaultValue:i.industry,errorText:this.errors.industry,inputHandler:this.inputHandler,helpText:"Describe what you sell"})),e("div",{class:"col-12 col-md-6"},!(null===(s=this.coreInfo)||void 0===s?void 0:s.tax_id_last4)||this.isEditingTaxId?e("form-control-number-masked",{name:"tax_id",label:$[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:"000000000",helpText:$[this.country].taxIdHelpText}):e("div",null,e("label",{class:"form-label",part:L},$[this.country].taxIdLabel),e("div",{class:"input-group mb-3"},e("input",{type:"text",class:"form-control",part:A,value:`****${null===(t=this.coreInfo)||void 0===t?void 0:t.tax_id_last4}`,disabled:!0}),e("button",{class:"btn btn-secondary",type:"button",part:I,onClick:()=>{this.isEditingTaxId=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{tax_id:"",tax_id_last4:null}))}},"Change")))),e("div",{class:"col-12"},e("form-control-text",{name:"website_url",label:"Business Website URL",defaultValue:i.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."})),e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"email",label:"Business Email Address",defaultValue:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),e("div",{class:"col-12 col-md-6"},e("form-control-number-masked",{name:"phone",label:"Business Phone Number",defaultValue:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:x.US})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},hs=class{constructor(e){s(this,e),this.clickEvent=t(this,"click-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.errorEvent=t(this,"error-event",7),this.formLoading=t(this,"formLoading",7),this.ownersPayload=[],this.refs=[],this.isLoading=!1,this.representativeIsOwner=null,this.matchRef=(s,t)=>{if(null===s)return;const e=this.ownersPayload.findIndex((s=>s.id===t));-1!==e&&(this.refs.length!==this.ownersPayload.length&&this.manageRefs(),this.refs[e]=s)},this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.representative=new C(s.data.representative||{}),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:V.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=s=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],s&&this.clickEvent.emit({name:F.addOwnerForm})},this.removeOwnerForm=s=>{this.ownersPayload=this.ownersPayload.filter((t=>t.id!==s)),this.newFormOpen&&(this.newFormOpen=!1)},this.handleRepresentativeIsOwnerChange=s=>{this.representativeIsOwner=s,this.representativeIsOwner&&(this.formLoading.emit(!0),this.isLoading=!0,this.ownersPayload=this.ownersPayload.filter((s=>""!==s.id)),this.patchBusiness({payload:{owners:[{id:this.representative.id},...this.ownersPayload]},onSuccess:()=>{this.getData(),this.newFormOpen=!1},finally:()=>{this.isLoading=!1,this.formLoading.emit(!1)}}))}}propChanged(){this.initializeApi()}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.initializeApi(),this.getBusiness&&this.getData()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}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(){if(this.isLoading)return e(i,null,e(B,null));const s=this.ownersPayload.some((s=>s.id===this.representative.id)),t=null===this.representativeIsOwner&&!s;return e(i,null,e("div",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Owners"),e("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."})),e("hr",{class:"mt-2"}),t&&e("div",{class:"alert alert-warning mb-3",part:D},e("div",{class:"card-body"},e("div",{class:"d-flex align-items-center mb-3"},e("strong",null,"Is the representative of this business also an owner?")),e("div",{class:"d-flex gap-2"},e(J,{variant:"primary",onClick:()=>this.handleRepresentativeIsOwnerChange(!0)},"Yes"),e(J,{variant:"secondary",onClick:()=>this.handleRepresentativeIsOwnerChange(!1)},"No")))),e("div",{class:"row gy-3"},this.ownersPayload.map((s=>e("justifi-owner-form",{key:s.id,authToken:this.authToken,businessId:this.businessId,ownerId:s.id,removeOwner:this.removeOwnerForm,newFormOpen:this.newFormOpen,ownersLength:this.ownersPayload.length,country:this.country,allowOptionalFields:this.allowOptionalFields,ref:t=>this.matchRef(t,s.id)})))),e("div",{class:"d-flex justify-content-start"},e("div",{class:"gap-2"},e(J,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner")))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],ownersPayload:["ownersWatcher"]}}},cs=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.representative={},this.isLoading=!1,this.getData=()=>{this.getBusiness&&this.formController&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.representative=new C(s.data.representative||{}),this.representative.address.country=this.country,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:V.representative}),this.formLoading.emit(!1)}})}}propChanged(){this.initializeApi(),this.getData()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.initializeApi(),this.initializeForm()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}initializeForm(){const s=Q[this.country];s?(this.formController=new f(s("representative",this.allowOptionalFields)),this.getData()):this.errorEvent.emit({message:"Missing schema for selected country",errorCode:n.MISSING_PROPS,severity:r.ERROR})}componentDidLoad(){this.formController&&this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get patchPayload(){return{representative:new C(this.formController.values.getValue()).payload}}render(){return!this.formController||this.isLoading?e(B,null):e("justifi-business-representative-form-inputs",{representativeDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController,country:this.country})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},ls=class{constructor(e){s(this,e),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.errorEvent=t(this,"error-event",7),this.formLoading=t(this,"formLoading",7),this.formCompleted=t(this,"formCompleted",7),this.errors={},this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get({endpoint:this.businessEndpoint,authToken:this.authToken});this.acceptedTermsBefore=s.data.terms_conditions_accepted}catch(s){this.errorEvent.emit({errorCode:n.FETCH_ERROR,message:s.message,severity:r.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const t=this.termsPayload,e=await this.api.post({endpoint:this.termsConditionsEndpoint,body:t,authToken:this.authToken});this.handleResponse(e,s)}catch(s){this.errorEvent.emit({errorCode:n.POST_ERROR,message:s.message,severity:r.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,t)=>{this.acceptedTerms=t,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=K(),this.formController=new f((s=>{const t=v({accepted:w().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),e=v({accepted:w().nullable()});return s?e:t})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(s,t){s.error?this.errorEvent.emit({errorCode:n.POST_ERROR,message:s.error.message,severity:r.ERROR,data:s.error}):t(),this.stepCompleteEvent.emit({response:s,formStep:V.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:s}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:V.termsAndConditions,metadata:"no data submitted"}),this.formCompleted.emit(),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get merchantAgreementLink(){return e("a",{href:"https://justifi.tech/merchant-agreement/",target:"_blank",rel:"noopener noreferrer"},"merchant agreement")}render(){return e("form",{key:"33336d0a66d63ce39951822fd570a9a0689e714d"},e("fieldset",{key:"fcfdb59eef671cb408ed99e2dad20d6be706688a"},e("legend",{key:"f0cf7f0ac15c90cf36ee25d4bf986c0e781a2e92",part:S},"Terms and Conditions"),e("hr",{key:"d5c820e7d6523f931040a994bd103d69fd644c45"}),e("div",{key:"681b584de14afe121f5dc69ee0bad1cab51ba0d1"},e("p",{key:"7c597bf891a108d303739126b806ded5220f56ab"},"Please read and accept the ",this.merchantAgreementLink," to submit your provisioning request.")),e("br",{key:"52854c5a07611180be40df21a5f60d7d9d4c4cb7"}),e("div",{key:"7448b3f6138b996edac137b961367725e3b40556",class:"row-gy-3"},e("div",{key:"c732deb4e1e3a2d04dd4e09914543a7f594af108",class:"col-12"},e("form-control-checkbox",{key:"fca18e4843aef20d13790029b114b2ecaeb6ffa2",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText,checked:this.acceptedTerms})))))}},ds=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.legal_address={},this.isLoading=!1,this.getData=()=>{this.getBusiness&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{const t=new T((s.data||{}).legal_address||{});this.legal_address=Object.assign(Object.assign({},t),{country:this.country}),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:V.legalAddress}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{legal_address:new T(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new f((0,Z[this.country])(this.allowOptionalFields)),this.getData()}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){var s;const t=null===(s=this.formController)||void 0===s?void 0:s.getInitialValues();return this.isLoading?e(B,null):e("form",null,e("fieldset",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Legal Address of your Business"),e("form-control-tooltip",{helpText:"No PO Boxes."})),e("hr",{class:"mt-2"}),e("justifi-form-address-fields",{country:this.country,errors:this.errors,defaultValues:t,inputHandler:this.inputHandler})))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},us=class{constructor(t){s(this,t)}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return e("div",{key:"53ba6c809e1968712b333f4bcf2798dbca186ddb",class:"d-flex gap-2"},e(J,{key:"b45c60083ccf6589cae0c63ce6b66c18da340dc7",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),e(J,{key:"27372798da0276de44d1563a4688486e7cc91d64",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,F.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),e(J,{key:"8bc14ca8fe951caf276f8ed03e502486e11acbe2",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,F.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},ms=class{constructor(t){s(this,t),this.allowOptionalFields=!1,this.country=_.USA,this.componentStepMapping={0:()=>e("justifi-business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),1:()=>e("justifi-legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),2:()=>e("justifi-additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>e("justifi-business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),4:()=>e("justifi-business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),5:()=>e("justifi-business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),6:()=>e("justifi-business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return e("div",{key:"ff7c9e688009383fdbe18c9824fa578d2338900c",class:"col-12 mb-4"},this.currentStepComponent)}};export{ts as justifi_additional_questions_form_step,os as justifi_business_bank_account_form_step,as as justifi_business_core_info_form_step,hs as justifi_business_owners_form_step,cs as justifi_business_representative_form_step,ls as justifi_business_terms_conditions_form_step,ds as justifi_legal_address_form_step,us as justifi_payment_provisioning_form_buttons,ms as justifi_payment_provisioning_form_steps}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,g as s,H as a}from"./p-CV0Pyo1O.js";import{S as r}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as n,J as d}from"./p-BqpQa748.js";import{w as o,c}from"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{a as h,C as l}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as f}from"./p-Daew0gTO.js";import{P as u}from"./p-DkoufM1t.js";import{S as b}from"./p-DqVU8ohH.js";import{b as m}from"./p-MeSAYDNh.js";import{B as p}from"./p-DFiTyYE9.js";import{u as y}from"./p-C4FLe2pT.js";import"./p-Bjv3eJBk.js";import"./p-55QcjheA.js";import"./p-D8GTwl9v.js";const v=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click",7),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(r,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},i("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:y,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},k={[u.NEW_BANK_ACCOUNT]:"New bank account",[u.NEW_CARD]:"New credit or debit card"},g="Payment form not ready",w="Validation error",j=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){n(),this.analytics=new d(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,f.selectedPaymentMethod={type:t.detail}}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:w}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(h.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:h.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:g}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||f.authToken,account:this.accountId||f.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||f.authToken||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||f.accountId||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethod||(this.disableCreditCard?this.disableBankAccount||(this.selectedPaymentMethod=u.NEW_BANK_ACCOUNT,f.selectedPaymentMethod={type:u.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=u.NEW_CARD,f.selectedPaymentMethod={type:u.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[];return this.disableCreditCard||t.push(u.NEW_CARD),this.disableBankAccount||t.push(u.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:l.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",g);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||w;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||f.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!f.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===f.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:k[t],hidden:this.shouldHideRadioInput}),e&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return i("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),i("div",{class:"mt-4"},i("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===u.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return i(r,{key:"bb6a2e0eec485c96a756c504a278670804be0634"},i("form",{key:"f12f65c8fbe45e86418be9d3c2ff1107e292c86d"},i("fieldset",{key:"becda77faf80fd8b1e6d967cc4ead3d4adc3b6e8"},i("div",{key:"0419c1843747f59e68800ae3e2c78096b32605b0",class:"row gy-3"},i("div",{key:"8724f40a13bc62808f6e99cced2f8d7419b22d53",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"ec9c0e2f6a85976d68e3dc939cd2826bfbd840d8",class:"col-12"},i("justifi-button",{key:"1c4b6a83c8357e15eaba071ea2fb8ba82b4c978c",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return s(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}},C=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(b,{height:"18px",width:"120px"}),i(b,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(b,{height:"18px",width:"110px"}),i(b,{height:"36px"}))))},M=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,this.tabId=m(),n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.accountNumberIframeElement.validate(),e=await this.routingNumberIframeElement.validate();return t&&e}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.accountNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"6c1e183b7ba2c70b41e22386d74a9cf7430aa8d5"},i(C,{key:"2755f4d21f8d62919ef56909f2dc6b9211bf550d",isReady:this.isReady}),i("hidden-input",{key:"c35448285cd2b53973caa4a56c28a135e1ed7d74"}),i("div",{key:"9fae602596267bafc39b9e3e9946a289b38393b6",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"bfaee6ed0eaa2a68175f18146d56195cc1a23e91",class:"row mb-3"},i("iframe-input",{key:"7385c2582ad5b397eb2afcb9c87b789d4918542c",inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber?tabId=${this.tabId}`})),i("div",{key:"effe6b1f18d5fa531f4537accfe8279b81bc7b49",class:"row"},i("iframe-input",{key:"19cc7e46d8f7cb79c70ba21f2e9c15c7665eca47",inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber?tabId=${this.tabId}`}))))}},_=class{constructor(e){t(this,e)}get showSimpleCardBillingForm(){return this.paymentMethodType===u.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===u.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.getValues()}async fill(t){var e;null===(e=this.selectedFormRef)||void 0===e||e.fill(t)}async validate(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.validate()}render(){return i(a,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:t=>this.selectedFormRef=t}))}},x=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(r,{key:"5f92a2a58c0828c78818f0055dc2692857730788"},i(p,{key:"541fe7cc24e137cf55fc470b16f3aa8c47eee0d3",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},I=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(b,{height:"18px",width:"100px"}),i(b,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(b,{height:"18px",width:"80px"}),i(b,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(b,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(b,{height:"18px",width:"30px"}),i(b,{height:"36px"}))))},P=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,this.tabId=m(),n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return t&&e&&i&&s}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.cardNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"e204cee1fc875392b8056baf58b7234a739fffce"},i(I,{key:"3accfb88d66661ceaef39f765bb3fddfd0f98393",isReady:this.isReady}),i("hidden-input",{key:"0416ddca8b444cf8702f3fff52065bf647bd4b61"}),i("div",{key:"37c1d5014e5a6658bfd28e08e361ffaa6488f6d7",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"e2956855dfbcab38a782c22e93bd49252196baa8",class:"mb-3"},i("iframe-input",{key:"55105f1eebab4b846e1b5c55448259368a412349",inputId:"cardNumber",ref:t=>this.cardNumberIframeElement=t,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"9464b1a500a84dcaa438a9ebdad756637d14cb24",class:"row"},i("div",{key:"adc51687629fb00d26c6627e95c0228f5a4dfd11",class:"col-4 align-content-end"},i("iframe-input",{key:"52a0e5e198b6bfac00515ec220370e289674b613",inputId:"expirationMonth",ref:t=>this.expirationMonthIframeElement=t,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"1b09582711d838643db265b003ed18b18042713e",class:"col-4 align-content-end"},i("iframe-input",{key:"a1731a8dc02723398e1aae58b3812fccf62e6157",inputId:"expirationYear",ref:t=>this.expirationYearIframeElement=t,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"1e2c3205f2e0b28d036480d2c61934da5e7da620",class:"col-4 align-content-end"},i("iframe-input",{key:"b7b87360068434122f9b5a8935468240684b7a1d",inputId:"CVV",ref:t=>this.cvvIframeElement=t,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}},O=class{constructor(i){t(this,i),this.checkboxChanged=e(this,"checkboxChanged",7),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(t,e)=>{this.isChecked=e,f.savePaymentMethod=e,this.checkboxChanged.emit(this.isChecked)}}render(){return i(r,{key:"981f6a84fc14a7b687e1b6567b30fb9f861b0aa2"},i("form-control-checkbox",{key:"566f6261d19f96b87b9382b26a86b71461a29d08",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{j as internal_tokenize_payment_method,M as justifi_bank_account_form,_ as justifi_billing_form,x as justifi_button,P as justifi_card_form,v as justifi_radio_list_item,O as justifi_save_new_payment_method}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import{p as i}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{T as a,a as r,b as h,c,d as o,e as p,f as n,g as d,h as m,i as f,j as b,k as y,l as j}from"./p-5mt2ek0H.js";import{T as u}from"./p-CZfYo5-1.js";import{p as g,a as k}from"./p-DYEXDs2k.js";import{o as l,g as C}from"./p-Dm07nLGs.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-C4FLe2pT.js";import"./p-DyETkJs3.js";import"./p-HfLk4CG0.js";import"./p-DO4RBao8.js";const O=class{constructor(e){t(this,e),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.payments=[],this.loading=!0,this.paging=i,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:u.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:u.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr").dataset.rowEntityId;if(!s)return;const e=this.payments.find((t=>t.id===s));this.clickEvent.emit({name:u.row,data:e})}}updateOnPropChange(){this.fetchData()}componentWillLoad(){this.paymentsTable=new a(this.payments,this.columns,g,k),this.getPayments&&this.fetchData(),l("set",(()=>{this.pagingParams={},this.errorMessage=""})),l("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}fetchData(){this.loading=!0,this.getPayments({params:this.paymentParams,onSuccess:({payments:t,pagingInfo:s})=>{this.payments=t,this.paging=s,this.paymentsTable.collectionData=this.payments},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e})},final:()=>{this.loading=!1}})}get paymentParams(){const t=C();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.payments.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.paymentsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return e(j,{key:"b694ec89a330819723a9c5a093515c5e594fd811"},e(r,{key:"b0e7f6fa8d4eebb697c0b78a638c9bd61146eb1c"},e(h,{key:"9952bf57d182e3530d8c0cdd9abc68f50633853e"},e(c,{key:"ac5beb9ed786566aadd04e8802c967760c90ba3c"},this.paymentsTable.columnData.map((t=>t)))),e(o,{key:"c167c67965757d73b3d433861a974d4ed499cae1"},e(p,{key:"456ad5dd06da225fc593361fc2fb244312b6dbd5",columnSpan:this.paymentsTable.columnData.length,isLoading:this.loading}),e(n,{key:"11cc043cf73eef3d520504285ffa13e21df0963a",isEmpty:this.showEmptyState,columnSpan:this.paymentsTable.columnData.length}),e(d,{key:"c98ab4e30ceb0cc8c8c0c239a8fbb8d4a7a63477",columnSpan:this.paymentsTable.columnData.length,errorMessage:this.errorMessage}),this.showRowData&&this.paymentsTable.rowData.map(((t,s)=>e(m,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},t)))),this.paging&&e(f,{key:"c5f2334f863b4da3be4a05220bb90358c0df1dfc"},e(b,{key:"229efe9952902c693e19c5d22f589e2b404e8e16"},e(y,{key:"b99252aa7653b8bed555998f6178a88c47c78d17",colSpan:this.paymentsTable.columnData.length},e("pagination-menu",{key:"b6312dfc56e4ce169c4f52cc867ffb11013c3817",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})}))))))}static get watchers(){return{pagingParams:["updateOnPropChange"],getPayments:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{O as payments_list_core}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import{p as i}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{T as a,a as r,b as h,c as o,d as c,e as n,f as p,g as m,h as f,i as d,j as b,k as u,l as g}from"./p-5mt2ek0H.js";import{T as y}from"./p-CZfYo5-1.js";import{t as l,a as j}from"./p-DyJ1zSHJ.js";import{o as k,g as C}from"./p-Dw63wyhO.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-C4FLe2pT.js";import"./p-DyETkJs3.js";import"./p-DO4RBao8.js";const w=class{constructor(e){t(this,e),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=i,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:y.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:y.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr").dataset.rowEntityId;if(!s)return;const e=this.terminals.find((t=>t.id===s));this.clickEvent.emit({name:y.row,data:e})}}updateOnPropChange(){this.fetchData()}componentWillLoad(){this.terminalsTable=new a(this.terminals,this.columns,l,j),this.getTerminals&&this.getSubAccounts&&this.fetchData(),k("set",(()=>{this.pagingParams={}})),k("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:s})=>{this.terminals=t,this.paging=s,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get terminalParams(){const t=C();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){let t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return e(g,{key:"73696e93d767ca2ce57663c49e5db63a0f4978c2"},e(r,{key:"4a70e805379f666560fce4d0c4f98217e6f371cc"},e(h,{key:"8dd564e628a29b076ee896289abd7952933694ee"},e(o,{key:"99672e6b3df7d9105b29bfcf8881669c79d522ef"},this.terminalsTable.columnData.map((t=>t)))),e(c,{key:"347c3cf280897589cbe616bd19af68fad3c83bc0"},e(n,{key:"d82d2bb2c34aa673b6a9f307c18184b6ca51047f",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),e(p,{key:"df70204e1a316aa7208407880e1b37305a74f018",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),e(m,{key:"2078ff1f374cb352069a5efee111303d18fac65f",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((t,s)=>e(f,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},t)))),this.paging&&e(d,{key:"b1ff579488cf7d238373c347066bf8537f6aebb1"},e(b,{key:"04d02b83cda0d175f13c8848db19c5cb9b9682a1"},e(u,{key:"ac311f37baabc3ea2cb0d60bc5b1c54f4638a8e2",colSpan:this.terminalsTable.columnData.length},e("pagination-menu",{key:"deeab93ca320e3cc3a33926468b9652f3a9aa3a5",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})}))))))}static get watchers(){return{pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{w as terminals_list_core}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import{p as a}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{T as i,a as r,b as h,c as o,d as c,e as n,f as p,g as d,h as f,i as m,j as u,k as b,l as g}from"./p-5mt2ek0H.js";import{T as k}from"./p-CZfYo5-1.js";import{c as y,a as j}from"./p-CGJ_mnry.js";import{o as l,g as C}from"./p-CpGEMRkH.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-C4FLe2pT.js";import"./p-DyETkJs3.js";import"./p-DO4RBao8.js";const v=class{constructor(e){t(this,e),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.checkouts=[],this.subAccounts=[],this.loading=!0,this.paging=a,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:k.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:k.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr").dataset.rowEntityId;if(!s)return;const e=this.checkouts.find((t=>t.id===s));this.clickEvent.emit({name:k.row,data:e})}}updateOnPropChange(){this.fetchData()}componentWillLoad(){this.checkoutsTable=new i(this.checkouts,this.columns,y,j),this.getCheckouts&&this.getSubAccounts&&this.fetchData(),l("set",(()=>{this.pagingParams={}})),l("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}fetchData(){this.loading=!0,this.getCheckouts({params:this.checkoutParams,onSuccess:async({checkouts:t,pagingInfo:s})=>{this.checkouts=t,this.paging=s,this.checkoutsTable.collectionData=this.checkouts,this.checkoutsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.checkouts=this.checkouts.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get checkoutParams(){const t=C();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){let t=this.checkouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.checkouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.checkoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return e(g,{key:"54239d9ac3afe4d4594d523f9b84b5bf852190b7"},e(r,{key:"0c466e435625f08326fc521690c055648a0d3a6e"},e(h,{key:"6ac0b1a9bf3d42eb5bac5910f341c84a75d15eaa"},e(o,{key:"171cc43a933be88dcfe2385414d6368755a66a00"},this.checkoutsTable.columnData.map((t=>t)))),e(c,{key:"238b814cfb2e27fa0ae0aee319da04fb7a9da477"},e(n,{key:"3e73b173a14edea582ee06caa248dd31bf7e8971",columnSpan:this.checkoutsTable.columnKeys.length,isLoading:this.loading}),e(p,{key:"cd2ec244aa3663f4255f245727790c30c28438f7",isEmpty:this.showEmptyState,columnSpan:this.checkoutsTable.columnKeys.length}),e(d,{key:"e2f458e70836a01cca79aa6e43c7d8a89bfa593d",columnSpan:this.checkoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.checkoutsTable.rowData.map(((t,s)=>e(f,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},t)))),this.paging&&e(m,{key:"97d1c34429fba943a752e9ece7348dd19d742c68"},e(u,{key:"252e8f76070a8a6a531c710cf36117a04625271a"},e(b,{key:"a3fcfa5e6a90cac15348a387f65fa5b7ed2517f8",colSpan:this.checkoutsTable.columnData.length},e("pagination-menu",{key:"e4fa2774647748fd12c3742b3dd078aee8fdf483",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})}))))))}static get watchers(){return{pagingParams:["updateOnPropChange"],getCheckouts:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{v as checkouts_list_core}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,r as e,c as i,H as s,g as n}from"./p-CV0Pyo1O.js";import{A as o}from"./p-55QcjheA.js";import{A as a,r,s as l,t as h,u as c,v as d,w as p,I as u,m as y,n as m,o as v}from"./p-BiNakvsa.js";import{S as f}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-DqVU8ohH.js";import{c as g,o as k,g as P,a as w,b as C}from"./p-Daew0gTO.js";import{H as A,u as E}from"./p-C4FLe2pT.js";import{f as S}from"./p-MeSAYDNh.js";import{w as j,c as _}from"./p-DVJaoI_m.js";import{H as I}from"./p-BoO2BHR_.js";import{H as R,b as T,h as L,i as N}from"./p-CI11WF1E.js";import{H as M}from"./p-EaBIgUj8.js";import{J as O,c as x}from"./p-BqpQa748.js";import"./p-HXpYMWUU.js";import{C as z,a as D,b as B}from"./p-Cjcsf8ku.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as H,a as U}from"./p-D2muobcE.js";import{C as F}from"./p-BHA4oSi3.js";import{P as q,p as V}from"./p-Jz9qdPhR.js";import{P as G,a as Y,b as W}from"./p-DkoufM1t.js";import{C as J}from"./p-ZpPDShvP.js";import"./p-D8GTwl9v.js";import"./p-Bjv3eJBk.js";var Q;!function(t){t.UNAVAILABLE="UNAVAILABLE",t.SESSION_ERROR="SESSION_ERROR",t.MERCHANT_VALIDATION_ERROR="MERCHANT_VALIDATION_ERROR",t.PAYMENT_PROCESSING_ERROR="PAYMENT_PROCESSING_ERROR",t.USER_CANCELLED="USER_CANCELLED"}(Q||(Q={}));class Z{constructor(){this.api=o()}initialize(t){if(this.applePayConfig=new a(t),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(t,e){try{return await this.api.post({endpoint:"apple_pay/merchant_session",authToken:t,headers:{"Sub-Account":e},body:{domain:window.location.host,display_name:this.applePayConfig.displayName}})}catch(t){throw console.error("Backend validation failed:",t),new Error("Merchant validation failed")}}async processPayment(t,e,i){const s=await this.api.post({endpoint:"apple_pay/process_token",authToken:t,body:i,headers:{"Sub-Account":e}});return{success:s.id&&!!s.data.token,data:s}}isAvailable(){return r.isApplePaySupported()&&r.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await r.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(t,e,i){if(!this.applePayConfig)throw console.error("[ApplePayService] Missing applePayConfig. Did you call initialize()?"),new Error("Apple Pay not initialized. Call initialize() first.");const s=new l(t);if(!s.isValid){const t=[];throw s.countryCode||t.push("countryCode"),s.currencyCode||t.push("currencyCode"),s.merchantCapabilities&&0!==s.merchantCapabilities.length||t.push("merchantCapabilities"),s.supportedNetworks&&0!==s.supportedNetworks.length||t.push("supportedNetworks"),s.total&&s.total.label&&s.total.amount||t.push("total"),console.error("[ApplePayService] Payment request is invalid. Missing/invalid:",t),new Error("Invalid payment request provided")}return this.currentPaymentRequest=s,new Promise(((t,n)=>{try{if("undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),n({success:!1,error:{code:Q.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,s),this.setupSessionEventHandlers(t,n,e,i),this.currentSession.begin()}catch(t){console.error("[ApplePayService] Exception while starting session:",t),n({success:!1,error:{code:Q.SESSION_ERROR,message:t instanceof Error?t.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(t,e,i,s){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest?(this.currentSession.onvalidatemerchant=async()=>{try{if(!i)throw console.error("[ApplePayService] Missing authToken for merchant validation"),new Error("Authentication token not provided.");const t=await this.validateMerchant(i,s);try{this.currentSession.completeMerchantValidation(t)}catch(t){throw console.error("Error calling completeMerchantValidation:",t),t}}catch(t){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.abort(),e({success:!1,error:{code:Q.MERCHANT_VALIDATION_ERROR,message:t instanceof Error?t.message:"Merchant validation failed"}})}},this.currentSession.onpaymentauthorized=async n=>{try{const o=n.payment,a=Object.assign(Object.assign({},o.token),{product_details:{name:this.currentPaymentRequest.total.label,price:r.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}}),l=await this.processPayment(i,s,a);l.success?(this.currentSession.completePayment({status:h.STATUS_SUCCESS}),t({success:!0,token:o.token,paymentMethodId:l.data.id})):(console.error("PSP reported payment failure:",l.data),this.currentSession.completePayment({status:h.STATUS_FAILURE}),e({success:!1,error:{code:Q.PAYMENT_PROCESSING_ERROR,message:"Payment processing failed"}}))}catch(t){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.completePayment({status:h.STATUS_FAILURE}),e({success:!1,error:{code:Q.PAYMENT_PROCESSING_ERROR,message:t instanceof Error?t.message:"Payment processing failed"}})}finally{this.currentSession=void 0,this.currentPaymentRequest=void 0}},this.currentSession.onpaymentmethodselected=()=>{const t={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(t)}catch(t){console.error("Error completing payment method selection:",t),this.currentSession.abort()}},this.currentSession.onshippingmethodselected=()=>{this.currentSession.completeShippingMethodSelection({status:h.STATUS_SUCCESS,newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]})},this.currentSession.oncancel=t=>{if(t.sessionError)switch(console.error(t.sessionError),t.sessionError.code){case"unknown":console.error("Unknown error - likely merchant validation issue"),console.error("This usually means:"),console.error("1. Merchant certificate is invalid or expired"),console.error("2. Merchant identifier mismatch"),console.error("3. Backend validation endpoint issues");break;case"invalidMerchantSession":console.error("Invalid merchant session provided"),console.error("Check that the merchant session from backend is valid");break;case"userCancel":console.error("User cancelled the payment");break;default:console.error("Other error code:",t.sessionError.code)}this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:Q.USER_CANCELLED,message:"User cancelled the Apple Pay session"}})},"onerror"in this.currentSession&&(this.currentSession.onerror=t=>{console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",t),this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:Q.SESSION_ERROR,message:"Apple Pay session error occurred"}})})):console.error("[ApplePayService] setupSessionEventHandlers called without required state",{hasSession:Boolean(this.currentSession),hasConfig:Boolean(this.applePayConfig),hasPaymentRequest:Boolean(this.currentPaymentRequest)})}static createPaymentRequest(t,e,i="US",s="USD"){return{countryCode:i,currencyCode:s,merchantCapabilities:r.getDefaultMerchantCapabilities(),supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(e,t)}}getApplePayConfig(){return this.applePayConfig}}const $=e=>{const{isLoading:i}=e;return i?t("div",{class:"container-fluid p-0"},t("div",{class:"row mb-3"},t("div",{class:"col-12 align-content-center"},t(b,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},X=e=>t("div",{class:"apple-pay-button-container"},t("button",Object.assign({class:(()=>{let t="apple-pay-button";switch(e.buttonStyle){case c.WHITE:t+=" apple-pay-button-white";break;case c.WHITE_OUTLINE:t+=" apple-pay-button-white-outline";break;default:t+=" apple-pay-button-black"}switch(e.buttonType){case d.BUY:t+=" apple-pay-button-type-buy";break;case d.DONATE:t+=" apple-pay-button-type-donate";break;default:t+=" apple-pay-button-type-plain"}return(e.disabled||e.isProcessing||!e.isAvailable)&&(t+=" disabled"),t})(),style:{width:e.width,height:e.height},onClick:()=>{!e.disabled&&!e.isProcessing&&e.isAvailable&&e.clickHandler&&e.clickHandler()},disabled:e.disabled||e.isProcessing||!e.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},e),e.isProcessing&&t("div",{class:"processing-overlay"},t("div",{class:"spinner"}),t("span",null,"Processing..."))),t("style",null,"\n .apple-pay-button-container {\n display: block;\n position: relative;\n width: 100%;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),K=class{constructor(t){e(this,t),this.applePayStarted=i(this,"applePayStarted",7),this.applePayCompleted=i(this,"applePayCompleted",7),this.applePayCancelled=i(this,"applePayCancelled",7),this.applePayError=i(this,"applePayError",7),this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=d.PLAIN,this.buttonStyle=c.BLACK,this.disabled=!1,this.showSkeleton=!0,this.width="100%",this.height="48px",this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.isConfigValid=!0,this.error=null,this.handleApplePayClick=async()=>{var t,e;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit();const i={countryCode:this.countryCode,currencyCode:g.paymentCurrency,merchantCapabilities:[p.SUPPORTS_3DS,p.SUPPORTS_CREDIT,p.SUPPORTS_DEBIT],supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(g.paymentDescription,g.paymentAmount)},s=await this.applePayService.startPaymentSession(i,g.authToken,g.accountId);s.success?this.applePayCompleted.emit({success:!0,token:s.token,paymentMethodId:s.paymentMethodId}):(this.applePayCompleted.emit({success:!1,error:s.error}),this.applePayError.emit({error:(null===(t=s.error)||void 0===t?void 0:t.message)||"Payment failed",code:(null===(e=s.error)||void 0===e?void 0:e.code)||K.ErrorCode.PAYMENT_FAILED}))}catch(t){const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.applePayError.emit({error:e,code:K.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:e})}finally{this.isProcessing=!1}}}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,!(Boolean(g.paymentAmount)&&Boolean(g.paymentCurrency)&&Boolean(g.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,console.error("Apple Pay config error: missing required values",{paymentAmount:g.paymentAmount,paymentCurrency:g.paymentCurrency,hasAuthToken:Boolean(g.authToken),accountId:g.accountId}),this.applePayError.emit({error:this.error,code:K.ErrorCode.CONFIG_ERROR}),void(this.isLoading=!1);if(this.isAvailable=r.isApplePaySupported(),this.canMakePayments=r.canMakePayments(),!this.isAvailable)return this.error="Apple Pay is not supported on this device",console.error(this.error),this.applePayError.emit({error:this.error,code:K.ErrorCode.NOT_SUPPORTED}),void(this.isLoading=!1);if(!this.canMakePayments)return this.error="Apple Pay is not available",console.error(this.error),this.applePayError.emit({error:this.error,code:K.ErrorCode.NOT_AVAILABLE}),void(this.isLoading=!1);const t={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};this.applePayService=new Z,this.applePayService.initialize(t),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(t){console.error("Apple Pay initialization error:",t),this.error=t instanceof Error?t.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:K.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?r.getDefaultSupportedNetworks():[]}async abort(){this.applePayService.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!g.applePayEnabled)return null;const e=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return t(f,null,g.checkoutLoaded&&t("script",{async:!0,src:"https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",onLoad:()=>{this.initializeApplePay()}}),t("div",{class:"apple-pay-container"},t($,{isLoading:this.isLoading}),e&&t(X,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick,width:this.width,height:this.height})),t("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};K.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};const tt=class{constructor(t){e(this,t)}render(){return t(f,{key:"13d4dd7fbc2335e2af7c24066800e0642df0cd77"},t("section",{key:"456cc598f5cf08e55b0c24ff23945b327df5fb66"},t("div",{key:"37143e2b5157cfb973189335e357f39e78fbb7a1"},t("div",{key:"f4d34254b589f631e5cf7f49cab4d37933a7b1a0",part:A},null==g?void 0:g.paymentDescription),t("div",{key:"7d4f4bad72a2c637eafd95ab7dc73f5881ed4906"},t("span",{key:"37b639cd520e87d73246f5d68a294fa2919376cd",part:A},"Total")," ",t("span",{key:"0ace5f0a3f53dd016d3d3167879364be20f407e4",part:A},S(+(null==g?void 0:g.totalAmount)))))))}},et=e=>{const{isLoading:i}=e;return i?t("div",{class:"container-fluid p-0"},t("div",{class:"row mb-3"},t("div",{class:"col-12 align-content-center"},t(b,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null};var it;!function(t){t.initialize="justifi.googlePay.initialize",t.ready="justifi.googlePay.ready",t.sdkLoaded="justifi.googlePay.sdkLoaded",t.initializeResult="justifi.googlePay.initializeResult",t.error="justifi.googlePay.error",t.buttonClicked="justifi.googlePay.buttonClicked",t.startPayment="justifi.googlePay.startPayment",t.paymentSuccess="justifi.googlePay.paymentSuccess",t.paymentCanceled="justifi.googlePay.paymentCanceled",t.paymentError="justifi.googlePay.paymentError"}(it||(it={}));const st=class{constructor(t){e(this,t),this.googlePayCompleted=i(this,"googlePayCompleted",7),this.googlePayCancelled=i(this,"googlePayCancelled",7),this.environment="TEST",this.iframeReady=!1,this.sdkLoaded=!1,this.isReadyToPay=!1,this.handleMessage=t=>{if(t.origin!==this.iframeOrigin)return;const{eventType:e,data:i}=t.data||{};switch(e){case it.ready:this.iframeReady=!0;break;case it.sdkLoaded:this.sdkLoaded=!0,this.sendInitialize();break;case it.initializeResult:this.isReadyToPay=i.isReadyToPay,i.error&&console.error("Init error:",i.error);break;case it.error:console.error("Google Pay error:",i);break;case it.buttonClicked:this.sendStartPayment();break;case it.paymentSuccess:this.googlePayCompleted.emit({success:!0,paymentMethodId:i.paymentMethodId,cardNetwork:i.cardNetwork,cardDetails:i.cardDetails});break;case it.paymentCanceled:this.googlePayCancelled.emit();break;case it.paymentError:this.googlePayCompleted.emit({success:!1,error:{code:i.code,message:i.message}})}}}async componentWillLoad(){await j(),this.iframeOrigin=_.iframeOrigin}componentDidLoad(){window.addEventListener("message",this.handleMessage)}disconnectedCallback(){window.removeEventListener("message",this.handleMessage)}sendInitialize(){var t;(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow)&&this.iframeElement.contentWindow.postMessage({eventType:it.initialize,data:{environment:this.environment,gatewayMerchantId:g.accountId,merchantName:this.merchantName,authToken:g.authToken,accountId:g.accountId}},this.iframeOrigin)}sendStartPayment(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={totalPrice:String(g.paymentAmount/100),totalPriceStatus:"FINAL",currencyCode:g.paymentCurrency||"USD"};this.iframeElement.contentWindow.postMessage({eventType:it.startPayment,data:e},this.iframeOrigin)}render(){return g.googlePayEnabled?t(s,null,t(et,{isLoading:!this.isReadyToPay}),t("iframe",{ref:t=>this.iframeElement=t,src:`${this.iframeOrigin}/v2/googlePay`,style:{border:"none",width:"100%",height:"48px",display:this.isReadyToPay?"block":"none"}})):(console.warn("Google Pay is not enabled for this checkout"),null)}},nt=class{constructor(t){e(this,t),this.levels={h1:I,h2:R,h3:M},this.level="h1"}render(){return t(f,{key:"1fc31aaf9d222d4f53e4ca546fd323389f4154c3"},t(this.levels[this.level],{key:"6bc979a358b5a93159d378db2452b57133ed3aaa",text:this.text,class:this.class}))}},ot=class{constructor(t){e(this,t),this.errorEvent=i(this,"error-event",7),this.submitEvent=i(this,"submit-event",7),this.checkoutChangedEvent=i(this,"checkout-changed",7),this.plaidService=new q,this.handleGooglePayCompleted=t=>{const{success:e,paymentMethodId:i,error:s}=t.detail||{};e&&i?(g.paymentToken=i,g.selectedPaymentMethod={type:G.GOOGLE_PAY},this.submitCheckout()):this.errorEvent.emit({message:s&&s.message||"Google Pay payment failed",errorCode:D.TOKENIZE_ERROR,severity:z.ERROR})},this.handleGooglePayCancelled=()=>{g.paymentToken=void 0,g.selectedPaymentMethod=void 0},this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:n}=t.detail;e&&i?(g.paymentToken=s,g.selectedPaymentMethod={type:G.APPLE_PAY},this.submitCheckout()):(console.error("Apple Pay completed but failed:",n),this.errorEvent.emit({message:(null==n?void 0:n.message)||"Apple Pay payment failed",errorCode:D.TOKENIZE_ERROR,severity:z.ERROR}))},this.handleApplePayError=t=>{const{error:e,code:i}=t.detail;console.error("Apple Pay error:",e),this.errorEvent.emit({message:e||"Apple Pay error occurred",errorCode:`APPLE_PAY_${i}`,severity:z.ERROR})},this.handleApplePayCancelled=()=>{g.paymentToken=void 0,g.selectedPaymentMethod=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),g.checkoutId=this.checkoutId;const t={authToken:this.authToken,checkoutId:this.checkoutId,service:new F};this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:s,onError:n})=>{var o;try{const a=await i.fetchCheckout(t,e);if(a.error)return n({error:U(a.error),code:H(null===(o=a.error)||void 0===o?void 0:o.code),severity:z.ERROR});s({checkout:a.data})}catch(t){const e=H(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:z.ERROR})}})(t),this.completeCheckout=(({authToken:t,checkoutId:e,service:i})=>async({payment:s,onSuccess:n,onError:o})=>{var a;try{const r=await i.complete(t,e,s);if(r.error)return o({error:U(r.error),code:H(null===(a=r.error)||void 0===a?void 0:a.code),severity:z.ERROR});n({checkout:r.data})}catch(t){const e=H(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:z.ERROR})}})(t),k((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new O(this),x(),g.authToken=this.authToken,this.fetchCheckout(),T("set",(t=>{const e=N[t];void 0!==e&&L(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this.removeApplePayListeners(),this.removeGooglePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==u.completed?t.status!==u.expired||this.errorEvent.emit({message:B.CHECKOUT_EXPIRED,errorCode:D.CHECKOUT_EXPIRED,severity:z.ERROR}):this.errorEvent.emit({message:B.CHECKOUT_ALREADY_COMPLETED,errorCode:D.CHECKOUT_ALREADY_COMPLETED,severity:z.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:t.code,severity:t.severity})}}):this.errorEvent.emit({message:B.NOT_AUTHENTICATED,errorCode:D.NOT_AUTHENTICATED,severity:z.ERROR})}updateStore(t){var e,i,s,n,o,a,r;g.accountId=t.account_id,g.checkoutLoaded=!0,g.paymentMethods=t.payment_methods.map((t=>new Y(t))),g.paymentMethodGroupId=t.payment_method_group_id,g.paymentDescription=t.payment_description,g.totalAmount=t.total_amount,g.paymentAmount=t.payment_amount,g.bnplEnabled=t.payment_settings.bnpl_payments,g.insuranceEnabled=t.payment_settings.insurance_payments,g.bankAccountVerification=null===(e=t.payment_settings)||void 0===e?void 0:e.bank_account_verification,g.applePayEnabled=null===(i=t.payment_settings)||void 0===i?void 0:i.apple_payments,g.googlePayEnabled=null===(s=t.payment_settings)||void 0===s?void 0:s.google_payments,g.bnplProviderClientId=null===(n=null==t?void 0:t.bnpl)||void 0===n?void 0:n.provider_client_id,g.bnplProviderMode=null===(o=null==t?void 0:t.bnpl)||void 0===o?void 0:o.provider_mode,g.bnplProviderApiVersion=null===(a=null==t?void 0:t.bnpl)||void 0===a?void 0:a.provider_api_version,g.bnplProviderCheckoutUrl=null===(r=null==t?void 0:t.bnpl)||void 0===r?void 0:r.provider_checkout_url}emitCheckoutChanged(){const t={availablePaymentMethodTypes:P(),selectedPaymentMethod:g.selectedPaymentMethod,savedPaymentMethods:g.paymentMethods};this.checkoutChangedEvent.emit(t)}queryFormRefs(){this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.googlePayRef=this.hostEl.querySelector("justifi-google-pay"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}setupGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.addEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.addEventListener("googlePayCancelled",this.handleGooglePayCancelled))}removeGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.removeEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.removeEventListener("googlePayCancelled",this.handleGooglePayCancelled))}async tokenizePaymentMethod(t){var e,i,s;const n=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},o=Object.assign(Object.assign({},t),n),a=Object.assign({accountId:g.accountId,payment_method_group_id:void 0},o);g.savePaymentMethod&&(a.payment_method_group_id=g.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:a,account:g.accountId}));return r.error?r:(g.paymentToken=r.id,r.id)}async setSelectedPaymentMethod(t){g.selectedPaymentMethod=t,g.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];g.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=g.selectedPaymentMethod)||void 0===t?void 0:t.type)===G.NEW_CARD,n=(null===(e=g.selectedPaymentMethod)||void 0===e?void 0:e.type)===G.NEW_BANK_ACCOUNT;if((s||n)&&(this.paymentMethodFormRef&&i.push(this.paymentMethodFormRef.validate()),this.billingFormRef&&i.push(this.billingFormRef.validate())),0===i.length)return!0;try{return!!(await Promise.all(i)).every((t=>"boolean"==typeof t?t:!1!==(null==t?void 0:t.isValid)))||(this.errorEvent.emit({message:"Validation error",errorCode:D.VALIDATION_ERROR,severity:z.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,s,n,o;const a=await this.validate();if(!g.selectedPaymentMethod)return void this.errorEvent.emit({message:"No payment method selected.",errorCode:D.VALIDATION_ERROR,severity:z.ERROR});const r=(null===(e=g.selectedPaymentMethod)||void 0===e?void 0:e.type)===G.NEW_CARD,l=(null===(i=g.selectedPaymentMethod)||void 0===i?void 0:i.type)===G.NEW_BANK_ACCOUNT,h=(null===(s=g.selectedPaymentMethod)||void 0===s?void 0:s.type)===G.PLAID;if(r||l){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return void this.errorEvent.emit({message:e.error.message,errorCode:D.TOKENIZE_ERROR,severity:z.ERROR})}if(h&&!g.paymentToken){const t=g.plaidPublicToken,e=g.plaidLinkTokenId;if(!t)return void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:D.TOKENIZE_ERROR,severity:z.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(g.authToken,g.accountId,t,e||void 0,g.savePaymentMethod?g.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:D.TOKENIZE_ERROR,severity:z.ERROR});const s=null==i?void 0:i.data,o=(null===(n=null==s?void 0:s.bank_account)||void 0===n?void 0:n.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);g.paymentToken=o}catch(t){return void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:D.TOKENIZE_ERROR,severity:z.ERROR})}}if(!a)return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:D.VALIDATION_ERROR,severity:z.ERROR});if(!g.paymentToken)return void this.errorEvent.emit({message:"Payment token not found.",errorCode:D.TOKENIZE_ERROR,severity:z.ERROR});let c;if(c={payment_mode:(t=>{switch(t){case G.NEW_CARD:case G.SAVED_CARD:case G.NEW_BANK_ACCOUNT:case G.SAVED_BANK_ACCOUNT:case G.PLAID:return W.ECOM;case G.SEZZLE:return W.BNPL;case G.APPLE_PAY:return W.APPLE_PAY;case G.GOOGLE_PAY:return W.GOOGLE_PAY;default:return}})(null===(o=g.selectedPaymentMethod)||void 0===o?void 0:o.type),payment_token:g.paymentToken},this.preCompleteHook){const t=w();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return void console.log("Checkout cancelled by preCompleteHook",t)}}this.completeCheckout({payment:c,onSuccess:({checkout:t})=>{this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:D.COMPLETE_CHECKOUT_ERROR,severity:z.ERROR})}})}render(){return t(s,{key:"ee341d8d78767a80e2627ea5244ba46ca63cd8df"})}get hostEl(){return n(this)}},at=class{constructor(t){e(this,t),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected",7),this.plaidError=i(this,"plaidError",7),this.plaidErrorRecovered=i(this,"plaidErrorRecovered",7),this.isAuthenticating=!1,this.publicToken=null,this.linkToken=null,this.linkTokenId=null,this.error=null,this.plaidLink=null,this.isSelected=!1,this.retryCount=0,this.isRetrying=!1,this.plaidService=new q,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{g.authToken&&g.accountId&&g.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:v.PLAID_SDK_LOAD_FAILED,message:m[v.PLAID_SDK_LOAD_FAILED],severity:y[v.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:v.PLAID_LINK_TOKEN_FAILED,message:m[v.PLAID_LINK_TOKEN_FAILED],severity:y[v.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const t=window.Plaid;this.plaidLink=t.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(t){this.handleError({code:v.PLAID_LINK_INIT_FAILED,message:m[v.PLAID_LINK_INIT_FAILED],severity:y[v.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,n;try{if(!g.authToken||!g.accountId)return void this.handleError({code:v.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:z.ERROR,retryable:!1,userAction:"Refresh the page"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var t;null===(t=this.abortController)||void 0===t||t.abort()}),3e4);const e=await this.plaidService.getLinkToken(g.authToken,g.accountId,g.checkoutId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),e.error)throw new Error("string"==typeof e.error?e.error:e.error.message||"Failed to get link token");this.linkToken=e.data.link_token,this.linkTokenId=(null==e?void 0:e.id)||(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)||null,this.linkTokenId&&(g.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let o=v.PLAID_LINK_TOKEN_FAILED,a=m[o],r=!0;"AbortError"===t.name?(o=v.PLAID_TIMEOUT,a=m[o],r=!0):(null===(e=t.message)||void 0===e?void 0:e.includes("network"))||(null===(i=t.message)||void 0===i?void 0:i.includes("fetch"))?(o=v.PLAID_NETWORK_ERROR,a=m[o],r=!0):((null===(s=t.message)||void 0===s?void 0:s.includes("401"))||(null===(n=t.message)||void 0===n?void 0:n.includes("unauthorized")))&&(o=v.PLAID_INVALID_CREDENTIALS,a="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:o,message:a,severity:y[o],originalError:t,retryable:r,userAction:r?"Click to try again":"Refresh the page"})}},this.mapApiErrorToPlaidError=t=>{if("string"==typeof t){if(t.includes("rate_limit"))return v.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return v.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return v.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return v.PLAID_RATE_LIMITED;case"maintenance":return v.PLAID_MAINTENANCE;case"not_authenticated":return v.PLAID_INVALID_CREDENTIALS;default:return v.PLAID_LINK_TOKEN_FAILED}return v.PLAID_LINK_TOKEN_FAILED},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=t=>{this.publicToken=t,this.isAuthenticating=!1,this.clearError(),this.retryCount=0,this.isSelected||(this.isSelected=!0,g.selectedPaymentMethod={type:G.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:z.INFO}),g.plaidPublicToken=t},this.handlePlaidExit=t=>{this.isAuthenticating=!1,t&&this.handlePlaidError(t)},this.handlePlaidEvent=(t,e)=>{switch(t){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(e)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=t=>{let e=v.PLAID_AUTHENTICATION_FAILED,i=m[e],s=!0,n="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=v.PLAID_INVALID_CREDENTIALS,i=m[e],s=!0;break;case"ITEM_LOGIN_REQUIRED":e=v.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":e=v.PLAID_ACCOUNT_LOCKED,i=m[e],s=!1,n="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=v.PLAID_MAINTENANCE,i=m[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=v.PLAID_RATE_LIMITED,i=m[e],s=!0;break;case"INVALID_REQUEST":e=v.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":e=v.PLAID_AUTHENTICATION_FAILED,i=t.error_message||"Bank authentication failed. Please try again.",s=!0;break;default:t.error_message&&(i=t.error_message)}if(t.error_message){const o=t.error_message.toLowerCase();o.includes("not supported")||o.includes("unsupported")?(e=v.PLAID_BANK_NOT_SUPPORTED,i=m[e],s=!1,n="Try a different payment method"):(o.includes("expired")||o.includes("timeout"))&&(e=v.PLAID_TOKEN_EXPIRED,i=m[e],s=!0)}this.handleError({code:e,message:i,severity:y[e],originalError:t,retryable:s,userAction:n}),this.isAuthenticating=!1},this.handleError=t=>{this.error=t,this.plaidError.emit({code:t.code,message:t.message,severity:t.severity,data:{originalError:t.originalError,retryable:t.retryable,userAction:t.userAction,retryCount:this.retryCount}}),console.error("Plaid error:",t),t.retryable&&this.retryCount<this.maxRetries&&this.scheduleRetry()},this.scheduleRetry=()=>{this.isRetrying||(this.isRetrying=!0,this.retryCount++,setTimeout((()=>{this.isRetrying=!1,this.clearError(),this.waitForStoreAndInitialize()}),this.retryDelay*this.retryCount))},this.clearError=()=>{this.error&&(this.error=null,this.retryCount=0)},this.syncWithStore=()=>{var t;const e=(null===(t=g.selectedPaymentMethod)||void 0===t?void 0:t.type)===G.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=g.selectedPaymentMethod)||void 0===e?void 0:e.type)!==G.PLAID&&(g.selectedPaymentMethod={type:G.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.waitForStoreAndInitialize()},this.scriptRef.onerror=()=>{this.handleError({code:v.PLAID_SDK_LOAD_FAILED,message:m[v.PLAID_SDK_LOAD_FAILED],severity:y[v.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}componentWillLoad(){var t;this.isSelected=(null===(t=g.selectedPaymentMethod)||void 0===t?void 0:t.type)===G.PLAID}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return g.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,g.selectedPaymentMethod={type:G.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(t){this.isSelected=t,t&&(g.selectedPaymentMethod={type:G.PLAID})}async isCurrentlySelected(){return this.isSelected}async deselect(){this.isSelected=!1}async reset(){this.publicToken=null,this.clearError(),this.isAuthenticating=!1,this.linkToken=null,this.plaidLink=null,this.retryCount=0,this.isRetrying=!1,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.abortController&&(this.abortController.abort(),this.abortController=null)}async isReadyForAuthentication(){return!(!this.plaidLink||!this.linkToken||this.isAuthenticating)}async retry(){this.error&&this.error.retryable&&(this.clearError(),this.waitForStoreAndInitialize())}async getErrorInfo(){return this.error}componentDidLoad(){const t=C("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(!0!==g.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[PlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const e=t("img",{class:"plaid-logo-img",src:V,alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return t(f,{class:"payment-method"},t("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:t=>this.scriptRef=t}),t("div",{title:"Pay with Plaid"},t("div",{onClick:t=>{t.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",e," "),(()=>this.error?t("div",{class:(this.error.severity===z.ERROR?"text-danger":this.error.severity===z.WARNING?"text-warning":"text-info")+" mt-2"},t("small",null,this.error.message),t("br",null),t("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&t("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?t("div",{class:"text-info mt-2"},t("small",null,"Connecting to your bank...")):this.publicToken?t("div",{class:"text-success mt-2"},t("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:t("div",{class:"text-muted mt-2"},t("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},rt=class{constructor(t){e(this,t),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),g.selectedPaymentMethod={id:t.id,type:t.type},g.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===G.SAVED_CARD&&g.disableCreditCard||t===G.SAVED_BANK_ACCOUNT&&g.disableBankAccount)}componentWillLoad(){g.paymentMethods.length||console.warn("No saved payment methods available."),g.disablePaymentMethodGroup&&console.warn("Payment method group is disabled.")}render(){return g.disablePaymentMethodGroup?null:t(f,null,t("div",{class:"saved-payment-methods"},g.paymentMethods.length?g.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((e=>t("div",{class:"radio-list-item p-3",part:E,onClick:this.onPaymentMethodOptionClick(e)},t("form-control-radio",{name:"paymentMethodType",value:null==e?void 0:e.id,checked:g.paymentToken===(null==e?void 0:e.id),label:`${J[null==e?void 0:e.brand]||""} *${null==e?void 0:e.acct_last_four}`})))):null))}},lt=t("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),ht=class{constructor(t){e(this,t),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected",7),this.paymentMethodOptionId=G.SEZZLE,this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((e=>{t=e}));const e=Number(g.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:g.bnplProviderClientId,apiMode:g.bnplProviderMode,apiVersion:g.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(t){t.preventDefault(),i.startCheckout({checkout_url:g.bnplProviderCheckoutUrl})},onComplete:e=>t({bnpl:e.data}),onCancel:e=>t({bnpl:e.data}),onFailure:e=>t({bnpl:e.data})}),this.sezzleCheckout=i,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}async handleSelectionClick(){g.selectedPaymentMethod={type:G.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var e,i;return g.bnplEnabled?t(f,{class:"payment-method"},t("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),t("div",null,t("div",null,"Buy now, pay later with ",lt),this.installmentPlan&&t("small",null,t("span",null,null===(e=this.installmentPlan)||void 0===e?void 0:e.installments.length)," ",t("span",null,this.installmentPlan.schedule," payments of")," ",t("span",{class:"fw-bold"},S(null===(i=this.installmentPlan)||void 0===i?void 0:i.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}};export{K as justifi_apple_pay,tt as justifi_checkout_summary,st as justifi_google_pay,nt as justifi_header,ot as justifi_modular_checkout,at as justifi_plaid_payment_method,rt as justifi_saved_payment_methods,ht as justifi_sezzle_payment_method}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as i,r as s,c as t}from"./p-CV0Pyo1O.js";import{au as e,as as r,an as o,H as l}from"./p-C4FLe2pT.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as a,J as n}from"./p-BqpQa748.js";import{C as h,a as c}from"./p-Cjcsf8ku.js";import{B as v}from"./p-DqtDbB8E.js";import{B as u}from"./p-BcNb9bVO.js";import{m as p}from"./p-CMqX6btO.js";import{S as m}from"./p-DqVU8ohH.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{k as f,j as b,c as w}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{g as j,a as x}from"./p-D2muobcE.js";import{T as y}from"./p-6V4e6Fb_.js";import{l as g}from"./p-MeSAYDNh.js";import"./p-Bjv3eJBk.js";import"./p-55QcjheA.js";import"./p-D8GTwl9v.js";const k=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(m,{width:"25%"})),i("div",{class:"col-12"},i(m,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"50%"}),i(m,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"65%"}),i(m,{width:"35%"}))),S=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(m,{width:"40%",height:"40px"})),i(k,null)),B=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(m,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(m,null),i(m,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(m,{width:"80px",height:"32px"}),i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(m,null),i(m,null)))))),C=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.submitted=t(this,"submit-event",7),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new b({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?w.boardingShipping:w.boardingOnly}),a(),this.analytics=new n(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",c.MISSING_PROPS,h.ERROR)}initializeGetBusiness(){p({id:this.businessId,authToken:this.authToken,service:new v})({onSuccess:({business:i})=>{this.business=new u(i),this.loading.business=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,a;try{const n=await t.fetchTerminalModels(i,s);if(n.error)return r({error:x(n.error),code:j(null===(a=n.error)||void 0===a?void 0:a.code),severity:h.ERROR});e({terminals:(null===(l=null===(o=n.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new f(i))))||[],orderLimit:null===(d=n.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=j(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:h.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new y})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:x(d.error),code:j(null===(l=d.error)||void 0===l?void 0:l.code),severity:h.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=j(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:h.ERROR})}})({authToken:this.authToken,service:new y});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(S,null),this.loading.terminals&&i("div",{class:"mt-5"},i(B,null),i(B,null),i(B,null)))}renderBusinessDetails(){var s,t,o,l,d,a,n,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(a=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===a?void 0:a.email),i("div",null,g(null===(h=null===(n=this.business)||void 0===n?void 0:n.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"bb4aaf359b1511f493e10aeb574dfb33a5ca2834"},i("div",{key:"d09aef6864ba87fca3556f2e873dcf9ed2f988d4",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{C as justifi_order_terminals}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{h as r}from"./p-BiNakvsa.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as o,J as c}from"./p-BqpQa748.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-B_KHnbK8.js";import{T as f,l,a as u,b as m,c as y,d as b,e as _,f as j,g,h as k,i as T,j as w,k as v}from"./p-5mt2ek0H.js";import{S as C}from"./p-BqNNwq6C.js";import{T as D}from"./p-CZfYo5-1.js";import{a as F}from"./p-MeSAYDNh.js";import{V as S,W as P}from"./p-C4FLe2pT.js";import"./p-D8GTwl9v.js";import"./p-Bjv3eJBk.js";import"./p-55QcjheA.js";import"./p-DyETkJs3.js";const R={created_at:()=>e("th",{part:S,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>e("th",{part:S,scope:"col",title:"The type of each transaction"},"Type"),id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>e("th",{part:S,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>e("th",{part:S,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>e("th",{part:S,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>e("th",{part:S,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>e("th",{part:S,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},B={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",platform_fee:"Platform Fee",platform_fee_return:"Platform Fee Return",processing_fee:"Processing Fee",processing_fee_return:"Processing Fee Return",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},I={created_at:(t,a)=>e("td",{part:P(a)},e("div",{class:"fw-bold"},F(t.created_at,{showDisplayDate:!0})),e("div",{class:"fw-bold"},F(t.created_at,{showTime:!0}))),type:(t,a)=>e("td",{part:P(a)},B[t.payment_balance_txn_type]),id:(t,a)=>e("td",{part:P(a)},t.id),amount:(t,a)=>e("td",{part:P(a),class:"text-end"},t.formattedPaymentAmount(t.amount)),balance:(t,a)=>e("td",{part:P(a),class:"text-end"},t.formattedPaymentAmount(t.balance)),currency:(t,a)=>e("td",{part:P(a)},t.currency),financial_transaction_id:(t,a)=>e("td",{part:P(a)},t.financial_transaction_id),payment_id:(t,a)=>e("td",{part:P(a)},t.payment_id),payment_balance_txn_type:(t,a)=>e("td",{part:P(a)},t.payment_balance_txn_type),source_id:(t,a)=>e("td",{part:P(a)},t.source_id),source_type:(t,a)=>e("td",{part:P(a)},t.source_type)},q=class{constructor(e){t(this,e),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=e=>{this.pagingParams={before_cursor:e},this.clickEvent.emit({name:D.previous})},this.handleClickNext=e=>{this.pagingParams={after_cursor:e},this.clickEvent.emit({name:D.next})},this.rowClickHandler=e=>{const t=e.target.closest("tr").dataset.rowEntityId;if(!t)return;const a=this.balanceTransactions.find((e=>e.id===t));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,R,I),o(),this.analytics=new c(this),this.initializeApi()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeApi()}handleError(e,t,a){this.isLoading=!1,this.errorEvent.emit({errorCode:e,message:t,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:e,authToken:t,service:a})=>async({params:i,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(e,t,i);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:s.ERROR}):n({balanceTransactions:c.data.map((e=>new r(e))),pagingInfo:Object.assign({},c.page_info)})}catch(e){const t=p(null==e?void 0:e.code);o({error:h(e),code:t,severity:s.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:e,pagingInfo:t})=>{this.balanceTransactions=e,this.paging=t,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e.message,this.handleError(e,t,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(i.MISSING_PROPS,this.errorMessage,s.ERROR))}get entityId(){return this.balanceTransactions.map((e=>e.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return e(C,{key:"7aaa611cf9d23ff9244d8df54e57daa3ec08a635"},e(l,{key:"d3f5244cfe909030c6072c7fdc4a5740029a4c17"},e(u,{key:"b0dc2044e5ee11b5d6a8298ed219c33f2bc42a35"},e(m,{key:"6a91d2b6968a6e969be3861c85b829c1ca5f899e"},e(y,{key:"ae84fd9d80b84054bfa1012137affa5c83b2be39"},this.transactionsTable.columnData.map((e=>e)))),e(b,{key:"6a5cdec3190bb80ed3f78f295d07271838260fce"},e(_,{key:"9fef843fa67a8049d77432d75f89446a2abe5ccc",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),e(j,{key:"3be23e217a98d0b2727dabc783134996ef0f9084",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),e(g,{key:"791ff61e65fb2f4e6a83f7d5142565b4a89106b5",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((t,a)=>e(k,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},t)))),this.paging&&e(T,{key:"898e2236fbed139f8196452463e3f248c01608d4"},e(w,{key:"9b416e1f6122d095b7516816ed686fe116479512"},e(v,{key:"6a12ce5ee3c5f28058ee5796cb174ef9fa4505b5",colSpan:this.transactionsTable.columnData.length},e("pagination-menu",{key:"06984f04a928213ecbb6b3bf5acd3cb3a48e901f",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{q as justifi_payment_transactions_list}
|