@justifi/webcomponents 6.14.5-rc.1 → 6.15.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Analytics-46pgYofS.js → Analytics-VQGAbMVS.js} +3 -3
- package/dist/cjs/{Api-C2V2lX6a.js → Api--EGkA-pT.js} +1 -1
- package/dist/cjs/{Plaid-B2o4c_Ej.js → Plaid-D85oV9FN.js} +5 -0
- package/dist/cjs/additional-questions-form-step_15.cjs.entry.js +7 -7
- package/dist/cjs/additional-statement_8.cjs.entry.js +8 -8
- package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +4 -4
- package/dist/cjs/bank-account-document-form-inputs.cjs.entry.js +1 -1
- package/dist/cjs/bank-account-form.cjs.entry.js +5 -5
- package/dist/cjs/{business.service-COn1NkhY.js → business.service-B51fjG_j.js} +2 -2
- package/dist/cjs/card-form.cjs.entry.js +5 -5
- package/dist/cjs/{check-pkg-version-BsDr9TZT.js → check-pkg-version-RMsgKzFc.js} +1 -1
- package/dist/cjs/{checkout-actions-VCJi-q4z.js → checkout-actions-BRQFQ6n-.js} +2 -2
- package/dist/cjs/{checkout.service-DObCfUj2.js → checkout.service-BsOwkSNp.js} +2 -2
- package/dist/cjs/{checkout.store-DOa1-SjA.js → checkout.store-DaV9lvEQ.js} +6 -1
- package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
- package/dist/cjs/dispute-notification_2.cjs.entry.js +10 -10
- package/dist/cjs/{event-types-CmDSoKh4.js → event-types-C_LP6UcW.js} +2 -2
- package/dist/cjs/form-address-fields_3.cjs.entry.js +2 -2
- package/dist/cjs/form-alert_3.cjs.entry.js +5 -5
- package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/form-control-date.cjs.entry.js +2 -2
- package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
- package/dist/cjs/form-control-file.cjs.entry.js +2 -2
- package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number_2.cjs.entry.js +2 -2
- package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
- package/dist/cjs/form-control-select_2.cjs.entry.js +4 -4
- package/dist/cjs/{get-business-BBDsPv-b.js → get-business-BpaRbn5S.js} +2 -2
- package/dist/cjs/{get-payment-details-BYZeUFAB.js → get-payment-details-Cmg8gWvo.js} +2 -2
- package/dist/cjs/{get-subaccounts-CuruLv9t.js → get-subaccounts-d4CUegsn.js} +3 -3
- package/dist/cjs/{index-CajjbB9t.js → index-DDa1jd08.js} +4 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/internal-button.cjs.entry.js +1 -1
- package/dist/cjs/{justifi-apple-pay_11.cjs.entry.js → justifi-apple-pay_12.cjs.entry.js} +283 -26
- package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +6 -6
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +6 -6
- package/dist/cjs/justifi-billing-form-full.cjs.entry.js +1 -1
- package/dist/cjs/justifi-billing-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-details.cjs.entry.js +8 -8
- package/dist/cjs/justifi-business-form.cjs.entry.js +8 -8
- package/dist/cjs/justifi-card-billing-form-simple.cjs.entry.js +1 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js +6 -6
- package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +5 -5
- package/dist/cjs/justifi-checkout.cjs.entry.js +8 -8
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +10 -10
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +8 -8
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +6 -6
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +10 -10
- package/dist/cjs/justifi-payment-details.cjs.entry.js +16 -16
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payout-details.cjs.entry.js +11 -11
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +10 -10
- package/dist/cjs/justifi-qr-terminal.cjs.entry.js +8 -8
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +8 -8
- package/dist/cjs/justifi-save-new-payment-method.cjs.entry.js +1 -1
- package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +8 -8
- package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +4 -4
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +8 -8
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +9 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-Cb1-8Jj8.js → package-DfwuePUh.js} +1 -1
- package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
- package/dist/cjs/{payment-provisioning-actions-CIsDrh8k.js → payment-provisioning-actions-DDooZhhk.js} +2 -2
- package/dist/cjs/{payment.service-XSIPp45g.js → payment.service-Vy_JnuSA.js} +2 -2
- package/dist/cjs/{payout.service-CIzggNLL.js → payout.service-BEPglFXf.js} +2 -2
- package/dist/cjs/{payouts-status-DVU5138C.js → payouts-status-1IUtW-UQ.js} +2 -2
- package/dist/cjs/{plaid.service-jphsDR0Z.js → plaid.service-DXQ7q51E.js} +2 -2
- package/dist/cjs/radio-list-item.cjs.entry.js +1 -1
- package/dist/cjs/save-new-payment-method.cjs.entry.js +3 -3
- package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
- package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
- package/dist/cjs/{terminal.service-ZyT05wTw.js → terminal.service-BP2YecQ_.js} +2 -2
- package/dist/cjs/{utils-WrOn06xB.js → utils-CBriZzRC.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Checkout.js +5 -0
- package/dist/collection/api/Paypal.js +1 -0
- package/dist/collection/api/index.js +1 -0
- package/dist/collection/api/services/paypal.service.js +9 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/billing-form/bank-account-billing-form-simple.js +1 -1
- package/dist/collection/components/checkout/billing-form/card-billing-form-simple.js +1 -1
- package/dist/collection/components/checkout/billing-form/justifi-billing-form.js +1 -1
- package/dist/collection/components/checkout/card-form/card-form.js +2 -2
- package/dist/collection/components/checkout/justifi-checkout.js +1 -1
- package/dist/collection/components/checkout/justifi-saved-payment-method.js +1 -1
- package/dist/collection/components/checkout/save-new-payment-method/justifi-save-new-payment-method.js +1 -1
- package/dist/collection/components/checkout/save-new-payment-method/save-new-payment-method.js +1 -1
- package/dist/collection/components/checkouts-list/checkouts-list-filters.js +3 -3
- package/dist/collection/components/checkouts-list/justifi-checkouts-list.js +2 -2
- package/dist/collection/components/dispute-management/dispute-notification.js +2 -2
- package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/customer-details.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +1 -1
- package/dist/collection/components/dispute-management/justifi-dispute-management.js +1 -1
- package/dist/collection/components/filters/table-filters-menu.js +1 -1
- package/dist/collection/components/modular-checkout/ModularCheckout.js +4 -0
- package/dist/collection/components/modular-checkout/justifi-modular-checkout.js +75 -11
- package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-billing-form-simple.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-form.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/justifi-billing-form-full.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/justifi-card-billing-form-simple.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/justifi-card-form.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/justifi-checkout-summary.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/paypal/justifi-paypal.js +253 -0
- package/dist/collection/components/modular-checkout/sub-components/paypal/paypal.js +17 -0
- package/dist/collection/components/order-terminals/justifi-order-terminals.js +1 -1
- package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
- package/dist/collection/components/payment-details/justifi-payment-details.js +8 -8
- package/dist/collection/components/payment-transactions-list/justifi-payment-transactions-list.js +1 -1
- package/dist/collection/components/payments-list/justifi-payments-list-filters.js +2 -2
- package/dist/collection/components/payments-list/justifi-payments-list.js +1 -1
- package/dist/collection/components/payout-details/justifi-payout-details.js +3 -3
- package/dist/collection/components/payout-transactions-list/justifi-payout-transactions-list.js +1 -1
- package/dist/collection/components/payouts-list/justifi-payouts-list-filters.js +2 -2
- package/dist/collection/components/payouts-list/justifi-payouts-list.js +1 -1
- package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list-filters.js +3 -3
- package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list.js +2 -2
- package/dist/collection/components/terminals-list/justifi-terminals-list-filters.js +1 -1
- package/dist/collection/components/terminals-list/justifi-terminals-list.js +1 -1
- package/dist/collection/components/tokenize-payment-method/justifi-tokenize-payment-method.js +1 -1
- package/dist/collection/store/checkout.store.js +5 -0
- package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
- package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
- package/dist/collection/ui-components/form/form-control-date.js +2 -2
- package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
- package/dist/collection/ui-components/form/form-control-file.js +2 -2
- package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
- package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
- package/dist/collection/ui-components/form/form-control-number.js +2 -2
- package/dist/collection/ui-components/form/form-control-radio.js +2 -2
- package/dist/collection/ui-components/form/form-control-select.js +2 -2
- package/dist/collection/ui-components/form/form-control-text.js +2 -2
- package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
- package/dist/collection/ui-components/form/hidden-input.js +1 -1
- package/dist/collection/ui-components/form/iframe-input.js +3 -3
- package/dist/collection/ui-components/internal-button.js +1 -1
- package/dist/collection/ui-components/radio-list-item.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
- package/dist/docs.json +115 -3
- package/dist/esm/{Analytics-YJZMjYtq.js → Analytics-hKJLmoJl.js} +3 -3
- package/dist/esm/{Api-od4ybwHR.js → Api-DAJ9sMMj.js} +1 -1
- package/dist/esm/{Plaid-DJ-4YL0_.js → Plaid-BP3xNxQF.js} +5 -0
- package/dist/esm/additional-questions-form-step_15.entry.js +7 -7
- package/dist/esm/additional-statement_8.entry.js +8 -8
- package/dist/esm/bank-account-billing-form-simple_4.entry.js +4 -4
- package/dist/esm/bank-account-document-form-inputs.entry.js +1 -1
- package/dist/esm/bank-account-form.entry.js +5 -5
- package/dist/esm/{business.service-BM14Brj6.js → business.service-kmkjOyTm.js} +2 -2
- package/dist/esm/card-form.entry.js +5 -5
- package/dist/esm/{check-pkg-version-DtP8CVbU.js → check-pkg-version-FEAmKlDW.js} +1 -1
- package/dist/esm/{checkout-actions-DhL8YxrK.js → checkout-actions-0ftD0elo.js} +2 -2
- package/dist/esm/{checkout.service-B8kSQSsn.js → checkout.service-BVBmNheb.js} +2 -2
- package/dist/esm/{checkout.store-B6amfNq_.js → checkout.store-B2mtQcB5.js} +6 -1
- package/dist/esm/custom-popper_2.entry.js +2 -2
- package/dist/esm/dispute-notification_2.entry.js +10 -10
- package/dist/esm/{event-types-DL21cZd2.js → event-types-B5-lsGjZ.js} +2 -2
- package/dist/esm/form-address-fields_3.entry.js +2 -2
- package/dist/esm/form-alert_3.entry.js +5 -5
- package/dist/esm/form-control-checkbox.entry.js +2 -2
- package/dist/esm/form-control-date.entry.js +2 -2
- package/dist/esm/form-control-file-v2_2.entry.js +3 -3
- package/dist/esm/form-control-file.entry.js +2 -2
- package/dist/esm/form-control-monetary.entry.js +2 -2
- package/dist/esm/form-control-number_2.entry.js +2 -2
- package/dist/esm/form-control-radio.entry.js +2 -2
- package/dist/esm/form-control-select_2.entry.js +4 -4
- package/dist/esm/{get-business-BSyOONF0.js → get-business-BLCT-zfN.js} +2 -2
- package/dist/esm/{get-payment-details-CoGzqJ6o.js → get-payment-details-BokzuPGl.js} +2 -2
- package/dist/esm/{get-subaccounts-yZP4GBHd.js → get-subaccounts-By7m_FxO.js} +3 -3
- package/dist/esm/{index-DkoufM1t.js → index-DEx8fQeW.js} +4 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal-button.entry.js +1 -1
- package/dist/esm/{justifi-apple-pay_11.entry.js → justifi-apple-pay_12.entry.js} +283 -27
- package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +6 -6
- package/dist/esm/justifi-bank-account-form.entry.js +6 -6
- package/dist/esm/justifi-billing-form-full.entry.js +1 -1
- package/dist/esm/justifi-billing-form.entry.js +1 -1
- package/dist/esm/justifi-business-details.entry.js +8 -8
- package/dist/esm/justifi-business-form.entry.js +8 -8
- package/dist/esm/justifi-card-billing-form-simple.entry.js +1 -1
- package/dist/esm/justifi-card-form.entry.js +6 -6
- package/dist/esm/justifi-checkout-qr-code.entry.js +5 -5
- package/dist/esm/justifi-checkout.entry.js +8 -8
- package/dist/esm/justifi-checkouts-list-filters.entry.js +3 -3
- package/dist/esm/justifi-checkouts-list.entry.js +10 -10
- package/dist/esm/justifi-dispute-management.entry.js +8 -8
- package/dist/esm/justifi-gross-payment-chart.entry.js +6 -6
- package/dist/esm/justifi-order-terminals.entry.js +10 -10
- package/dist/esm/justifi-payment-details.entry.js +16 -16
- package/dist/esm/justifi-payment-provisioning.entry.js +8 -8
- package/dist/esm/justifi-payment-transactions-list.entry.js +8 -8
- package/dist/esm/justifi-payments-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +8 -8
- package/dist/esm/justifi-payout-details.entry.js +11 -11
- package/dist/esm/justifi-payout-transactions-list.entry.js +8 -8
- package/dist/esm/justifi-payouts-list-filters.entry.js +3 -3
- package/dist/esm/justifi-payouts-list.entry.js +10 -10
- package/dist/esm/justifi-qr-terminal.entry.js +8 -8
- package/dist/esm/justifi-refund-payment.entry.js +8 -8
- package/dist/esm/justifi-save-new-payment-method.entry.js +1 -1
- package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +8 -8
- package/dist/esm/justifi-skeleton.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +4 -4
- package/dist/esm/justifi-terminal-orders-list.entry.js +8 -8
- package/dist/esm/justifi-terminals-list-filters.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +9 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-B_uQqefL.js → package-Dn9_7aQh.js} +1 -1
- package/dist/esm/payment-method-option.entry.js +1 -1
- package/dist/esm/{payment-provisioning-actions-DJKGndr3.js → payment-provisioning-actions-VRIPjnAQ.js} +2 -2
- package/dist/esm/{payment.service-S0sEKmRn.js → payment.service-CMUlMV1Y.js} +2 -2
- package/dist/esm/{payout.service-ZABnlfYv.js → payout.service-C0yd0JZS.js} +2 -2
- package/dist/esm/{payouts-status-C0nijel1.js → payouts-status-CaiC5qpn.js} +2 -2
- package/dist/esm/{plaid.service-qxtz2sWM.js → plaid.service-CqihCTBS.js} +2 -2
- package/dist/esm/radio-list-item.entry.js +1 -1
- package/dist/esm/save-new-payment-method.entry.js +3 -3
- package/dist/esm/table-filters-menu.entry.js +1 -1
- package/dist/esm/terminal-quantity-selector.entry.js +1 -1
- package/dist/esm/{terminal.service-CB2kRLwO.js → terminal.service-DuF3uTuA.js} +2 -2
- package/dist/esm/{utils-D6LKoG0M.js → utils-YUOJKtjO.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/ModularCheckout.js +4 -0
- package/dist/module/Plaid.js +5 -0
- package/dist/module/additional-statement2.js +1 -1
- package/dist/module/bank-account-billing-form-simple2.js +1 -1
- package/dist/module/cancellation-policy2.js +1 -1
- package/dist/module/card-billing-form-simple2.js +1 -1
- package/dist/module/card-form2.js +2 -2
- package/dist/module/checkout.store.js +5 -0
- package/dist/module/custom-popper2.js +2 -2
- package/dist/module/customer-details2.js +1 -1
- package/dist/module/dispute-notification2.js +2 -2
- package/dist/module/dispute-response2.js +1 -1
- package/dist/module/duplicate-charge2.js +1 -1
- package/dist/module/electronic-evidence2.js +1 -1
- package/dist/module/form-control-checkbox2.js +2 -2
- package/dist/module/form-control-date2.js +2 -2
- package/dist/module/form-control-file-v22.js +1 -1
- package/dist/module/form-control-file2.js +2 -2
- package/dist/module/form-control-monetary2.js +2 -2
- package/dist/module/form-control-number-masked2.js +2 -2
- package/dist/module/form-control-number2.js +2 -2
- package/dist/module/form-control-radio2.js +2 -2
- package/dist/module/form-control-select2.js +2 -2
- package/dist/module/form-control-text2.js +2 -2
- package/dist/module/form-control-textarea2.js +2 -2
- package/dist/module/hidden-input2.js +1 -1
- package/dist/module/iframe-input2.js +3 -3
- package/dist/module/internal-button2.js +1 -1
- package/dist/module/justifi-bank-account-billing-form-simple.js +1 -1
- package/dist/module/justifi-bank-account-form.js +1 -1
- package/dist/module/justifi-billing-form-full.js +1 -1
- package/dist/module/justifi-billing-form.js +1 -1
- package/dist/module/justifi-button2.js +1 -1
- package/dist/module/justifi-card-billing-form-simple.js +1 -1
- package/dist/module/justifi-card-form.js +1 -1
- package/dist/module/justifi-checkout-summary2.js +1 -1
- package/dist/module/justifi-checkout.js +53 -47
- package/dist/module/justifi-checkouts-list-filters.js +2 -2
- package/dist/module/justifi-checkouts-list.js +2 -2
- package/dist/module/justifi-dispute-management.js +1 -1
- package/dist/module/justifi-header2.js +1 -1
- package/dist/module/justifi-modular-checkout2.js +75 -11
- package/dist/module/justifi-order-terminals.js +1 -1
- package/dist/module/justifi-payment-details.js +8 -8
- package/dist/module/justifi-payment-transactions-list.js +1 -1
- package/dist/module/justifi-payments-list-filters.js +2 -2
- package/dist/module/justifi-payments-list.js +1 -1
- package/dist/module/justifi-payout-details.js +3 -3
- package/dist/module/justifi-payout-transactions-list.js +1 -1
- package/dist/module/justifi-payouts-list-filters.js +2 -2
- package/dist/module/justifi-payouts-list.js +1 -1
- package/dist/module/justifi-paypal.d.ts +11 -0
- package/dist/module/justifi-paypal.js +6 -0
- package/dist/module/justifi-paypal2.js +226 -0
- package/dist/module/justifi-save-new-payment-method.js +1 -1
- package/dist/module/justifi-saved-payment-method.js +1 -1
- package/dist/module/justifi-skeleton.js +1 -1
- package/dist/module/justifi-terminal-orders-list-filters.js +3 -3
- package/dist/module/justifi-terminal-orders-list.js +2 -2
- package/dist/module/justifi-terminals-list-filters.js +1 -1
- package/dist/module/justifi-terminals-list.js +1 -1
- package/dist/module/justifi-tokenize-payment-method2.js +1 -1
- package/dist/module/package.js +1 -1
- package/dist/module/payment-method-option.js +1 -1
- package/dist/module/product-or-service2.js +1 -1
- package/dist/module/radio-list-item2.js +1 -1
- package/dist/module/refund-policy2.js +1 -1
- package/dist/module/save-new-payment-method2.js +1 -1
- package/dist/module/shipping-details2.js +1 -1
- package/dist/module/table-filters-menu2.js +1 -1
- package/dist/module/terminal-quantity-selector2.js +1 -1
- package/dist/types/api/Checkout.d.ts +13 -1
- package/dist/types/api/Paypal.d.ts +11 -0
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/services/paypal.service.d.ts +8 -0
- package/dist/types/components/modular-checkout/ModularCheckout.d.ts +6 -2
- package/dist/types/components/modular-checkout/justifi-modular-checkout.d.ts +7 -0
- package/dist/types/components/modular-checkout/sub-components/paypal/justifi-paypal.d.ts +36 -0
- package/dist/types/components/modular-checkout/sub-components/paypal/paypal.d.ts +39 -0
- package/dist/types/components.d.ts +53 -0
- package/dist/types/store/checkout.store.d.ts +2 -0
- package/dist/webcomponents/index.esm.js +1 -1
- package/dist/webcomponents/{p-4d747ce5.entry.js → p-0d8a256c.entry.js} +1 -1
- package/dist/webcomponents/{p-b6c112cd.entry.js → p-0f7cc07b.entry.js} +1 -1
- package/dist/webcomponents/p-1034e83d.entry.js +1 -0
- package/dist/webcomponents/{p-99d17144.entry.js → p-10b91a6c.entry.js} +1 -1
- package/dist/webcomponents/p-18306b40.entry.js +1 -0
- package/dist/webcomponents/{p-005d353c.entry.js → p-1a55efda.entry.js} +1 -1
- package/dist/webcomponents/p-22a57828.entry.js +1 -0
- package/dist/webcomponents/p-2458de56.entry.js +1 -0
- package/dist/webcomponents/{p-5f57c81c.entry.js → p-2549c891.entry.js} +1 -1
- package/dist/webcomponents/{p-36d7033b.entry.js → p-27b07530.entry.js} +1 -1
- package/dist/webcomponents/{p-4f54d1b2.entry.js → p-28fb6b50.entry.js} +1 -1
- package/dist/webcomponents/p-2e82a488.entry.js +1 -0
- package/dist/webcomponents/{p-f0083ace.entry.js → p-31204dd5.entry.js} +1 -1
- package/dist/webcomponents/p-33281304.entry.js +1 -0
- package/dist/webcomponents/{p-da21ae43.entry.js → p-36340e63.entry.js} +1 -1
- package/dist/webcomponents/p-3642e189.entry.js +1 -0
- package/dist/webcomponents/p-36f05f5f.entry.js +1 -0
- package/dist/webcomponents/{p-b8d46fc5.entry.js → p-3c33b3c1.entry.js} +1 -1
- package/dist/webcomponents/{p-88a3c0cf.entry.js → p-408a4f5f.entry.js} +1 -1
- package/dist/webcomponents/{p-041a22dd.entry.js → p-42021e67.entry.js} +1 -1
- package/dist/webcomponents/{p-f1592a71.entry.js → p-5348209c.entry.js} +1 -1
- package/dist/webcomponents/p-5a11c49f.entry.js +1 -0
- package/dist/webcomponents/{p-2139497d.entry.js → p-5bdae8c7.entry.js} +1 -1
- package/dist/webcomponents/p-636c9571.entry.js +1 -0
- package/dist/webcomponents/p-76e96874.entry.js +1 -0
- package/dist/webcomponents/p-772ab8a3.entry.js +1 -0
- package/dist/webcomponents/p-777470cb.entry.js +1 -0
- package/dist/webcomponents/p-7e64a668.entry.js +1 -0
- package/dist/webcomponents/{p-a1b7e2fc.entry.js → p-80a9f84c.entry.js} +1 -1
- package/dist/webcomponents/{p-bc435cae.entry.js → p-86f9d5f6.entry.js} +1 -1
- package/dist/webcomponents/{p-9bd0bb34.entry.js → p-8a5ce8ff.entry.js} +1 -1
- package/dist/webcomponents/p-8d11aa27.entry.js +1 -0
- package/dist/webcomponents/{p-348decec.entry.js → p-9c45729d.entry.js} +1 -1
- package/dist/webcomponents/p-9ed85832.entry.js +1 -0
- package/dist/webcomponents/{p-cb977890.entry.js → p-9f0ef3f3.entry.js} +1 -1
- package/dist/webcomponents/{p-DD9-ceDZ.js → p-B0DHIvEj.js} +1 -1
- package/dist/webcomponents/p-BFi5l0xt.js +1 -0
- package/dist/webcomponents/{p-BnQkpNjd.js → p-BHaO3c8W.js} +1 -1
- package/dist/webcomponents/{p-C2l2dxvr.js → p-Ba0_MQtJ.js} +1 -1
- package/dist/webcomponents/{p-CELpJl4Y.js → p-Bl00tHyn.js} +1 -1
- package/dist/webcomponents/{p-C3geClRX.js → p-ByQMBEDC.js} +1 -1
- package/dist/webcomponents/p-C-buCQRx.js +1 -0
- package/dist/webcomponents/p-CKgQN8v0.js +1 -0
- package/dist/webcomponents/p-CLq3Og7o.js +1 -0
- package/dist/webcomponents/p-CXsRwohv.js +1 -0
- package/dist/webcomponents/p-Cy2N3vAg.js +1 -0
- package/dist/webcomponents/p-CyOXIqHo.js +1 -0
- package/dist/webcomponents/p-D6uhYbLo.js +1 -0
- package/dist/webcomponents/p-DEx8fQeW.js +1 -0
- package/dist/webcomponents/{p-Co3Rtlnu.js → p-DZQBPUfH.js} +1 -1
- package/dist/webcomponents/p-Dn9_7aQh.js +1 -0
- package/dist/webcomponents/{p-gAlfGUcr.js → p-DnLqZpI1.js} +1 -1
- package/dist/webcomponents/{p-CT8oFJ_1.js → p-DsvK2pes.js} +1 -1
- package/dist/webcomponents/{p-BEmZOGbG.js → p-FWuMPTxn.js} +1 -1
- package/dist/webcomponents/p-Fpaf7CLD.js +1 -0
- package/dist/webcomponents/p-a891caf8.entry.js +1 -0
- package/dist/webcomponents/{p-3734d15d.entry.js → p-aebd2149.entry.js} +1 -1
- package/dist/webcomponents/{p-6ab4c4e0.entry.js → p-af728bc6.entry.js} +1 -1
- package/dist/webcomponents/p-b6ce91f0.entry.js +1 -0
- package/dist/webcomponents/{p-16471ba1.entry.js → p-b9664e84.entry.js} +1 -1
- package/dist/webcomponents/{p-b17fabdc.entry.js → p-b98ea26a.entry.js} +1 -1
- package/dist/webcomponents/{p-61eae8cd.entry.js → p-c4889a06.entry.js} +1 -1
- package/dist/webcomponents/p-c6f85bef.entry.js +1 -0
- package/dist/webcomponents/p-ca6c5365.entry.js +1 -0
- package/dist/webcomponents/p-d05257f9.entry.js +1 -0
- package/dist/webcomponents/p-d2e890a3.entry.js +1 -0
- package/dist/webcomponents/p-d397b38f.entry.js +1 -0
- package/dist/webcomponents/{p-ecaec672.entry.js → p-d446ab68.entry.js} +1 -1
- package/dist/webcomponents/{p-49e40ebe.entry.js → p-d4de565d.entry.js} +1 -1
- package/dist/webcomponents/{p-b945fa49.entry.js → p-d555220f.entry.js} +1 -1
- package/dist/webcomponents/p-dd4eea27.entry.js +1 -0
- package/dist/webcomponents/{p-836c4136.entry.js → p-ddba9ab3.entry.js} +1 -1
- package/dist/webcomponents/p-e0bce67a.entry.js +1 -0
- package/dist/webcomponents/p-e1e5bddf.entry.js +1 -0
- package/dist/webcomponents/{p-b9b5d046.entry.js → p-e55216fb.entry.js} +1 -1
- package/dist/webcomponents/{p-cb5d2198.entry.js → p-ead48010.entry.js} +1 -1
- package/dist/webcomponents/{p-ecbed9bc.entry.js → p-f8764c8e.entry.js} +1 -1
- package/dist/webcomponents/{p-ead927fb.entry.js → p-fa2e7534.entry.js} +1 -1
- package/dist/webcomponents/p-fda6f27d.entry.js +1 -0
- package/dist/webcomponents/p-rznJBkm3.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-0464be7b.entry.js +0 -1
- package/dist/webcomponents/p-0c1cc1e9.entry.js +0 -1
- package/dist/webcomponents/p-1208da06.entry.js +0 -1
- package/dist/webcomponents/p-13cbf119.entry.js +0 -1
- package/dist/webcomponents/p-1491320a.entry.js +0 -1
- package/dist/webcomponents/p-15934f30.entry.js +0 -1
- package/dist/webcomponents/p-38bdce5d.entry.js +0 -1
- package/dist/webcomponents/p-3ef039ec.entry.js +0 -1
- package/dist/webcomponents/p-488dc072.entry.js +0 -1
- package/dist/webcomponents/p-49f279c3.entry.js +0 -1
- package/dist/webcomponents/p-4d60d249.entry.js +0 -1
- package/dist/webcomponents/p-558677a7.entry.js +0 -1
- package/dist/webcomponents/p-568b81a2.entry.js +0 -1
- package/dist/webcomponents/p-5f7137db.entry.js +0 -1
- package/dist/webcomponents/p-6f34fa90.entry.js +0 -1
- package/dist/webcomponents/p-760f423b.entry.js +0 -1
- package/dist/webcomponents/p-79fd9000.entry.js +0 -1
- package/dist/webcomponents/p-8fO8CrtQ.js +0 -1
- package/dist/webcomponents/p-9c506058.entry.js +0 -1
- package/dist/webcomponents/p-9e9dcc20.entry.js +0 -1
- package/dist/webcomponents/p-B_uQqefL.js +0 -1
- package/dist/webcomponents/p-BjNqkh37.js +0 -1
- package/dist/webcomponents/p-C1PEDhkE.js +0 -1
- package/dist/webcomponents/p-CMvr3y5s.js +0 -1
- package/dist/webcomponents/p-CaLXuYmg.js +0 -1
- package/dist/webcomponents/p-ChiCyW0k.js +0 -1
- package/dist/webcomponents/p-D1H6VUbM.js +0 -1
- package/dist/webcomponents/p-DNxN6bjU.js +0 -1
- package/dist/webcomponents/p-DkoufM1t.js +0 -1
- package/dist/webcomponents/p-Dl0CAW76.js +0 -1
- package/dist/webcomponents/p-a14d3d7d.entry.js +0 -1
- package/dist/webcomponents/p-bbd403f5.entry.js +0 -1
- package/dist/webcomponents/p-c4799285.entry.js +0 -1
- package/dist/webcomponents/p-d4208a51.entry.js +0 -1
- package/dist/webcomponents/p-d6122124.entry.js +0 -1
- package/dist/webcomponents/p-de8c6cd4.entry.js +0 -1
- package/dist/webcomponents/p-ee108873.entry.js +0 -1
- package/dist/webcomponents/p-f6941969.entry.js +0 -1
- package/dist/webcomponents/p-mjjqv7AN.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i,H as s,g as a}from"./p-CV0Pyo1O.js";import{A as n}from"./p-Bl00tHyn.js";import{A as o,r,s as l,t as h,u as c,v as d,w as u,C as p,b as y,c as m,I as v,x as f,y as g,z as b}from"./p-D6uhYbLo.js";import{S as M}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as w}from"./p-eBK-iWrz.js";import{c as k,o as P,a as j,g as C,b as T}from"./p-Fpaf7CLD.js";import{t as A,r as E}from"./p-Bu7gdOaV.js";import{f as I}from"./p-Ds_P-dB8.js";import{w as N,c as D}from"./p-B4vLfYnZ.js";import{H as S}from"./p-CZk3i5Tu.js";import{H as O,b as L,h as x,i as z}from"./p-x2oNTAWh.js";import{H as _}from"./p-BAB1lPu0.js";import{J as R}from"./p-BHaO3c8W.js";import{c as U}from"./p-ByQMBEDC.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{m as B,a as Y}from"./p-CXsRwohv.js";import{C as F}from"./p-DsvK2pes.js";import{P as Q}from"./p-CKgQN8v0.js";import{P as V,a as H,b as W}from"./p-DEx8fQeW.js";import{C as Z}from"./p-ZpPDShvP.js";import"./p-Dn9_7aQh.js";import"./p-DgTOxu8x.js";import"./p-CLq3Og7o.js";const G=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click",7),this.checked=!1,this.hidden=!1}render(){return i(M,{key:"02955940079320bd9c6bf94e239545385ac36458"},i("radio-list-item",{key:"fc6b98e456e4326b843b2b3248b7327436767cf4",name:this.name,value:this.value,label:this.label,checked:this.checked,hidden:this.hidden,class:this.class,"onRadio-click":t=>this.radioClick.emit(t.detail)}))}};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 J{constructor(){this.api=n()}initialize(t){if(this.applePayConfig=new o(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.hostname,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,a)=>{try{if("undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),a({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,a,e,i),this.currentSession.begin()}catch(t){console.error("[ApplePayService] Exception while starting session:",t),a({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 a=>{try{const n=a.payment,o=Object.assign(Object.assign({},n.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,o);l.success?(this.currentSession.completePayment({status:h.STATUS_SUCCESS}),t({success:!0,token:n.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 K=t=>{const{isLoading:e}=t;return e?i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-center"},i(w,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},$=t=>i("div",{class:"apple-pay-button-container"},i("button",Object.assign({class:(()=>{let e="apple-pay-button";switch(t.buttonStyle){case c.WHITE:e+=" apple-pay-button-white";break;case c.WHITE_OUTLINE:e+=" apple-pay-button-white-outline";break;default:e+=" apple-pay-button-black"}switch(t.buttonType){case d.BUY:e+=" apple-pay-button-type-buy";break;case d.DONATE:e+=" apple-pay-button-type-donate";break;default:e+=" apple-pay-button-type-plain"}return(t.disabled||t.isProcessing||!t.isAvailable)&&(e+=" disabled"),e})(),style:{width:t.width,height:t.height},onClick:()=>{!t.disabled&&!t.isProcessing&&t.isAvailable&&t.clickHandler&&t.clickHandler()},disabled:t.disabled||t.isProcessing||!t.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},t),t.isProcessing&&i("div",{class:"processing-overlay"},i("div",{class:"spinner"}),i("span",null,"Processing..."))),i("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 ")),X=class{constructor(i){t(this,i),this.applePayStarted=e(this,"applePayStarted",7),this.applePayCompleted=e(this,"applePayCompleted",7),this.applePayCancelled=e(this,"applePayCancelled",7),this.applePayError=e(this,"applePayError",7),this.sdkLoaded=!1,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.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,i;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit();const i={countryCode:this.countryCode,currencyCode:k.paymentCurrency,merchantCapabilities:[u.SUPPORTS_3DS,u.SUPPORTS_CREDIT,u.SUPPORTS_DEBIT],supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(k.paymentDescription,k.paymentAmount)},s=await this.applePayService.startPaymentSession(i,k.authToken,k.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)||X.ErrorCode.PAYMENT_FAILED}))}catch(t){if((null===(i=null==t?void 0:t.error)||void 0===i?void 0:i.code)===q.USER_CANCELLED)this.applePayCancelled.emit();else{const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.applePayError.emit({error:e,code:X.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:e})}}finally{this.isProcessing=!1}}}componentWillLoad(){this.isAvailable=r.isApplePaySupported(),this.isAvailable?k.checkoutLoaded?this.loadApplePaySDK():P("checkoutLoaded",(t=>{t&&this.loadApplePaySDK()})):this.isLoading=!1}loadApplePaySDK(){if(this.sdkLoaded)return;this.sdkLoaded=!0;const t=document.createElement("script");t.src="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",t.async=!0,t.onload=()=>this.initializeApplePay(),document.head.appendChild(t)}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,!(Boolean(k.paymentAmount)&&Boolean(k.paymentCurrency)&&Boolean(k.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,this.applePayError.emit({error:this.error,code:X.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",this.applePayError.emit({error:this.error,code:X.ErrorCode.NOT_SUPPORTED}),void(this.isLoading=!1);if(!this.canMakePayments)return this.error="Apple Pay is not available",this.applePayError.emit({error:this.error,code:X.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 J,this.applePayService.initialize(t),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(t){this.error=t instanceof Error?t.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:X.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?r.getDefaultSupportedNetworks():[]}async abort(){var t;null===(t=this.applePayService)||void 0===t||t.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!k.applePayEnabled)return null;if(!this.isAvailable)return null;const t=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return i(M,null,i("div",{class:"apple-pay-container"},i(K,{isLoading:this.isLoading}),t&&i($,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick,width:this.width,height:this.height})),i("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};X.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(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(M,{key:"fafd798e951f401204004138571fce414f3bb428"},i("internal-button",{key:"eda77ddbd02a38370f79e58d52d2824631517666",text:this.text,variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,type:this.type,disabled:this.disabled,class:this.class,customStyle:this.customStyle,hidden:this.hidden}))}},et=class{constructor(e){t(this,e)}render(){return i(M,{key:"7d3447ff4daa9bf4f603ca381027b3f43cfcc6a1"},i("section",{key:"1c8189ccde6dc986ad2d4c74da2dd10cacfc1c36"},i("div",{key:"45e6d5f47d8a92e0bd4a7bfa427630a96f049b4a"},i("div",{key:"9900b5fd770cd59b00803c3614216c16a803da41",part:A},null==k?void 0:k.paymentDescription),i("div",{key:"16cec140ef6912533a80b1f6341fcc9cb341b478"},i("span",{key:"f8883538c99a524017bb102bfd8cfaea7062e650",part:A},"Total")," ",i("span",{key:"11baa64630a60c56cedfa53548c107ec3fe3c0f5",part:A},I(+(null==k?void 0:k.totalAmount)))))))}},it=t=>{const{isLoading:e}=t;return e?i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-center"},i(w,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null};var st;!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"}(st||(st={}));const at=class{constructor(i){t(this,i),this.googlePayStarted=e(this,"googlePayStarted",7),this.googlePayCompleted=e(this,"googlePayCompleted",7),this.googlePayCancelled=e(this,"googlePayCancelled",7),this.merchantDisplayName="JustiFi Checkout",this.useNativePaymentRequest=!1,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 st.ready:this.iframeReady=!0;break;case st.sdkLoaded:this.sdkLoaded=!0,this.sendInitialize();break;case st.initializeResult:this.isReadyToPay=i.isReadyToPay,i.error&&console.error("Init error:",i.error);break;case st.error:console.error("Google Pay error:",i);break;case st.buttonClicked:this.googlePayStarted.emit(),this.sendStartPayment();break;case st.paymentSuccess:this.googlePayCompleted.emit({success:!0,paymentMethodId:i.paymentMethodId,cardNetwork:i.cardNetwork,cardDetails:i.cardDetails});break;case st.paymentCanceled:this.googlePayCancelled.emit();break;case st.paymentError:this.googlePayCompleted.emit({success:!1,error:{code:i.code,message:i.message}})}}}async componentWillLoad(){await N(),this.iframeOrigin=D.iframeOrigin}componentDidLoad(){window.addEventListener("message",this.handleMessage)}disconnectedCallback(){window.removeEventListener("message",this.handleMessage)}googlePayEnvironment(){return void 0!==this.environment?this.environment:"test"===k.checkoutMode?"TEST":"PRODUCTION"}sendInitialize(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={environment:this.googlePayEnvironment(),gatewayMerchantId:k.accountId,merchantName:this.merchantDisplayName,authToken:k.authToken,accountId:k.accountId,useNativePaymentRequest:this.useNativePaymentRequest};this.iframeElement.contentWindow.postMessage({eventType:st.initialize,data:e},this.iframeOrigin)}sendStartPayment(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={totalPrice:String(k.paymentAmount/100),totalPriceStatus:"FINAL",currencyCode:k.paymentCurrency||"USD"};this.iframeElement.contentWindow.postMessage({eventType:st.startPayment,data:e},this.iframeOrigin)}render(){return k.checkoutLoaded?k.googlePayEnabled?i(s,null,i(it,{isLoading:!this.isReadyToPay}),i("iframe",{ref:t=>this.iframeElement=t,src:`${this.iframeOrigin}/v2/googlePay`,allow:"payment",style:{border:"none",width:"100%",height:"48px",display:this.isReadyToPay?"block":"none"}})):(console.warn("Google Pay is not enabled for this checkout"),null):null}},nt=class{constructor(e){t(this,e),this.levels={h1:S,h2:O,h3:_},this.level="h1"}render(){return i(M,{key:"b51ffe7c6ff6de409396fd941d39321eb837665d"},i(this.levels[this.level],{key:"dfba7ab895567a38b6b08fc1b734bdb9e98afff5",text:this.text,class:this.class}))}},ot=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.checkoutChangedEvent=e(this,"checkout-changed",7),this.plaidService=new Q,this.handlePaypalStarted=()=>{k.isWalletProcessing=!0},this.handlePaypalCompleted=t=>{const{success:e,paymentMethodId:i,fundingSource:s}=t.detail||{};k.isWalletProcessing=!1,e&&i?(k.paymentToken=i,k.selectedPaymentMethod={type:"venmo"===s?V.VENMO:V.PAYPAL},this.submitCheckout()):this.errorEvent.emit({message:"Paypal payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})},this.handlePaypalCancelled=()=>{k.isWalletProcessing=!1,k.paymentToken=void 0,k.selectedPaymentMethod=void 0},this.handlePaypalError=t=>{k.isWalletProcessing=!1;const{error:e,code:i}=t.detail||{};this.errorEvent.emit({message:e||"Paypal error occurred",errorCode:`PAYPAL_${i}`,severity:p.ERROR})},this.handleApplePayStarted=()=>{k.isWalletProcessing=!0},this.handleGooglePayStarted=()=>{k.isWalletProcessing=!0},this.handleGooglePayCompleted=t=>{const{success:e,paymentMethodId:i,error:s}=t.detail||{};e&&i?(k.isWalletProcessing=!1,k.paymentToken=i,k.selectedPaymentMethod={type:V.GOOGLE_PAY},this.submitCheckout()):(k.isWalletProcessing=!1,this.errorEvent.emit({message:s&&s.message||"Google Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleGooglePayCancelled=()=>{k.isWalletProcessing=!1,k.paymentToken=void 0,k.selectedPaymentMethod=void 0},this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:a}=t.detail;e&&i?(k.isWalletProcessing=!1,k.paymentToken=s,k.selectedPaymentMethod={type:V.APPLE_PAY},this.submitCheckout()):(k.isWalletProcessing=!1,console.error("Apple Pay completed but failed:",a),this.errorEvent.emit({message:(null==a?void 0:a.message)||"Apple Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleApplePayError=t=>{k.isWalletProcessing=!1;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:p.ERROR})},this.handleApplePayCancelled=()=>{k.isWalletProcessing=!1,k.paymentToken=void 0,k.selectedPaymentMethod=void 0}}connectedCallback(){var t;this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners(),this.setupPaypalListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),k.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new F};this.getCheckout=B(e),this.completeCheckout=Y(e),null===(t=this.unsubscribeCheckoutChanges)||void 0===t||t.call(this),this.unsubscribeCheckoutChanges=j((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new R(this),U(),k.authToken=this.authToken,this.fetchCheckout(),L("set",(t=>{const e=z[t];void 0!==e&&x(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners(),this.setupPaypalListeners()}disconnectedCallback(){var t,e;null===(t=this.unsubscribeCheckoutChanges)||void 0===t||t.call(this),this.unsubscribeCheckoutChanges=void 0,null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners(),this.removeGooglePayListeners(),this.removePaypalListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==v.completed?t.status!==v.expired||this.errorEvent.emit({message:m.CHECKOUT_EXPIRED,errorCode:y.CHECKOUT_EXPIRED,severity:p.ERROR}):this.errorEvent.emit({message:m.CHECKOUT_ALREADY_COMPLETED,errorCode:y.CHECKOUT_ALREADY_COMPLETED,severity:p.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:t.code,severity:t.severity})}}):this.errorEvent.emit({message:m.NOT_AUTHENTICATED,errorCode:y.NOT_AUTHENTICATED,severity:p.ERROR})}updateStore(t){var e,i,s,a,n,o,r,l,h,c,d,u,p,y,m;k.accountId=t.account_id;const v=null!=t.mode?String(t.mode).toLowerCase():"";k.checkoutMode="test"===v?"test":"live"===v?"live":null;const f=t.payment_methods.map((t=>new H(t))),g=Boolean(null===(e=t.payment_settings)||void 0===e?void 0:e.ach_payments);k.paymentMethods=f.filter((t=>t.type!==V.SAVED_BANK_ACCOUNT||g)),k.paymentMethodGroupId=t.payment_method_group_id,k.paymentDescription=t.payment_description,k.totalAmount=t.total_amount,k.paymentAmount=t.payment_amount,k.bnplEnabled=t.payment_settings.bnpl_payments,k.insuranceEnabled=null!==(i=t.payment_settings.insurance_payments)&&void 0!==i&&i,k.bankAccountVerification=null===(s=t.payment_settings)||void 0===s?void 0:s.bank_account_verification,k.applePayEnabled=null!==(n=null===(a=t.payment_settings)||void 0===a?void 0:a.apple_payments)&&void 0!==n&&n,k.googlePayEnabled=null!==(r=null===(o=t.payment_settings)||void 0===o?void 0:o.google_payments)&&void 0!==r&&r,k.paypalEnabled=null!==(h=null===(l=t.payment_settings)||void 0===l?void 0:l.paypal_payments)&&void 0!==h&&h,k.paypalProviderClientId=null!==(d=null===(c=t.paypal)||void 0===c?void 0:c.provider_client_id)&&void 0!==d?d:"",k.achPaymentsEnabled=g,k.bnplProviderClientId=null===(u=null==t?void 0:t.bnpl)||void 0===u?void 0:u.provider_client_id,k.bnplProviderMode=null===(p=null==t?void 0:t.bnpl)||void 0===p?void 0:p.provider_mode,k.bnplProviderApiVersion=null===(y=null==t?void 0:t.bnpl)||void 0===y?void 0:y.provider_api_version,k.bnplProviderCheckoutUrl=null===(m=null==t?void 0:t.bnpl)||void 0===m?void 0:m.provider_checkout_url,k.paymentCurrency=(t.payment_currency||k.paymentCurrency).toUpperCase(),k.checkoutLoaded=!0}emitCheckoutChanged(){const t={availablePaymentMethodTypes:C(),selectedPaymentMethod:k.selectedPaymentMethod,savedPaymentMethods:k.paymentMethods};this.checkoutChangedEvent.emit(t)}queryFormRefs(){if(this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full, justifi-tokenize-payment-method"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.googlePayRef=this.hostEl.querySelector("justifi-google-pay"),this.paypalRef=this.hostEl.querySelector("justifi-paypal"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),!k.selectedPaymentMethod&&this.paymentMethodFormRef){const t=this.paymentMethodFormRef.tagName.toLowerCase();"justifi-card-form"===t?k.selectedPaymentMethod={type:V.NEW_CARD}:"justifi-bank-account-form"!==t||k.checkoutLoaded&&!k.achPaymentsEnabled||(k.selectedPaymentMethod={type:V.NEW_BANK_ACCOUNT})}this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayStarted",this.handleApplePayStarted),this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayStarted",this.handleApplePayStarted),this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}setupGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.addEventListener("googlePayStarted",this.handleGooglePayStarted),this.googlePayRef.addEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.addEventListener("googlePayCancelled",this.handleGooglePayCancelled))}removeGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.removeEventListener("googlePayStarted",this.handleGooglePayStarted),this.googlePayRef.removeEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.removeEventListener("googlePayCancelled",this.handleGooglePayCancelled))}setupPaypalListeners(){this.paypalRef&&(this.paypalRef.addEventListener("paypalStarted",this.handlePaypalStarted),this.paypalRef.addEventListener("paypalCompleted",this.handlePaypalCompleted),this.paypalRef.addEventListener("paypalCancelled",this.handlePaypalCancelled),this.paypalRef.addEventListener("paypalError",this.handlePaypalError))}removePaypalListeners(){this.paypalRef&&(this.paypalRef.removeEventListener("paypalStarted",this.handlePaypalStarted),this.paypalRef.removeEventListener("paypalCompleted",this.handlePaypalCompleted),this.paypalRef.removeEventListener("paypalCancelled",this.handlePaypalCancelled),this.paypalRef.removeEventListener("paypalError",this.handlePaypalError))}async tokenizePaymentMethod(t){var e,i,s;const a=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},n=Object.assign(Object.assign({},t),a),o=Object.assign({accountId:k.accountId,payment_method_group_id:void 0},n);k.savePaymentMethod&&(o.payment_method_group_id=k.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:o,account:k.accountId}));return r.error?r:(k.paymentToken=r.id,r.id)}async fillBillingForm(t){k.billingFormFields=t}async setSelectedPaymentMethod(t){k.selectedPaymentMethod=t,k.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];k.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=k.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.NEW_CARD,a=(null===(e=k.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_BANK_ACCOUNT;if((s||a)&&(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:y.VALIDATION_ERROR,severity:p.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,s,a,n,o,r,l;if(k.isSubmitting)return;k.isSubmitting=!0;const h=await this.validate();if(!k.selectedPaymentMethod)return k.isSubmitting=!1,void this.errorEvent.emit({message:"No payment method selected.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});const c=(null===(e=k.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_CARD,d=(null===(i=k.selectedPaymentMethod)||void 0===i?void 0:i.type)===V.NEW_BANK_ACCOUNT,u=(null===(s=k.selectedPaymentMethod)||void 0===s?void 0:s.type)===V.PLAID;if(c||d){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return k.isSubmitting=!1,void this.errorEvent.emit({message:e.error.message,errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}if(u&&!k.paymentToken){const t=k.plaidPublicToken,e=k.plaidLinkTokenId;if(!t)return k.isSubmitting=!1,void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(k.authToken,k.accountId,t,e||void 0,k.savePaymentMethod?k.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return k.isSubmitting=!1,void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});const s=null==i?void 0:i.data,n=(null===(a=null==s?void 0:s.bank_account)||void 0===a?void 0:a.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);k.paymentToken=n}catch(t){return k.isSubmitting=!1,void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}}if(!h)return k.isSubmitting=!1,void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});const m=(null===(n=k.selectedPaymentMethod)||void 0===n?void 0:n.type)===V.SEZZLE;if(m){const t=this.hostEl.querySelector("justifi-sezzle-payment-method"),e=await(null==t?void 0:t.resolvePaymentMethod({isValid:h}));if("success"!==(null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.status))return k.isSubmitting=!1,void this.errorEvent.emit({message:(null===(r=null==e?void 0:e.error)||void 0===r?void 0:r.message)||"Sezzle checkout was not completed.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}if(!m&&!k.paymentToken)return k.isSubmitting=!1,void this.errorEvent.emit({message:"Payment token not found.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});const v={payment_mode:(t=>{switch(t){case V.NEW_CARD:case V.SAVED_CARD:case V.NEW_BANK_ACCOUNT:case V.SAVED_BANK_ACCOUNT:case V.PLAID:return W.ECOM;case V.SEZZLE:return W.BNPL;case V.APPLE_PAY:return W.APPLE_PAY;case V.GOOGLE_PAY:return W.GOOGLE_PAY;case V.PAYPAL:return W.PAYPAL;case V.VENMO:return W.VENMO;default:return}})(null===(l=k.selectedPaymentMethod)||void 0===l?void 0:l.type),payment_token:m?void 0:k.paymentToken};if(this.preCompleteHook){const t=T();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return k.isSubmitting=!1,void console.log("Checkout cancelled by preCompleteHook",t)}}this.completeCheckout({payment:v,onSuccess:({checkout:t})=>{k.isSubmitting=!1,this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{k.isSubmitting=!1,this.errorEvent.emit({message:t.message,errorCode:y.COMPLETE_CHECKOUT_ERROR,severity:p.ERROR})}})}render(){return i(s,{key:"127bf2aea6758c7d91e33f252a3db4bc27b066ff"})}get hostEl(){return a(this)}},rt=n();class lt{async createPaypalOrder(t,e,i,s){return rt.post({endpoint:`checkouts/${e}/paypal/orders`,body:{funding_source:i},authToken:t,signal:s})}}const ht="paypal-script",ct=["paypal-payments","venmo-payments"],dt="PAYMENT_FAILED",ut=class{constructor(i){t(this,i),this.paypalStarted=e(this,"paypalStarted",7),this.paypalCompleted=e(this,"paypalCompleted",7),this.paypalCancelled=e(this,"paypalCancelled",7),this.paypalError=e(this,"paypalError",7),this.paypalService=new lt,this.paypalEligible=!1,this.venmoEligible=!1,this.startSession=async(t,e)=>{if(!t)return;this.pendingOrderId=void 0,this.paypalStarted.emit({fundingSource:e});let i=!1;const s=this.createOrder(e).then((t=>({orderId:t.provider_order_id}))).catch((t=>{throw i=!0,this.emitError((null==t?void 0:t.message)||"Could not create the Paypal order","ORDER_ERROR"),t}));s.catch((()=>{}));try{await t.start({presentationMode:"auto"},s)}catch(t){if(i)return;this.emitError((null==t?void 0:t.message)||"Paypal payment failed",dt)}}}componentDidLoad(){k.checkoutLoaded?this.initializePaypal():P("checkoutLoaded",(t=>{t&&this.initializePaypal()}))}get currencyCode(){return(k.paymentCurrency||"USD").toUpperCase()}emitError(t,e){this.paypalError.emit({error:t,code:e})}loadPaypalScript(){const t=window.paypal;return t?Promise.resolve(t):new Promise(((t,e)=>{let i=document.head.querySelector(`script[data-test-id="${ht}"]`);i||(i=document.createElement("script"),i.src="test"===k.checkoutMode?"https://www.sandbox.paypal.com/web-sdk/v6/core":"https://www.paypal.com/web-sdk/v6/core",i.async=!0,i.setAttribute("data-test-id",ht),document.head.appendChild(i)),i.addEventListener("load",(()=>{const i=window.paypal;i?t(i):e(new Error("Paypal script loaded but window.paypal is undefined"))})),i.addEventListener("error",(()=>e(new Error("Error loading Paypal script"))))}))}metadataId(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}async initializePaypal(){const t=k.paypalProviderClientId;if(!t)return this.paypalEligible=!1,this.venmoEligible=!1,void this.emitError("Missing Paypal client id","CONFIG_ERROR");try{const e=await this.loadPaypalScript();this.sdkInstance=await e.createInstance({clientId:t,components:ct,pageType:"checkout",metadataId:this.metadataId()});const i=await this.sdkInstance.findEligibleMethods({currencyCode:this.currencyCode});this.paypalEligible=i.isEligible("paypal"),this.venmoEligible=i.isEligible("venmo"),this.paypalEligible&&(this.paypalSession=this.sdkInstance.createPayPalOneTimePaymentSession(this.sessionOptions("paypal"))),this.venmoEligible&&(this.venmoSession=this.sdkInstance.createVenmoOneTimePaymentSession(this.sessionOptions("venmo")))}catch(t){this.paypalEligible=!1,this.venmoEligible=!1,this.emitError((null==t?void 0:t.message)||"Error initializing Paypal","INITIALIZATION_ERROR")}}sessionOptions(t){return{onApprove:()=>this.paypalCompleted.emit({success:!0,paymentMethodId:this.pendingOrderId,fundingSource:t}),onCancel:()=>this.paypalCancelled.emit({fundingSource:t}),onError:t=>this.emitError((null==t?void 0:t.message)||"Paypal payment failed",dt)}}async createOrder(t){const e=await this.paypalService.createPaypalOrder(k.authToken,k.checkoutId,t);if(null==e?void 0:e.error)throw new Error(("string"==typeof e.error?e.error:e.error.message)||"Could not create the Paypal order");const i=null==e?void 0:e.data;if(!(null==i?void 0:i.provider_order_id))throw new Error("Paypal order is missing a provider order id");return this.pendingOrderId=i.id,i}render(){if(!k.paypalEnabled)return null;const t=this.venmoEligible&&"USD"===this.currencyCode;return this.paypalEligible||t?i(M,null,i("div",{class:"paypal-buttons"},this.paypalEligible&&i("paypal-button",{type:"pay",onClick:()=>this.startSession(this.paypalSession,"paypal")}),t&&i("venmo-button",{type:"pay",onClick:()=>this.startSession(this.venmoSession,"venmo")})),i("style",null,"\n .paypal-buttons {\n display: flex;\n gap: 8px;\n width: 100%;\n }\n .paypal-buttons > * {\n flex: 1 1 0;\n min-width: 0;\n }\n ")):null}},pt=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.plaidError=e(this,"plaidError",7),this.plaidErrorRecovered=e(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.sdkLoaded=!1,this.plaidService=new Q,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.hasLoggedAchPaymentsDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{k.authToken&&k.accountId&&k.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:b.PLAID_SDK_LOAD_FAILED,message:g[b.PLAID_SDK_LOAD_FAILED],severity:f[b.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:b.PLAID_LINK_TOKEN_FAILED,message:g[b.PLAID_LINK_TOKEN_FAILED],severity:f[b.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:b.PLAID_LINK_INIT_FAILED,message:g[b.PLAID_LINK_INIT_FAILED],severity:f[b.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,a;try{if(!k.authToken||!k.accountId)return void this.handleError({code:b.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:p.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(k.authToken,k.accountId,k.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&&(k.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let n=b.PLAID_LINK_TOKEN_FAILED,o=g[n],r=!0;"AbortError"===t.name?(n=b.PLAID_TIMEOUT,o=g[n],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"))?(n=b.PLAID_NETWORK_ERROR,o=g[n],r=!0):((null===(s=t.message)||void 0===s?void 0:s.includes("401"))||(null===(a=t.message)||void 0===a?void 0:a.includes("unauthorized")))&&(n=b.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:n,message:o,severity:f[n],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 b.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return b.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return b.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return b.PLAID_RATE_LIMITED;case"maintenance":return b.PLAID_MAINTENANCE;case"not_authenticated":return b.PLAID_INVALID_CREDENTIALS;default:return b.PLAID_LINK_TOKEN_FAILED}return b.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,k.selectedPaymentMethod={type:V.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:p.INFO}),k.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=b.PLAID_AUTHENTICATION_FAILED,i=g[e],s=!0,a="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=b.PLAID_INVALID_CREDENTIALS,i=g[e],s=!0;break;case"ITEM_LOGIN_REQUIRED":e=b.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":e=b.PLAID_ACCOUNT_LOCKED,i=g[e],s=!1,a="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=b.PLAID_MAINTENANCE,i=g[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=b.PLAID_RATE_LIMITED,i=g[e],s=!0;break;case"INVALID_REQUEST":e=b.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":e=b.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 n=t.error_message.toLowerCase();n.includes("not supported")||n.includes("unsupported")?(e=b.PLAID_BANK_NOT_SUPPORTED,i=g[e],s=!1,a="Try a different payment method"):(n.includes("expired")||n.includes("timeout"))&&(e=b.PLAID_TOKEN_EXPIRED,i=g[e],s=!0)}this.handleError({code:e,message:i,severity:f[e],originalError:t,retryable:s,userAction:a}),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=k.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=k.selectedPaymentMethod)||void 0===e?void 0:e.type)!==V.PLAID&&(k.selectedPaymentMethod={type:V.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentWillLoad(){var t;this.isSelected=(null===(t=k.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID,!0===k.bankAccountVerification&&(k.checkoutLoaded?k.achPaymentsEnabled&&this.loadPlaidSDK():P("checkoutLoaded",(t=>{t&&!0===k.bankAccountVerification&&k.achPaymentsEnabled&&this.loadPlaidSDK()})))}loadPlaidSDK(){if(this.sdkLoaded)return;this.sdkLoaded=!0;const t=document.createElement("script");t.src="https://cdn.plaid.com/link/v2/stable/link-initialize.js",t.async=!0,t.onload=()=>this.initializePlaidLink(),t.onerror=()=>{this.handleError({code:b.PLAID_SDK_LOAD_FAILED,message:g[b.PLAID_SDK_LOAD_FAILED],severity:f[b.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})},document.head.appendChild(t)}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return k.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,k.selectedPaymentMethod={type:V.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(t){this.isSelected=t,t&&(k.selectedPaymentMethod={type:V.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=P("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(k.checkoutLoaded&&!k.achPaymentsEnabled)return this.hasLoggedAchPaymentsDisabledWarning||(console.warn("[JustifiPlaidPaymentMethod] ACH payments are disabled for this checkout. Component will not render."),this.hasLoggedAchPaymentsDisabledWarning=!0),null;if(!0!==k.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[JustifiPlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const t=i("img",{class:"plaid-logo-img",src:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=",alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return i(M,{class:"payment-method"},i("div",{title:"Pay with Plaid"},i("div",{onClick:t=>{t.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",t," "),(()=>this.error?i("div",{class:(this.error.severity===p.ERROR?"text-danger":this.error.severity===p.WARNING?"text-warning":"text-info")+" mt-2"},i("small",null,this.error.message),i("br",null),i("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&i("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?i("div",{class:"text-info mt-2"},i("small",null,"Connecting to your bank...")):this.publicToken?i("div",{class:"text-success mt-2"},i("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:i("div",{class:"text-muted mt-2"},i("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},yt=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),k.selectedPaymentMethod={id:t.id,type:t.type},k.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===V.SAVED_CARD&&k.disableCreditCard||t===V.SAVED_BANK_ACCOUNT&&k.disableBankAccount)}componentWillLoad(){k.checkoutLoaded&&(k.paymentMethods.length||console.warn("No saved payment methods available."),k.disablePaymentMethodGroup&&console.warn("Payment method group is disabled."))}render(){return k.disablePaymentMethodGroup?null:i(M,null,i("div",{class:"saved-payment-methods"},k.paymentMethods.length?k.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((t=>i("div",{class:"radio-list-item p-3",part:E,onClick:this.onPaymentMethodOptionClick(t)},i("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:k.paymentToken===(null==t?void 0:t.id),label:`${Z[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},mt=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.paymentMethodOptionId=V.SEZZLE,this.initializeSezzleCheckout=()=>{const t=Number(k.paymentAmount),e=new(0,window.Checkout)({mode:"popup",publicKey:k.bnplProviderClientId,apiMode:k.bnplProviderMode,apiVersion:k.bnplProviderApiVersion});e.sezzleButtonElement=this.sezzleButtonRef,e.init({onClick:function(t){t.preventDefault(),e.startCheckout({checkout_url:k.bnplProviderCheckoutUrl})},onComplete:t=>{var e;return null===(e=this.resolveSezzlePromise)||void 0===e?void 0:e.call(this,{bnpl:t.data})},onCancel:t=>{var e;return null===(e=this.resolveSezzlePromise)||void 0===e?void 0:e.call(this,{bnpl:t.data})},onFailure:t=>{var e;return null===(e=this.resolveSezzlePromise)||void 0===e?void 0:e.call(this,{bnpl:t.data})}}),this.sezzleCheckout=e,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(t)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){if(!t.isValid)return{validationError:!0};if(!this.sezzleButtonRef)return{error:{code:"sezzle_not_ready",message:"Sezzle is not ready yet. Please try again.",decline_code:""}};const e=new Promise((t=>{this.resolveSezzlePromise=t}));return this.sezzleButtonRef.click(),e}async handleSelectionClick(){k.selectedPaymentMethod={type:V.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var t,e;return k.bnplEnabled?i(M,{class:"payment-method"},i("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),i("div",null,i("div",null,"Buy now, pay later with ",i("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"}})),this.installmentPlan&&i("small",null,i("span",null,null===(t=this.installmentPlan)||void 0===t?void 0:t.installments.length)," ",i("span",null,this.installmentPlan.schedule," payments of")," ",i("span",{class:"fw-bold"},I(null===(e=this.installmentPlan)||void 0===e?void 0:e.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}},vt={[V.NEW_BANK_ACCOUNT]:"New bank account",[V.NEW_CARD]:"New credit or debit card"},ft="Payment form not ready",gt="Validation error",bt=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(){U(),this.analytics=new R(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,k.selectedPaymentMethod={type:t.detail}}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:y.TOKENIZE_ERROR,message:gt}),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(y.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:y.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async fillBillingForm(t){k.billingFormFields=t}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:ft}};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 getValues(){return this.billingFormRef.getValues()}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||k.authToken,account:this.accountId||k.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||k.authToken||this.emitError({errorCode:y.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||k.accountId||this.emitError({errorCode:y.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||k.checkoutLoaded&&!k.achPaymentsEnabled||(this.selectedPaymentMethod=V.NEW_BANK_ACCOUNT,k.selectedPaymentMethod={type:V.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=V.NEW_CARD,k.selectedPaymentMethod={type:V.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=[],e=!k.checkoutLoaded||k.achPaymentsEnabled;return this.disableCreditCard||t.push(V.NEW_CARD),!this.disableBankAccount&&e&&t.push(V.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:p.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",ft);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||gt;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||k.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!k.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===k.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:vt[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("billing-form",{ref:t=>{t&&(this.billingFormRef=t)},hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===V.NEW_CARD?"card-form":"bank-account-form",{ref:t=>{t&&(this.paymentMethodFormRef=t)}})}render(){return i(M,{key:"73aeacd6caa05ef5e126a6577c22464eacfc6d96"},i("form",{key:"7c1ddd145c53590fb1b9522ea8dbd52339817754"},i("fieldset",{key:"38bb226348b721f01f900930710f6b705d5a96ed"},i("div",{key:"b4f27d1e36c4d5e37190fa99b79c36cf00a8d9a3",class:"row gy-3"},i("div",{key:"85ae7c532c3c6056d5122cfd30fd4e2b75cf82f9",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"7727760fa2ccbaff134fa95e338406224bc8d787",class:"col-12"},i("internal-button",{key:"9f268e40c2d37a0d8ba423ad6dffe88c4cab3bc3",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 a(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{X as justifi_apple_pay,tt as justifi_button,et as justifi_checkout_summary,at as justifi_google_pay,nt as justifi_header,ot as justifi_modular_checkout,ut as justifi_paypal,pt as justifi_plaid_payment_method,G as justifi_radio_list_item,yt as justifi_saved_payment_methods,mt as justifi_sezzle_payment_method,bt as justifi_tokenize_payment_method}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{c as r,a as i,F as n}from"./p-D9sqTVmd.js";import{f as o}from"./p-Ds_P-dB8.js";import"./p-B4vLfYnZ.js";import{R as a,C as u,b as h,q as l}from"./p-
|
|
1
|
+
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{c as r,a as i,F as n}from"./p-D9sqTVmd.js";import{f as o}from"./p-Ds_P-dB8.js";import"./p-B4vLfYnZ.js";import{R as a,C as u,b as h,q as l}from"./p-D6uhYbLo.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{B as c}from"./p-CU2Dwa94.js";import{S as d}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{P as m}from"./p-BFi5l0xt.js";import{m as p}from"./p-Cy2N3vAg.js";import{J as f}from"./p-BHaO3c8W.js";import{c as y}from"./p-ByQMBEDC.js";import{g as v,a as j}from"./p-CLq3Og7o.js";import{A as b}from"./p-Bl00tHyn.js";import{S as w}from"./p-eBK-iWrz.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-DgTOxu8x.js";import"./p-Bu7gdOaV.js";import"./p-Dn9_7aQh.js";const g=t=>{const e=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${o(e)}`,(function(t){return+t<=+e})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},C=t=>{if(t)return r({amount:g(t),description:i().optional(),reason:i().optional().oneOf([a.customerRequest,a.duplicate,a.fraudulent],"Select a reason")})},T=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],x=b();class B{async postRefund(t,e,s,r){return x.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":e},body:r,authToken:s})}}const D=b();class A{async postVoid(t,e,s){return D.post({endpoint:`payments/${t}/void`,headers:{"Sub-Account":e},authToken:s})}}const I=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),S=()=>t(d,null,t("div",{class:"row gap-5"},t(I,null),t(I,null),t(I,null))),k=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event",7),this.submitEvent=s(this,"submit-event",7),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}componentWillLoad(){y(),this.analytics=new f(this),this.initializeApi(),this.formController=new n(C())}handleError(t,e,s){this.errorEvent.emit({errorCode:t,message:e,severity:s})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(h.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",u.ERROR)}isPaymentCreatedWithin25Minutes(){var t;if(!this.payment||!(null===(t=this.payment)||void 0===t?void 0:t.created_at))return!1;const e=new Date(this.payment.created_at);return((new Date).getTime()-e.getTime())/6e4<=25}initializeFormController(){const t=this.refundPayload.amount,e=t?t.toString():"0";this.formController=new n(C(e)),this.formController.setInitialValues({amount:e}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?p({id:this.paymentId,authToken:this.authToken,service:new m})({onSuccess:({payment:t})=>{this.payment=t,this.refundPayload=new l({amount:t.amount_refundable})},onError:({error:t,code:e,severity:s})=>{this.handleError(e,t,s)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(h.MISSING_PROPS,"Payment ID and Auth Token are required",u.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const e=this.formController.values.getValue();return this.refundLoading=!0,this.isPaymentCreatedWithin25Minutes()?this.tryVoidPayment():this.processRefund(e)}async tryVoidPayment(){const t=(({authToken:t,accountId:e,paymentId:s,service:r})=>async({onSuccess:i,onError:n,final:o})=>{var a;try{const o=await r.postVoid(s,e,t);if(o.error)return n({error:j(o.error),code:v(null===(a=o.error)||void 0===a?void 0:a.code),severity:u.ERROR});i(o)}catch(t){const e=v(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:u.ERROR})}finally{o()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new A});return new Promise((e=>{let s,r=!1;const i=this.formController.values.getValue();t({onSuccess:t=>{s=t,r=!0},onError:({error:t,code:s,severity:n})=>{r=!0,this.handleError(s,t,n),this.processRefund(i).then(e)},final:()=>{s&&!s.error&&r&&(this.submitEvent.emit({response:s}),this.submitDisabled=!0,this.refundLoading=!1,e(s.data))}})}))}async processRefund(t){const e=(({authToken:t,accountId:e,paymentId:s,service:r})=>async({refundBody:i,onSuccess:n,onError:o,final:a})=>{var h;try{const a=await r.postRefund(s,e,t,i);if(a.error)return o({error:j(a.error),code:v(null===(h=a.error)||void 0===h?void 0:h.code),severity:u.ERROR});n(a)}catch(t){const e=v(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:u.ERROR})}finally{a()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new B});return new Promise((s=>{let r;e({refundBody:t,onSuccess:t=>{r=t},onError:({error:t,code:e,severity:s})=>{r=t,this.handleError(e,t,s)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,s(r.data)}})}))}render(){if(this.paymentLoading)return t(S,null);const e=this.formController.getInitialValues(),s=this.refundPayload.amount;return t(d,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:e.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:e.reason,inputHandler:this.inputHandler,options:T,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:e.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(c,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${o(+s)}`))))))}};export{k as justifi_refund_payment}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,h as e}from"./p-CV0Pyo1O.js";import{f as t,p as s,c as r}from"./p-CGnRD4wF.js";import{f as l,a as d}from"./p-Bu7gdOaV.js";import{S as f}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as i,a as o}from"./p-Ds_P-dB8.js";import"./p-B4vLfYnZ.js";import{P as p}from"./p-D6uhYbLo.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const c=class{constructor(e){a(this,e),this.setParamsOnChange=(a,e)=>{t[a]=e},this.handleDateInput=(a,e)=>{const t=i(e,{setEndOfDay:!0});this.setParamsOnChange(a,t)}}componentWillLoad(){Object.entries({status:this.status,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([a,e])=>{e&&(s[a]=e)}))}get statusOptions(){return[{label:"All",value:""},{label:p.paid,value:"paid"},{label:p.failed,value:"failed"},{label:p.forwarded,value:"forwarded"},{label:p.scheduled,value:"scheduled"},{label:p.in_transit,value:"in_transit"},{label:p.canceled,value:"canceled"}]}render(){const a=Object.assign({},t);return e(f,{key:"df8048dae4bc40f8736e10a9288a274bd52d862c"},e("table-filters-menu",{key:"6ebfb5f5f3a9aaba4b8cf490fc97ab7f4d076a8c",params:a,clearParams:r,part:l},e("div",{key:"d18a0c09e5ea1afac91db9f00c15fa4c8c324045",class:"grid-cols-2 gap-3 p-1"},e("div",{key:"31f7705449fefaee5ccfacedbb4e643dce38a0e3",class:"p-2"},e("form-control-select",{key:"0a922f2694866148e22ba4ddd055731a5aff4a2c",name:"status",label:"Status",options:this.statusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.status||t.status||"",disabled:!!this.status,part:d})),e("div",{key:"aa484b1b5344206a80110b870fff54a189a2129f",class:"p-2"},e("form-control-date",{key:"7a3882d54359b913b1ab81958d710b51a028072e",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:o(this.createdAfter,{showInputDate:!0})||o(t.created_after,{showInputDate:!0}),disabled:!!this.createdAfter,part:d})),e("div",{key:"0a58445d63237e1b4ea462ed5cbc13cde22385b8",class:"p-2"},e("form-control-date",{key:"80a5a37baf40d3d0f478cff6577276e78063b6dc",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:o(this.createdBefore,{showInputDate:!0})||o(t.created_before,{showInputDate:!0}),disabled:!!this.createdBefore,part:d})))))}};export{c as justifi_payouts_list_filters}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as o}from"./p-CV0Pyo1O.js";import{J as r}from"./p-BHaO3c8W.js";import{c as a}from"./p-ByQMBEDC.js";import{w as s}from"./p-B4vLfYnZ.js";import{S as p}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-Dn9_7aQh.js";import"./p-Bl00tHyn.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-D6uhYbLo.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import"./p-DgTOxu8x.js";const i=class{constructor(o){t(this,o)}async componentWillLoad(){await s(),a(),this.analytics=new r(this)}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){return this.cardFormElement.validate()}async tokenize({clientId:t,paymentMethodMetadata:o,account:r}){return this.cardFormElement.tokenize({clientId:t,paymentMethodMetadata:o,account:r})}render(){return o(p,{key:"4fa9ff677d40a6733c33d34135fe85e52392f8b0"},o("card-form",{key:"3fe97adcb966b78dc28d5902409671e88525ca41",ref:t=>this.cardFormElement=t}))}};export{i as justifi_card_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{S as a}from"./p-05AWudQe.js";import{T as r,a as i,b as o,c as d,d as h,e as n,f as c,g as p,h as l,i as m,j as f,k as u,l as b}from"./p-DZr0wLGh.js";import{T as g}from"./p-CZfYo5-1.js";import{c as y}from"./p-
|
|
1
|
+
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{S as a}from"./p-05AWudQe.js";import{T as r,a as i,b as o,c as d,d as h,e as n,f as c,g as p,h as l,i as m,j as f,k as u,l as b}from"./p-DZr0wLGh.js";import{T as g}from"./p-CZfYo5-1.js";import{c as y}from"./p-ByQMBEDC.js";import{a6 as v,a7 as w}from"./p-Bu7gdOaV.js";import{a as j}from"./p-Ds_P-dB8.js";import"./p-B4vLfYnZ.js";import{f as T,p as C,C as k,b as _}from"./p-D6uhYbLo.js";import{p as O}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{B as D,a as B}from"./p-Dz8KJn2G.js";import"./p-HXpYMWUU.js";import{g as S,a as P}from"./p-CLq3Og7o.js";import{A as x}from"./p-Bl00tHyn.js";import{J as I}from"./p-BHaO3c8W.js";import{o as L,g as q}from"./p-DUtecvro.js";import"./p-MPer3Rw7.js";import"./p-Dn9_7aQh.js";import"./p-DgTOxu8x.js";const A={created_at:()=>t("th",{part:v,scope:"col",title:"The date and time the order was created"},"Created At"),updated_at:()=>t("th",{part:v,scope:"col",title:"The date and time the order was last updated"},"Updated At"),order_status:()=>t("th",{part:v,scope:"col",title:"The current status of the order"},"Order Status"),business_id:()=>t("th",{part:v,scope:"col",title:"The business ID associated with the order"},"Business ID"),company_name:()=>t("th",{part:v,scope:"col",title:"The business name associated with the order"},"Business Name"),provider:()=>t("th",{part:v,scope:"col",title:"The provider associated with the order"},"Provider"),order_type:()=>t("th",{part:v,scope:"col",title:"The type of order"},"Order Type"),quantity:()=>t("th",{part:v,scope:"col",title:"The number of terminals associated with the order"},"Order Quantity")},E={created_at:(e,s)=>t("td",{part:w(s)},t("div",{class:"fw-bold"},j(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},j(e.created_at,{showTime:!0}))),updated_at:(e,s)=>t("td",{part:w(s)},t("div",{class:"fw-bold"},j(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},j(e.updated_at,{showTime:!0}))),order_status:(e,s)=>t("td",{part:w(s)},t(B,Object.assign({},{submitted:{variant:D.PRIMARY,title:"This order is submitted",text:"Submitted"},completed:{variant:D.SUCCESS,title:"This order has been completed",text:"Completed"},created:{variant:D.SECONDARY,title:"This order is created",text:"Created"},in_progress:{variant:D.PRIMARY,title:"This order is in progress",text:"In Progress"},on_hold:{variant:D.WARNING,title:"This order is on hold",text:"On Hold"},canceled:{variant:D.DANGER,title:"This order is canceled",text:"Canceled"}}[e.order_status]))),business_id:(e,s)=>t("td",{part:w(s)},e.business_id),company_name:(e,s)=>t("td",{part:w(s)},e.company_name),provider:(e,s)=>t("td",{part:w(s)},e.provider),order_type:(e,s)=>{let a;return e.order_type===T.boardingOnly?a="Boarding Only":e.order_type===T.boardingShipping&&(a="Boarding & Shipping"),t("td",{part:w(s)},a)},quantity:(e,s)=>t("td",{part:w(s)},e.terminals.length)},H=x();class M{async fetchTerminalOrders(t,e,s){return H.get({endpoint:"terminals/orders",params:s,headers:{account:t},authToken:e})}}const Q=class{constructor(t){e(this,t),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.columns="created_at,updated_at,order_status,quantity",this.terminalOrders=[],this.loading=!0,this.paging=O,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:g.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:g.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const s=this.terminalOrders.find((t=>t.id===e));this.clickEvent.emit({name:g.row,data:s})}}componentWillLoad(){y(),this.analytics=new I(this),this.terminalOrdersTable=new r(this.terminalOrders,this.columns,A,E),this.initializeGetData(),this.getTerminalOrders&&this.fetchData(),L("set",(()=>{this.pagingParams={}})),L("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}authPropChanged(){this.initializeGetData(),this.getTerminalOrders&&this.fetchData()}pagingOrColumnsChanged(){this.getTerminalOrders&&this.fetchData()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:t,authToken:e,service:s})=>async({params:a,onSuccess:r,onError:i,final:o})=>{var d,h;try{const o=await s.fetchTerminalOrders(t,e,a);if(o.error)return i({error:P(o.error),code:S(null===(h=o.error)||void 0===h?void 0:h.code),severity:k.ERROR});{const t=Object.assign({},o.page_info);r({terminalOrders:(null===(d=o.data)||void 0===d?void 0:d.map((t=>new C(t))))||[],pagingInfo:t})}}catch(t){const e=S(null==t?void 0:t.code);return i({error:t.message||t,code:e,severity:k.ERROR})}finally{o()}})({id:this.accountId,authToken:this.authToken,service:new M}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:_.MISSING_PROPS,message:this.errorMessage,severity:k.ERROR}))}fetchData(){this.getTerminalOrders&&(this.loading=!0,this.getTerminalOrders({params:this.terminalOrderParams,onSuccess:async({terminalOrders:t,pagingInfo:e})=>{this.terminalOrders=t,this.paging=e,this.terminalOrdersTable.collectionData=this.terminalOrders},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s})},final:()=>{this.loading=!1}}))}get terminalOrderParams(){const t=q();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.terminalOrders.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalOrdersTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(a,{key:"7b803503d5cf3086abd05e1f4aa9579eb9f59b88"},t(i,{key:"455a2d115788de71fb27f172f404e5702a089484"},t(o,{key:"fe67da8a9c8f8de5025bee2ea2898da4e31d2b20"},t(d,{key:"c6f04a3a47e2a2401f83d2644cf53574c565dd28"},t(h,{key:"afeb4c45e315337faf683ec96d4602a7525efe2f"},this.terminalOrdersTable.columnData.map((t=>t)))),t(n,{key:"16e226273ab43d6a2d818c2db51752215d215749"},t(c,{key:"668ac3b5f4fd091e42d1c835a002787a70924db1",columnSpan:this.terminalOrdersTable.columnKeys.length,isLoading:this.loading}),t(p,{key:"d154e795f3f202b7a7adb90ef375a1b79e45469b",isEmpty:this.showEmptyState,columnSpan:this.terminalOrdersTable.columnKeys.length}),t(l,{key:"a2b21c0335d8d538194329cbc3938f70b0ee5ecc",columnSpan:this.terminalOrdersTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalOrdersTable.rowData.map(((e,s)=>t(m,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},e)))),this.paging&&t(f,{key:"ed6c4c9993aa5db0f39fc04f30c0f5432dfb922e"},t(u,{key:"0887b03bf1109312a2531ef832175ac01fe88270"},t(b,{key:"913efcfe5f17b1da60002fc87a7de42940e5abe3",colSpan:this.terminalOrdersTable.columnData.length},t("pagination-menu",{key:"0149a80b7f5173f5426fe50a610a8554052158e8",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["authPropChanged"],authToken:["authPropChanged"],pagingParams:["pagingOrColumnsChanged"],columns:["pagingOrColumnsChanged"]}}};export{Q as justifi_terminal_orders_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,H as i,g as
|
|
1
|
+
import{r as t,c as s,h as e,H as i,g as a}from"./p-CV0Pyo1O.js";import{w as o,x as r,q as h,u as c,v as l}from"./p-Bu7gdOaV.js";import{F as f}from"./p-CLZcevBz.js";import"./p-CZfYo5-1.js";const n=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.fileSelected=s(this,"fileSelected",7),this.isFocused=!1,this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=t=>{const s=t.target,e=s.getAttribute("name");this.inputHandler(e,s.value),this.formControlInput.emit({name:e,value:s.value})},this.changeHandler=()=>{const t=this.fileInput.files;t&&this.fileSelected.emit({fileList:t,document_type:this.documentType})}}componentDidLoad(){this.fileInput=this.el.querySelector("input")}get part(){let t=o;return this.errorText&&(t=h),this.disabled&&(t=c),this.isFocused&&(t=l),t}render(){return e(i,{key:"fef20fda4ea06209e00414aa76fa1a1f51f36c9b"},e("div",{key:"0f0c8ad43992eaecca08fc9f17b8bc8ddd05db34",class:"form-group d-flex flex-column"},e("div",{key:"bf34365ec7a4389d86b4c66739317ccdb66d29ab",class:"d-flex align-items-start gap-2"},e("label",{key:"4bb0b05cbe1a2ee377e62546b4912b10caead7eb",part:r,class:"form-label",htmlFor:this.name},this.label),e("form-control-tooltip",{key:"f2835e5c1c4f85805bc43524c7aa9523c726a60e",helpText:this.helpText})),e("input",{key:"613b1fae37b8e4c09ba1b6d42ea258e012ca4427",ref:t=>this.fileInput=t,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()}}),e(f,{key:"c51b148397176578b3f99c9550e33ed7e2041782",errorText:this.errorText,name:this.name})))}get el(){return a(this)}};export{n as form_control_file}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,h as r}from"./p-CV0Pyo1O.js";import{S as o}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";const s=class{constructor(r){i(this,r)}async getValues(){var i,r;return null!==(r=null===(i=this.billingFormRef)||void 0===i?void 0:i.getValues())&&void 0!==r?r:{}}async validate(){var i,r;return null!==(r=null===(i=this.billingFormRef)||void 0===i?void 0:i.validate())&&void 0!==r?r:{isValid:!1,errors:{}}}render(){return r(o,{key:"
|
|
1
|
+
import{r as i,h as r}from"./p-CV0Pyo1O.js";import{S as o}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";const s=class{constructor(r){i(this,r)}async getValues(){var i,r;return null!==(r=null===(i=this.billingFormRef)||void 0===i?void 0:i.getValues())&&void 0!==r?r:{}}async validate(){var i,r;return null!==(r=null===(i=this.billingFormRef)||void 0===i?void 0:i.validate())&&void 0!==r?r:{isValid:!1,errors:{}}}render(){return r(o,{key:"5f845819a98bb3f9c477d39447c342dbc568f541"},r("billing-form",{key:"992fb4ea8df4767d7359b73250581b8b1e5c83ad",legend:this.legend,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:this.paymentMethodType,ref:i=>this.billingFormRef=i}))}};export{s as justifi_billing_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as e,H as a,g as i}from"./p-CV0Pyo1O.js";import{F as r}from"./p-CLZcevBz.js";import{a3 as o,q as h,v as l,u as f,w as n,x as c}from"./p-Bu7gdOaV.js";const d=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.errorText="",this.inputHandler=()=>{},this.disabled=!1}render(){return e(a,{key:"126751292134f9287c1515db834f0485c2fd06a7",exportparts:"label,input,input-invalid"},e("div",{key:"b58a7a17af7ad91715ef47c901109b1f6dff9899",class:"form-group d-flex flex-column"},e("div",{key:"eb464b05d2fa376c996f64307f631268d31c786a",class:"d-flex align-items-start gap-2"},e("label",{key:"0290614c933f57683866d0cc242488461af52061",part:"label",class:"form-label",htmlFor:this.name},this.label),e("form-control-tooltip",{key:"ec7f81546fa75b28dd86c5b01aa7448b4973b320",helpText:this.helpText})),e("input",{key:"10e971984efa55233896aa3550054f1bd576d38f",type:"file",name:this.name,part:`input ${this.errorText?"input-invalid ":""}${this.disabled?"input-disabled":""}`,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onBlur:()=>this.formControlBlur.emit(),onChange:()=>this.errorText=""}),e(r,{key:"9eb539f07b58278bdf9cd6ba0abe93c12d548f00",errorText:this.errorText,name:this.name})))}get el(){return i(this)}},b=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.isFocused=!1,this.helpText="",this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=t=>{const s=t.target,e=s.getAttribute("name");this.inputHandler(e,s.value),this.formControlInput.emit({name:e,value:s.value})},this.updateInput=t=>{const s=this.el.querySelector("textarea");s&&(s.value=t||"")}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){return this.isFocused&&this.errorText?o:this.errorText?h:this.isFocused?l:this.disabled?f:n}render(){return e(a,{key:"38a1df15414183fb880c0591c571485cdb25171d"},e("div",{key:"5e784dc692cb1485fe047d935325a25814486fa6",class:"form-group d-flex flex-column"},e("label",{key:"1dc05dec6cea4bbf9ba8ffada82af711404f0824",part:c,class:"form-label",htmlFor:this.name},this.label),e("textarea",{key:"06f3d3f3855e0665bf53fa29b1b60ff5a095bc08",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",disabled:this.disabled}),e("form-control-help-text",{key:"58c54e79b3df71b78a7a4e217e4639d1db891f0f",helpText:this.helpText,name:this.name}),e("form-control-error-text",{key:"c421126159489a14fda61b9c7e3430965362702d",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{d as form_control_file_v2,b as form_control_textarea}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,h as e}from"./p-CV0Pyo1O.js";import{S as t}from"./p-05AWudQe.js";import{S as r}from"./p-eBK-iWrz.js";import"./p-Bu7gdOaV.js";const i=class{constructor(e){s(this,e)}render(){return e(t,{key:"
|
|
1
|
+
import{r as s,h as e}from"./p-CV0Pyo1O.js";import{S as t}from"./p-05AWudQe.js";import{S as r}from"./p-eBK-iWrz.js";import"./p-Bu7gdOaV.js";const i=class{constructor(e){s(this,e)}render(){return e(t,{key:"c54376afe1b0cebb0394ede10307bcdb32d68bb5"},e(r,{key:"681e9e9d33bd7c2385e7b527f9093a93fbf884bb",component:this.component,height:this.height,width:this.width,className:this.class,styles:this.customStyle}))}};export{i as justifi_skeleton}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{c as e,F as r}from"./p-D9sqTVmd.js";import{b as o,i as a,a as h,c as n,d as p,e as l,f as m}from"./p-CbyGKcz_.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{C as d,b as c}from"./p-D6uhYbLo.js";import"./p-CLHwhyvu.js";import{C as u,B as j,b as v}from"./p-DaDqgDrb.js";import{J as f}from"./p-BHaO3c8W.js";import{B as b}from"./p-CU2Dwa94.js";import{S as g}from"./p-05AWudQe.js";import{H as w}from"./p-CZk3i5Tu.js";import"./p-CZfYo5-1.js";import{c as C}from"./p-ByQMBEDC.js";import{S as y}from"./p-eBK-iWrz.js";import{B}from"./p-XYgDHrVL.js";import{m as D,a as O}from"./p-B0DHIvEj.js";import{B as x}from"./p-DnLqZpI1.js";import"./p-BFTU3MAI.js";import"./p-Do9dxNjh.js";import"./p-CawcnSoV.js";import"./p-OReJ-ZQb.js";import"./p-DgTOxu8x.js";import"./p-Ds_P-dB8.js";import"./p-Dn9_7aQh.js";import"./p-Bl00tHyn.js";import"./p-Bu7gdOaV.js";import"./p-CLq3Og7o.js";const _=e(Object.assign(Object.assign({},o().fields),{legal_address:n(),additional_questions:h(),representative:a("representative")}));e(Object.assign(Object.assign({},p().fields),{legal_address:m(),additional_questions:h(),representative:l("representative")}));const q=_,L=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(y,{width:"25%"})),s("div",{class:"col-12"},s(y,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"50%"}),s(y,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"65%"}),s(y,{width:"35%"}))),S=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(y,{width:"40%",height:"40px"})),s(L,null),s(L,null),s(L,null)),k=class{constructor(s){t(this,s),this.submitEvent=i(this,"submit-event",7),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.isLoading=!1,this.isSaving=!1,this.country=u.USA,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const t=new j(s);this.country=t.country_of_establishment,this.formController.setInitialValues(Object.assign({},t))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),t=this.formController.getInitialValues(),i=new j(Object.assign(Object.assign({},t),s)).payload;this.patchBusiness({payload:i,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:t,severity:i})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:t,message:s.message,severity:i})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){C(),this.analytics=new f(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 x}),this.patchBusiness=O({authToken:this.authToken,businessId:this.businessId,service:new x}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:t,severity:i})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:t,message:s.message,severity:i})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:c.MISSING_PROPS,severity:d.ERROR})}handleReponse(s){s.error&&(this.errorMessage=v.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(g,null,this.isLoading?s(S,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(w,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("business-core-info",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("legal-address-form",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("business-representative",{formController:this.formController,country:this.country})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(b,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:B.submit}),isLoading:this.isSaving},"Submit")))))}};export{k as justifi_business_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,h as i}from"./p-CV0Pyo1O.js";import{S as e}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";const s=class{constructor(i){r(this,i)}async getValues(){var r,i;return null!==(i=null===(r=this.cardBillingFormSimpleRef)||void 0===r?void 0:r.getValues())&&void 0!==i?i:{}}async validate(){var r,i;return null!==(i=null===(r=this.cardBillingFormSimpleRef)||void 0===r?void 0:r.validate())&&void 0!==i?i:{isValid:!1,errors:{}}}render(){return i(e,{key:"
|
|
1
|
+
import{r,h as i}from"./p-CV0Pyo1O.js";import{S as e}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";const s=class{constructor(i){r(this,i)}async getValues(){var r,i;return null!==(i=null===(r=this.cardBillingFormSimpleRef)||void 0===r?void 0:r.getValues())&&void 0!==i?i:{}}async validate(){var r,i;return null!==(i=null===(r=this.cardBillingFormSimpleRef)||void 0===r?void 0:r.validate())&&void 0!==i?i:{isValid:!1,errors:{}}}render(){return i(e,{key:"252d0c30a2ce3775759aa0490592bea6608620ca"},i("card-billing-form-simple",{key:"62a33d79b9b12dfefbfef68f0cf9ec8beb52d177",legend:this.legend,ref:r=>this.cardBillingFormSimpleRef=r}))}};export{s as justifi_card_billing_form_simple}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as a}from"./p-CV0Pyo1O.js";import{l as t}from"./p-OeJ-3w3l.js";import"./p-B4vLfYnZ.js";import{c as s,a as d}from"./p-Ds_P-dB8.js";import{I as l,a as i}from"./p-D6uhYbLo.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{f as r,p as c,c as o}from"./p-CArdj6i_.js";import{f as p,a as b}from"./p-Bu7gdOaV.js";import{S as f}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-BFTU3MAI.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const u=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{r[e]=a},this.handleDateInput=(e,a)=>{const t=s(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({status:this.checkoutStatus,payment_mode:this.paymentMode,checkout_id:this.checkoutId,successful_payment_id:this.successfulPaymentId,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([e,a])=>{a&&(c[e]=a)}))}get checkoutStatusOptions(){return[{label:"All",value:""},{label:"Created",value:l.created},{label:"Completed",value:l.completed},{label:"Attempted",value:l.attempted},{label:"Expired",value:l.expired}]}get checkoutPaymentModeOptions(){return[{label:"All",value:""},{label:"E-commerce",value:i.ecom},{label:"BNPL",value:i.bnpl},{label:"Apple Pay",value:i.apple_pay}]}render(){const e=Object.assign({},r);return a(f,{key:"175f4d80e539b956be529d9e0e7bd94dd00aef32"},a("table-filters-menu",{key:"4d8acfb715b038948bce514d501b567be0e3d15d",params:e,clearParams:o,part:p},a("div",{key:"062bc3404f5985a84bf716976b617f9816012d0c",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"77d933a6d6b78350295b8169aa252157188625fa",class:"p-2"},a("form-control-text",{key:"d5193421fd54a05069d2c93b2d9702fe614a5b12",name:"checkout_id",label:"Checkout ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.checkoutId||r.checkout_id,disabled:!!this.checkoutId,part:b})),a("div",{key:"964eb355ce3c7d089d832aac9909d81d12a13001",class:"p-2"},a("form-control-text",{key:"5942e0937e04b6957efed9eabc770f28665669f6",name:"successful_payment_id",label:"Successful Payment ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.successfulPaymentId||r.successful_payment_id,disabled:!!this.successfulPaymentId,part:b})),a("div",{key:"35a093a384d2c386cbfc117714409ee3e262bc72",class:"p-2"},a("form-control-select",{key:"7bdbb5d2f9e3a1b82ff9f5245767992308d8ba7d",name:"status",label:"Status",options:this.checkoutStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.checkoutStatus||r.status||"",disabled:!!this.checkoutStatus,part:b})),a("div",{key:"59de4b040ac72aa2f26ea52c729125de23c561cd",class:"p-2"},a("form-control-select",{key:"c6f202c97e0dce53b11da79369659de1f01aa4e7",name:"payment_mode",label:"Payment Mode",options:this.checkoutPaymentModeOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentMode||r.payment_mode||"",disabled:!!this.paymentMode,part:b})),a("div",{key:"63094ad30d30ede904b82b40b4223b466258b43b",class:"p-2"},a("form-control-date",{key:"dc8a121917086233970feff405edfab4a5a84794",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:d(this.createdAfter,{showInputDateTime:!0})||d(r.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:b})),a("div",{key:"fa9eefce1d398a0be634a03a72ce98f28ecac696",class:"p-2"},a("form-control-date",{key:"9b07c3693396a1bf47d996fa83d1902188cf78cb",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:d(this.createdBefore,{showInputDateTime:!0})||d(r.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:b})))))}};export{u as justifi_checkouts_list_filters}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as s,H as a,g as i}from"./p-CV0Pyo1O.js";import{w as o,x as h,q as r,u as c,v as l}from"./p-Bu7gdOaV.js";import{F as f}from"./p-CLZcevBz.js";import"./p-CZfYo5-1.js";const n=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.isFocused=!1,this.handleFormControlInput=t=>{const e=t.target,s=e.getAttribute("name");this.inputHandler(s,e.value),this.formControlInput.emit(e.value)},this.updateInput=t=>{this.selectElement.value=t}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){let t=o;return this.errorText&&(t=r),this.disabled&&(t=c),this.isFocused&&(t=l),t}render(){var t;return s(a,{key:"1bf4b5a98883ea56ee00cc10c8e665c5816322f9"},s("div",{key:"9c36f16f9fad894ffe4ae9e665fae50839fbac58",class:"form-group d-flex flex-column"},s("div",{key:"f81841ffb7bf19c6460a087cec95617aa3a983a2",class:"d-flex align-items-start gap-2"},s("label",{key:"d17ae46135877411c2aa15b5a2390c31ca791955",part:h,class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"2e0c07c7f0421547271c18fa1919e97b1735a6ba",helpText:this.helpText})),s("select",{key:"5c68fb7f1ae8c55b3c52730286f2b33391b619cc",ref:t=>this.selectElement=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-select is-invalid":"form-select",disabled:this.disabled},null===(t=this.options)||void 0===t?void 0:t.map((t=>s("option",{value:t.value},t.label)))),s(f,{key:"43c4397970628eabb1554d9352808566aa219a7a",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}},d=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.isFocused=!1,this.handleFormControlInput=t=>{const e=t.target,s=e.getAttribute("name");this.inputHandler(s,e.value),this.formControlInput.emit({name:s,value:e.value})},this.updateInput=t=>{const e=this.el.querySelector("input");e&&(e.value=t||"")}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){return this.errorText?r:this.disabled?c:this.isFocused?l:o}render(){return s(a,{key:"d5da001e89033cf864424d99675b6f5fbe44cd93"},s("div",{key:"753cf0dc5a584368da89079b34d7176b3b9ac29b",class:"form-group d-flex flex-column"},s("div",{key:"4dbb0d4de88bf0f6d28b1b902c9c77ba2b06f70d",class:"d-flex align-items-start gap-2"},s("label",{key:"ede8f0582b639d5cb4b829a89ae313b3df69ec71",part:h,class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"f0414539f6e9c0b44b8f3ead71c1e5741ca47359",helpText:this.helpText})),s("input",{key:"2720e10473b5ac6e99c745cf14912670fe5cef0e",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled}),s(f,{key:"abb212dba851919df2cfc6db6a59ac9354c20919",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{n as form_control_select,d as form_control_text}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,H as a}from"./p-CV0Pyo1O.js";import{q as i,u as o,v as r,w as h,x as
|
|
1
|
+
import{r as t,c as s,h as e,H as a}from"./p-CV0Pyo1O.js";import{q as i,u as o,v as r,w as h,x as n,y as c}from"./p-Bu7gdOaV.js";import{F as f}from"./p-BTuqVZ6O.js";import{F as l}from"./p-CLZcevBz.js";import"./p-CZfYo5-1.js";import{f as p}from"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";const d=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.isFocused=!1,this.defaultValue="0",this.formatRawValue=t=>t.replace(/\D/g,""),this.formatDisplayValue=t=>p(+t,void 0,!0),this.updateInput=t=>{const s=this.formControl.name,e=this.formatRawValue(t);this.formControl.value=this.formatDisplayValue(e),this.inputHandler(s,e),this.formControlInput.emit({name:s,value:e})}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get inputPart(){return this.errorText?i:this.disabled?o:this.isFocused?r:h}render(){return e(a,{key:"75334e0b6e8fe81520e7cc63fc2f75e6d3cb003d"},e("div",{key:"87614554e0b1e8869a2c0a4720b3b829c11806d9",class:"form-group d-flex flex-column"},e("label",{key:"8a102611fa774e4cc45200213497035060bead70",part:n,class:"form-label",htmlFor:this.name},this.label),e(f,{key:"e59c711fa4aee5691b282eda8854ee846566943a",name:this.name,helpText:this.helpText}),e("div",{key:"657787e9d25c59a42b53c9b7c11ad5a40270b967",class:"input-group"},e("span",{key:"6dc19d2560caf09b45a7fbbf6a94efad8fc96fd4",class:"input-group-text",part:c},"$"),e("input",{key:"58580f4041310d855069a85fe8b7e84524cb8966",ref:t=>this.formControl=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:t=>this.updateInput(t.target.value),onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.inputPart,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled})),e(l,{key:"d3702fe61cc90977fea9a23ab9e65ba3e5a74205",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{d as form_control_monetary}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-CV0Pyo1O.js";import{A as s}from"./p-
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-CV0Pyo1O.js";import{A as s}from"./p-Bl00tHyn.js";import{C as n,b as r}from"./p-D6uhYbLo.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as o,a as h}from"./p-CLq3Og7o.js";import{E as a}from"./p-Bh6Q8AqQ.js";import{J as c}from"./p-BHaO3c8W.js";import{c as l}from"./p-ByQMBEDC.js";import{f as u,o as f}from"./p-Ds_P-dB8.js";import{S as d}from"./p-MPer3Rw7.js";import{S as b}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-Dn9_7aQh.js";import"./p-Bu7gdOaV.js";import"./p-HXpYMWUU.js";
|
|
2
2
|
/*!
|
|
3
3
|
* @kurkle/color v0.3.4
|
|
4
4
|
* https://github.com/kurkle/color#readme
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as a}from"./p-CV0Pyo1O.js";import{c as t,a as i,F as c}from"./p-D9sqTVmd.js";import{a9 as d}from"./p-Bu7gdOaV.js";import"./p-BFTU3MAI.js";const s=t({additional_statement:i().nullable()});var o,l;!function(e){e.disputeReason="dispute_reason",e.productOrService="product_or_service",e.customerDetails="customer_details",e.cancellationPolicy="cancellation_policy",e.refundPolicy="refund_policy",e.duplicateCharge="duplicate_charge",e.electronicEvidence="electronic_evidence",e.shippingDetails="shipping_details",e.additionalStatement="additional_statement"}(o||(o={})),function(e){e.activity_log="activity_log",e.cancellationPolicy="cancellation_policy",e.customerCommunication="customer_communication",e.customerSignature="customer_signature",e.duplicateChargeDocumentation="duplicate_charge_documentation",e.receipt="receipt",e.refundPolicy="refund_policy",e.serviceDocumentation="service_documentation",e.shippingDocumentation="shipping_documentation",e.uncategorizedFile="uncategorized_file"}(l||(l={}));class n{set presignedUrl(e){this._presignedUrl=e}get presignedUrl(){return this._presignedUrl}async getFileString(){const e=new Promise(((e,a)=>{const t=new FileReader;t.onload=a=>{e(a.target.result)},t.onerror=()=>{a(new Error("Error reading file"))},t.readAsArrayBuffer(this._file)}));return await e}constructor(e,a){this._file=e,this.file_name=e.name,this.file_type=e.type,this.dispute_evidence_type=a}}const r=(e,a)=>{const t=e.target,i=t.name,c=t.files;a[i]=[];for(const e of c)a[i].push(new n(e,i))},f=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.acceptedTerms=!1,this.documents={uncategorized_file:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.additionalStatement)))}componentWillLoad(){this.form=new c(s)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t;return a("div",{key:"705936da10f418086c5757af0de3e53ab10716e0"},a("div",{key:"56606aa326884a0e4417259a47739d867c2adfd7",class:"row gy-3"},a("div",{key:"77d1e0eac15050e686f603dee1ca43f55373129f",class:"col-12"},a("h2",{key:"7ded76e33d6190d0bf38c04ae1be16d3fbe90ee6",class:"h5",part:d},"Additional Evidence")),a("div",{key:"62ac6a05b02dd2572faf39c1676300d01e72b953",class:"col-12"},a("form-control-textarea",{key:"04aecc2015fea1ecf1e8a4dc5c17ae126040eaba",label:"Is there anything else you would like to say about this dispute?",name:"additional_statement",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.additional_statement,inputHandler:this.inputHandler,errorText:this.errors.additional_statement})),a("div",{key:"f483f7187b15facbc60411659aee39b59f5046eb",class:"col-12"},a("form-control-file-v2",{key:"7d11206b29a51d5ad493488f8446fcf1254ed411",label:"Additional files",name:"uncategorized_file",multiple:!0,helpText:"Upload any additional pieces of evidence that have not already been provided.",onChange:e=>r(e,this.documents),errorText:null===(t=this.documentErrors)||void 0===t?void 0:t.uncategorized_file}))))}},b=t({cancellation_policy_disclosure:i().nullable(),cancellation_rebuttal:i().nullable()}),h=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={cancellation_policy:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.cancellationPolicy)))}componentWillLoad(){this.form=new c(b)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"97168f1e084510db91708b5f769d680506e48378"},a("div",{key:"fed6ca9c4aa195adbbc702957f94ce13be6d12ea",class:"row gy-3"},a("div",{key:"6ac7b963019a8b83e3068940a3219338e5603f20",class:"col-12"},a("h2",{key:"0a9a79bfc840aa2190eb48b7860db7eab1e94d6b",class:"h5",part:d},"Cancellation Policy")),a("div",{key:"662b83a4b580d8f2621a6475fa693314a1459d77",class:"col-12"},a("form-control-textarea",{key:"5c1edfe81316fa0da00ed80ad448e4165eff4445",label:"Cancellation Policy Disclosure",name:"cancellation_policy_disclosure",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.cancellation_policy_disclosure,inputHandler:this.inputHandler,errorText:this.errors.cancellation_policy_disclosure})),a("div",{key:"36c6f8408c1975ba23bb41cd44c8442a3c5ef952",class:"col-12"},a("form-control-textarea",{key:"570795ddd085ea26d8456908efe0651793f4490a",label:"Cancellation Rebuttal",name:"cancellation_rebuttal",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.cancellation_rebuttal,inputHandler:this.inputHandler,errorText:this.errors.cancellation_rebuttal})),a("div",{key:"4cb3da1f399fb639e08474d6ec6d82071d31968f",class:"col-12"},a("form-control-file-v2",{key:"701338b09a213b850347a4204d2b0c536406afd3",label:"Upload Cancellation Policy",name:"cancellation_policy",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.cancellation_policy}))))}},u=t({customer_name:i().nullable(),customer_email_address:i().nullable(),customer_billing_address:i().nullable()}),v=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={customer_signature:[],customer_communication:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.customerDetails)))}componentWillLoad(){this.form=new c(u)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c,s;return a("div",{key:"e4f028d0369b88c270aa610ab457921ee729f1cb"},a("div",{key:"ba4d130e343603baa3c1b3d8141b981f97cb7133",class:"row gy-3"},a("div",{key:"a21d574e6fbd3daef4960b39aba9568060a79ebd",class:"col-12"},a("h2",{key:"a87274deacfdb31ae769252f7418416152528d43",class:"h5",part:d},"Customer Details")),a("div",{key:"2aa05a739cc38a95860b255dab7142fd1a7932d3",class:"col-12"},a("form-control-text",{key:"b4fa7ef3c75d3c2ddc83292c2a13c80ee2a6a4cf",label:"Full Name",name:"customer_name",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.customer_name,inputHandler:this.inputHandler,errorText:this.errors.customer_name})),a("div",{key:"b8a6851094599ed3683f3c14f18305ff0a8ed557",class:"col-12"},a("form-control-text",{key:"4c8d73b3001a36502c6e6083eafdc8e06af86d23",label:"Email",name:"customer_email_address",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.customer_email_address,inputHandler:this.inputHandler,errorText:this.errors.customer_email_address})),a("div",{key:"45d406392c4ba199d77583f18874797f4b7c125e",class:"col-12"},a("form-control-textarea",{key:"757de489531e8e28beb052403842d191e2a45be1",label:"Billing Address",name:"customer_billing_address",defaultValue:null===(i=this.disputeResponse)||void 0===i?void 0:i.customer_billing_address,inputHandler:this.inputHandler,errorText:this.errors.customer_billing_address})),a("div",{key:"3e339e0f275e1ab8e195d77973b60af364d5cdc6",class:"col-12"},a("form-control-file-v2",{key:"64175687470e62ce55d62163b8d231c481fce2a6",label:"Customer Signature",name:"customer_signature",onChange:e=>r(e,this.documents),errorText:null===(c=this.documentErrors)||void 0===c?void 0:c.customer_signature})),a("div",{key:"27d1ac884a8986c8e9a23c92296e2f8871ec0f45",class:"col-12"},a("form-control-file-v2",{key:"f7169172d91f4ea785d1532bb4a442cba8cc1c9e",label:"Customer Communication",name:"customer_communication",onChange:e=>r(e,this.documents),errorText:null===(s=this.documentErrors)||void 0===s?void 0:s.customer_communication}))))}},p=t({duplicate_charge_original_payment_id:i().nullable(),duplicate_charge_explanation:i().nullable()}),m=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={duplicate_charge_documentation:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.duplicateCharge)))}componentWillLoad(){this.form=new c(p)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"a4be51ca28d0558a06a96429c9f6967de65f7687"},a("div",{key:"e240189e3a8d31963667e6779a9497ab8258f983",class:"row gy-3"},a("div",{key:"c22af27a5e94810c4daa4105d30b69a9bac3ea84",class:"col-12"},a("h2",{key:"6b09237bb4a404c03a20f1dd3687b1b2b6c02f72",class:"h5",part:d},"Duplicate Charge")),a("div",{key:"91cca8f6bfe938aad35d57f1360cea9c8a46b89b",class:"col-12"},a("form-control-text",{key:"88cd9fad95f55f1302cf8b638eee372279c0b601",label:"Original Payment ID",name:"duplicate_charge_original_payment_id",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.duplicate_charge_original_payment_id,inputHandler:this.inputHandler,errorText:this.errors.duplicate_charge_original_payment_id})),a("div",{key:"930ddf5ae0d1f22e87f40d422cc7cc3cf202cf78",class:"col-12"},a("form-control-textarea",{key:"ab6764a1f982f6be6dd0fc94d5f6630b54fca654",label:"Duplicate Charge Explanation",name:"duplicate_charge_explanation",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.duplicate_charge_explanation,inputHandler:this.inputHandler,errorText:this.errors.duplicate_charge_explanation})),a("div",{key:"8ca0a2a0b69d577022bd82d7f04fe8205ee66e7f",class:"col-12"},a("form-control-file-v2",{key:"9a5e4ac52a949a8a7b4bcabd397f8b38edbff159",label:"Duplicate Charge Documentation",name:"duplicate_charge_documentation",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.duplicate_charge_documentation}))))}},y=t({customer_purchase_ip_address:i().nullable()}),_=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={activity_log:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.electronicEvidence)))}componentWillLoad(){this.form=new c(y)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t;return a("div",{key:"edbcd0fd94da7a6fb25403bca804133cd20be070"},a("div",{key:"82263da6e6a92b478366025bf648fce4f3f91db6",class:"row gy-3"},a("div",{key:"f6435773410b5561ead0e4a20637a57b785b8c50",class:"col-12"},a("h2",{key:"c911fb7238d292f9d11627e13729cf613192cb13",class:"h5",part:d},"Electronic Evidence")),a("div",{key:"ae43f664aa254449df9cf2c6e851e2e9c532c90e",class:"col-12"},a("form-control-text",{key:"a7781046a1ef45514831affa9c650b7849100817",label:"Purchase IP Address",name:"customer_purchase_ip_address",helpText:"The IP address used by the customer during the purchase.",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.customer_purchase_ip_address,inputHandler:this.inputHandler,errorText:this.errors.customer_purchase_ip_address})),a("div",{key:"47ba5795dde01a4d62fbdeae9e5b7b29cd538cc5",class:"col-12"},a("form-control-file-v2",{key:"a44528a479ec5fa2d60e357aa577b1a44f81a074",label:"Activity Logs",name:"activity_log",helpText:"Any server or activity logs that provide evidence of the customer's access to or download of the purchased digital product. This information should encompass IP addresses, relevant timestamps, and any detailed records of activity.",onChange:e=>r(e,this.documents),errorText:null===(t=this.documentErrors)||void 0===t?void 0:t.activity_log}))))}},k=t({product_description:i().nullable(),service_date:i().nullable()}),g=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={service_documentation:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.productOrService)))}componentWillLoad(){this.form=new c(k)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"05c536ee29807808dde18056696f0874d58efbe9"},a("div",{key:"07927d573fff06c4b65330a4cfb493f594e362d4",class:"row gy-3"},a("div",{key:"c38ab76b089b7b66aad0dd89dbc74b2a3fedddda",class:"col-12"},a("h2",{key:"830d1384bc17af43bcd20145eab870ca293d965d",class:"h5",part:d},"Product & Service Details")),a("div",{key:"6b5fb4827719e7dd29a90935ec5afd540c1c81fd",class:"col-12"},a("form-control-text",{key:"0fed87fcbb554a739285431f6256f8b8d7802b9a",label:"Product Description",name:"product_description",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.product_description,inputHandler:this.inputHandler,errorText:this.errors.product_description})),a("div",{key:"8a59d2bb505dd211126d6e4a6e741aaed959edc7",class:"col-12"},a("form-control-date",{key:"ffa4f5323aaa7c274950f2176774a4f7946c4ca4",label:"Service Date",name:"service_date",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.service_date,inputHandler:this.inputHandler,errorText:this.errors.service_date})),a("div",{key:"c9e7aca6c2e9c66ec0884b34533af18a1c581b4d",class:"col-12"},a("form-control-file-v2",{key:"8db8543f45b02496d2cc6f04794c18da55f4c146",label:"Service Documentation",name:"service_documentation",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.service_documentation}))))}},x=t({refund_policy_disclosure:i().nullable(),refund_refusal_explanation:i().nullable()}),j=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={refund_policy:[],receipt:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.refundPolicy)))}componentWillLoad(){this.form=new c(x)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c;return a("div",{key:"baf5ee051fb023d19f3d0c21d4a7ee651e283c76"},a("div",{key:"c8e4870b875bff53184b90e2d254acdee795e51c",class:"row gy-3"},a("div",{key:"872d7f45c1b5832234d013a3f7065d05f9896d80",class:"col-12"},a("h2",{key:"7ae62cf2f5ab51537349b91db8fa9d2fa351e685",class:"h5",part:d},"Refund Policy and Receipt")),a("div",{key:"48a8249261d3bcf981e45dba6aaf260c4419816e",class:"col-12"},a("form-control-textarea",{key:"31b6c4b3ffadc1fe812a00fb5e4d40de423b635e",label:"Refund Policy Disclosure",name:"refund_policy_disclosure",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.refund_policy_disclosure,inputHandler:this.inputHandler})),a("div",{key:"f5504c3367bc74127dec92d95d0934a9bbb00b29",class:"col-12"},a("form-control-textarea",{key:"9fe085d5435561251b3192169904438f0b6501e6",label:"Refund Refusal Explanation",name:"refund_refusal_explanation",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.refund_refusal_explanation,inputHandler:this.inputHandler})),a("div",{key:"ae8110175bfd1880b62e41fc1b474f31a9523cfb",class:"col-12"},a("form-control-file-v2",{key:"ba38271cac7afd52ba6669086d664cec2e008f77",label:"Upload Refund Policy",name:"refund_policy",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.refund_policy})),a("div",{key:"31ff66405fdae65e1b441b847a0e5f048822e0fc",class:"col-12"},a("form-control-file-v2",{key:"a36cb88846ba11690a4525ffbb27c0b4fb2140af",label:"Upload Receipt",name:"receipt",onChange:e=>r(e,this.documents),errorText:null===(c=this.documentErrors)||void 0===c?void 0:c.receipt}))))}},O=t({shipping_carrier:i().nullable(),shipping_tracking_number:i().nullable(),shipping_date:i().nullable(),shipping_address:i().nullable()}),T=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={shipping_documentation:[]},this.documentList=[],this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.shippingDetails)))}componentWillLoad(){this.form=new c(O)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c,s;return a("div",{key:"079899510230700b1b0164642856719267e0dc09"},a("div",{key:"23229775a0a57e60cd6de4ceff1bcb60d2502283",class:"row gy-3"},a("div",{key:"9376fd2dfe64983f734f93354c08a38cbe6d46d4",class:"col-12"},a("h2",{key:"141a2e2a5098388d15e4626a4311a0d95991af3b",class:"h5",part:d},"Shipping Details")),a("div",{key:"c1eae745411ea51d07839c84abce48742cf8e31b",class:"col-12"},a("form-control-text",{key:"37ffbdb5be2e0bcffcc78b19ce5a125fd3a7cbd5",label:"Shipping Carrier Name",name:"shipping_carrier",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.shipping_carrier,inputHandler:this.inputHandler,errorText:this.errors.shipping_carrier})),a("div",{key:"27f39470af011e3cbae85e35e56c544a331c1241",class:"col-12"},a("form-control-text",{key:"dda7d915ab28bb2845cbfd1338222b1c50aab063",label:"Tracking Number",name:"shipping_tracking_number",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.shipping_tracking_number,inputHandler:this.inputHandler,errorText:this.errors.shipping_tracking_number})),a("div",{key:"bbf1cff1e23632597fad5c84b4c6ceb8080be547",class:"col-12"},a("form-control-date",{key:"8a0bc94d48e7ccde53408ad6a3f20ffcfe7a6263",label:"Date Shipped",name:"shipping_date",defaultValue:null===(i=this.disputeResponse)||void 0===i?void 0:i.shipping_date,inputHandler:this.inputHandler,errorText:this.errors.shipping_date})),a("div",{key:"55e9efd42f6380c0bb645de90dde4eb63ce80a5d",class:"col-12"},a("form-control-textarea",{key:"0dac6c8521bec728b7dd182841552b72f38dbbec",label:"Shipping Address",name:"shipping_address",defaultValue:null===(c=this.disputeResponse)||void 0===c?void 0:c.shipping_address,inputHandler:this.inputHandler,errorText:this.errors.shipping_address})),a("div",{key:"488034d64bc2808d27b9a072515cb84593e72db9",class:"col-12"},a("form-control-file-v2",{key:"609b0177ed8279fe483f5b4e59ee076b4b471ee7",label:"Shipping Documentation",name:"shipping_documentation",onChange:e=>r(e,this.documents),errorText:null===(s=this.documentErrors)||void 0===s?void 0:s.shipping_documentation}))))}};export{f as additional_statement,h as cancellation_policy,v as customer_details,m as duplicate_charge,_ as electronic_evidence,g as product_or_service,j as refund_policy,T as shipping_details}
|
|
1
|
+
import{r as e,h as a}from"./p-CV0Pyo1O.js";import{c as t,a as i,F as c}from"./p-D9sqTVmd.js";import{a9 as d}from"./p-Bu7gdOaV.js";import"./p-BFTU3MAI.js";const s=t({additional_statement:i().nullable()});var o,l;!function(e){e.disputeReason="dispute_reason",e.productOrService="product_or_service",e.customerDetails="customer_details",e.cancellationPolicy="cancellation_policy",e.refundPolicy="refund_policy",e.duplicateCharge="duplicate_charge",e.electronicEvidence="electronic_evidence",e.shippingDetails="shipping_details",e.additionalStatement="additional_statement"}(o||(o={})),function(e){e.activity_log="activity_log",e.cancellationPolicy="cancellation_policy",e.customerCommunication="customer_communication",e.customerSignature="customer_signature",e.duplicateChargeDocumentation="duplicate_charge_documentation",e.receipt="receipt",e.refundPolicy="refund_policy",e.serviceDocumentation="service_documentation",e.shippingDocumentation="shipping_documentation",e.uncategorizedFile="uncategorized_file"}(l||(l={}));class n{set presignedUrl(e){this._presignedUrl=e}get presignedUrl(){return this._presignedUrl}async getFileString(){const e=new Promise(((e,a)=>{const t=new FileReader;t.onload=a=>{e(a.target.result)},t.onerror=()=>{a(new Error("Error reading file"))},t.readAsArrayBuffer(this._file)}));return await e}constructor(e,a){this._file=e,this.file_name=e.name,this.file_type=e.type,this.dispute_evidence_type=a}}const r=(e,a)=>{const t=e.target,i=t.name,c=t.files;a[i]=[];for(const e of c)a[i].push(new n(e,i))},f=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.acceptedTerms=!1,this.documents={uncategorized_file:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.additionalStatement)))}componentWillLoad(){this.form=new c(s)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t;return a("div",{key:"d87892b31a560cf5089bb8b94403deda25c75132"},a("div",{key:"a083b417adafd62cd32827014eb8566c8d8e431e",class:"row gy-3"},a("div",{key:"832973d1fd655582b7371dcb0906b5fed9d77727",class:"col-12"},a("h2",{key:"339e84637eb3e2080bc08c06379b436ed66cdbf3",class:"h5",part:d},"Additional Evidence")),a("div",{key:"a8228b7e9d8fd51f491f279975ba380a0f6f6029",class:"col-12"},a("form-control-textarea",{key:"966cd51de65c862e9371f2e013f9f666da5f049a",label:"Is there anything else you would like to say about this dispute?",name:"additional_statement",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.additional_statement,inputHandler:this.inputHandler,errorText:this.errors.additional_statement})),a("div",{key:"3c21b60e1da1d208c16b4e4003242660f28f42e5",class:"col-12"},a("form-control-file-v2",{key:"f767738c5ebf8a63d403d48e971042aabdf91224",label:"Additional files",name:"uncategorized_file",multiple:!0,helpText:"Upload any additional pieces of evidence that have not already been provided.",onChange:e=>r(e,this.documents),errorText:null===(t=this.documentErrors)||void 0===t?void 0:t.uncategorized_file}))))}},b=t({cancellation_policy_disclosure:i().nullable(),cancellation_rebuttal:i().nullable()}),h=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={cancellation_policy:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.cancellationPolicy)))}componentWillLoad(){this.form=new c(b)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"b2b9de71bee44157e6f62cab9a759ca3a6fc7c91"},a("div",{key:"b54a10355e8b0dd0da69e9c07abaf4376f759f4b",class:"row gy-3"},a("div",{key:"ed43e475ed87fa9658060f403187a063bec1813c",class:"col-12"},a("h2",{key:"48e9d7955c066771d8c47b55abf4fc2498bcc11a",class:"h5",part:d},"Cancellation Policy")),a("div",{key:"783da1c2a786ee85f412303583a778dd81331e8a",class:"col-12"},a("form-control-textarea",{key:"04267a5b01060f577eb88810c83013e6cb2bc437",label:"Cancellation Policy Disclosure",name:"cancellation_policy_disclosure",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.cancellation_policy_disclosure,inputHandler:this.inputHandler,errorText:this.errors.cancellation_policy_disclosure})),a("div",{key:"340db58f52fa708a40a1548b84411174f1b7ca85",class:"col-12"},a("form-control-textarea",{key:"a8dafe6142a2ce7409d7d7dd60637e819bb99b9e",label:"Cancellation Rebuttal",name:"cancellation_rebuttal",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.cancellation_rebuttal,inputHandler:this.inputHandler,errorText:this.errors.cancellation_rebuttal})),a("div",{key:"7ff48beda50edb31c80d0bbe5fe7948ce214a493",class:"col-12"},a("form-control-file-v2",{key:"2f3780f2036026f49db380d5201fc6a46d4b15c6",label:"Upload Cancellation Policy",name:"cancellation_policy",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.cancellation_policy}))))}},u=t({customer_name:i().nullable(),customer_email_address:i().nullable(),customer_billing_address:i().nullable()}),v=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={customer_signature:[],customer_communication:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.customerDetails)))}componentWillLoad(){this.form=new c(u)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c,s;return a("div",{key:"4217dd2605586a82ee34515e6c9b5a3ab6358b55"},a("div",{key:"42eb8a48d1161d329bddf574c863c92376a4bbc9",class:"row gy-3"},a("div",{key:"4d8d1267035ed1e81e6050d7e648ff80d369365d",class:"col-12"},a("h2",{key:"923c89d2959dd09fdbb60cfbca0d0021697dc5b8",class:"h5",part:d},"Customer Details")),a("div",{key:"5b3daa86ad6ce05babf3efd0c3c4f3a3264b4c6c",class:"col-12"},a("form-control-text",{key:"bd6eae36d75ec77e8d652686f2f070bbead4e385",label:"Full Name",name:"customer_name",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.customer_name,inputHandler:this.inputHandler,errorText:this.errors.customer_name})),a("div",{key:"3f8f8ff8fcb8a8e41053e3f9b55152296cb91d3e",class:"col-12"},a("form-control-text",{key:"ddf390a5e37e99b8f99b7673b6b07f3851a759f4",label:"Email",name:"customer_email_address",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.customer_email_address,inputHandler:this.inputHandler,errorText:this.errors.customer_email_address})),a("div",{key:"eed293a2acc46219bd33974f93affb3ca977fc57",class:"col-12"},a("form-control-textarea",{key:"4f5e5b9cfc9aefe48c2c85bba3a3a308215c36b9",label:"Billing Address",name:"customer_billing_address",defaultValue:null===(i=this.disputeResponse)||void 0===i?void 0:i.customer_billing_address,inputHandler:this.inputHandler,errorText:this.errors.customer_billing_address})),a("div",{key:"0ccfa871557435a96350e8ace59179611c01dc2c",class:"col-12"},a("form-control-file-v2",{key:"e9d35062a5011f4e72d60e85855efb0d7ceed8c1",label:"Customer Signature",name:"customer_signature",onChange:e=>r(e,this.documents),errorText:null===(c=this.documentErrors)||void 0===c?void 0:c.customer_signature})),a("div",{key:"cb184b84ccc36bd51242dcb57c96ba2d85567e4a",class:"col-12"},a("form-control-file-v2",{key:"b7d1d427468cd0744001102e2c704e8ad65577b6",label:"Customer Communication",name:"customer_communication",onChange:e=>r(e,this.documents),errorText:null===(s=this.documentErrors)||void 0===s?void 0:s.customer_communication}))))}},p=t({duplicate_charge_original_payment_id:i().nullable(),duplicate_charge_explanation:i().nullable()}),m=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={duplicate_charge_documentation:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.duplicateCharge)))}componentWillLoad(){this.form=new c(p)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"805b160927f30729b321ffbafc15fe78fed732c9"},a("div",{key:"fcc99471b08ea21905c1246849ec41e05194834f",class:"row gy-3"},a("div",{key:"f7259723ec39b5ae09aaa552a99f3a8a15b85fd8",class:"col-12"},a("h2",{key:"5f0719c624bce5542364120568079fb6921c7d6f",class:"h5",part:d},"Duplicate Charge")),a("div",{key:"718c50ebae8b6ca9c146d81f261dad5007945a33",class:"col-12"},a("form-control-text",{key:"090a5f0e4ca359af300f655ad94296af1a28eef0",label:"Original Payment ID",name:"duplicate_charge_original_payment_id",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.duplicate_charge_original_payment_id,inputHandler:this.inputHandler,errorText:this.errors.duplicate_charge_original_payment_id})),a("div",{key:"217b8e9b896412a1e74d138c20d6cc42760e7a54",class:"col-12"},a("form-control-textarea",{key:"d9ba9a25ccaa5848f17ec8f1dfde222c29624e06",label:"Duplicate Charge Explanation",name:"duplicate_charge_explanation",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.duplicate_charge_explanation,inputHandler:this.inputHandler,errorText:this.errors.duplicate_charge_explanation})),a("div",{key:"eb26362fb100e775339b4a64959521a1b7cad394",class:"col-12"},a("form-control-file-v2",{key:"5753787dd59e736a7a2dea84268d93983cfdeae4",label:"Duplicate Charge Documentation",name:"duplicate_charge_documentation",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.duplicate_charge_documentation}))))}},y=t({customer_purchase_ip_address:i().nullable()}),_=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={activity_log:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.electronicEvidence)))}componentWillLoad(){this.form=new c(y)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t;return a("div",{key:"1de8dc7fafbd3dba15344a817fd2c008929ab0bc"},a("div",{key:"dda3c4b88713e0e1b9fe25c2a4fe2d015889f2b3",class:"row gy-3"},a("div",{key:"1638ff98ca047509306f9387e68ba83c9be5c885",class:"col-12"},a("h2",{key:"9ee705b8558a88bd4eebe2448e2da655fbcf9bf3",class:"h5",part:d},"Electronic Evidence")),a("div",{key:"71a392aa19784a1e25654791544fab6e9fd482a6",class:"col-12"},a("form-control-text",{key:"b2ef47161c0c73f010461f326f39f60efb140ae8",label:"Purchase IP Address",name:"customer_purchase_ip_address",helpText:"The IP address used by the customer during the purchase.",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.customer_purchase_ip_address,inputHandler:this.inputHandler,errorText:this.errors.customer_purchase_ip_address})),a("div",{key:"0341ecbd1404b29e223d508e937752ed67a5f9e2",class:"col-12"},a("form-control-file-v2",{key:"00d8fd3c9bfded6f20ae8568aca1fd21564649df",label:"Activity Logs",name:"activity_log",helpText:"Any server or activity logs that provide evidence of the customer's access to or download of the purchased digital product. This information should encompass IP addresses, relevant timestamps, and any detailed records of activity.",onChange:e=>r(e,this.documents),errorText:null===(t=this.documentErrors)||void 0===t?void 0:t.activity_log}))))}},k=t({product_description:i().nullable(),service_date:i().nullable()}),g=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={service_documentation:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.productOrService)))}componentWillLoad(){this.form=new c(k)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"3f2d1c2f4b0595e922712f8754ae1022b2d19261"},a("div",{key:"0ab14085510225a4d00b352014ea72f4dc0a059a",class:"row gy-3"},a("div",{key:"12271b714bf3e6b6756274674e3413018124fa4c",class:"col-12"},a("h2",{key:"9b6175bf1eb88788b909be3f7a46337a75856306",class:"h5",part:d},"Product & Service Details")),a("div",{key:"912e647000393b9146329e7d4cca78ee15837621",class:"col-12"},a("form-control-text",{key:"7b365315a58fdfa65fa7e1e6f009dc5c70c17d95",label:"Product Description",name:"product_description",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.product_description,inputHandler:this.inputHandler,errorText:this.errors.product_description})),a("div",{key:"03d48b21fb83a4a4b07ed6f0f7b6f08a32c10ce5",class:"col-12"},a("form-control-date",{key:"fbd7c448acc69aa0012999f90d3b38f9374af933",label:"Service Date",name:"service_date",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.service_date,inputHandler:this.inputHandler,errorText:this.errors.service_date})),a("div",{key:"74683fc2825cffa9403313b21d52a4ddb76db12e",class:"col-12"},a("form-control-file-v2",{key:"7d3e5f2f96375d884a98e207c22d2b3115ed6e1b",label:"Service Documentation",name:"service_documentation",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.service_documentation}))))}},x=t({refund_policy_disclosure:i().nullable(),refund_refusal_explanation:i().nullable()}),j=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={refund_policy:[],receipt:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.refundPolicy)))}componentWillLoad(){this.form=new c(x)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c;return a("div",{key:"828ac1997382fa491920b9439099959ae5376c81"},a("div",{key:"8d0453e4c2ec424a2010cfd01885cb4a03020d93",class:"row gy-3"},a("div",{key:"d15021ea6df4b3939d4564a84951ebadb50cc7cd",class:"col-12"},a("h2",{key:"632eafab4924af0d433f28a3329877b98376ea27",class:"h5",part:d},"Refund Policy and Receipt")),a("div",{key:"cb55f0f106e68e9af4057a4496811db991f487d0",class:"col-12"},a("form-control-textarea",{key:"1fdca1aea95757a0dac55b338355eeffd351c6cb",label:"Refund Policy Disclosure",name:"refund_policy_disclosure",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.refund_policy_disclosure,inputHandler:this.inputHandler})),a("div",{key:"6f6c35c4626a764e4119dc253aded2985ac6ffbc",class:"col-12"},a("form-control-textarea",{key:"6c0fcba48cad9f8c3cc9ed6c35d6b0e1301f9c35",label:"Refund Refusal Explanation",name:"refund_refusal_explanation",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.refund_refusal_explanation,inputHandler:this.inputHandler})),a("div",{key:"1bf52c92c53313ab7542bfc1b2ed607e9d5db032",class:"col-12"},a("form-control-file-v2",{key:"67b266e26d5568e3370b3f8aaad2c0d6450f67f6",label:"Upload Refund Policy",name:"refund_policy",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.refund_policy})),a("div",{key:"8994ee85c8a31fc709a0fa396d97e4da576e57c3",class:"col-12"},a("form-control-file-v2",{key:"c468b92349b6a92f02b6eef0dc06c71dfc924c4e",label:"Upload Receipt",name:"receipt",onChange:e=>r(e,this.documents),errorText:null===(c=this.documentErrors)||void 0===c?void 0:c.receipt}))))}},O=t({shipping_carrier:i().nullable(),shipping_tracking_number:i().nullable(),shipping_date:i().nullable(),shipping_address:i().nullable()}),T=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={shipping_documentation:[]},this.documentList=[],this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.shippingDetails)))}componentWillLoad(){this.form=new c(O)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c,s;return a("div",{key:"0d7695711048ad14596ba44e364b45e3aa3d1e39"},a("div",{key:"e6911e35f66ef8aaa591f54e389d67c202af8172",class:"row gy-3"},a("div",{key:"d59ab2fe6318a27c4b38650e4e9d07b9c851041f",class:"col-12"},a("h2",{key:"b8a8634fe9dcf11c332dab0c1736732e579aeb59",class:"h5",part:d},"Shipping Details")),a("div",{key:"5170b37a386805e194d8cf7c769ffdbac8db8fa2",class:"col-12"},a("form-control-text",{key:"7bc3f59737fa075134e2bc476fa26d79ddc4e26b",label:"Shipping Carrier Name",name:"shipping_carrier",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.shipping_carrier,inputHandler:this.inputHandler,errorText:this.errors.shipping_carrier})),a("div",{key:"ef41052d0eec68b02d04638ce7cfdbc1477c16eb",class:"col-12"},a("form-control-text",{key:"b88d31bed47cdf09e04a29122c1adf955bdc4d25",label:"Tracking Number",name:"shipping_tracking_number",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.shipping_tracking_number,inputHandler:this.inputHandler,errorText:this.errors.shipping_tracking_number})),a("div",{key:"743dea4d8f59e62103403fa58936ca86d7bbf216",class:"col-12"},a("form-control-date",{key:"4be255a38f91f9bf758428d780649d2775d22153",label:"Date Shipped",name:"shipping_date",defaultValue:null===(i=this.disputeResponse)||void 0===i?void 0:i.shipping_date,inputHandler:this.inputHandler,errorText:this.errors.shipping_date})),a("div",{key:"7b274a743a9ca8f3cb7b86facbe12b723b8695e4",class:"col-12"},a("form-control-textarea",{key:"833a03ac489cfa6fe6991e14a079b104b7b86ddc",label:"Shipping Address",name:"shipping_address",defaultValue:null===(c=this.disputeResponse)||void 0===c?void 0:c.shipping_address,inputHandler:this.inputHandler,errorText:this.errors.shipping_address})),a("div",{key:"a1363e8014fe90442e1d0f6820bf2b9cf9966c90",class:"col-12"},a("form-control-file-v2",{key:"beb99c4b9e898265f8a904984172fb1a6a52cb49",label:"Shipping Documentation",name:"shipping_documentation",onChange:e=>r(e,this.documents),errorText:null===(s=this.documentErrors)||void 0===s?void 0:s.shipping_documentation}))))}};export{f as additional_statement,h as cancellation_policy,v as customer_details,m as duplicate_charge,_ as electronic_evidence,g as product_or_service,j as refund_policy,T as shipping_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{n as s,C as a,b as r}from"./p-
|
|
1
|
+
import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{n as s,C as a,b as r}from"./p-D6uhYbLo.js";import{J as n}from"./p-BHaO3c8W.js";import{c as o}from"./p-ByQMBEDC.js";import{T as c}from"./p-C-buCQRx.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as d,a as p}from"./p-CLq3Og7o.js";import{m,S as u}from"./p-rznJBkm3.js";import{S as l}from"./p-05AWudQe.js";import{T as f,a as b,b as v,c as g,d as k,e as y,f as j,g as T,h as _,i as C,j as w,k as D,l as S}from"./p-DZr0wLGh.js";import{T as O}from"./p-CZfYo5-1.js";import{B as P,a as A}from"./p-Dz8KJn2G.js";import{a6 as x,a7 as B}from"./p-Bu7gdOaV.js";import{j as I}from"./p-Ds_P-dB8.js";import{o as E,g as L}from"./p-BzjgvHHT.js";import"./p-Dn9_7aQh.js";import"./p-Bl00tHyn.js";import"./p-DgTOxu8x.js";import"./p-MPer3Rw7.js";const z={nickname:()=>t("th",{part:x,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:x,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:x,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:x,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:x,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:x,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:x,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:x,scope:"col",title:"The current status of each terminal"},"Status")},H={nickname:(e,i)=>t("td",{part:B(i)},e.nickname),model_name:(e,i)=>t("td",{part:B(i)},e.model_name),id:(e,i)=>t("td",{part:B(i)},e.id),provider:(e,i)=>t("td",{part:B(i)},I(e.provider)),provider_serial_number:(e,i)=>t("td",{part:B(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:B(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:B(i)},e.sub_account_name),status:(e,i)=>t("td",{part:B(i)},t(A,Object.assign({},{connected:{variant:P.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:P.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:P.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:P.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:P.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},G=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:O.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:O.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:O.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new f(this.terminals,this.columns,z,H),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),E("set",(()=>{this.pagingParams={}})),E("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:e,service:i})=>async({params:r,onSuccess:n,onError:o})=>{var c,h;try{const m=await i.fetchTerminals(t,e,r);if(m.error)return o({error:p(m.error),code:d(null===(h=m.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const t=Object.assign({},m.page_info);n({terminals:(null===(c=m.data)||void 0===c?void 0:c.map((t=>new s(t))))||[],pagingInfo:t})}}catch(t){const e=d(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:a.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new c}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new u}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:e})=>{this.terminals=t,this.paging=e,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}get terminalParams(){const t=L();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const 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 t(l,{key:"f5e035ad6cbe9693ce0a29e36d14278d5224eeb3"},t(b,{key:"bea0034ac9f41ac47556bf6536e24a3b700710a4"},t(v,{key:"6c12904931722da0e3bc6747e7f6163d2d12f749"},t(g,{key:"c877fa13f3e9fae282ad0709143e8a3fd6515422"},t(k,{key:"d49940b86aa8d64e272b16fc1e8d697f8e337a35"},this.terminalsTable.columnData.map((t=>t)))),t(y,{key:"75e0e101683f678015a79074ce196343cfab689b"},t(j,{key:"25110bdfbd4e07caebf67ccab9ffd53ef006cb10",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(T,{key:"5921d80f047c9c34146ec585cfb914e813abdffd",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(_,{key:"0894247ae6a79ee9928d4e4c5b77d5e5c0ce3435",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((e,i)=>t(C,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(w,{key:"32ba2beb908ed756541c760fe2027631ac40d6cb"},t(D,{key:"4894339ca7c22087ad9b6452f1c42dc3c2b53218"},t(S,{key:"4013c7c6eeae5d152a0bd3145113fb9d403d2e02",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"5c4ee6431d6b291ace0671d47165ae579e7b3f67",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{G as justifi_terminals_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as a}from"./p-CV0Pyo1O.js";import{c as o}from"./p-ByQMBEDC.js";import{J as s}from"./p-BHaO3c8W.js";import{w as r}from"./p-B4vLfYnZ.js";import{S as i}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-Dn9_7aQh.js";import"./p-Bl00tHyn.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-D6uhYbLo.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import"./p-DgTOxu8x.js";const e=class{constructor(a){t(this,a)}async componentWillLoad(){await r(),o(),this.analytics=new s(this)}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){return!!this.bankAccountFormElement&&this.bankAccountFormElement.validate()}async tokenize({clientId:t,paymentMethodMetadata:a,account:o}){return this.bankAccountFormElement?this.bankAccountFormElement.tokenize({clientId:t,paymentMethodMetadata:a,account:o}):{error:{message:"Bank account form is not available."}}}render(){return a(i,{key:"1263233d6c63c0df4a2a6a17b263651156ad6bee"},a("bank-account-form",{key:"f6c6707201ef127eafc81e12535bcfa37ddf3c5d",ref:t=>this.bankAccountFormElement=t}))}};export{e as justifi_bank_account_form}
|