@justifi/webcomponents 6.12.3 → 6.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (606) hide show
  1. package/dist/cjs/{Analytics-DcqsdFaD.js → Analytics-CITnMj7H.js} +4 -5
  2. package/dist/cjs/{Plaid-BlSGeGpn.js → Plaid-BRSyOOuw.js} +60 -4
  3. package/dist/cjs/additional-questions-details_5.cjs.entry.js +1 -1
  4. package/dist/cjs/additional-questions-form-step_14.cjs.entry.js +154 -21
  5. package/dist/cjs/additional-questions_5.cjs.entry.js +1 -1
  6. package/dist/cjs/{justifi-additional-statement_8.cjs.entry.js → additional-statement_8.cjs.entry.js} +24 -24
  7. package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +5 -5
  8. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  9. package/dist/cjs/{business-identity-schema-DWWtSiUF.js → business-identity-schema-DuFGX6_i.js} +68 -1
  10. package/dist/cjs/{business.service-BheJs82v.js → business.service-Z9OACEQL.js} +1 -2
  11. package/dist/cjs/card-form.cjs.entry.js +2 -2
  12. package/dist/cjs/{check-pkg-version-DFTQGZz1.js → check-pkg-version-CZMgXZID.js} +1 -1
  13. package/dist/cjs/{checkout.service-DZKdHQQq.js → checkout.service-BZOyqXgW.js} +1 -2
  14. package/dist/cjs/{country-config-D7fss2oF.js → country-config-aJp8ScEs.js} +1 -0
  15. package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
  16. package/dist/cjs/{justifi-dispute-notification_3.cjs.entry.js → dispute-notification_2.cjs.entry.js} +67 -90
  17. package/dist/cjs/{event-types-BWQT2lwu.js → event-types-AU1B76Vm.js} +30 -0
  18. package/dist/cjs/form-address-fields_3.cjs.entry.js +3 -3
  19. package/dist/cjs/form-control-date.cjs.entry.js +2 -2
  20. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
  21. package/dist/cjs/form-control-file.cjs.entry.js +2 -2
  22. package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
  23. package/dist/cjs/form-control-number_2.cjs.entry.js +89 -0
  24. package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
  25. package/dist/cjs/form-control-select_2.cjs.entry.js +4 -4
  26. package/dist/cjs/{get-business-TFzhaBXn.js → get-business-aR-C83KX.js} +2 -2
  27. package/dist/cjs/{get-payment-details-DL5FmIyF.js → get-payment-details-dwhA02Zl.js} +2 -3
  28. package/dist/cjs/{get-subaccounts-CVK4O7th.js → get-subaccounts-B1jmSa2d.js} +2 -3
  29. package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
  30. package/dist/cjs/internal-button.cjs.entry.js +1 -1
  31. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +12 -13
  32. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +5 -6
  33. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -6
  34. package/dist/cjs/justifi-billing-form-full.cjs.entry.js +1 -1
  35. package/dist/cjs/justifi-business-details.cjs.entry.js +7 -8
  36. package/dist/cjs/justifi-business-form.cjs.entry.js +12 -14
  37. package/dist/cjs/justifi-card-billing-form-simple.cjs.entry.js +1 -1
  38. package/dist/cjs/justifi-card-form.cjs.entry.js +5 -6
  39. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -5
  40. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +3 -4
  41. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +190 -27
  42. package/dist/cjs/justifi-dispute-management.cjs.entry.js +65 -18
  43. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +11071 -23
  44. package/dist/cjs/justifi-order-terminals.cjs.entry.js +9 -10
  45. package/dist/cjs/justifi-payment-details.cjs.entry.js +16 -17
  46. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +7 -8
  47. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +7 -8
  48. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
  49. package/dist/cjs/justifi-payments-list.cjs.entry.js +7 -8
  50. package/dist/cjs/justifi-payout-details.cjs.entry.js +10 -11
  51. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +7 -8
  52. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +3 -4
  53. package/dist/cjs/justifi-payouts-list.cjs.entry.js +9 -10
  54. package/dist/cjs/justifi-refund-payment.cjs.entry.js +7 -8
  55. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -6
  56. package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
  57. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +4 -5
  58. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +178 -24
  59. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +2 -3
  60. package/dist/cjs/justifi-terminals-list.cjs.entry.js +8 -9
  61. package/dist/cjs/loader.cjs.js +1 -1
  62. package/dist/cjs/{package-bM0MyhTf.js → package-DOiqjXmm.js} +1 -1
  63. package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
  64. package/dist/cjs/{payment-provisioning-actions-BO7dzIm1.js → payment-provisioning-actions-BiSpysjW.js} +2 -2
  65. package/dist/cjs/{payment.service-sZKlg2Jq.js → payment.service-ByrgA_QZ.js} +1 -2
  66. package/dist/cjs/{payout.service-BcQVsMCS.js → payout.service-CnQm_BpU.js} +1 -2
  67. package/dist/cjs/{payouts-status-CwgOMz-S.js → payouts-status-AuS3Mp0V.js} +2 -2
  68. package/dist/cjs/{plaid.service-BcgO2VXC.js → plaid.service-Dlb8EUR8.js} +1 -2
  69. package/dist/cjs/radio-list-item.cjs.entry.js +1 -1
  70. package/dist/cjs/{schema-validations-_yWWnnaG.js → schema-validations-DNPcvDh5.js} +13 -2
  71. package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
  72. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
  73. package/dist/cjs/{terminal.service-CjMMWSh3.js → terminal.service-BdwHQ3Vv.js} +1 -2
  74. package/dist/cjs/{utils-DbTucCTO.js → utils-FVGp6se3.js} +1 -1
  75. package/dist/cjs/webcomponents.cjs.js +1 -1
  76. package/dist/collection/api/Analytics.js +2 -2
  77. package/dist/collection/api/Terminal.js +1 -1
  78. package/dist/collection/collection-manifest.json +10 -16
  79. package/dist/collection/components/business-details/owner-details/owner-details.js +1 -1
  80. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +2 -2
  81. package/dist/collection/components/business-forms/owner-form/owner-form.js +226 -12
  82. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +1 -0
  83. package/dist/collection/components/business-forms/schemas/schema-validations.js +2 -2
  84. package/dist/collection/components/checkout/billing-form/billing-form-full.js +2 -2
  85. package/dist/collection/components/checkout/billing-form/billing-form-schema.js +1 -1
  86. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +2 -2
  87. package/dist/collection/components/checkouts-list/justifi-checkouts-list.js +166 -16
  88. package/dist/collection/components/dispute-management/{justifi-dispute-notification.js → dispute-notification.js} +5 -6
  89. package/dist/collection/components/dispute-management/dispute-response/{justifi-additional-statement.js → additional-statement.js} +3 -3
  90. package/dist/collection/components/dispute-management/dispute-response/{justifi-cancellation-policy.js → cancellation-policy.js} +3 -3
  91. package/dist/collection/components/dispute-management/dispute-response/{justifi-customer-details.js → customer-details.js} +3 -3
  92. package/dist/collection/components/dispute-management/dispute-response/{dispute-response-core.js → dispute-response.js} +105 -77
  93. package/dist/collection/components/dispute-management/dispute-response/{justifi-duplicate-charge.js → duplicate-charge.js} +3 -3
  94. package/dist/collection/components/dispute-management/dispute-response/{justifi-electronic-evidence.js → electronic-evidence.js} +3 -3
  95. package/dist/collection/components/dispute-management/dispute-response/{justifi-product-or-service.js → product-or-service.js} +3 -3
  96. package/dist/collection/components/dispute-management/dispute-response/{justifi-refund-policy.js → refund-policy.js} +3 -3
  97. package/dist/collection/components/dispute-management/dispute-response/{justifi-shipping-details.js → shipping-details.js} +3 -3
  98. package/dist/collection/components/dispute-management/justifi-dispute-management.js +78 -11
  99. package/dist/collection/components/filters/table-filters-menu.js +1 -1
  100. package/dist/collection/components/gross-payment-chart/justifi-gross-payment-chart.js +79 -15
  101. package/dist/collection/components/modular-checkout/justifi-modular-checkout.js +1 -1
  102. package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-billing-form-simple.js +1 -1
  103. package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-form.js +1 -1
  104. package/dist/collection/components/modular-checkout/sub-components/justifi-billing-form-full.js +1 -1
  105. package/dist/collection/components/modular-checkout/sub-components/justifi-card-billing-form-simple.js +1 -1
  106. package/dist/collection/components/modular-checkout/sub-components/justifi-card-form.js +1 -1
  107. package/dist/collection/components/modular-checkout/sub-components/justifi-checkout-summary.js +1 -1
  108. package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
  109. package/dist/collection/components/order-terminals/justifi-order-terminals.js +1 -1
  110. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
  111. package/dist/collection/components/payment-details/justifi-payment-details.js +8 -8
  112. package/dist/collection/components/payment-transactions-list/justifi-payment-transactions-list.js +1 -1
  113. package/dist/collection/components/payments-list/justifi-payments-list-filters.js +2 -2
  114. package/dist/collection/components/payments-list/justifi-payments-list.js +1 -1
  115. package/dist/collection/components/payout-details/justifi-payout-details.js +3 -3
  116. package/dist/collection/components/payout-transactions-list/justifi-payout-transactions-list.js +1 -1
  117. package/dist/collection/components/payouts-list/justifi-payouts-list-filters.js +2 -2
  118. package/dist/collection/components/payouts-list/justifi-payouts-list.js +1 -1
  119. package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list-filters.js +3 -3
  120. package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list.js +134 -10
  121. package/dist/collection/components/terminals-list/justifi-terminals-list-filters.js +1 -1
  122. package/dist/collection/components/terminals-list/justifi-terminals-list.js +1 -1
  123. package/dist/collection/components/tokenize-payment-method/justifi-tokenize-payment-method.js +1 -1
  124. package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
  125. package/dist/collection/ui-components/form/form-control-date.js +2 -2
  126. package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
  127. package/dist/collection/ui-components/form/form-control-file.js +2 -2
  128. package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
  129. package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
  130. package/dist/collection/ui-components/form/form-control-number.js +2 -2
  131. package/dist/collection/ui-components/form/form-control-radio.js +2 -2
  132. package/dist/collection/ui-components/form/form-control-select.js +2 -2
  133. package/dist/collection/ui-components/form/form-control-text.js +2 -2
  134. package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
  135. package/dist/collection/ui-components/form/hidden-input.js +1 -1
  136. package/dist/collection/ui-components/form/iframe-input.js +3 -3
  137. package/dist/collection/ui-components/internal-button.js +1 -1
  138. package/dist/collection/ui-components/radio-list-item.js +1 -1
  139. package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
  140. package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
  141. package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
  142. package/dist/collection/utils/checkout-billing-state-options.js +12 -0
  143. package/dist/docs.json +5763 -6945
  144. package/dist/esm/{Analytics-Cyc3ZLPx.js → Analytics-Cg17Xhj_.js} +4 -5
  145. package/dist/esm/{Plaid-BuKEVgbB.js → Plaid-l6nNIjab.js} +58 -3
  146. package/dist/esm/additional-questions-details_5.entry.js +3 -3
  147. package/dist/esm/additional-questions-form-step_14.entry.js +156 -23
  148. package/dist/esm/additional-questions_5.entry.js +2 -2
  149. package/dist/esm/{justifi-additional-statement_8.entry.js → additional-statement_8.entry.js} +18 -18
  150. package/dist/esm/{badge-B6dp1XGV.js → badge-Dlcl9qdm.js} +1 -1
  151. package/dist/esm/bank-account-billing-form-simple_4.entry.js +7 -7
  152. package/dist/esm/bank-account-form.entry.js +4 -4
  153. package/dist/esm/bank-account-read-only-value.entry.js +1 -1
  154. package/dist/esm/business-identity-schema-0Q3kck3C.js +163 -0
  155. package/dist/esm/{business.service-BPbZ5fxQ.js → business.service-C31wbMVs.js} +1 -2
  156. package/dist/esm/{button-DRdaAudE.js → button-BvzOzV4l.js} +1 -1
  157. package/dist/esm/card-form.entry.js +4 -4
  158. package/dist/esm/{check-pkg-version-6iGDh82c.js → check-pkg-version-D-rHqtUI.js} +1 -1
  159. package/dist/esm/{checkout.service-CJMfFKyS.js → checkout.service-cVdOGDuI.js} +1 -2
  160. package/dist/esm/{country-config-P042rrI3.js → country-config-CdvhLcnT.js} +1 -1
  161. package/dist/esm/custom-popper_2.entry.js +3 -3
  162. package/dist/esm/{justifi-dispute-notification_3.entry.js → dispute-notification_2.entry.js} +68 -90
  163. package/dist/esm/{event-types-Bg2SZArf.js → event-types-DalU_6SB.js} +29 -1
  164. package/dist/esm/form-address-fields_3.entry.js +5 -5
  165. package/dist/esm/form-control-checkbox.entry.js +3 -3
  166. package/dist/esm/form-control-date.entry.js +4 -4
  167. package/dist/esm/{form-control-error-text-DVedKyhp.js → form-control-error-text-Di9QePY5.js} +1 -1
  168. package/dist/esm/form-control-file-v2_2.entry.js +5 -5
  169. package/dist/esm/form-control-file.entry.js +4 -4
  170. package/dist/esm/{form-control-help-text-D-349cNw.js → form-control-help-text-DGMpMuAm.js} +1 -1
  171. package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
  172. package/dist/esm/form-control-monetary.entry.js +5 -5
  173. package/dist/esm/form-control-number_2.entry.js +86 -0
  174. package/dist/esm/form-control-radio.entry.js +3 -3
  175. package/dist/esm/form-control-select_2.entry.js +6 -6
  176. package/dist/esm/{get-business-DIpEbczl.js → get-business-Gg6qn5on.js} +2 -2
  177. package/dist/esm/{get-payment-details-DjBou5Fu.js → get-payment-details-BiWgSJau.js} +2 -3
  178. package/dist/esm/{get-subaccounts-CgDWE_5o.js → get-subaccounts-CkjZeR9U.js} +2 -3
  179. package/dist/esm/{header-1-Bl7MHW0w.js → header-1-evYxFIGN.js} +1 -1
  180. package/dist/esm/{header-3-C7JJVnMG.js → header-3-BUDap2xY.js} +1 -1
  181. package/dist/esm/hidden-input_2.entry.js +7 -7
  182. package/dist/esm/{insurance-state-qTdpe84i.js → insurance-state-CLGc1-_4.js} +1 -1
  183. package/dist/esm/internal-button.entry.js +3 -3
  184. package/dist/esm/justifi-apple-pay_11.entry.js +17 -18
  185. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +5 -6
  186. package/dist/esm/justifi-bank-account-form.entry.js +5 -6
  187. package/dist/esm/justifi-billing-form-full.entry.js +1 -1
  188. package/dist/esm/justifi-business-details.entry.js +10 -11
  189. package/dist/esm/justifi-business-form.entry.js +14 -16
  190. package/dist/esm/justifi-card-billing-form-simple.entry.js +1 -1
  191. package/dist/esm/justifi-card-form.entry.js +5 -6
  192. package/dist/esm/justifi-checkout.entry.js +5 -6
  193. package/dist/esm/justifi-checkouts-list-filters.entry.js +4 -5
  194. package/dist/esm/justifi-checkouts-list.entry.js +190 -27
  195. package/dist/esm/justifi-details.entry.js +2 -2
  196. package/dist/esm/justifi-dispute-management.entry.js +64 -17
  197. package/dist/esm/justifi-gross-payment-chart.entry.js +11071 -23
  198. package/dist/esm/justifi-order-terminals.entry.js +11 -12
  199. package/dist/esm/justifi-payment-details.entry.js +20 -21
  200. package/dist/esm/justifi-payment-provisioning.entry.js +11 -12
  201. package/dist/esm/justifi-payment-transactions-list.entry.js +10 -11
  202. package/dist/esm/justifi-payments-list-filters.entry.js +3 -3
  203. package/dist/esm/justifi-payments-list.entry.js +12 -13
  204. package/dist/esm/justifi-payout-details.entry.js +15 -16
  205. package/dist/esm/justifi-payout-transactions-list.entry.js +10 -11
  206. package/dist/esm/justifi-payouts-list-filters.entry.js +4 -5
  207. package/dist/esm/justifi-payouts-list.entry.js +13 -14
  208. package/dist/esm/justifi-refund-payment.entry.js +10 -11
  209. package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
  210. package/dist/esm/justifi-season-interruption-insurance.entry.js +8 -9
  211. package/dist/esm/justifi-skeleton.entry.js +3 -3
  212. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +5 -6
  213. package/dist/esm/justifi-terminal-orders-list.entry.js +175 -21
  214. package/dist/esm/justifi-terminals-list-filters.entry.js +3 -4
  215. package/dist/esm/justifi-terminals-list.entry.js +12 -13
  216. package/dist/esm/loader.js +1 -1
  217. package/dist/esm/{package-beXEDfB9.js → package-B6YPrwyC.js} +1 -1
  218. package/dist/esm/pagination-menu.entry.js +1 -1
  219. package/dist/esm/{parts-DnrawQn3.js → parts-CPKMvyV_.js} +1 -1
  220. package/dist/esm/payment-method-option.entry.js +2 -2
  221. package/dist/esm/{payment-provisioning-actions-Dr0YIShV.js → payment-provisioning-actions-cl5xIYnF.js} +2 -2
  222. package/dist/esm/payment-provisioning-form-buttons_2.entry.js +2 -2
  223. package/dist/esm/{payment-provisioning-loading-DI2wDkhm.js → payment-provisioning-loading-Dve2xQA4.js} +1 -1
  224. package/dist/esm/{payment.service-Ckbb7gXA.js → payment.service-5_u-UzTY.js} +1 -2
  225. package/dist/esm/{payments-status-BIDoGw-m.js → payments-status-BlVUt4C1.js} +1 -1
  226. package/dist/esm/{payout.service-BgFKxEoL.js → payout.service-D2zS5y8N.js} +1 -2
  227. package/dist/esm/{payouts-status-1T2NZBoE.js → payouts-status-DCjCGTaa.js} +3 -3
  228. package/dist/esm/{plaid.service-BLguQHs_.js → plaid.service-BiJ65YG8.js} +1 -2
  229. package/dist/esm/radio-list-item.entry.js +2 -2
  230. package/dist/esm/{schema-validations-v6WGlZkq.js → schema-validations-A1o1biOB.js} +13 -3
  231. package/dist/esm/{skeleton-CXGFVqDf.js → skeleton-BEHo2ypu.js} +1 -1
  232. package/dist/esm/{spinner-kSw6PcwU.js → spinner-DIiQZd6_.js} +1 -1
  233. package/dist/esm/{table-CcyuIutB.js → table-DqGfsdys.js} +3 -3
  234. package/dist/esm/table-filters-menu.entry.js +3 -3
  235. package/dist/esm/terminal-quantity-selector.entry.js +2 -2
  236. package/dist/esm/{terminal.service-0oISl5j-.js → terminal.service-CIxDfM7V.js} +1 -2
  237. package/dist/esm/{utils-DcfpJGDZ.js → utils-C1B2hVAB.js} +1 -1
  238. package/dist/esm/{utils-BxYS3WDw.js → utils-CX6puxwf.js} +1 -1
  239. package/dist/esm/webcomponents.js +1 -1
  240. package/dist/module/Analytics.js +2 -2
  241. package/dist/module/Plaid.js +2 -2
  242. package/dist/module/{justifi-refund-policy.d.ts → additional-statement.d.ts} +4 -4
  243. package/dist/module/additional-statement.js +6 -0
  244. package/dist/module/{justifi-additional-statement2.js → additional-statement2.js} +8 -8
  245. package/dist/module/badge.js +1 -1
  246. package/dist/module/bank-account-billing-form-simple2.js +1 -1
  247. package/dist/module/billing-form-full2.js +3 -3
  248. package/dist/module/billing-form-schema.js +1 -1
  249. package/dist/module/business-address-schema.js +1 -1
  250. package/dist/module/business-bank-account-form-step2.js +2 -2
  251. package/dist/module/business-core-info-schema.js +1 -1
  252. package/dist/module/business-identity-schema.js +1 -1
  253. package/dist/module/business-owners-form-step2.js +21 -26
  254. package/dist/module/button.js +1 -1
  255. package/dist/module/cancellation-policy.d.ts +11 -0
  256. package/dist/module/cancellation-policy.js +6 -0
  257. package/dist/module/{justifi-cancellation-policy2.js → cancellation-policy2.js} +8 -8
  258. package/dist/module/card-billing-form-simple2.js +1 -1
  259. package/dist/module/country-config.js +1 -1
  260. package/dist/module/custom-popper2.js +2 -2
  261. package/dist/module/{checkouts-list-core.d.ts → customer-details.d.ts} +4 -4
  262. package/dist/module/customer-details.js +6 -0
  263. package/dist/module/{justifi-customer-details2.js → customer-details2.js} +8 -8
  264. package/dist/module/dispute-notification.d.ts +11 -0
  265. package/dist/module/dispute-notification.js +6 -0
  266. package/dist/module/dispute-notification2.js +82 -0
  267. package/dist/module/dispute-response.d.ts +11 -0
  268. package/dist/module/dispute-response.js +6 -0
  269. package/dist/module/{dispute-response-core.js → dispute-response2.js} +105 -53
  270. package/dist/module/duplicate-charge.d.ts +11 -0
  271. package/dist/module/duplicate-charge.js +6 -0
  272. package/dist/module/{justifi-duplicate-charge2.js → duplicate-charge2.js} +8 -8
  273. package/dist/module/electronic-evidence.d.ts +11 -0
  274. package/dist/module/electronic-evidence.js +6 -0
  275. package/dist/module/{justifi-electronic-evidence2.js → electronic-evidence2.js} +8 -8
  276. package/dist/module/event-types3.js +119 -1
  277. package/dist/module/form-alert2.js +1 -1
  278. package/dist/module/form-control-date2.js +2 -2
  279. package/dist/module/form-control-file-v22.js +1 -1
  280. package/dist/module/form-control-file2.js +2 -2
  281. package/dist/module/form-control-monetary2.js +2 -2
  282. package/dist/module/form-control-number-masked2.js +2 -2
  283. package/dist/module/form-control-number2.js +3 -3
  284. package/dist/module/form-control-radio2.js +2 -2
  285. package/dist/module/form-control-select2.js +2 -2
  286. package/dist/module/form-control-text2.js +2 -2
  287. package/dist/module/form-control-textarea2.js +3 -3
  288. package/dist/module/get-payment-details.js +1 -1
  289. package/dist/module/hidden-input2.js +2 -2
  290. package/dist/module/iframe-input2.js +4 -4
  291. package/dist/module/internal-button2.js +1 -1
  292. package/dist/module/justifi-bank-account-billing-form-simple.js +1 -1
  293. package/dist/module/justifi-bank-account-form.js +1 -1
  294. package/dist/module/justifi-billing-form-full.js +1 -1
  295. package/dist/module/justifi-button2.js +1 -1
  296. package/dist/module/justifi-card-billing-form-simple.js +1 -1
  297. package/dist/module/justifi-card-form.js +1 -1
  298. package/dist/module/justifi-checkout-summary2.js +1 -1
  299. package/dist/module/justifi-checkouts-list-filters.js +3 -3
  300. package/dist/module/justifi-checkouts-list.js +197 -28
  301. package/dist/module/justifi-dispute-management.js +103 -62
  302. package/dist/module/justifi-gross-payment-chart.js +11074 -24
  303. package/dist/module/justifi-header2.js +1 -1
  304. package/dist/module/justifi-modular-checkout2.js +2 -2
  305. package/dist/module/justifi-order-terminals.js +4 -4
  306. package/dist/module/justifi-payment-details.js +9 -9
  307. package/dist/module/justifi-payment-provisioning.js +53 -59
  308. package/dist/module/justifi-payment-transactions-list.js +2 -2
  309. package/dist/module/justifi-payments-list-filters.js +2 -2
  310. package/dist/module/justifi-payments-list.js +2 -2
  311. package/dist/module/justifi-payout-details.js +4 -4
  312. package/dist/module/justifi-payout-transactions-list.js +2 -2
  313. package/dist/module/justifi-payouts-list-filters.js +3 -3
  314. package/dist/module/justifi-payouts-list.js +2 -2
  315. package/dist/module/justifi-season-interruption-insurance.js +1 -1
  316. package/dist/module/justifi-skeleton.js +1 -1
  317. package/dist/module/justifi-terminal-orders-list-filters.js +4 -4
  318. package/dist/module/justifi-terminal-orders-list.js +184 -22
  319. package/dist/module/justifi-terminals-list-filters.js +2 -2
  320. package/dist/module/justifi-terminals-list.js +3 -3
  321. package/dist/module/justifi-tokenize-payment-method2.js +1 -1
  322. package/dist/module/owner-details2.js +1 -1
  323. package/dist/module/owner-form-inputs2.js +2 -2
  324. package/dist/module/owner-form2.js +177 -33
  325. package/dist/module/package.js +1 -1
  326. package/dist/module/pagination-menu2.js +1 -1
  327. package/dist/module/parts.js +1 -1
  328. package/dist/module/payment-method-option.js +1 -1
  329. package/dist/module/payment-provisioning-form-steps2.js +52 -58
  330. package/dist/module/product-or-service.d.ts +11 -0
  331. package/dist/module/product-or-service.js +6 -0
  332. package/dist/module/{justifi-product-or-service2.js → product-or-service2.js} +8 -8
  333. package/dist/module/radio-list-item2.js +1 -1
  334. package/dist/module/{owner-form-core.d.ts → refund-policy.d.ts} +4 -4
  335. package/dist/module/refund-policy.js +6 -0
  336. package/dist/module/{justifi-refund-policy2.js → refund-policy2.js} +8 -8
  337. package/dist/module/schema-validations.js +13 -3
  338. package/dist/module/shipping-details.d.ts +11 -0
  339. package/dist/module/shipping-details.js +6 -0
  340. package/dist/module/{justifi-shipping-details2.js → shipping-details2.js} +8 -8
  341. package/dist/module/spinner.js +1 -1
  342. package/dist/module/table-filters-menu2.js +1 -1
  343. package/dist/module/terminal-quantity-selector2.js +1 -1
  344. package/dist/module/utils2.js +1 -1
  345. package/dist/types/api/Terminal.d.ts +1 -1
  346. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +69 -5
  347. package/dist/types/components/checkouts-list/justifi-checkouts-list.d.ts +28 -6
  348. package/dist/types/components/dispute-management/{justifi-dispute-notification.d.ts → dispute-notification.d.ts} +1 -1
  349. package/dist/types/components/dispute-management/dispute-response/{justifi-additional-statement.d.ts → additional-statement.d.ts} +1 -1
  350. package/dist/types/components/dispute-management/dispute-response/{justifi-cancellation-policy.d.ts → cancellation-policy.d.ts} +1 -1
  351. package/dist/types/components/dispute-management/dispute-response/{justifi-customer-details.d.ts → customer-details.d.ts} +1 -1
  352. package/dist/types/components/dispute-management/dispute-response/{dispute-response-core.d.ts → dispute-response.d.ts} +21 -10
  353. package/dist/types/components/dispute-management/dispute-response/{justifi-duplicate-charge.d.ts → duplicate-charge.d.ts} +1 -1
  354. package/dist/types/components/dispute-management/dispute-response/{justifi-electronic-evidence.d.ts → electronic-evidence.d.ts} +1 -1
  355. package/dist/types/components/dispute-management/dispute-response/{justifi-product-or-service.d.ts → product-or-service.d.ts} +1 -1
  356. package/dist/types/components/dispute-management/dispute-response/{justifi-refund-policy.d.ts → refund-policy.d.ts} +1 -1
  357. package/dist/types/components/dispute-management/dispute-response/{justifi-shipping-details.d.ts → shipping-details.d.ts} +1 -1
  358. package/dist/types/components/dispute-management/justifi-dispute-management.d.ts +10 -2
  359. package/dist/types/components/gross-payment-chart/justifi-gross-payment-chart.d.ts +13 -2
  360. package/dist/types/components/terminal-orders-list/justifi-terminal-orders-list.d.ts +21 -3
  361. package/dist/types/components.d.ts +304 -551
  362. package/dist/types/utils/checkout-billing-state-options.d.ts +9 -0
  363. package/dist/webcomponents/p-0708cb76.entry.js +1 -0
  364. package/dist/webcomponents/p-0ce6c1b1.entry.js +1 -0
  365. package/dist/webcomponents/p-12ae030d.entry.js +1 -0
  366. package/dist/webcomponents/p-137a36a4.entry.js +1 -0
  367. package/dist/webcomponents/p-1d294e34.entry.js +1 -0
  368. package/dist/webcomponents/{p-4d21df48.entry.js → p-1f34b2f7.entry.js} +1 -1
  369. package/dist/webcomponents/p-1f7f2436.entry.js +1 -0
  370. package/dist/webcomponents/{p-256c5509.entry.js → p-22d19755.entry.js} +1 -1
  371. package/dist/webcomponents/p-2aac2ab6.entry.js +1 -0
  372. package/dist/webcomponents/{p-2425a375.entry.js → p-2dfdecbb.entry.js} +1 -1
  373. package/dist/webcomponents/p-397b28ba.entry.js +20 -0
  374. package/dist/webcomponents/{p-10be75b8.entry.js → p-3cefb032.entry.js} +1 -1
  375. package/dist/webcomponents/p-45668f01.entry.js +1 -0
  376. package/dist/webcomponents/p-46477dfe.entry.js +1 -0
  377. package/dist/webcomponents/{p-befe01ef.entry.js → p-49c13952.entry.js} +1 -1
  378. package/dist/webcomponents/p-4ccf9cd7.entry.js +1 -0
  379. package/dist/webcomponents/p-58b5e08e.entry.js +1 -0
  380. package/dist/webcomponents/p-5G1OMxZz.js +1 -0
  381. package/dist/webcomponents/{p-1e877e0a.entry.js → p-5ec9634c.entry.js} +1 -1
  382. package/dist/webcomponents/{p-8253ef9f.entry.js → p-605bd107.entry.js} +1 -1
  383. package/dist/webcomponents/{p-c9e1df15.entry.js → p-60c65da4.entry.js} +1 -1
  384. package/dist/webcomponents/p-63b7abf3.entry.js +1 -0
  385. package/dist/webcomponents/p-63e88b48.entry.js +1 -0
  386. package/dist/webcomponents/p-65281b33.entry.js +1 -0
  387. package/dist/webcomponents/{p-3c046adc.entry.js → p-70dcd833.entry.js} +1 -1
  388. package/dist/webcomponents/p-7ebed752.entry.js +1 -0
  389. package/dist/webcomponents/p-7ff9ce05.entry.js +1 -0
  390. package/dist/webcomponents/p-8964f4ca.entry.js +1 -0
  391. package/dist/webcomponents/p-89844a98.entry.js +1 -0
  392. package/dist/webcomponents/p-89cd31f2.entry.js +1 -0
  393. package/dist/webcomponents/p-8d6856e7.entry.js +1 -0
  394. package/dist/webcomponents/p-8e821593.entry.js +1 -0
  395. package/dist/webcomponents/p-90f2f71d.entry.js +1 -0
  396. package/dist/webcomponents/p-9153c121.entry.js +1 -0
  397. package/dist/webcomponents/p-91940d05.entry.js +1 -0
  398. package/dist/webcomponents/p-95317547.entry.js +1 -0
  399. package/dist/webcomponents/p-9b944aa4.entry.js +1 -0
  400. package/dist/webcomponents/{p-CR_-qIuN.js → p-APOabprT.js} +1 -1
  401. package/dist/webcomponents/p-Aacb4jqT.js +1 -0
  402. package/dist/webcomponents/p-B5gBiARs.js +1 -0
  403. package/dist/webcomponents/p-B6YPrwyC.js +1 -0
  404. package/dist/webcomponents/{p-bn_huKYG.js → p-BICxxa69.js} +1 -1
  405. package/dist/webcomponents/p-BJu1-9kE.js +1 -0
  406. package/dist/webcomponents/{p-Cej-1bD6.js → p-BXyADlAH.js} +1 -1
  407. package/dist/webcomponents/p-Ba8jdOkX.js +1 -0
  408. package/dist/webcomponents/p-BxKbnILQ.js +1 -0
  409. package/dist/webcomponents/{p-2LVpxCS_.js → p-CHo7TfsM.js} +1 -1
  410. package/dist/webcomponents/p-CHw7tICr.js +1 -0
  411. package/dist/webcomponents/{p-DnrawQn3.js → p-CPKMvyV_.js} +1 -1
  412. package/dist/webcomponents/p-Ce_W43gc.js +1 -0
  413. package/dist/webcomponents/{p-B5vVjDc_.js → p-Cm9f5fyh.js} +1 -1
  414. package/dist/webcomponents/p-CqiVXthx.js +1 -0
  415. package/dist/webcomponents/{p-x9fFFf7F.js → p-Cu7hgXL1.js} +1 -1
  416. package/dist/webcomponents/p-D-zwk1J3.js +1 -0
  417. package/dist/webcomponents/{p-D1D2eC05.js → p-D1_eip6x.js} +1 -1
  418. package/dist/webcomponents/p-D8ytux5N.js +1 -0
  419. package/dist/webcomponents/p-DO9lqnbB.js +1 -0
  420. package/dist/webcomponents/p-DSclFZ32.js +1 -0
  421. package/dist/webcomponents/p-DYHjzFnJ.js +1 -0
  422. package/dist/webcomponents/{p-DgH-jcIo.js → p-DjjAx7PF.js} +1 -1
  423. package/dist/webcomponents/p-Dk26hk5T.js +1 -0
  424. package/dist/webcomponents/p-DrMJliVY.js +1 -0
  425. package/dist/webcomponents/p-NZS8uCtH.js +1 -0
  426. package/dist/webcomponents/p-XIWgia4J.js +1 -0
  427. package/dist/webcomponents/{p-9581d6a1.entry.js → p-a9695714.entry.js} +1 -1
  428. package/dist/webcomponents/p-afe714cb.entry.js +1 -0
  429. package/dist/webcomponents/p-av6jyzyC.js +1 -0
  430. package/dist/webcomponents/p-b0b6083f.entry.js +1 -0
  431. package/dist/webcomponents/p-b192f251.entry.js +1 -0
  432. package/dist/webcomponents/p-b436a7d2.entry.js +1 -0
  433. package/dist/webcomponents/{p-e6e56dbb.entry.js → p-b62ff001.entry.js} +1 -1
  434. package/dist/webcomponents/p-bde7fe69.entry.js +1 -0
  435. package/dist/webcomponents/p-c108cd71.entry.js +1 -0
  436. package/dist/webcomponents/p-c1539656.entry.js +1 -0
  437. package/dist/webcomponents/p-c4415366.entry.js +1 -0
  438. package/dist/webcomponents/p-c8bc235f.entry.js +1 -0
  439. package/dist/webcomponents/{p-09d2efad.entry.js → p-ca87c609.entry.js} +1 -1
  440. package/dist/webcomponents/p-d1eabad2.entry.js +1 -0
  441. package/dist/webcomponents/{p-31e74a5a.entry.js → p-d5e7291a.entry.js} +1 -1
  442. package/dist/webcomponents/p-d79c5ee4.entry.js +1 -0
  443. package/dist/webcomponents/{p-9db1444f.entry.js → p-db09f306.entry.js} +1 -1
  444. package/dist/webcomponents/{p-354fb3c4.entry.js → p-e020f003.entry.js} +1 -1
  445. package/dist/webcomponents/p-e17b92ec.entry.js +1 -0
  446. package/dist/webcomponents/{p-1e8135f0.entry.js → p-e322dcba.entry.js} +1 -1
  447. package/dist/webcomponents/p-e5c2215a.entry.js +1 -0
  448. package/dist/webcomponents/p-e6ec9e6d.entry.js +1 -0
  449. package/dist/webcomponents/p-f1b9cbf0.entry.js +1 -0
  450. package/dist/webcomponents/p-f9aafb21.entry.js +1 -0
  451. package/dist/webcomponents/p-fE5A37L5.js +1 -0
  452. package/dist/webcomponents/{p-bc2af6b4.entry.js → p-ff8cf16c.entry.js} +1 -1
  453. package/dist/webcomponents/p-jIDKmNHy.js +1 -0
  454. package/dist/webcomponents/p-nb_LhbJq.js +1 -0
  455. package/dist/webcomponents/p-oTtn8xDw.js +1 -0
  456. package/dist/webcomponents/p-uZ5KAseb.js +1 -0
  457. package/dist/webcomponents/webcomponents.esm.js +1 -1
  458. package/package.json +2 -2
  459. package/readme.md +7 -14
  460. package/dist/cjs/Dispute-CruQTF6_.js +0 -59
  461. package/dist/cjs/business-additional-questions-schema-CI80eZLJ.js +0 -73
  462. package/dist/cjs/checkouts-list-core.cjs.entry.js +0 -146
  463. package/dist/cjs/checkouts-table-CCxrsy0x.js +0 -55
  464. package/dist/cjs/dispute.service-BbtwY673.js +0 -32
  465. package/dist/cjs/form-control-number_3.cjs.entry.js +0 -249
  466. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +0 -11075
  467. package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +0 -61
  468. package/dist/cjs/terminal-orders-list-core.cjs.entry.js +0 -108
  469. package/dist/cjs/terminal-orders-table-Cz6qvzVE.js +0 -83
  470. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +0 -523
  471. package/dist/collection/components/checkouts-list/checkouts-list-core.js +0 -262
  472. package/dist/collection/components/dispute-management/dispute-management-core.js +0 -169
  473. package/dist/collection/components/dispute-management/dispute-response/justifi-dispute-response.js +0 -190
  474. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +0 -139
  475. package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +0 -199
  476. package/dist/esm/Dispute-BH0Xfn-F.js +0 -57
  477. package/dist/esm/business-additional-questions-schema-DKudYaoE.js +0 -69
  478. package/dist/esm/business-identity-schema-CFhSc0cA.js +0 -99
  479. package/dist/esm/checkouts-list-core.entry.js +0 -144
  480. package/dist/esm/checkouts-table-C8sPHeTm.js +0 -51
  481. package/dist/esm/dispute.service-vlYGy0nR.js +0 -30
  482. package/dist/esm/form-control-number_3.entry.js +0 -245
  483. package/dist/esm/gross-payment-chart-core.entry.js +0 -11073
  484. package/dist/esm/justifi-dispute-management-core.entry.js +0 -59
  485. package/dist/esm/terminal-orders-list-core.entry.js +0 -106
  486. package/dist/esm/terminal-orders-table-C7KOcRpq.js +0 -79
  487. package/dist/module/checkouts-list-core.js +0 -6
  488. package/dist/module/checkouts-list-core2.js +0 -227
  489. package/dist/module/dispute-management-core.js +0 -193
  490. package/dist/module/dispute-response-actions.js +0 -119
  491. package/dist/module/gross-payment-chart-core.d.ts +0 -11
  492. package/dist/module/gross-payment-chart-core.js +0 -6
  493. package/dist/module/gross-payment-chart-core2.js +0 -11096
  494. package/dist/module/justifi-additional-statement.d.ts +0 -11
  495. package/dist/module/justifi-additional-statement.js +0 -6
  496. package/dist/module/justifi-cancellation-policy.d.ts +0 -11
  497. package/dist/module/justifi-cancellation-policy.js +0 -6
  498. package/dist/module/justifi-customer-details.d.ts +0 -11
  499. package/dist/module/justifi-customer-details.js +0 -6
  500. package/dist/module/justifi-dispute-management-core.d.ts +0 -11
  501. package/dist/module/justifi-dispute-management-core.js +0 -6
  502. package/dist/module/justifi-dispute-notification.d.ts +0 -11
  503. package/dist/module/justifi-dispute-notification.js +0 -6
  504. package/dist/module/justifi-dispute-notification2.js +0 -85
  505. package/dist/module/justifi-dispute-response-core.d.ts +0 -11
  506. package/dist/module/justifi-dispute-response-core.js +0 -6
  507. package/dist/module/justifi-dispute-response.d.ts +0 -11
  508. package/dist/module/justifi-dispute-response.js +0 -6
  509. package/dist/module/justifi-dispute-response2.js +0 -198
  510. package/dist/module/justifi-duplicate-charge.d.ts +0 -11
  511. package/dist/module/justifi-duplicate-charge.js +0 -6
  512. package/dist/module/justifi-electronic-evidence.d.ts +0 -11
  513. package/dist/module/justifi-electronic-evidence.js +0 -6
  514. package/dist/module/justifi-product-or-service.d.ts +0 -11
  515. package/dist/module/justifi-product-or-service.js +0 -6
  516. package/dist/module/justifi-refund-policy.js +0 -6
  517. package/dist/module/justifi-shipping-details.d.ts +0 -11
  518. package/dist/module/justifi-shipping-details.js +0 -6
  519. package/dist/module/owner-form-core.js +0 -6
  520. package/dist/module/owner-form-core2.js +0 -262
  521. package/dist/module/terminal-orders-list-core.d.ts +0 -11
  522. package/dist/module/terminal-orders-list-core.js +0 -6
  523. package/dist/module/terminal-orders-list-core2.js +0 -209
  524. package/dist/types/components/business-forms/owner-form/owner-form-core.d.ts +0 -88
  525. package/dist/types/components/checkouts-list/checkouts-list-core.d.ts +0 -34
  526. package/dist/types/components/dispute-management/dispute-management-core.d.ts +0 -18
  527. package/dist/types/components/dispute-management/dispute-response/justifi-dispute-response.d.ts +0 -35
  528. package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +0 -21
  529. package/dist/types/components/terminal-orders-list/terminal-orders-list-core.d.ts +0 -28
  530. package/dist/webcomponents/p--e0ff06z.js +0 -1
  531. package/dist/webcomponents/p-032b4553.entry.js +0 -1
  532. package/dist/webcomponents/p-042daaf8.entry.js +0 -1
  533. package/dist/webcomponents/p-0638f0bd.entry.js +0 -1
  534. package/dist/webcomponents/p-0b3f4f22.entry.js +0 -1
  535. package/dist/webcomponents/p-1c4f5f1d.entry.js +0 -1
  536. package/dist/webcomponents/p-24935254.entry.js +0 -1
  537. package/dist/webcomponents/p-2a755daf.entry.js +0 -1
  538. package/dist/webcomponents/p-3488951f.entry.js +0 -1
  539. package/dist/webcomponents/p-437a99dc.entry.js +0 -1
  540. package/dist/webcomponents/p-49c0cd3a.entry.js +0 -1
  541. package/dist/webcomponents/p-50f5e313.entry.js +0 -1
  542. package/dist/webcomponents/p-52908814.entry.js +0 -1
  543. package/dist/webcomponents/p-587886f1.entry.js +0 -1
  544. package/dist/webcomponents/p-5ef355ce.entry.js +0 -1
  545. package/dist/webcomponents/p-5ef854e0.entry.js +0 -1
  546. package/dist/webcomponents/p-67498c25.entry.js +0 -1
  547. package/dist/webcomponents/p-6917aa3c.entry.js +0 -1
  548. package/dist/webcomponents/p-6d81822f.entry.js +0 -1
  549. package/dist/webcomponents/p-6f0c582a.entry.js +0 -1
  550. package/dist/webcomponents/p-80652cf8.entry.js +0 -1
  551. package/dist/webcomponents/p-82fe02e4.entry.js +0 -1
  552. package/dist/webcomponents/p-83147f23.entry.js +0 -1
  553. package/dist/webcomponents/p-8c2427ed.entry.js +0 -1
  554. package/dist/webcomponents/p-92de00d7.entry.js +0 -1
  555. package/dist/webcomponents/p-94306884.entry.js +0 -1
  556. package/dist/webcomponents/p-9937e2e7.entry.js +0 -1
  557. package/dist/webcomponents/p-9dca1331.entry.js +0 -1
  558. package/dist/webcomponents/p-9f74d7ea.entry.js +0 -1
  559. package/dist/webcomponents/p-B--N37zY.js +0 -1
  560. package/dist/webcomponents/p-BH0Xfn-F.js +0 -1
  561. package/dist/webcomponents/p-Bg2SZArf.js +0 -1
  562. package/dist/webcomponents/p-BovgIz83.js +0 -1
  563. package/dist/webcomponents/p-BsQy297i.js +0 -1
  564. package/dist/webcomponents/p-CDf5H0TB.js +0 -1
  565. package/dist/webcomponents/p-CUI41_5y.js +0 -1
  566. package/dist/webcomponents/p-CX36GHQP.js +0 -1
  567. package/dist/webcomponents/p-Cf6HoQKl.js +0 -1
  568. package/dist/webcomponents/p-CsdYMTrc.js +0 -1
  569. package/dist/webcomponents/p-D4OlsyTo.js +0 -1
  570. package/dist/webcomponents/p-D8EGHc_m.js +0 -1
  571. package/dist/webcomponents/p-DPmnGTmg.js +0 -1
  572. package/dist/webcomponents/p-DWevPe7C.js +0 -1
  573. package/dist/webcomponents/p-Dbg501Lu.js +0 -1
  574. package/dist/webcomponents/p-DcBvJu0k.js +0 -1
  575. package/dist/webcomponents/p-DkdzUTnl.js +0 -1
  576. package/dist/webcomponents/p-HT_4DkD0.js +0 -1
  577. package/dist/webcomponents/p-MDZuGvsl.js +0 -1
  578. package/dist/webcomponents/p-XrKLre8M.js +0 -1
  579. package/dist/webcomponents/p-_-2E_vYf.js +0 -1
  580. package/dist/webcomponents/p-a75d76ff.entry.js +0 -1
  581. package/dist/webcomponents/p-a7778957.entry.js +0 -1
  582. package/dist/webcomponents/p-a9d7cdae.entry.js +0 -1
  583. package/dist/webcomponents/p-b060a9c9.entry.js +0 -1
  584. package/dist/webcomponents/p-b06910b0.entry.js +0 -1
  585. package/dist/webcomponents/p-b483e71b.entry.js +0 -1
  586. package/dist/webcomponents/p-bdf21f71.entry.js +0 -1
  587. package/dist/webcomponents/p-be5d1005.entry.js +0 -1
  588. package/dist/webcomponents/p-beXEDfB9.js +0 -1
  589. package/dist/webcomponents/p-bfe2583d.entry.js +0 -1
  590. package/dist/webcomponents/p-c09fccd3.entry.js +0 -1
  591. package/dist/webcomponents/p-c827cbc9.entry.js +0 -1
  592. package/dist/webcomponents/p-cc5b7c27.entry.js +0 -1
  593. package/dist/webcomponents/p-d878df6c.entry.js +0 -1
  594. package/dist/webcomponents/p-ddf699e6.entry.js +0 -20
  595. package/dist/webcomponents/p-e0b3735f.entry.js +0 -1
  596. package/dist/webcomponents/p-ea30cf08.entry.js +0 -1
  597. package/dist/webcomponents/p-edf5a854.entry.js +0 -1
  598. package/dist/webcomponents/p-ef89824b.entry.js +0 -1
  599. package/dist/webcomponents/p-fc7ba195.entry.js +0 -1
  600. package/dist/webcomponents/p-hhdRync5.js +0 -1
  601. package/dist/webcomponents/p-niGr4RT2.js +0 -1
  602. package/dist/webcomponents/p-pL4dNfsl.js +0 -1
  603. package/dist/webcomponents/p-qcQTYcr3.js +0 -1
  604. package/dist/webcomponents/p-qrNmDp6K.js +0 -1
  605. package/dist/webcomponents/p-uCg79W3M.js +0 -1
  606. package/dist/webcomponents/p-zi3ljCdQ.js +0 -1
@@ -0,0 +1 @@
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-nb_LhbJq.js";import{m as i}from"./p-5G1OMxZz.js";import{C as d,e as c,g as f,f as l}from"./p-NZS8uCtH.js";import{J as r}from"./p-DO9lqnbB.js";import{c as h}from"./p-DjjAx7PF.js";import"./p-DVJaoI_m.js";import{b,d as o,s as p}from"./p-BRnBHsdq.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{P as n,M as m}from"./p-D1_eip6x.js";import{a as y,b as u,D as v,c as k,C as j,E as C}from"./p-Cu7hgXL1.js";import{S as g}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as w}from"./p-uZ5KAseb.js";import{a as D,B as P}from"./p-CHw7tICr.js";import"./p-CYQvLgSs.js";import"./p-HXpYMWUU.js";import"./p-Cm9f5fyh.js";import"./p-B6YPrwyC.js";import"./p-D8GTwl9v.js";import"./p-CPKMvyV_.js";const x=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(w,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(w,{width:"70%"})),e("div",{class:"col-12"},e(w,{width:"40%"})),e("div",{class:"col-12"},e(w,{width:"40%"})),e("div",{class:"col-12"},e(w,{width:"100%"})),e("div",{class:"col-12"},e(w,{width:"80%"}))),B=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event",7),this.recordClickEvent=a(this,"record-click-event",7),this.loading=!0}componentWillLoad(){h(),this.analytics=new r(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?(this.getPaymentDetails=i({id:this.paymentId,authToken:this.authToken,service:new s}),this.fetchData()):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:c.MISSING_PROPS,severity:d.ERROR}))}updateOnPropChange(){this.getPaymentDetails&&this.fetchData()}fetchData(){this.loading=!0,this.getPaymentDetails({onSuccess:({payment:e})=>{this.payment=e,this.errorMessage=null},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({errorCode:t,message:e,severity:a})},final:()=>{this.loading=!1}})}get PaymentStatus(){return this.payment.status===f.disputed&&this.payment.disputes.some((e=>e.status===l.lost))?n.DISPUTE_LOST:this.payment.status}render(){return e(g,{key:"f4952600aea69aae085ac57364e96397d1a20e51"},this.loading&&e(x,{key:"2f819c97a1a6ddb9df2a11e0cd6a5bc013ed19ae"}),!this.loading&&this.errorMessage&&C(this.errorMessage),!this.loading&&!this.errorMessage&&this.payment&&e("justifi-details",{key:"35a58e3917bdc3133f02374c0e031374be7c728c",errorMessage:this.errorMessage},e(y,{key:"dad5f79ea18ef718b92bf2c2abbbba34542d6caa",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},m(this.PaymentStatus),this.payment.expedited?e(D,{variant:P.WARNING,title:"Expedited",text:"Expedited"}):null),title:this.payment.formattedPaymentAmount(this.payment.amount)},e(u,{key:"12e7cfb4f4f56a1af8403b935cb51db3751f1395",classes:"border-1 border-end",title:"Updated At",value:`${b(this.payment.updated_at)} ${o(this.payment.updated_at)}`}),e(u,{key:"023945353c0cbab340f4f510951164f110045ea5",classes:"border-1 border-end",title:"Created At",value:`${b(this.payment.created_at)} ${o(this.payment.created_at)}`}),e(u,{key:"dcb261f7c4faf53eb686cfd5c8e0ade39a72bdea",title:"ID",value:this.payment.id})),e("div",{key:"a7774df4ece900dc67494377cf648bf64f558490",slot:"detail-sections"},e(v,{key:"ef4a9197d4eb47d81c11c7f974f1e4058d5e3166",sectionTitle:"Details"}),e("div",{key:"17ef105d1b37ad34cce4bdd17cbf2e4023c0e2e5",class:"d-flex flex-column gap-2 w-100"},e(k,{key:"dbb764a1a6cbe949d2e281334e2f420f957b98fe",title:"Amount",value:this.payment.formattedPaymentAmount(this.payment.amount)}),e(k,{key:"7a3547ade7107456956618c72a95056a0771d219",title:"Fees",value:this.payment.formattedPaymentAmount(this.payment.fee_amount)}),e(k,{key:"94df0647f7286a4a7c9001f9e82b4277fe0f8457",title:"Refunded",value:this.payment.formattedPaymentAmount(this.payment.amount_refunded)}),e(k,{key:"59c13e257938124af50adfaa73571f152c402bd4",title:"Net",value:this.payment.formattedPaymentAmount(this.payment.balance)}),e(k,{key:"6abf719a072a3a1ea5878d999e517dafb7ba19d5",title:"Status",value:m(this.PaymentStatus)}),e(k,{key:"c494d2b4be8c9e13747f0299a618ea6c9ff723d7",title:"Payment ID",value:this.payment.id}),e(k,{key:"1024b282558896dcb2c4ab7718045d98a6f6853e",title:"Processing Fees",value:this.payment.formattedPaymentAmount(this.payment.fee_amount)}),e(k,{key:"6bf6fb7f648609fdeaa4e5a0b6f3d4c7bcd4af97",title:"Statement Descriptor",value:this.payment.statement_descriptor}),e(k,{key:"43da8b6ab1aa87b6b938f1d0fd95708399cb9cc0",title:"Description",value:this.payment.description}),e(k,{key:"e6180466f4341e2c438f09cc42feb518f59aded4",title:"Expedited",value:this.payment.expedited?"Yes":"No"})),this.payment.payment_method.card&&[e(v,{key:"289f80acfa3cd41f82637e8f9d9e63dac4c11b5b",sectionTitle:"Payment Method"}),e("div",{key:"616a2e7ae000581dd481725c57a644fc3e0a9b7c",class:"d-flex flex-column gap-2 w-100"},e(k,{key:"2c13ea8a771e2f155a9e3d5dbae78c7800f31adb",title:"ID",value:this.payment.payment_method.card.id}),e(k,{key:"62700836b3bd9656d07dc58d0d07d164c091cd74",title:"Payment Type",value:"Card"}),e(k,{key:"528ad4dddccaa7f5bc274b3b297557f659d46789",title:"Last 4 Numbers",value:this.payment.payment_method.lastFourDigits}),e(k,{key:"fdf2ad89e4e7ad253e16bff9038dc79da5a71b19",title:"Brand",value:p(this.payment.payment_method.card.brand)}),e(k,{key:"0b2c505e1fae49414414d5e839b1bdc849290c41",title:"Cardholder",value:this.payment.payment_method.payersName}))],this.payment.payment_method.bank_account&&[e(v,{key:"2a04be5ee508a547661e1ff947c2c9b40da2a192",sectionTitle:"Payment Method"}),e("div",{key:"1316f9c749960ca0ab4967ff03697583e690007d",class:"d-flex flex-column gap-2 w-100"},e(k,{key:"46fe5297825ef0b9e3f34fdee6f47f3dd3b9272d",title:"ID",value:this.payment.payment_method.bank_account.id}),e(k,{key:"44f1f47522b94ce5e403d766ee71645b4285d675",title:"Last 4 Numbers",value:this.payment.last_four_digits}),e(k,{key:"f03369474996dc0ae52c7d909ac1bba51e291668",title:"Bank Name",value:this.payment.payment_method.bank_account.brand}),e(k,{key:"d697a0e2a954f0e4efb4cec27dcae9c57fa0ce54",title:"Account Owner",value:this.payment.payment_method.payersName}))],this.payment.metadata&&[e(v,{key:"7cdd88cc59c7852574b05e1709f85afe3bf7367e",sectionTitle:"Metadata"}),e("div",{key:"bde3519c811862185b0757fd7c8a2a0a05117466",class:"d-table gap-2 w-100"},e(j,{key:"7675f134c9580381d495a1d7534e73b77583cb8b",metadata:this.payment.metadata}))])))}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"],getPaymentDetails:["updateOnPropChange"]}}};export{B as justifi_payment_details}
@@ -1 +1 @@
1
- import{r,h as i}from"./p-CV0Pyo1O.js";import{S as e}from"./p-BqNNwq6C.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:"958a6f3085b8ec0eb3d978de7100049576485b2b"},i("card-billing-form-simple",{key:"a98e775d5a4585d4e3ef32353af0f724a6d442a1",legend:this.legend,ref:r=>this.cardBillingFormSimpleRef=r}))}};export{s as justifi_card_billing_form_simple}
1
+ import{r,h as i}from"./p-CV0Pyo1O.js";import{S as e}from"./p-BqNNwq6C.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:"1e25de93c795dd6c8ec2979918a5b10389a55354"},i("card-billing-form-simple",{key:"d9db1793b83e5fa216f72bfe7803d968ee499ac7",legend:this.legend,ref:r=>this.cardBillingFormSimpleRef=r}))}};export{s as justifi_card_billing_form_simple}
@@ -0,0 +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-CKiAlBsU.js";import{f as o}from"./p-BRnBHsdq.js";import"./p-DVJaoI_m.js";import{R as a,C as u,e as h,o as l}from"./p-NZS8uCtH.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{B as c}from"./p-CHo7TfsM.js";import{S as m}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{P as d}from"./p-nb_LhbJq.js";import{m as p}from"./p-5G1OMxZz.js";import{J as f}from"./p-DO9lqnbB.js";import{c as v}from"./p-DjjAx7PF.js";import{g as y,a as j}from"./p-Cm9f5fyh.js";import{A as b}from"./p-CYQvLgSs.js";import{S as w}from"./p-uZ5KAseb.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-D8GTwl9v.js";import"./p-CPKMvyV_.js";import"./p-B6YPrwyC.js";const C=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}))},T=t=>{if(t)return r({amount:C(t),description:i().optional(),reason:i().optional().oneOf([a.customerRequest,a.duplicate,a.fraudulent],"Select a reason")})},g=[{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"}],A=b();class S{async postRefund(t,e,s,r){return A.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":e},body:r,authToken:s})}}const x=b();class I{async postVoid(t,e,s){return x.post({endpoint:`payments/${t}/void`,headers:{"Sub-Account":e},authToken:s})}}const P=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),B=()=>t(m,null,t("div",{class:"row gap-5"},t(P,null),t(P,null),t(P,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(){v(),this.analytics=new f(this),this.initializeApi(),this.formController=new n(T())}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(T(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 d})({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:y(null===(a=o.error)||void 0===a?void 0:a.code),severity:u.ERROR});i(o)}catch(t){const e=y(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:u.ERROR})}finally{return o()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new I});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(t,s,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:y(null===(h=a.error)||void 0===h?void 0:h.code),severity:u.ERROR});n(a)}catch(t){const e=y(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:u.ERROR})}finally{return a()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new S});return new Promise((s=>{let r;e({refundBody:t,onSuccess:t=>{r=t},onError:({error:t,code:e,severity:s})=>{r=t,this.handleError(t,e,s)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,s(r.data)}})}))}render(){if(this.paymentLoading)return t(B,null);const e=this.formController.getInitialValues(),s=this.refundPayload.amount;return t(m,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:g,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 t,c as e,h as i,H as s,g as n}from"./p-CV0Pyo1O.js";import{A as a}from"./p-CYQvLgSs.js";import{A as o,p as r,q as h,r as l,s as c,t as d,u,C as p,e as y,v as m,I as v,w as f,x as g,y as M}from"./p-NZS8uCtH.js";import{S as b}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as k}from"./p-uZ5KAseb.js";import{c as w,o as j,a as P,g as T,b as A}from"./p-BArmtmkq.js";import{t as N,r as C}from"./p-CPKMvyV_.js";import{f as I}from"./p-BRnBHsdq.js";import{w as E,c as D}from"./p-DVJaoI_m.js";import{H as S}from"./p-jIDKmNHy.js";import{H as O,b as L,h as x,i as z}from"./p-D-zwk1J3.js";import{H as _}from"./p-DYHjzFnJ.js";import{J as R}from"./p-DO9lqnbB.js";import{c as U}from"./p-DjjAx7PF.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as B,a as Y}from"./p-Cm9f5fyh.js";import{C as F}from"./p-fE5A37L5.js";import{P as Q}from"./p-av6jyzyC.js";import{P as V,a as H,b as q}from"./p-DkoufM1t.js";import{C as G}from"./p-ZpPDShvP.js";import"./p-D8GTwl9v.js";import"./p-B6YPrwyC.js";const Z=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click",7),this.checked=!1,this.hidden=!1}render(){return i(b,{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 W;!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"}(W||(W={}));class J{constructor(){this.api=a()}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 h(t);if(!s.isValid){const t=[];throw s.countryCode||t.push("countryCode"),s.currencyCode||t.push("currencyCode"),s.merchantCapabilities&&0!==s.merchantCapabilities.length||t.push("merchantCapabilities"),s.supportedNetworks&&0!==s.supportedNetworks.length||t.push("supportedNetworks"),s.total&&s.total.label&&s.total.amount||t.push("total"),console.error("[ApplePayService] Payment request is invalid. Missing/invalid:",t),new Error("Invalid payment request provided")}return this.currentPaymentRequest=s,new Promise(((t,n)=>{try{if("undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),n({success:!1,error:{code:W.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,s),this.setupSessionEventHandlers(t,n,e,i),this.currentSession.begin()}catch(t){console.error("[ApplePayService] Exception while starting session:",t),n({success:!1,error:{code:W.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:W.MERCHANT_VALIDATION_ERROR,message:t instanceof Error?t.message:"Merchant validation failed"}})}},this.currentSession.onpaymentauthorized=async n=>{try{const a=n.payment,o=Object.assign(Object.assign({},a.token),{product_details:{name:this.currentPaymentRequest.total.label,price:r.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}}),h=await this.processPayment(i,s,o);h.success?(this.currentSession.completePayment({status:l.STATUS_SUCCESS}),t({success:!0,token:a.token,paymentMethodId:h.data.id})):(console.error("PSP reported payment failure:",h.data),this.currentSession.completePayment({status:l.STATUS_FAILURE}),e({success:!1,error:{code:W.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:l.STATUS_FAILURE}),e({success:!1,error:{code:W.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:l.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:W.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:W.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(k,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},X=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 ")),$=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.showSkeleton=!0,this.width="100%",this.height="48px",this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.isConfigValid=!0,this.error=null,this.handleApplePayClick=async()=>{var t,e,i;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit();const i={countryCode:this.countryCode,currencyCode:w.paymentCurrency,merchantCapabilities:[u.SUPPORTS_3DS,u.SUPPORTS_CREDIT,u.SUPPORTS_DEBIT],supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(w.paymentDescription,w.paymentAmount)},s=await this.applePayService.startPaymentSession(i,w.authToken,w.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)||$.ErrorCode.PAYMENT_FAILED}))}catch(t){if((null===(i=null==t?void 0:t.error)||void 0===i?void 0:i.code)===W.USER_CANCELLED)this.applePayCancelled.emit();else{const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.applePayError.emit({error:e,code:$.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:e})}}finally{this.isProcessing=!1}}}componentWillLoad(){this.isAvailable=r.isApplePaySupported(),this.isAvailable?w.checkoutLoaded?this.loadApplePaySDK():j("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(w.paymentAmount)&&Boolean(w.paymentCurrency)&&Boolean(w.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,this.applePayError.emit({error:this.error,code:$.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:$.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:$.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:$.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(!w.applePayEnabled)return null;if(!this.isAvailable)return null;const t=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return i(b,null,i("div",{class:"apple-pay-container"},i(K,{isLoading:this.isLoading}),t&&i(X,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick,width:this.width,height:this.height})),i("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};$.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(b,{key:"f1ac17863df571d72e7db9b748b1980218145322"},i("internal-button",{key:"0b7052d216fb79ed5d9f90aacff97d39dce87473",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(b,{key:"4dda3e1e4f81cfda61011706c2f4e3104815d97c"},i("section",{key:"f8bbdeb389afbfc906e6cc956a68f9a3485ed43c"},i("div",{key:"2f8019ae43d5d4a5835ec6d5674304bd321d34b7"},i("div",{key:"67626fe735d0c0372fe638960198592027fb24f5",part:N},null==w?void 0:w.paymentDescription),i("div",{key:"48d8b4b930d2f3b199bc0a59c93ef4f1339f7649"},i("span",{key:"ca6413ce719ae81eaa4654911cdfc09d63f9a9db",part:N},"Total")," ",i("span",{key:"9ed165b192efa2ecf2f77a129d33161e36b1594f",part:N},I(+(null==w?void 0:w.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(k,{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 nt=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.environment="TEST",this.iframeReady=!1,this.sdkLoaded=!1,this.isReadyToPay=!1,this.handleMessage=t=>{if(t.origin!==this.iframeOrigin)return;const{eventType:e,data:i}=t.data||{};switch(e){case 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 E(),this.iframeOrigin=D.iframeOrigin}componentDidLoad(){window.addEventListener("message",this.handleMessage)}disconnectedCallback(){window.removeEventListener("message",this.handleMessage)}sendInitialize(){var t;(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow)&&this.iframeElement.contentWindow.postMessage({eventType:st.initialize,data:{environment:this.environment,gatewayMerchantId:w.accountId,merchantName:this.merchantName,authToken:w.authToken,accountId:w.accountId}},this.iframeOrigin)}sendStartPayment(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={totalPrice:String(w.paymentAmount/100),totalPriceStatus:"FINAL",currencyCode:w.paymentCurrency||"USD"};this.iframeElement.contentWindow.postMessage({eventType:st.startPayment,data:e},this.iframeOrigin)}render(){return w.checkoutLoaded?w.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}},at=class{constructor(e){t(this,e),this.levels={h1:S,h2:O,h3:_},this.level="h1"}render(){return i(b,{key:"879e301ec35e7cc536dec135e11daf140c67eeed"},i(this.levels[this.level],{key:"1766cb9a4d84bee1b3365b4df93515274cf31565",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.handleApplePayStarted=()=>{w.isWalletProcessing=!0},this.handleGooglePayStarted=()=>{w.isWalletProcessing=!0},this.handleGooglePayCompleted=t=>{const{success:e,paymentMethodId:i,error:s}=t.detail||{};e&&i?(w.isWalletProcessing=!1,w.paymentToken=i,w.selectedPaymentMethod={type:V.GOOGLE_PAY},this.submitCheckout()):(w.isWalletProcessing=!1,this.errorEvent.emit({message:s&&s.message||"Google Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleGooglePayCancelled=()=>{w.isWalletProcessing=!1,w.paymentToken=void 0,w.selectedPaymentMethod=void 0},this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:n}=t.detail;e&&i?(w.isWalletProcessing=!1,w.paymentToken=s,w.selectedPaymentMethod={type:V.APPLE_PAY},this.submitCheckout()):(w.isWalletProcessing=!1,console.error("Apple Pay completed but failed:",n),this.errorEvent.emit({message:(null==n?void 0:n.message)||"Apple Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleApplePayError=t=>{w.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=()=>{w.isWalletProcessing=!1,w.paymentToken=void 0,w.selectedPaymentMethod=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),w.checkoutId=this.checkoutId;const t={authToken:this.authToken,checkoutId:this.checkoutId,service:new F};this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:s,onError:n})=>{var a;try{const o=await i.fetchCheckout(t,e);if(o.error)return n({error:Y(o.error),code:B(null===(a=o.error)||void 0===a?void 0:a.code),severity:p.ERROR});s({checkout:o.data})}catch(t){const e=B(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:p.ERROR})}})(t),this.completeCheckout=(({authToken:t,checkoutId:e,service:i})=>async({payment:s,onSuccess:n,onError:a})=>{var o;try{const r=await i.complete(t,e,s);if(r.error)return a({error:Y(r.error),code:B(null===(o=r.error)||void 0===o?void 0:o.code),severity:p.ERROR});n({checkout:r.data})}catch(t){const e=B(null==t?void 0:t.code);return a({error:t.message||t,code:e,severity:p.ERROR})}})(t),P((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new R(this),U(),w.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()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this.removeApplePayListeners(),this.removeGooglePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==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,n,a,o,r;w.accountId=t.account_id,w.checkoutLoaded=!0,w.paymentMethods=t.payment_methods.map((t=>new H(t))),w.paymentMethodGroupId=t.payment_method_group_id,w.paymentDescription=t.payment_description,w.totalAmount=t.total_amount,w.paymentAmount=t.payment_amount,w.bnplEnabled=t.payment_settings.bnpl_payments,w.insuranceEnabled=t.payment_settings.insurance_payments,w.bankAccountVerification=null===(e=t.payment_settings)||void 0===e?void 0:e.bank_account_verification,w.applePayEnabled=null===(i=t.payment_settings)||void 0===i?void 0:i.apple_payments,w.googlePayEnabled=null===(s=t.payment_settings)||void 0===s?void 0:s.google_payments,w.bnplProviderClientId=null===(n=null==t?void 0:t.bnpl)||void 0===n?void 0:n.provider_client_id,w.bnplProviderMode=null===(a=null==t?void 0:t.bnpl)||void 0===a?void 0:a.provider_mode,w.bnplProviderApiVersion=null===(o=null==t?void 0:t.bnpl)||void 0===o?void 0:o.provider_api_version,w.bnplProviderCheckoutUrl=null===(r=null==t?void 0:t.bnpl)||void 0===r?void 0:r.provider_checkout_url}emitCheckoutChanged(){const t={availablePaymentMethodTypes:T(),selectedPaymentMethod:w.selectedPaymentMethod,savedPaymentMethods:w.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.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),!w.selectedPaymentMethod&&this.paymentMethodFormRef){const t=this.paymentMethodFormRef.tagName.toLowerCase();"justifi-card-form"===t?w.selectedPaymentMethod={type:V.NEW_CARD}:"justifi-bank-account-form"===t&&(w.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))}async tokenizePaymentMethod(t){var e,i,s;const n=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},a=Object.assign(Object.assign({},t),n),o=Object.assign({accountId:w.accountId,payment_method_group_id:void 0},a);w.savePaymentMethod&&(o.payment_method_group_id=w.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:o,account:w.accountId}));return r.error?r:(w.paymentToken=r.id,r.id)}async fillBillingForm(t){w.billingFormFields=t}async setSelectedPaymentMethod(t){w.selectedPaymentMethod=t,w.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];w.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=w.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.NEW_CARD,n=(null===(e=w.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_BANK_ACCOUNT;if((s||n)&&(this.paymentMethodFormRef&&i.push(this.paymentMethodFormRef.validate()),this.billingFormRef&&i.push(this.billingFormRef.validate())),0===i.length)return!0;try{return!!(await Promise.all(i)).every((t=>"boolean"==typeof t?t:!1!==(null==t?void 0:t.isValid)))||(this.errorEvent.emit({message:"Validation error",errorCode:y.VALIDATION_ERROR,severity:p.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,s,n,a;if(w.isSubmitting)return;w.isSubmitting=!0;const o=await this.validate();if(!w.selectedPaymentMethod)return w.isSubmitting=!1,void this.errorEvent.emit({message:"No payment method selected.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});const r=(null===(e=w.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_CARD,h=(null===(i=w.selectedPaymentMethod)||void 0===i?void 0:i.type)===V.NEW_BANK_ACCOUNT,l=(null===(s=w.selectedPaymentMethod)||void 0===s?void 0:s.type)===V.PLAID;if(r||h){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return w.isSubmitting=!1,void this.errorEvent.emit({message:e.error.message,errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}if(l&&!w.paymentToken){const t=w.plaidPublicToken,e=w.plaidLinkTokenId;if(!t)return w.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(w.authToken,w.accountId,t,e||void 0,w.savePaymentMethod?w.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return w.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,a=(null===(n=null==s?void 0:s.bank_account)||void 0===n?void 0:n.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);w.paymentToken=a}catch(t){return w.isSubmitting=!1,void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}}if(!o)return w.isSubmitting=!1,void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});if(!w.paymentToken)return w.isSubmitting=!1,void this.errorEvent.emit({message:"Payment token not found.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});let c;if(c={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 q.ECOM;case V.SEZZLE:return q.BNPL;case V.APPLE_PAY:return q.APPLE_PAY;case V.GOOGLE_PAY:return q.GOOGLE_PAY;default:return}})(null===(a=w.selectedPaymentMethod)||void 0===a?void 0:a.type),payment_token:w.paymentToken},this.preCompleteHook){const t=A();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return w.isSubmitting=!1,void console.log("Checkout cancelled by preCompleteHook",t)}}this.completeCheckout({payment:c,onSuccess:({checkout:t})=>{w.isSubmitting=!1,this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{w.isSubmitting=!1,this.errorEvent.emit({message:t.message,errorCode:y.COMPLETE_CHECKOUT_ERROR,severity:p.ERROR})}})}render(){return i(s,{key:"c3de4a4b90c599a374678d98c324a6b24dbec50d"})}get hostEl(){return n(this)}},rt=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.waitForStoreAndInitialize=()=>{w.authToken&&w.accountId&&w.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:M.PLAID_SDK_LOAD_FAILED,message:g[M.PLAID_SDK_LOAD_FAILED],severity:f[M.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:M.PLAID_LINK_TOKEN_FAILED,message:g[M.PLAID_LINK_TOKEN_FAILED],severity:f[M.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:M.PLAID_LINK_INIT_FAILED,message:g[M.PLAID_LINK_INIT_FAILED],severity:f[M.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,n;try{if(!w.authToken||!w.accountId)return void this.handleError({code:M.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(w.authToken,w.accountId,w.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&&(w.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let a=M.PLAID_LINK_TOKEN_FAILED,o=g[a],r=!0;"AbortError"===t.name?(a=M.PLAID_TIMEOUT,o=g[a],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"))?(a=M.PLAID_NETWORK_ERROR,o=g[a],r=!0):((null===(s=t.message)||void 0===s?void 0:s.includes("401"))||(null===(n=t.message)||void 0===n?void 0:n.includes("unauthorized")))&&(a=M.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:a,message:o,severity:f[a],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 M.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return M.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return M.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return M.PLAID_RATE_LIMITED;case"maintenance":return M.PLAID_MAINTENANCE;case"not_authenticated":return M.PLAID_INVALID_CREDENTIALS;default:return M.PLAID_LINK_TOKEN_FAILED}return M.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,w.selectedPaymentMethod={type:V.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:p.INFO}),w.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=M.PLAID_AUTHENTICATION_FAILED,i=g[e],s=!0,n="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=M.PLAID_INVALID_CREDENTIALS,i=g[e],s=!0;break;case"ITEM_LOGIN_REQUIRED":e=M.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":e=M.PLAID_ACCOUNT_LOCKED,i=g[e],s=!1,n="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=M.PLAID_MAINTENANCE,i=g[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=M.PLAID_RATE_LIMITED,i=g[e],s=!0;break;case"INVALID_REQUEST":e=M.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":e=M.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 a=t.error_message.toLowerCase();a.includes("not supported")||a.includes("unsupported")?(e=M.PLAID_BANK_NOT_SUPPORTED,i=g[e],s=!1,n="Try a different payment method"):(a.includes("expired")||a.includes("timeout"))&&(e=M.PLAID_TOKEN_EXPIRED,i=g[e],s=!0)}this.handleError({code:e,message:i,severity:f[e],originalError:t,retryable:s,userAction:n}),this.isAuthenticating=!1},this.handleError=t=>{this.error=t,this.plaidError.emit({code:t.code,message:t.message,severity:t.severity,data:{originalError:t.originalError,retryable:t.retryable,userAction:t.userAction,retryCount:this.retryCount}}),console.error("Plaid error:",t),t.retryable&&this.retryCount<this.maxRetries&&this.scheduleRetry()},this.scheduleRetry=()=>{this.isRetrying||(this.isRetrying=!0,this.retryCount++,setTimeout((()=>{this.isRetrying=!1,this.clearError(),this.waitForStoreAndInitialize()}),this.retryDelay*this.retryCount))},this.clearError=()=>{this.error&&(this.error=null,this.retryCount=0)},this.syncWithStore=()=>{var t;const e=(null===(t=w.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=w.selectedPaymentMethod)||void 0===e?void 0:e.type)!==V.PLAID&&(w.selectedPaymentMethod={type:V.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentWillLoad(){var t;this.isSelected=(null===(t=w.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID,!0===w.bankAccountVerification&&(w.checkoutLoaded?this.loadPlaidSDK():j("checkoutLoaded",(t=>{t&&!0===w.bankAccountVerification&&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:M.PLAID_SDK_LOAD_FAILED,message:g[M.PLAID_SDK_LOAD_FAILED],severity:f[M.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 w.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,w.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&&(w.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=j("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(!0!==w.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(b,{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"]}}},ht=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),w.selectedPaymentMethod={id:t.id,type:t.type},w.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===V.SAVED_CARD&&w.disableCreditCard||t===V.SAVED_BANK_ACCOUNT&&w.disableBankAccount)}componentWillLoad(){w.checkoutLoaded&&(w.paymentMethods.length||console.warn("No saved payment methods available."),w.disablePaymentMethodGroup&&console.warn("Payment method group is disabled."))}render(){return w.disablePaymentMethodGroup?null:i(b,null,i("div",{class:"saved-payment-methods"},w.paymentMethods.length?w.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((t=>i("div",{class:"radio-list-item p-3",part:C,onClick:this.onPaymentMethodOptionClick(t)},i("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:w.paymentToken===(null==t?void 0:t.id),label:`${G[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},lt=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"}}),ct=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.paymentMethodOptionId=V.SEZZLE,this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((e=>{t=e}));const e=Number(w.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:w.bnplProviderClientId,apiMode:w.bnplProviderMode,apiVersion:w.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(t){t.preventDefault(),i.startCheckout({checkout_url:w.bnplProviderCheckoutUrl})},onComplete:e=>t({bnpl:e.data}),onCancel:e=>t({bnpl:e.data}),onFailure:e=>t({bnpl:e.data})}),this.sezzleCheckout=i,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}async handleSelectionClick(){w.selectedPaymentMethod={type:V.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var t,e;return w.bnplEnabled?i(b,{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 ",lt),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)}},dt={[V.NEW_BANK_ACCOUNT]:"New bank account",[V.NEW_CARD]:"New credit or debit card"},ut="Payment form not ready",pt="Validation error",yt=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,w.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:pt}),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){w.billingFormFields=t}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:ut}};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||w.authToken,account:this.accountId||w.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||w.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||w.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||(this.selectedPaymentMethod=V.NEW_BANK_ACCOUNT,w.selectedPaymentMethod={type:V.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=V.NEW_CARD,w.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=[];return this.disableCreditCard||t.push(V.NEW_CARD),this.disableBankAccount||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",ut);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||pt;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||w.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!w.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===w.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:dt[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(b,{key:"2d4349f3e5ad632981cdeb14dbe4e483f79379da"},i("form",{key:"754afee2c5229cf016bd8fc0cf81041cf37270a8"},i("fieldset",{key:"01867151a09d384e1258ef7f62fbc88c526706cc"},i("div",{key:"7ba453d4629a0c2ef583daddcb9cf02ac5eee265",class:"row gy-3"},i("div",{key:"4148f2269c738a00f2684d69d4a83a4ab2424f2b",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"e67b09357571aadfb3d2712f55954506748b3826",class:"col-12"},i("internal-button",{key:"c2e805060ff7e9e97144533ffad3b4a02433e792",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 n(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{$ as justifi_apple_pay,tt as justifi_button,et as justifi_checkout_summary,nt as justifi_google_pay,at as justifi_header,ot as justifi_modular_checkout,rt as justifi_plaid_payment_method,Z as justifi_radio_list_item,ht as justifi_saved_payment_methods,ct as justifi_sezzle_payment_method,yt as justifi_tokenize_payment_method}
@@ -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-CPKMvyV_.js";import{F as f}from"./p-Ce_W43gc.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:"9499d7c542341eabf4e5571dec7c9083d13b7666"},s("div",{key:"c9967fd597028fcac9582ac39121c9a445330712",class:"form-group d-flex flex-column"},s("div",{key:"213e629f9364a9e2a2796cfca0c008fd7bf1e212",class:"d-flex align-items-start gap-2"},s("label",{key:"c9d68b3dcc00ca877a80a8464478fd9ac38bd40c",part:h,class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"e655af202b042934dba8ce2a003af3bef9a74df9",helpText:this.helpText})),s("select",{key:"4b4e4ccb7cc36b1ce5f48d0b11c5e036256267b9",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:"a9ea85db5af5a500e50c87ba83c5e64a43c422fa",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:"4ab9e7a2c6312b568de8a8ee429ef02f3f792173"},s("div",{key:"e273e0bc062be883505fe3047d41a741eaf23a44",class:"form-group d-flex flex-column"},s("div",{key:"a7496dd4f6b5549f26752ca2de35a34c5261e439",class:"d-flex align-items-start gap-2"},s("label",{key:"97480c49cb0fcd3c75d123c6033df4880755baf0",part:h,class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"e2a53e4e15be4f9f739a79afeaf28c3671c14a4d",helpText:this.helpText})),s("input",{key:"1571553d763734454026b2c4feaa88a9535f2057",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:"44f7c7847a2255ff3ddd83f542ff6690d1aed798",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}
@@ -0,0 +1 @@
1
+ import{r as t,h as o}from"./p-CV0Pyo1O.js";import{c as a}from"./p-DjjAx7PF.js";import{J as s}from"./p-DO9lqnbB.js";import{w as r}from"./p-DVJaoI_m.js";import{S as p}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import"./p-B6YPrwyC.js";import"./p-CYQvLgSs.js";import"./p-BRnBHsdq.js";import"./p-HXpYMWUU.js";import"./p-NZS8uCtH.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D8GTwl9v.js";const i=class{constructor(o){t(this,o)}async componentWillLoad(){await r(),a(),this.analytics=new s(this)}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){return this.bankAccountFormElement.validate()}async tokenize({clientId:t,paymentMethodMetadata:o,account:a}){return this.bankAccountFormElement.tokenize({clientId:t,paymentMethodMetadata:o,account:a})}render(){return o(p,{key:"3a267a32b400d122cd124245979218ffc45453ee"},o("bank-account-form",{key:"72044965224da0d85455ad7688b3d1852a46126e",ref:t=>this.bankAccountFormElement=t}))}};export{i as justifi_bank_account_form}
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as s,H as i}from"./p-CV0Pyo1O.js";import{C as a,e as r,E as n,z as o,B as h,w as l,x as c,y as d}from"./p-NZS8uCtH.js";import{m as u,a as m,c as b,d as p,e as f,f as v,g as y}from"./p-APOabprT.js";import{B as g,a as k,D as w,I as _}from"./p-BJu1-9kE.js";import{a as x,d as T,b as L,g as C,h as j}from"./p-DrMJliVY.js";import{F as O,c as A,a as E,b as S,d as V}from"./p-CKiAlBsU.js";import{A as H,C as I,e as D,R as B,f as P,O as N}from"./p-BcNb9bVO.js";import{C as M,P as R,I as F}from"./p-CVaOFfrI.js";import{b as W,a0 as q,C as Z,x as U,u as z,D as Y,aa as $,a6 as G,aj as J,am as X,A as K,a1 as Q}from"./p-CPKMvyV_.js";import{P as tt}from"./p-DSclFZ32.js";import{b as et,a as st,c as it}from"./p-Bt4GjEWL.js";import{a as at,B as rt}from"./p-XYgDHrVL.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{n as nt}from"./p-BnjCmwMr.js";import{B as ot,C as ht,v as lt,D as ct,E as dt,F as ut,G as mt}from"./p-XIWgia4J.js";import{B as bt}from"./p-CHo7TfsM.js";import"./p-CZfYo5-1.js";import{c as pt}from"./p-D8ytux5N.js";import{s as ft,b as vt,d as yt}from"./p-BRnBHsdq.js";import{S as gt}from"./p-uZ5KAseb.js";import{u as kt,a as wt,b as _t}from"./p-C6o0liMT.js";import{A as xt}from"./p-CYQvLgSs.js";import{S as Tt}from"./p-BqNNwq6C.js";import{P as Lt}from"./p-av6jyzyC.js";import"./p-Cm9f5fyh.js";import"./p-BFTU3MAI.js";import"./p-D8GTwl9v.js";class Ct{constructor(t){this.id=t.id,this.account_owner_name=t.account_owner_name,this.full_name=t.full_name,this.account_type=t.account_type,this.account_number=t.account_number,this.acct_last_four=t.acct_last_four,this.account_number_last4=t.account_number_last4,this.routing_number=t.routing_number,this.institution_number=t.institution_number,this.transit_number=t.transit_number,this.bank_name=t.bank_name,this.country=t.country,this.currency=t.currency,this.nickname=t.nickname,this.metadata=t.metadata,this.business_id=t.business_id,this.platform_account_id=t.platform_account_id,this.created_at=t.created_at,this.updated_at=t.updated_at}get payload(){return{account_owner_name:this.account_owner_name||"",account_type:this.account_type||"",account_number:this.account_number||"",routing_number:this.routing_number||"",institution_number:this.institution_number||"",transit_number:this.transit_number||"",bank_name:this.bank_name||"",nickname:this.nickname||"",business_id:this.business_id||""}}}const jt=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.additional_questions={},this.recurringPayments=!1,this.isLoading=!1,this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.additional_questions=new H(t.data.additional_questions||{}),this.formController.setInitialValues(Object.assign({},this.additional_questions))},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:s=>{e=s,t()},onError:({error:t,code:s,severity:i})=>{e=t,this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:at.additionalQuestions}),this.formLoading.emit(!1)}})},this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e})),this.additional_questions=new H(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}propChanged(){this.initializeApi()}recurringPaymentsWatcher(t){this.recurringPayments="Yes"===(null==t?void 0:t.business_recurring_payments)}async validateAndSubmit({onSuccess:t}){this.formController.validateAndSubmit((()=>this.sendData(t)))}get patchPayload(){return{additional_questions:new H(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new O(x(this.allowOptionalFields))}componentDidLoad(){this.getBusiness&&this.getData(),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}render(){var t,e,i,a,r;const n=this.formController.getInitialValues();return this.isLoading?s(tt,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"Additional Questions"),s("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-monetary-provisioning",{name:"business_revenue",label:"What is your business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(t=this.errors)||void 0===t?void 0:t.business_revenue,defaultValue:null==n?void 0:n.business_revenue,maskOptions:M.WHOLE})),s("div",{class:"col-12 col-md-6"},s("form-control-monetary-provisioning",{name:"business_payment_volume",label:"What is your business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(e=this.errors)||void 0===e?void 0:e.business_payment_volume,defaultValue:null==n?void 0:n.business_payment_volume,maskOptions:M.WHOLE})),s("div",{class:"col-12"},s("form-control-text",{name:"business_average_transaction_amount",label:"What is your average transaction size?",inputHandler:this.inputHandler,errorText:null===(i=this.errors)||void 0===i?void 0:i.business_average_transaction_amount,defaultValue:null==n?void 0:n.business_average_transaction_amount})),s("div",{class:"col-12"},s("form-control-select",{name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(a=this.errors)||void 0===a?void 0:a.business_when_service_received,options:et,defaultValue:null==n?void 0:n.business_when_service_received})),s("div",{class:"col-12"},s("form-control-text",{name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business? (optional)",inputHandler:this.inputHandler,errorText:null===(r=this.errors)||void 0===r?void 0:r.business_other_payment_details,defaultValue:null==n?void 0:n.business_other_payment_details})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],additional_questions:["recurringPaymentsWatcher"]}}},Ot=class{constructor(e){t(this,e)}render(){return s("div",{key:"d0dacb95d07d3e4ca9bc2c9f23b6c490871da4e9",class:"row gy-3"},s("div",{key:"02ed406f38558badf9f591e076b120d09c71f83b",class:"col-12"},s("form-control-file",{key:"11ff1dc68264b9e5aa561ffe19b423abc1a00c78",name:"voided_check",label:"Voided Check",documentType:n.voidedCheck,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.voided_check,multiple:!0})),s("div",{key:"71d26407522a75a54489155566c18af1a64c1417",class:"col-12"},s("form-control-file",{key:"7ea42e03a44c223a5fedc273e94e635e70d54f4b",name:"bank_statement",label:"Bank Statement",documentType:n.bankStatement,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.bank_statement,multiple:!0})))}},At=class{constructor(e){t(this,e)}render(){var t,e,i,a,r,n;return s("div",{key:"d3445ce89732e19baea2e8f224c42011d5a03998",class:"row gy-3"},s("div",{key:"966e1d8ba6043b4f9b57ae0061ae94c177c12b48",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Bank Name",value:null===(t=this.defaultValue)||void 0===t?void 0:t.bank_name}):s("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),s("div",{key:"314a4f7e181b978b2ff1fdbfdfc8d9484089829a",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Nickname",value:null===(e=this.defaultValue)||void 0===e?void 0:e.nickname}):s("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),s("div",{key:"45ac55707ce44b208adaf72e944ea3056810183a",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):s("form-control-text",{name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler})),s("div",{key:"74ce58b36eb3a425d900d7bb0858bda18b2e341c",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Type",value:null===(a=this.defaultValue)||void 0===a?void 0:a.account_type}):s("form-control-select",{name:"account_type",label:"Account Type",options:st,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),s("div",{key:"2562105aaaae00d9c46eb61d931a43927d96a8ce",class:"col-6"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Number",value:(null===(r=this.defaultValue)||void 0===r?void 0:r.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):s("form-control-text",{name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:nt,helpText:"Please copy the account number as shown on your statement/check. Do not include spaces or dashes."})),s("div",{key:"4c7e6cba0ee1e2567dc5b608559b13ebd3fddd07",class:"col-6"},this.formDisabled?s("bank-account-read-only-value",{label:"Routing Number",value:(null===(n=this.defaultValue)||void 0===n?void 0:n.routing_number)||""}):s("form-control-text",{name:"routing_number",label:"Routing Number",defaultValue:this.defaultValue.routing_number,maxLength:9,errorText:this.errors.routing_number,inputHandler:this.inputHandler,keyDownHandler:nt,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))}},Et=class{constructor(e){t(this,e)}render(){var t,e,i,a,r,n,o;return s("div",{key:"8de8f05777f72ecb1112328544e75be7cd929e8d",class:"row gy-3"},s("div",{key:"513fb78b434ba3aebe51b636f7494b54e437c65f",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Bank Name",value:null===(t=this.defaultValue)||void 0===t?void 0:t.bank_name}):s("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),s("div",{key:"37a1ef4ac58fbe1633a93020e786d546cd832867",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Nickname",value:null===(e=this.defaultValue)||void 0===e?void 0:e.nickname}):s("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),s("div",{key:"fc8820e264d14ac3c5a1c6fd171b381c2b6d99e1",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):s("form-control-text",{name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler})),s("div",{key:"f183b1c5f6a8b0f905c916cd1715448f3e02d26f",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Type",value:null===(a=this.defaultValue)||void 0===a?void 0:a.account_type}):s("form-control-select",{name:"account_type",label:"Account Type",options:st,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),s("div",{key:"8366ebde2f319f6d910a34917f57ad43b3ee234f",class:"col-3"},this.formDisabled?s("bank-account-read-only-value",{label:"Transit Number",value:(null===(r=this.defaultValue)||void 0===r?void 0:r.transit_number)||""}):s("form-control-text",{name:"transit_number",label:"Transit Number",defaultValue:this.defaultValue.transit_number,maxLength:5,errorText:this.errors.transit_number,inputHandler:this.inputHandler,keyDownHandler:nt,helpText:"5 digits"})),s("div",{key:"c91166337c2984048466014634f5d4e59ce2b40a",class:"col-3"},this.formDisabled?s("bank-account-read-only-value",{label:"Institution Number",value:(null===(n=this.defaultValue)||void 0===n?void 0:n.institution_number)||""}):s("form-control-text",{name:"institution_number",label:"Institution Number",defaultValue:this.defaultValue.institution_number,maxLength:3,errorText:this.errors.institution_number,inputHandler:this.inputHandler,keyDownHandler:nt,helpText:"3 digits"})),s("div",{key:"ebce2f50ec265ed2fef7a0b3dae84d33036ad145",class:"col-6"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Number",value:(null===(o=this.defaultValue)||void 0===o?void 0:o.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):s("form-control-text",{name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:nt,helpText:"Please copy the account number as shown on your statement. Do not include spaces or dashes."})))}},St=(t,e)=>t.some((t=>t.document_type===e)),Vt=t=>t?{bank_name:dt.nullable(),nickname:ct.nullable(),account_owner_name:lt.nullable(),account_type:ht.nullable(),account_number:ot.nullable()}:{bank_name:dt.required("Enter bank name"),nickname:ct.required("Enter nickname"),account_owner_name:lt.required("Enter account owner name"),account_type:ht.required("Select account type"),account_number:ot.required("Enter account number")},Ht=(t,e)=>{if(e)return{voided_check:S().nullable(),bank_statement:S().nullable()};const s=St(t,n.voidedCheck),i=St(t,n.bankStatement),a=s||i,r="Please upload either a voided check or a bank statement. Only one is required.";return{voided_check:S().when("bank_statement",{is:t=>!t&&!a,then:t=>t.required(r),otherwise:t=>t.notRequired()}),bank_statement:S().when("voided_check",{is:t=>!t&&!a,then:t=>t.required(r),otherwise:t=>t.notRequired()})}},It={[I.USA]:(t,e=[])=>((t,e)=>{const s=Object.assign(Object.assign(Object.assign({},Vt(e)),(t=>t?{routing_number:mt.nullable()}:{routing_number:mt.required("Enter routing number")})(e)),Ht(t,e));return A().shape(s,[["voided_check","bank_statement"]])})(e,t),[I.CAN]:(t,e=[])=>((t,e)=>{const s=Object.assign(Object.assign(Object.assign({},Vt(e)),(t=>{const e=E().length(3,"Institution number must be 3 digits").matches(ut,"Enter valid institution number"),s=E().length(5,"Transit number must be 5 digits").matches(ut,"Enter valid transit number");return t?{institution_number:e.nullable(),transit_number:s.nullable()}:{institution_number:e.required("Enter institution number"),transit_number:s.required("Enter transit number")}})(e)),Ht(t,e));return A().shape(s,[["voided_check","bank_statement"]])})(e,t)},Dt=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.bankAccount={},this.existingDocuments=[],this.documentData=new o,this.isLoading=!1,this.viewMode="manual",this.bankAccountVerification=!1,this.platformAccountId=null,this.getSchema=()=>(0,It[this.country])(this.allowOptionalFields,this.existingDocuments),this.initializeFormController=()=>{this.formController=new O(this.getSchema()),this.formController.setInitialValues("readonly"===this.viewMode?Object.assign({},this.bankAccount):{business_id:this.businessId}),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))},this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))},this.storeFiles=t=>{const e=Array.from(t.detail.fileList),s=t.detail.document_type,i=e.map((t=>new h({file:t,document_type:s},this.businessId)));this.documentData[s]=i},this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.processBusinessResponse(t.data),this.determineViewMode()},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.initializeFormController(),this.isLoading=!1}})},this.handleChangeBankAccount=()=>{this.viewMode=this.plaidAvailable?"plaid":"manual",this.documentData=new o,this.initializeFormController()},this.handleCancel=()=>{this.viewMode=this.existingBankAccount?"readonly":"plaid",this.documentData=new o,this.initializeFormController()},this.handleToggleToManualEntry=()=>{this.viewMode="manual"},this.handleToggleToPlaidVerification=()=>{this.viewMode="plaid"},this.handleSaveBankAccount=async()=>{this.formController.validateAndSubmit((()=>{this.sendData((()=>{}))}))},this.postDocumentRecordData=async t=>{this.isLoading=!0;const e=t.record_data;return new Promise((s=>{this.postDocumentRecord({payload:e,onSuccess:e=>{s(this.handleDocRecordResponse(t,e))},onError:({error:t,code:e,severity:i})=>{this.errorEvent.emit({message:t,errorCode:e,severity:i}),s(!1)}})}))},this.handleDocRecordResponse=(t,e)=>e.error?(this.errorEvent.emit({errorCode:r.POST_ERROR,message:e.error.message,severity:a.ERROR,data:e.error}),!1):(t.setPresignedUrl(e.data.presigned_url),!0),this.uploadDocument=async t=>{if(!t.presigned_url)throw new Error("Presigned URL is not set");const e=await t.getFileData(),s=await fetch(t.presigned_url,{method:"PUT",body:e});return this.handleUploadResponse(s)},this.handleUploadResponse=t=>!t.error||(this.errorEvent.emit({errorCode:r.POST_ERROR,message:t.error.message,severity:a.ERROR,data:t.error}),!1)}propChanged(){this.initializeApi()}watchHandler(t){this.formLoading.emit(t)}async validateAndSubmit({onSuccess:t}){"readonly"===this.viewMode?this.sendData(t):this.formController.validateAndSubmit((()=>this.sendData(t)))}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData(),this.formController=new O(this.getSchema())}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.postBankAccount=b({authToken:this.authToken,service:new k}),this.postDocumentRecord=p({authToken:this.authToken,service:new w})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}get postPayload(){const t=this.formController.values.getValue();return new Ct(t).payload}get existingBankAccount(){var t;return!!(null===(t=this.bankAccount)||void 0===t?void 0:t.id)}get plaidAvailable(){return this.bankAccountVerification&&!!this.platformAccountId}get showCancel(){return this.bankAccountVerification||this.existingBankAccount}processBusinessResponse(t){const{bank_accounts:e,documents:s,settings:i,platform_account_id:a}=t;e.length>0?this.bankAccount=new Ct(e[e.length-1]):(this.bankAccount=new Ct({}),this.bankAccount.business_id=this.businessId),this.existingDocuments=s,this.bankAccountVerification=!0===i.bank_account_verification,this.platformAccountId=a}determineViewMode(){this.viewMode=this.existingBankAccount?"readonly":this.plaidAvailable?"plaid":"manual"}async sendData(t){try{if("manual"===this.viewMode&&!await this.postBankAccountData())return;if(!await this.postBusinessDocuments())return;"manual"===this.viewMode&&(this.viewMode="readonly",await this.refreshBankAccountData()),t()}catch(t){this.errorEvent.emit({message:t,errorCode:r.POST_ERROR,severity:a.ERROR})}}async postBankAccountData(){let t;return this.isLoading=!0,new Promise((e=>{let s=!1;this.postBankAccount({payload:this.postPayload,onSuccess:e=>{t=e,s=!0},onError:({error:t,code:e,severity:i})=>{s=!1,this.errorEvent.emit({message:t,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:at.bankAccount}),this.isLoading=!1,e(s)}})}))}async refreshBankAccountData(){return new Promise((t=>{this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.processBusinessResponse(t.data),this.determineViewMode(),this.initializeFormController()},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.isLoading=!1,t()}})}))}async postBusinessDocuments(){this.isLoading=!0;try{const t=Object.values(this.documentData).flat();return!t.length||!(await Promise.all(t.map((t=>this.postDocumentRecordData(t))))).includes(!1)&&!(await Promise.all(t.map((t=>this.uploadDocument(t))))).includes(!1)}finally{this.isLoading=!1}}renderBankAccountInputs(t){const e=this.formController.getInitialValues();return s(this.country===I.CAN?"bank-account-form-inputs-canada":"bank-account-form-inputs",{defaultValue:e,errors:this.errors,inputHandler:this.inputHandler,formDisabled:t})}renderReadonlyView(){return s("div",null,this.renderBankAccountInputs(!0),s("div",{class:"mt-3"},s(bt,{variant:"secondary",type:"button",onClick:this.handleChangeBankAccount,disabled:this.isLoading,part:q},"Change Bank Account")))}renderPlaidView(){return s("div",{class:"mt-3"},s("plaid-verification",{authToken:this.authToken,accountId:this.platformAccountId,businessId:this.businessId,onPlaidVerificationSuccess:()=>{this.viewMode="readonly",this.refreshBankAccountData()}}),s("div",{class:"mt-3"},s(bt,{type:"button",variant:"link",className:"p-0",onClick:this.handleToggleToManualEntry,disabled:this.isLoading,part:Z},"Enter bank details manually (document upload required)")))}renderManualEntryView(){return s("div",null,this.plaidAvailable&&s("div",{class:"mb-3"},s(bt,{type:"button",variant:"secondary",onClick:this.handleToggleToPlaidVerification,disabled:this.isLoading,part:q},"Link bank account with Plaid instead")),this.renderBankAccountInputs(!1),s("div",{class:"mt-3 d-flex gap-2"},this.showCancel&&s(bt,{variant:"secondary",type:"button",onClick:this.handleCancel,disabled:this.isLoading,part:q},"Cancel"),s(bt,{variant:"primary",type:"button",onClick:this.handleSaveBankAccount,disabled:this.isLoading,isLoading:this.isLoading},"Save Bank Account")))}renderDocumentUploads(){return s("fieldset",{class:"mt-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"Document Uploads"),s("form-control-tooltip",{helpText:"One document (voided check or bank statement) is required for underwriting purposes. It needs to visibly show the name tied to the account and the account number. Various file formats such as PDF, DOC, DOCX, JPEG are accepted. Multiple files can be uploaded for each document category."})),s("hr",{class:"mt-2"}),s("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading}),s("bank-account-document-form-inputs",{inputHandler:this.inputHandler,errors:this.errors,storeFiles:this.storeFiles}))}render(){return this.isLoading?s(tt,null):s("form",null,s("fieldset",{class:"mb-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"Bank Account Info"),s("form-control-tooltip",{helpText:"This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),s("hr",{class:"mt-2"}),"readonly"===this.viewMode&&this.renderReadonlyView(),"plaid"===this.viewMode&&this.renderPlaidView(),"manual"===this.viewMode&&this.renderManualEntryView()),"plaid"!==this.viewMode&&this.renderDocumentUploads())}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],isLoading:["watchHandler"]}}},Bt=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.coreInfo={},this.isLoading=!1,this.isEditingTaxId=!1,this.getData=()=>{this.getBusiness&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.coreInfo=new D(t.data),this.formController.setInitialValues(Object.assign({},this.coreInfo))},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:s=>{e=s,t(),this.isEditingTaxId=!1},onError:({error:t,code:s,severity:i,rawError:a})=>{e=t,a&&"object"==typeof a&&a.param&&this.formController.setFieldError(a.param,a.message),this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:at.businessInfo}),this.formLoading.emit(!1)}})},this.inputHandler=(t,e)=>{this.errors[t]&&this.formController.clearFieldError(t),this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:t}){this.formController.validateAndSubmit((()=>this.sendData(t)))}get patchPayload(){return new D(this.formController.values.getValue()).payload}componentWillLoad(){this.initializeApi();const t=this.country===I.CAN?T(this.allowOptionalFields):L(this.allowOptionalFields);this.formController=new O(t),this.getData()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}render(){var t,e;const i=this.formController.getInitialValues();return this.isLoading?s(tt,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"Business Information")),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"legal_name",label:"Business Name",defaultValue:i.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)."})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:i.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)"})),s("div",{class:"col-12 col-md-8"},s("form-control-select",{name:"classification",label:"Business Classification",options:it,defaultValue:i.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-4"},s("form-control-date",{name:"date_of_incorporation",label:"Date of Registration",defaultValue:i.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"industry",label:"Industry",defaultValue:i.industry,errorText:this.errors.industry,inputHandler:this.inputHandler,helpText:"Describe what you sell"})),s("div",{class:"col-12 col-md-6"},!(null===(t=this.coreInfo)||void 0===t?void 0:t.tax_id_last4)||this.isEditingTaxId?s("form-control-number-masked",{name:"tax_id",label:pt[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:"000000000",helpText:pt[this.country].taxIdHelpText}):s("div",null,s("label",{class:"form-label",part:U},pt[this.country].taxIdLabel),s("div",{class:"input-group mb-3"},s("input",{type:"text",class:"form-control",part:z,value:`****${null===(e=this.coreInfo)||void 0===e?void 0:e.tax_id_last4}`,disabled:!0}),s("button",{class:"btn btn-secondary",type:"button",part:q,onClick:()=>{this.isEditingTaxId=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{tax_id:"",tax_id_last4:null}))}},"Change")))),s("div",{class:"col-12"},s("form-control-text",{name:"website_url",label:"Business Website URL",defaultValue:i.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler,helpText:"Don't have a live website? You can use your social media business page, app store link, or staging site URL."})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"email",label:"Business Email Address",defaultValue:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-number-masked",{name:"phone",label:"Business Phone Number",defaultValue:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:R.US})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},Pt=class{constructor(e){t(this,e),this.documents=[],this.isLoading=!1}render(){return this.isLoading?s(gt,{height:"50px"}):this.documents.length?s(i,null,s("div",{class:"card",part:Y},s("div",{class:"card-body"},s("h5",{class:"card-title",part:W},"Documents Already on File"),s("div",{class:"table-responsive"},s("table",{class:"table table-sm table-borderless",part:$},s("thead",null,s("tr",null,s("th",{style:{width:"25%"},part:G,scope:"col"},"File Name"),s("th",{style:{width:"25%"},part:G,scope:"col"},"File Type"),s("th",{style:{width:"25%"},part:G,scope:"col"},"Document Type"),s("th",{style:{width:"25%"},part:G,scope:"col"},"Date Uploaded"))),s("tbody",null,this.documents.sort(((t,e)=>t.document_type.localeCompare(e.document_type))).map(((t,e)=>s("tr",{class:0===e?"border-bottom border-top":"border-bottom"},s("td",{part:J},t.file_name),s("td",{part:J},t.file_type),s("td",{part:J},ft(t.document_type)),s("td",{part:J},`${vt(t.created_at)} - ${yt(t.created_at)}`))))))))),s("hr",null)):null}},Nt=class{constructor(s){t(this,s),this.clickEvent=e(this,"click-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.ownersPayload=[],this.refs=[],this.isLoading=!1,this.representativeIsOwner=null,this.matchRef=(t,e)=>{if(null===t)return;const s=this.ownersPayload.findIndex((t=>t.id===e));-1!==s&&(this.refs.length!==this.ownersPayload.length&&this.manageRefs(),this.refs[s]=t)},this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.representative=new B(t.data.representative||{}),t.data.owners.length?this.ownersPayload=t.data.owners.map((t=>({id:t.id}))):this.addOwnerForm()},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1,this.manageRefs()}})},this.sendData=async t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:{owners:this.ownersPayload},onSuccess:s=>{e=s,t()},onError:({error:t,code:s,severity:i})=>{e=t,this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:at.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=t=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],t&&this.clickEvent.emit({name:rt.addOwnerForm})},this.removeOwnerForm=t=>{this.ownersPayload=this.ownersPayload.filter((e=>e.id!==t)),this.newFormOpen&&(this.newFormOpen=!1)},this.handleRepresentativeIsOwnerChange=t=>{this.representativeIsOwner=t,this.representativeIsOwner&&(this.formLoading.emit(!0),this.isLoading=!0,this.ownersPayload=this.ownersPayload.filter((t=>""!==t.id)),this.patchBusiness({payload:{representative:{is_owner:!0},owners:[{id:this.representative.id},...this.ownersPayload]},onSuccess:()=>{this.getData(),this.newFormOpen=!1},finally:()=>{this.isLoading=!1,this.formLoading.emit(!1)}}))}}propChanged(){this.initializeApi()}get showAddOwnerButton(){return this.ownersPayload.length<4&&!this.newFormOpen}manageRefs(){this.refs=this.ownersPayload.map((t=>t.id))}async validateAndSubmit({onSuccess:t}){const e=this.refs.map((t=>t.validate()));if(!(await Promise.all(e)).every((t=>t)))return;const s=this.refs.map((t=>t.submit()));(await Promise.all(s)).every((t=>t))&&this.sendData(t)}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}ownersWatcher(){this.manageRefs()}handleOwnerSubmit(t){const e=t.detail,s=this.ownersPayload.map((t=>t.id===e.id?e:t));s.includes(e)||(s[this.ownersPayload.findIndex((t=>!t.id))]=e,this.newFormOpen&&(this.newFormOpen=!1)),this.ownersPayload=s}render(){if(this.isLoading)return s(i,null,s(tt,null));const t=this.ownersPayload.some((t=>t.id===this.representative.id)),e=null===this.representativeIsOwner&&!t;return s(i,null,s("div",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"Owners"),s("form-control-tooltip",{helpText:"For partnerships, LLCs or privately held corporations, the business is required to apply with all individuals with 25% or more ownership to the application. For charities and registered non-profits, the business is required to apply with 1 individual with substantial control over the entity, such as a board member or director."})),s("hr",{class:"mt-2"}),e&&s("div",{class:"alert alert-warning mb-3",part:X},s("div",{class:"card-body"},s("div",{class:"d-flex align-items-center mb-3"},s("strong",null,"Is the representative of this business also an owner?")),s("div",{class:"d-flex gap-2"},s(bt,{variant:"primary",onClick:()=>this.handleRepresentativeIsOwnerChange(!0)},"Yes"),s(bt,{variant:"secondary",onClick:()=>this.handleRepresentativeIsOwnerChange(!1)},"No")))),s("div",{class:"row gy-3"},this.ownersPayload.map((t=>s("owner-form",{key:t.id,authToken:this.authToken,businessId:this.businessId,ownerId:t.id,removeOwner:this.removeOwnerForm,newFormOpen:this.newFormOpen,ownersLength:this.ownersPayload.length,country:this.country,allowOptionalFields:this.allowOptionalFields,ref:e=>this.matchRef(e,t.id)})))),s("div",{class:"d-flex justify-content-start"},s("div",{class:"gap-2"},s(bt,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner")))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],ownersPayload:["ownersWatcher"]}}},Mt=class{constructor(e){t(this,e),this.isEditingIdentification=!1,this.inputHandler=(t,e)=>{kt(this.formController,{[t]:e})},this.onAddressFormUpdate=t=>{wt(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),t))}}render(){var t,e,i,a,r,n,o,h,l;return s("form",{key:"ef49167cc726b3d4efa128503553a77a7627ebee"},s("fieldset",{key:"3714ce7eab6e9cee062911564d1c2635b68dfc8b"},s("div",{key:"4f27236b0438e29d7449bf5e9f71c00c7245effa",class:"d-flex align-items-center gap-2"},s("legend",{key:"adc144da314549264571b245c5388ab56c1dbbf1",class:"mb-0",part:W},"Representative"),s("form-control-tooltip",{key:"bcc76add04febe984427103a594aa63cab17bd27",helpText:"The representative for your business needs to be someone who has significant control over managing your business's finance. You will have an opportunity to add owners later in the form."})),s("hr",{key:"98bfed19989ee57e451a7005f3e60af16cc5d3b5",class:"mt-2"}),s("div",{key:"8f5e0e3deed2627ecf9f77290f268c0e2ee68bfa",class:"row gy-3"},s("div",{key:"b1205284a54a608b9c3b6be386e134849c9c6b25",class:"col-12 col-md-8"},s("form-control-text",{key:"36fcd91ca263adfd9fb69dc88f15404f93a8bc13",name:"name",label:"Full Name",defaultValue:null===(t=this.representativeDefaultValue)||void 0===t?void 0:t.name,errorText:this.errors.name,inputHandler:this.inputHandler})),s("div",{key:"879337d3c6a120f5dc9de3cd3364b34b9c4689df",class:"col-12 col-md-4"},s("form-control-text",{key:"ff2e4d29e76b93693735b35cbaca4416f0cd28a0",name:"title",label:"Title",defaultValue:null===(e=this.representativeDefaultValue)||void 0===e?void 0:e.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),s("div",{key:"2a011b74b4c203ae4a309d7d76ea8fd0631a5f2c",class:"col-12 col-md-6"},s("form-control-text",{key:"1ef20c59829ed3abe81cc53355bbafd5d4894360",name:"email",label:"Email Address",defaultValue:null===(i=this.representativeDefaultValue)||void 0===i?void 0:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{key:"460dad175238fdfea8c79666343943a95aac0fd5",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"7bd3ad79f6da1d33e38c2246d9c0378c2ef8b7d7",name:"phone",label:"Phone Number",defaultValue:null===(a=this.representativeDefaultValue)||void 0===a?void 0:a.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:R.US})),s("div",{key:"cda84bfc9f88a35177a42b7f9ec4c58292600c0b",class:"col-12 col-md-4"},s("form-control-date",{key:"5ed66fabc97afc94a5839135add25dbcb5237900",name:"dob_full",label:"Birth Date",defaultValue:null===(r=this.representativeDefaultValue)||void 0===r?void 0:r.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:t=>_t(t,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"0e19619fd081ea9dacd0eb25388a4c7b2c993312",class:"col-12 col-md-8"},!(null===(n=this.representativeDefaultValue)||void 0===n?void 0:n.ssn_last4)||this.isEditingIdentification?s("form-control-number-masked",{name:"identification_number",label:pt[this.country].idNumberLabel,defaultValue:this.isEditingIdentification?"":null===(o=this.representativeDefaultValue)||void 0===o?void 0:o.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:F[this.country],helpText:pt[this.country].identityHelpText}):s("div",null,s("label",{class:"form-label",part:U},pt[this.country].idNumberLabel),s("div",{class:"input-group mb-3"},s("input",{type:"text",class:"form-control",part:z,value:`****${null===(h=this.representativeDefaultValue)||void 0===h?void 0:h.ssn_last4}`,disabled:!0}),s("button",{class:"btn btn-secondary",type:"button",part:q,onClick:()=>{this.isEditingIdentification=!0,kt(this.formController,{identification_number:"",ssn_last4:null})}},"Change")))),s("div",{key:"6647390b209f5a630bf60e8952a7b0e70c92ca8a",class:"col-12"},s("identity-address-form",{key:"9755d0450fc8d83ba0a98a304455df346ff33e7f",errors:this.errors.address,defaultValues:null===(l=this.representativeDefaultValue)||void 0===l?void 0:l.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},Rt=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.representative={},this.isLoading=!1,this.getData=()=>{this.getBusiness&&this.formController&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.representative=new B(t.data.representative||{}),this.representative.address.country=this.country,this.formController.setInitialValues(Object.assign({},this.representative))},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:s=>{e=s,t()},onError:({error:t,code:s,severity:i})=>{e=t,this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:at.representative}),this.formLoading.emit(!1)}})}}propChanged(){this.initializeApi(),this.getData()}async validateAndSubmit({onSuccess:t}){this.formController.validateAndSubmit((()=>this.sendData(t)))}componentWillLoad(){this.initializeApi(),this.initializeForm()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}initializeForm(){const t=C[this.country];t?(this.formController=new O(t("representative",this.allowOptionalFields)),this.getData()):this.errorEvent.emit({message:"Missing schema for selected country",errorCode:r.MISSING_PROPS,severity:a.ERROR})}componentDidLoad(){this.formController&&this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}get patchPayload(){return{representative:new B(this.formController.values.getValue()).payload}}render(){return!this.formController||this.isLoading?s(tt,null):s("business-representative-form-inputs",{representativeDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController,country:this.country})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},Ft=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.formCompleted=e(this,"formCompleted",7),this.errors={},this.fetchData=async()=>{this.formLoading.emit(!0);try{const t=await this.api.get({endpoint:this.businessEndpoint,authToken:this.authToken});this.acceptedTermsBefore=t.data.terms_conditions_accepted}catch(t){this.errorEvent.emit({errorCode:r.FETCH_ERROR,message:t.message,severity:a.ERROR,data:t})}finally{this.formLoading.emit(!1)}},this.sendData=async t=>{this.formLoading.emit(!0);try{const e=this.termsPayload,s=await this.api.post({endpoint:this.termsConditionsEndpoint,body:e,authToken:this.authToken});this.handleResponse(s,t)}catch(t){this.errorEvent.emit({errorCode:r.POST_ERROR,message:t.message,severity:a.ERROR,data:t})}finally{this.formLoading.emit(!1)}},this.inputHandler=(t,e)=>{this.acceptedTerms=e,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=xt(),this.formController=new O((t=>{const e=A({accepted:V().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),s=A({accepted:V().nullable()});return t?s:e})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(t,e){t.error?this.errorEvent.emit({errorCode:r.POST_ERROR,message:t.error.message,severity:a.ERROR,data:t.error}):e(),this.stepCompleteEvent.emit({response:t,formStep:at.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:t}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:at.termsAndConditions,metadata:"no data submitted"}),this.formCompleted.emit(),t()):this.formController.validateAndSubmit((()=>this.sendData(t)))}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}get merchantAgreementLink(){return s("a",{href:"https://justifi.tech/merchant-agreement/",target:"_blank",rel:"noopener noreferrer"},"merchant agreement")}render(){return s("form",{key:"24b0a8ff0187894cf5e0f56e9e4b28c378e720cb"},s("fieldset",{key:"26fa9159dd6d61edd28b9443a10eeb981f150308"},s("legend",{key:"103bdecbc51f2cccd9105e2f9b271b60760618ec",part:W},"Terms and Conditions"),s("hr",{key:"dfd29fbe609a57d8160df7980ed0e63e75934a86"}),s("div",{key:"61e06597ec652c1d7c6e7e2bd8c9b653d061d076"},s("p",{key:"cd4def71580cd14d6edb5887221ebf6aa80cc2ea"},"Please read and accept the ",this.merchantAgreementLink," to submit your provisioning request.")),s("br",{key:"e3c64733f11a4f702e686e6c5ae7acd7e6bd1c34"}),s("div",{key:"71bd74de3aee69805a2aa1297356ff8b8db3c76c",class:"row-gy-3"},s("div",{key:"94a28c13e3bbc1c89cd1b5ebde2e1732b48f99ea",class:"col-12"},s("form-control-checkbox",{key:"fee95fa42192fee1bbfd544307b4e1c11c0d97f4",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText,checked:this.acceptedTerms})))))}},Wt=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.legal_address={},this.isLoading=!1,this.getData=()=>{this.getBusiness&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{const e=new P((t.data||{}).legal_address||{});this.legal_address=Object.assign(Object.assign({},e),{country:this.country}),this.formController.setInitialValues(Object.assign({},this.legal_address))},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:s=>{e=s,t()},onError:({error:t,code:s,severity:i})=>{e=t,this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:at.legalAddress}),this.formLoading.emit(!1)}})},this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:t}){this.formController.validateAndSubmit((()=>this.sendData(t)))}get patchPayload(){return{legal_address:new P(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new O((0,j[this.country])(this.allowOptionalFields)),this.getData()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}render(){var t;const e=null===(t=this.formController)||void 0===t?void 0:t.getInitialValues();return this.isLoading?s(tt,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"Legal Address of your Business"),s("form-control-tooltip",{helpText:"No PO Boxes."})),s("hr",{class:"mt-2"}),s("form-address-fields",{country:this.country,errors:this.errors,defaultValues:e,inputHandler:this.inputHandler})))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},qt=class{loadingWatcher(){this.formLoading.emit(this.isLoading)}constructor(s){t(this,s),this.clickEvent=e(this,"click-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.ownerSubmitted=e(this,"ownerSubmitted",7),this.isLoading=!1,this.errors={},this.owner={},this.getData=()=>{this.getOwner&&(this.isLoading=!0,this.getOwner({onSuccess:t=>{this.instantiateOwner(t.data)},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>this.isLoading=!1}))},this.sendData=()=>(this.isLoading=!0,new Promise((t=>{this.ownerId?this.patchOwner({payload:this.payload,onSuccess:e=>{this.ownerSubmitted.emit({id:e.data.id}),this.instantiateOwner(e.data),t(!0)},onError:({error:e,code:s,severity:i})=>{this.errorEvent.emit({message:e,errorCode:s,severity:i}),t(!1)},final:()=>this.isLoading=!1}):this.postOwner({payload:this.payload,onSuccess:e=>{this.ownerSubmitted.emit({id:e.data.id}),this.instantiateOwner(e.data),t(!0)},onError:({error:e,code:s,severity:i})=>{this.errorEvent.emit({message:e,errorCode:s,severity:i}),t(!1)},final:()=>this.isLoading=!1})}))),this.instantiateOwner=async t=>{this.owner=Object.assign({},new N(t)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?rt.updateOwner:rt.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:rt.removeOwner})},this.validate=this.validate.bind(this),this.submit=this.submit.bind(this),this.validateAndSubmit=this.validateAndSubmit.bind(this)}async returnOwnerData(){return this.ownerId}async validate(){return this.formController.validate()}async submit(){if(await this.validate())return this.sendData()}async validateAndSubmit(t){t.preventDefault(),await this.validate()&&this.submit()}get payload(){const t=new N(this.formController.values.getValue()).payload;return this.ownerId?t:Object.assign(Object.assign({},t),{business_id:this.businessId})}get formTitle(){return this.ownerId?"Edit Business Owner":"Add Business Owner"}get submitButtonText(){return this.ownerId?"Update":"Add"}get showRemoveButton(){return!(this.ownersLength<=1)&&(!(this.ownerId||!this.newFormOpen)||!(!this.ownerId||this.newFormOpen)||void 0)}componentWillLoad(){this.formController=new O((0,C[this.country])("owner",this.allowOptionalFields)),this.initializeApi(),this.ownerId&&this.getOwner?this.getData():this.instantiateOwner({})}componentDidLoad(){this.formController.errors.subscribe((t=>this.errors=Object.assign({},t)))}initializeApi(){this.authToken&&(this.getOwner=f({authToken:this.authToken,identityId:this.ownerId,service:new _}),this.patchOwner=v({authToken:this.authToken,identityId:this.ownerId,service:new _}),this.postOwner=y({authToken:this.authToken,service:new _}))}render(){return s(i,{key:"1661676befd63f9308edcb02be179db71b7c9d99",style:{display:"block"}},s("form",{key:"4961f358ca8953156477d455cacb19e4dec3cc29",onSubmit:this.validateAndSubmit},s("fieldset",{key:"27ecfec87ae93a1bdec94f3cc925558dc8f0ff23"},s("legend",{key:"4c194cf9e08e6fab9982b95a4b12c3c3a8cecdc3",class:"fw-semibold fs-5",part:K},this.formTitle),s("br",{key:"ef1f9b184dac866d27cfa245106d90db0954fa51"}),s("div",{key:"2936ecc396220f8b80e5d8454bc6f6f70cb3ae73",class:"row gy-3"},s("owner-form-inputs",{key:"f34d38b718ed7fde67102aa1034b5e6377e001f8",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController,country:this.country}),s("div",{key:"2d5266bc1a7f4aeb12cab8a494107f2668b2fb0e",class:"d-flex gap-2 justify-content-start"},s(bt,{key:"39631fd0364221ac2a274d8aa794a1f3c8d28780",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(bt,{key:"120fbae294f8f67bd14fe0be5dc1bcf881ffd489",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"73eccba19a595b67f64139769a495d5a27e02b2f"}))))}static get watchers(){return{isLoading:["loadingWatcher"]}}},Zt=class{constructor(s){t(this,s),this.plaidVerificationSuccess=e(this,"plaidVerificationSuccess",7),this.plaidVerificationError=e(this,"plaidVerificationError",7),this.linkToken=null,this.linkTokenId=null,this.plaidLink=null,this.isAuthenticating=!1,this.isSuccess=!1,this.error=null,this.isLoading=!1,this.plaidService=new Lt,this.abortController=null,this.timeoutId=null,this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:d.PLAID_SDK_LOAD_FAILED,message:c[d.PLAID_SDK_LOAD_FAILED],severity:l[d.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:d.PLAID_LINK_TOKEN_FAILED,message:c[d.PLAID_LINK_TOKEN_FAILED],severity:l[d.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:d.PLAID_LINK_INIT_FAILED,message:c[d.PLAID_LINK_INIT_FAILED],severity:l[d.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,s,i;try{if(!this.authToken||!this.accountId)return void this.handleError({code:d.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please provide authToken and accountId.",severity:a.ERROR,retryable:!1,userAction:"Provide required props"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var t;null===(t=this.abortController)||void 0===t||t.abort()}),3e4);const t=await this.plaidService.getLinkTokenForVerification(this.authToken,this.businessId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),t.error)throw new Error("string"==typeof t.error?t.error:t.error.message||"Failed to get link token");this.linkToken=t.data.link_token,this.linkTokenId=t.data.id}catch(a){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let r=d.PLAID_LINK_TOKEN_FAILED,n=c[r],o=!0;"AbortError"===a.name?(r=d.PLAID_TIMEOUT,n=c[r],o=!0):(null===(t=a.message)||void 0===t?void 0:t.includes("network"))||(null===(e=a.message)||void 0===e?void 0:e.includes("fetch"))?(r=d.PLAID_NETWORK_ERROR,n=c[r],o=!0):((null===(s=a.message)||void 0===s?void 0:s.includes("401"))||(null===(i=a.message)||void 0===i?void 0:i.includes("unauthorized")))&&(r=d.PLAID_INVALID_CREDENTIALS,n="Authentication failed. Please check your credentials.",o=!1),this.handleError({code:r,message:n,severity:l[r],originalError:a,retryable:o,userAction:o?"Click to try again":"Check your credentials"})}},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=async t=>{var e;this.isAuthenticating=!1,this.isLoading=!0,this.clearError();try{const s=await this.plaidService.postPlaidVerifiedBankAccountData(this.authToken,this.businessId,{public_token:t,link_token_id:this.linkTokenId},null===(e=this.abortController)||void 0===e?void 0:e.signal);if(s.error)throw new Error("string"==typeof s.error?s.error:s.error.message||"Failed to verify bank account");this.isSuccess=!0,this.isLoading=!1,this.plaidVerificationSuccess.emit({publicToken:t,bankAccount:s.data})}catch(t){this.isLoading=!1,this.handleError({code:d.PLAID_AUTHENTICATION_FAILED,message:(null==t?void 0:t.message)||"Failed to verify bank account",severity:l[d.PLAID_AUTHENTICATION_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},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=d.PLAID_AUTHENTICATION_FAILED,s=c[e],i=!0,a="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=d.PLAID_INVALID_CREDENTIALS,s=c[e],i=!0;break;case"ITEM_LOGIN_REQUIRED":e=d.PLAID_INVALID_CREDENTIALS,s="Your bank requires re-authentication. Please try again.",i=!0;break;case"ITEM_LOCKED":e=d.PLAID_ACCOUNT_LOCKED,s=c[e],i=!1,a="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=d.PLAID_MAINTENANCE,s=c[e],i=!0;break;case"RATE_LIMIT_EXCEEDED":e=d.PLAID_RATE_LIMITED,s=c[e],i=!0;break;default:t.error_message&&(s=t.error_message)}this.handleError({code:e,message:s,severity:l[e],originalError:t,retryable:i,userAction:a}),this.isAuthenticating=!1},this.handleError=t=>{this.error=t,this.isLoading=!1,this.plaidVerificationError.emit(t),console.error("Plaid verification error:",t)},this.clearError=()=>{this.error&&(this.error=null)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.initializePlaidLink()},this.scriptRef.onerror=()=>{this.handleError({code:d.PLAID_SDK_LOAD_FAILED,message:c[d.PLAID_SDK_LOAD_FAILED],severity:l[d.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}disconnectedCallback(){this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){const t=s("svg",{class:"plaid-logo-img",height:"20",width:"20",viewBox:"0 0 28 29",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline",marginLeft:"5px",marginRight:"5px",marginTop:"-2px"}},s("g",{fill:"#fff","fill-rule":"evenodd"},s("path",{d:"M25.7629 26.2628L28 17.5309L24.9691 14.5001L27.9999 11.4691L25.7628 2.73706L17.0309 0.5L14.0001 3.531L10.969 0.50014L2.23706 2.73734L0 11.4691L3.03128 14.4999L0.00014 17.531L2.2372 26.2629L10.9691 28.5L14.0001 25.469L17.031 28.4999L25.7629 26.2628ZM15.7321 23.7371L18.6186 20.8505L22.2912 24.5233L17.6956 25.7007L15.7321 23.7371ZM11.1136 9.88154L14.0003 6.99502L16.8868 9.8814L14.0001 12.7679L11.1136 9.88154ZM12.2682 14.5L9.38154 17.3865L6.49502 14.5L9.38154 11.6135L12.2682 14.5ZM18.6187 11.6133L21.5053 14.5L18.6186 17.3865L15.7321 14.5L18.6187 11.6133ZM16.8867 19.1186L14.0001 22.0051L11.1135 19.1185L14.0001 16.2319L16.8867 19.1186ZM10.3044 25.7007L5.70864 24.5233L9.38154 20.8504L12.2682 23.7371L10.3044 25.7007ZM4.76308 16.2319L7.6496 19.1185L3.9767 22.7914L2.7993 18.1957L4.76308 16.2319ZM3.9767 6.20836L7.64974 9.8814L4.76308 12.7681L2.7993 10.8041L3.9767 6.20836ZM12.2683 5.26294L9.38168 8.1496L5.70892 4.4767L10.3047 3.2993L12.2683 5.26294ZM17.6959 3.2993L22.2915 4.4767L18.6186 8.14946L15.7321 5.26294L17.6959 3.2993ZM23.2372 12.7681L20.3505 9.8814L24.0233 6.20878L25.2007 10.8046L23.2372 12.7681ZM24.0233 22.7914L20.3505 19.1186L23.2372 16.2321L25.2007 18.1957L24.0233 22.7914Z"})));return s(Tt,null,s("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:t=>this.scriptRef=t}),s("div",null,s("div",{class:"mb-3"},s(bt,{variant:"primary",type:"button",onClick:t=>{t.preventDefault(),this.openPlaidLink()},disabled:this.isLoading,part:Q},"Connect with Plaid ",t," (instant verification)")),(()=>this.error?s("div",{class:(this.error.severity===a.ERROR?"text-danger":this.error.severity===a.WARNING?"text-warning":"text-info")+" mt-2"},s("small",null,this.error.message),s("br",null),this.error.userAction&&s("small",{class:"text-muted"},this.error.userAction)):null)(),(()=>this.error?null:this.isLoading?s("div",{class:"text-info mt-2"},s("small",null,"Verifying bank account...")):this.isSuccess?s("div",{class:"text-success mt-2"},s("small",null,"✓ Bank account verified successfully")):this.isAuthenticating?s("div",{class:"text-info mt-2"},s("small",null,"Connecting to your bank...")):null)()))}};export{jt as additional_questions_form_step,Ot as bank_account_document_form_inputs,At as bank_account_form_inputs,Et as bank_account_form_inputs_canada,Dt as business_bank_account_form_step,Bt as business_core_info_form_step,Pt as business_documents_on_file,Nt as business_owners_form_step,Mt as business_representative_form_inputs,Rt as business_representative_form_step,Ft as business_terms_conditions_form_step,Wt as legal_address_form_step,qt as owner_form,Zt as plaid_verification}
@@ -1 +1 @@
1
- import{r as s,h as t}from"./p-CV0Pyo1O.js";import{C as i}from"./p-BcNb9bVO.js";import{B as e}from"./p-XYgDHrVL.js";import{B as o}from"./p-2LVpxCS_.js";import"./p-CZfYo5-1.js";import"./p-DnrawQn3.js";const n=class{constructor(t){s(this,t)}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return t("div",{key:"6fac4d1e92b732da3e7e867c091f23e9e3b7d6ab",class:"d-flex gap-2"},t(o,{key:"a96025bed24ade707d7f28561a12a9bcf62401e8",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),t(o,{key:"c4bd0d4a7f79942b307a4587e77c73158d4b704d",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,e.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),t(o,{key:"5fa56e168646f4fa266fde124c78dc2564a6c311",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,e.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},r=class{constructor(e){s(this,e),this.allowOptionalFields=!1,this.country=i.USA,this.componentStepMapping={0:()=>t("business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),1:()=>t("legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),2:()=>t("additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>t("business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),4:()=>t("business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),5:()=>t("business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),6:()=>t("business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return t("div",{key:"6bd8ebe91fefb364dd29a741e2cdf8a90aa1351b",class:"col-12 mb-4"},this.currentStepComponent)}};export{n as payment_provisioning_form_buttons,r as payment_provisioning_form_steps}
1
+ import{r as s,h as t}from"./p-CV0Pyo1O.js";import{C as i}from"./p-BcNb9bVO.js";import{B as e}from"./p-XYgDHrVL.js";import{B as o}from"./p-CHo7TfsM.js";import"./p-CZfYo5-1.js";import"./p-CPKMvyV_.js";const n=class{constructor(t){s(this,t)}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return t("div",{key:"6fac4d1e92b732da3e7e867c091f23e9e3b7d6ab",class:"d-flex gap-2"},t(o,{key:"a96025bed24ade707d7f28561a12a9bcf62401e8",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),t(o,{key:"c4bd0d4a7f79942b307a4587e77c73158d4b704d",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,e.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),t(o,{key:"5fa56e168646f4fa266fde124c78dc2564a6c311",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,e.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},r=class{constructor(e){s(this,e),this.allowOptionalFields=!1,this.country=i.USA,this.componentStepMapping={0:()=>t("business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),1:()=>t("legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),2:()=>t("additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>t("business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),4:()=>t("business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),5:()=>t("business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),6:()=>t("business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return t("div",{key:"6bd8ebe91fefb364dd29a741e2cdf8a90aa1351b",class:"col-12 mb-4"},this.currentStepComponent)}};export{n as payment_provisioning_form_buttons,r as payment_provisioning_form_steps}
@@ -0,0 +1 @@
1
+ import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{J as e}from"./p-DO9lqnbB.js";import{C as r,e as o}from"./p-NZS8uCtH.js";import{m as n,b as h}from"./p-APOabprT.js";import{B as a}from"./p-BJu1-9kE.js";import{A as p}from"./p-CYQvLgSs.js";import"./p-CLHwhyvu.js";import{C as m,B as l,c as d}from"./p-BcNb9bVO.js";import{c as u}from"./p-DjjAx7PF.js";import{i as c}from"./p-BRnBHsdq.js";import{t as v}from"./p-CPKMvyV_.js";import{S as f}from"./p-BqNNwq6C.js";import{H as g}from"./p-jIDKmNHy.js";import"./p-CZfYo5-1.js";import{B as y}from"./p-XYgDHrVL.js";import{P as j}from"./p-DSclFZ32.js";import"./p-B6YPrwyC.js";import"./p-Cm9f5fyh.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-uZ5KAseb.js";const b=p();class C{async postProvisioning(s,t,i){return b.post({endpoint:"entities/provisioning",body:{business_id:t,product_category:i},authToken:s})}}const w=()=>s("div",{class:"row gap-3 p-5"},s("div",{class:"col-12"},s(g,{text:"Business Already Provisioned"})),s("div",{class:"col-12",part:v},s("p",null,"We have already received the onboarding information for this business."))),k=()=>s("div",{class:"row gap-3 p5"},s("div",{class:"col-12"},s(g,{text:"You're all set for now"})),s("div",{class:"col-12",part:v},s("p",null,"We're reviewing your information and working on your approval. We'll be in touch to let you know once you've been approved (or if we find anything that needs fixing). Have a good one!"))),B=class{constructor(s){t(this,s),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.submitEvent=i(this,"submit-event",7),this.loading=!1,this.businessLoading=!0,this.businessProvisioned=!1,this.formSubmitted=!1,this.currentStep=0,this.country=m.USA,this.allowOptionalFields=!1,this.formTitle="Business Information",this.refs=[],this.setBusinessProvisioned=()=>new Promise((s=>{this.getBusiness({onSuccess:t=>{const i=new l(t.data);this.businessProvisioned=d(i),this.country=i.country_of_establishment,this.businessProvisioned&&this.errorEvent.emit({message:"A request to provision payments for this business has already been submitted.",errorCode:o.PROVISIONING_REQUESTED,severity:r.INFO}),this.businessLoading=!1,s()},onError:({error:t,code:i,severity:e})=>{this.errorEvent.emit({message:t,errorCode:i,severity:e}),this.businessLoading=!1,s()}})})),this.postProvisioningData=()=>{this.postProvisioning({onSuccess:s=>{this.formSubmitted=!0,this.submitEvent.emit({response:s})},onError:({error:s,code:t,severity:i})=>{this.submitEvent.emit({response:{error:s}}),this.errorEvent.emit({message:s,errorCode:t,severity:i})}})},this.incrementSteps=()=>{if(this.currentStep<this.totalSteps)return this.currentStep++},this.decrementSteps=()=>{this.currentStep>0&&(this.currentStep-=1)},this.previousStepButtonOnClick=()=>{this.clickEvent.emit({name:y.previousStep}),this.decrementSteps()},this.nextStepButtonOnClick=(s,t)=>{s.preventDefault(),this.clickEvent.emit({name:t}),this.refs[this.currentStep].validateAndSubmit({onSuccess:this.incrementSteps})}}propChanged(){this.initializeApi()}handleFormCompleted(){this.postProvisioningData()}handleFormLoading(s){this.loading=s.detail}async componentWillLoad(){u(),this.analytics=new e(this),this.initializeApi(),this.getBusiness?await this.setBusinessProvisioned():this.businessLoading=!1,this.refs=new Array(7)}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?c(this.authToken)?this.errorEvent.emit({message:"auth-token is expired",errorCode:o.NOT_AUTHENTICATED,severity:r.ERROR}):(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new a}),this.postProvisioning=h({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new C})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:o.MISSING_PROPS,severity:r.ERROR})}get formDisabled(){return this.loading||this.businessProvisioned}get totalSteps(){return this.refs.length-1}get stepCounter(){return`Step ${this.currentStep+1} of ${this.totalSteps+1}`}render(){return s(f,null,this.businessLoading?s(j,null):this.businessProvisioned?s(w,null):this.formSubmitted?s(k,null):s("div",{class:"row gap-3"},s(g,{text:this.formTitle}),s("payment-provisioning-form-steps",{businessId:this.businessId,authToken:this.authToken,refs:this.refs,currentStep:this.currentStep,allowOptionalFields:this.allowOptionalFields,country:this.country,handleFormLoading:this.handleFormLoading}),s("div",{class:"d-flex justify-content-between align-items-center"},s("div",{class:"d-flex align-items-center",part:v},this.stepCounter),s("payment-provisioning-form-buttons",{currentStep:this.currentStep,totalSteps:this.totalSteps,formLoading:this.loading,formDisabled:this.formDisabled,previousStepButtonOnClick:this.previousStepButtonOnClick,nextStepButtonOnClick:this.nextStepButtonOnClick}))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{B as justifi_payment_provisioning}
@@ -1 +1 @@
1
- import{r as e,h as n,H as t,c as i,g as o}from"./p-CV0Pyo1O.js";import{c as r}from"./p-D8GTwl9v.js";import{a7 as s,q as a,v as c,w as d,x as u}from"./p-DnrawQn3.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-BsQy297i.js";import{p as h}from"./p-beXEDfB9.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:g}=m,b=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}focusWithoutPageScroll(e){if(e)try{e.focus({preventScroll:!0})}catch(n){const{scrollX:t,scrollY:i}=window;e.focus(),window.scrollTo(t,i)}}async componentDidLoad(){const e=await this.getBaseFontStyles();g("fontStyles",e);const n=await this.getFocusedStyles();g("focused",n);const t=await this.getFocusedAndInvalidStyles();g("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?s:this.errorText?a:this.isFocused?c:d}render(){return n(t,{key:"5697b5e318914b8866bc6ad2fb2009e5f8c8d80f"},n("input",{key:"3370d11bc6e5a49f28dd2e95bf1d92ee7a0dd892",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,s="[iFrameSizer]",a=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){W(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=L(),window.iFrameResize=window.iFrameResize||L()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,b(e))}function v(e,n){x("info",e,n,b(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),C((function(){R(A),T(P),l("onResized",A)}),A,"init")}function t(e){var n=Number(u[P]["max"+e]),t=Number(u[P]["min"+e]),i=e.toLowerCase(),o=Number(A[i]);p(P,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(P,"Set "+i+" to min value")),o>n&&(o=n,p(P,"Set "+i+" to max value")),A[i]=""+o}function i(e){return W.slice(W.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;E("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=A.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(P),{x:Math.floor(Number(n.left)+Number(a.x)),y:Math.floor(Number(n.top)+Number(a.y))}}function c(e){var n=e?r(A.iframe):{x:0,y:0},t={x:Number(A.width)+n.x,y:Number(A.height)+n.y};p(P,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(P,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(P,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",a)?j():T(P)}function f(e){var n={};if(0===Number(A.width)&&0===Number(A.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:A.width,y:A.height};l(e,{iframe:A.iframe,screenX:Number(n.x),screenY:Number(n.y),type:A.type})}function l(e,n){return S(P,e,n)}var m,b,y,x,I,z,W=e.data,A={},P=null;"[iFrameResizerChild]Ready"===W?function(){for(var e in u)E("iFrame requested init",N(e),u[e].iframe,e)}():s===(""+W).slice(0,13)&&W.slice(13).split(":")[0]in u?(x=(y=W.slice(13).split(":"))[1]?parseInt(y[1],10):0,I=u[y[0]]&&u[y[0]].iframe,z=getComputedStyle(I),A={iframe:I,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(z)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(z),width:y[2],type:y[3]},u[P=A.id]&&(u[P].loaded=!0),(b=A.type in{true:1,false:1,undefined:1})&&p(P,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,k(A.type+" No settings for "+e+". Message was: "+W)),n}(P)&&(p(P,"Received: "+W),m=!0,null===A.iframe&&(k(P,"IFrame ("+A.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[P]&&u[P].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(P,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(P,"Checking connection is from: "+(n=u[P]&&u[P].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+A.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[P]&&u[P].firstRun&&u[P]&&(u[P].firstRun=!1),A.type){case"close":F(A.iframe);break;case"message":m=i(6),p(P,"onMessage passed: {iframe: "+A.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:A.iframe,message:JSON.parse(m)}),p(P,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[P].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[P]&&u[P].iframe,P),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=P;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[P]&&u[P].stopPageInfo&&(u[P].stopPageInfo(),delete u[P].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(P,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(P,"--")):window.top===window.self?p(P,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(P,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(A);break;case"init":n(),l("onInit",A.iframe);break;default:0===Number(A.width)&&0===Number(A.height)?k("Unsupported message received ("+A.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,s,h,m}())):v(P,"Ignored: "+W)}function S(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function z(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==S(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}S(t,"onClosed",t),p(t,"--"),z(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===a&&p(n,"Get page position: "+(a={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+a.y)}function T(e){null!==a&&(window.scrollTo(a.x,a.y),p(e,"Set page position: "+a.x+","+a.y),j())}function j(){a=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),C((function(){R(e),E("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&E("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),A(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function E(e,n,t,i,o){var r,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function N(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function W(t,r){function s(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(s,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),a=N(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){E("iFrame.onload",a,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),E("init",a,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:F.bind(null,u[f].iframe),removeListeners:z.bind(null,u[f].iframe),resize:E.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){E("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){E("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function A(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function P(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),A((function(){H("Tab Visible","resize")}),16))}function H(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&E(e,n,u[t].iframe,t)}))}function L(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),W(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",I),w(window,"resize",(function(){p("window","Trigger event: resize"),A((function(){H("Window resize","resize")}),16)})),w(document,"visibilitychange",P),w(document,"-webkit-visibilitychange",P),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded",7),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?s:this.isValid?this.isFocused?c:d:a}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"e85f5a2417ccc46ac8df23a695c6ef3fcd71577e",class:"form-group d-flex flex-column"},n("div",{key:"02878f7fb1e720aa97a67e72d5f1711e0fbd0668",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"57c46b739fb284c4ee618594f04cc5ff128bf16c",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"4634650c721673a52ea55e331154a624c19266dc",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"facd226e399f41537657603c50c45887c1177c42",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"73c34b9ab89a21e6b3203904988bf8a542eb01f8",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{b as hidden_input,I as iframe_input}
1
+ import{r as e,h as n,H as t,c as i,g as o}from"./p-CV0Pyo1O.js";import{c as r}from"./p-D8GTwl9v.js";import{a3 as a,q as s,v as c,w as d,x as u}from"./p-CPKMvyV_.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-Ce_W43gc.js";import{p as h}from"./p-B6YPrwyC.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:g}=m,b=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}focusWithoutPageScroll(e){if(e)try{e.focus({preventScroll:!0})}catch(n){const{scrollX:t,scrollY:i}=window;e.focus(),window.scrollTo(t,i)}}async componentDidLoad(){const e=await this.getBaseFontStyles();g("fontStyles",e);const n=await this.getFocusedStyles();g("focused",n);const t=await this.getFocusedAndInvalidStyles();g("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?a:this.errorText?s:this.isFocused?c:d}render(){return n(t,{key:"d3aa78cd75de1a781c8100c121933122c6db599b"},n("input",{key:"7ac01ecc01ca776cd6928a3a1d1e0b2baa4b8965",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,a="[iFrameSizer]",s=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){W(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=L(),window.iFrameResize=window.iFrameResize||L()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,b(e))}function v(e,n){x("info",e,n,b(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return a+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),C((function(){R(P),T(A),l("onResized",P)}),P,"init")}function t(e){var n=Number(u[A]["max"+e]),t=Number(u[A]["min"+e]),i=e.toLowerCase(),o=Number(P[i]);p(A,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(A,"Set "+i+" to min value")),o>n&&(o=n,p(A,"Set "+i+" to max value")),P[i]=""+o}function i(e){return W.slice(W.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;E("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=P.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(A),{x:Math.floor(Number(n.left)+Number(s.x)),y:Math.floor(Number(n.top)+Number(s.y))}}function c(e){var n=e?r(P.iframe):{x:0,y:0},t={x:Number(P.width)+n.x,y:Number(P.height)+n.y};p(A,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(s=t,d(),p(A,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(A,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",s)?j():T(A)}function f(e){var n={};if(0===Number(P.width)&&0===Number(P.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:P.width,y:P.height};l(e,{iframe:P.iframe,screenX:Number(n.x),screenY:Number(n.y),type:P.type})}function l(e,n){return S(A,e,n)}var m,b,y,x,I,z,W=e.data,P={},A=null;"[iFrameResizerChild]Ready"===W?function(){for(var e in u)E("iFrame requested init",N(e),u[e].iframe,e)}():a===(""+W).slice(0,13)&&W.slice(13).split(":")[0]in u?(x=(y=W.slice(13).split(":"))[1]?parseInt(y[1],10):0,I=u[y[0]]&&u[y[0]].iframe,z=getComputedStyle(I),P={iframe:I,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(z)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(z),width:y[2],type:y[3]},u[A=P.id]&&(u[A].loaded=!0),(b=P.type in{true:1,false:1,undefined:1})&&p(A,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,k(P.type+" No settings for "+e+". Message was: "+W)),n}(A)&&(p(A,"Received: "+W),m=!0,null===P.iframe&&(k(A,"IFrame ("+P.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[A]&&u[A].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(A,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(A,"Checking connection is from: "+(n=u[A]&&u[A].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+P.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[A]&&u[A].firstRun&&u[A]&&(u[A].firstRun=!1),P.type){case"close":F(P.iframe);break;case"message":m=i(6),p(A,"onMessage passed: {iframe: "+P.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:P.iframe,message:JSON.parse(m)}),p(A,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[A].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[A]&&u[A].iframe,A),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=A;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[A]&&u[A].stopPageInfo&&(u[A].stopPageInfo(),delete u[A].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",a=decodeURIComponent(t),(h=document.getElementById(a)||document.getElementsByName(a)[0])?(e=r(h),p(A,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),s={x:e.x,y:e.y},d(),p(A,"--")):window.top===window.self?p(A,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(A,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(P);break;case"init":n(),l("onInit",P.iframe);break;default:0===Number(P.width)&&0===Number(P.height)?k("Unsupported message received ("+P.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,a,h,m}())):v(A,"Ignored: "+W)}function S(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function z(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==S(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}S(t,"onClosed",t),p(t,"--"),z(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===s&&p(n,"Get page position: "+(s={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+s.y)}function T(e){null!==s&&(window.scrollTo(s.x,s.y),p(e,"Set page position: "+s.x+","+s.y),j())}function j(){s=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),C((function(){R(e),E("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&E("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),P(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function E(e,n,t,i,o){var r,s=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(a+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||s||(s=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function N(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function W(t,r){function a(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(a,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),s=N(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){E("iFrame.onload",s,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),E("init",s,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:F.bind(null,u[f].iframe),removeListeners:z.bind(null,u[f].iframe),resize:E.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){E("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){E("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function P(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function A(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),P((function(){H("Tab Visible","resize")}),16))}function H(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&E(e,n,u[t].iframe,t)}))}function L(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),W(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",I),w(window,"resize",(function(){p("window","Trigger event: resize"),P((function(){H("Window resize","resize")}),16)})),w(document,"visibilitychange",A),w(document,"-webkit-visibilitychange",A),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded",7),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?a:this.isValid?this.isFocused?c:d:s}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"a3039409160cb6fd7dd2e7bf189e241f34ddeca6",class:"form-group d-flex flex-column"},n("div",{key:"dab356c30fedca21f6092cfbaf576e23df36b318",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"0469fb973476f92cd5b275b62e4a462521448273",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"d91253d593d700279c0d869b34d3d4f5d572759a",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"2a3676ad3d25daedccaa0cb2297f505641b47497",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"e54b9c1a7ef5da3bed2eb62e25a28c91865f1f40",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{b as hidden_input,I as iframe_input}
@@ -0,0 +1 @@
1
+ import{r as a,h as e}from"./p-CV0Pyo1O.js";import{f as t,p as s,c as l}from"./p-AMVhBsGv.js";import{f as r,a as f}from"./p-CPKMvyV_.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as i,a as o}from"./p-BRnBHsdq.js";import"./p-DVJaoI_m.js";import{P as c}from"./p-NZS8uCtH.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";const p=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:c.paid,value:"paid"},{label:c.failed,value:"failed"},{label:c.forwarded,value:"forwarded"},{label:c.scheduled,value:"scheduled"},{label:c.in_transit,value:"in_transit"},{label:c.canceled,value:"canceled"}]}render(){const a=Object.assign({},t);return e(d,{key:"3625f5efccbe6a0715abb425731f53ab4ff89b05"},e("table-filters-menu",{key:"ce1fad33a28dd75075ec382e73f1822170061215",params:a,clearParams:l,part:r},e("div",{key:"613d95baab2642c7e9d032476dbf66529a64f10f",class:"grid-cols-2 gap-3 p-1"},e("div",{key:"39096bd7917514f0f7fddc98520ff78b1ac38e99",class:"p-2"},e("form-control-select",{key:"dd93b57d82296c2ea79a76a52e499123bffcf346",name:"status",label:"Status",options:this.statusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.status||t.status||"",disabled:!!this.status,part:f})),e("div",{key:"323b2e91854d75266135cf6af37aacb86c9776d1",class:"p-2"},e("form-control-date",{key:"b3c67ec5e63fc5484a153689bbd56666d7679a4c",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:f})),e("div",{key:"6a949567f2c4183f4431ffb07fbcbb61b33f1044",class:"p-2"},e("form-control-date",{key:"8ad670d02f45ea839c712b2cfe5cf7bade503554",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:f})))))}};export{p as justifi_payouts_list_filters}
@@ -1 +1 @@
1
- import{r as a,h as e,H as s}from"./p-CV0Pyo1O.js";import{E as c}from"./p-CLHwhyvu.js";import{P as t,Q as i,R as b,S as d,T as f}from"./p-DnrawQn3.js";const n=class{constructor(e){a(this,e),this.paging=c,this.params={}}render(){return e(s,{key:"7b821154b627026ef8624af6e4759e2176004676"},e("nav",{key:"7990aee285d0cc3e6f83cb59bb216439e5364df5","aria-label":"Table pagination",class:"d-flex justify-content-end gap-3"},e("ul",{key:"02c68163934ce1aabf4abd607cc28e549e20ebe1",class:"pagination m-0"},e("li",{key:"aab661ae85fc61eecd230d058f135483796769c0",class:"page-item "+(this.paging.has_previous?"":" disabled")},e("button",{key:"ef42a41831a9890186c333418b161877761674e1",class:"page-link",onClick:a=>{a.preventDefault(),this.paging.handleClickPrevious(this.paging.start_cursor)},part:this.paging.has_previous?t:i},e("span",{key:"a898a92687e4a5fec37d9dab4208430260a9f274",class:"me-1",part:b},"«"),e("span",{key:"ecc2eeedc064d405ad178b9a98ed088e12f1b2fb",part:d},"Previous"))),e("li",{key:"56569cd9f9803ead8b1180e2f982a98d7009be1f",class:"page-item "+(this.paging.has_next?"":" disabled")},e("button",{key:"c39d389ab89609e8ce11b3dd81eb5c4a50d3521f",class:"page-link",onClick:a=>{a.preventDefault(),this.paging.handleClickNext(this.paging.end_cursor)},part:this.paging.has_next?t:i},e("span",{key:"6a01458a048a524931b03df6a964fa4a0ac403ac",part:d},"Next"),e("span",{key:"f4cb3d084647c00dff30b99f751180564463443f",class:"ms-1",part:f},"»"))))))}};export{n as pagination_menu}
1
+ import{r as a,h as e,H as s}from"./p-CV0Pyo1O.js";import{E as c}from"./p-CLHwhyvu.js";import{K as t,L as i,M as b,N as d,O as f}from"./p-CPKMvyV_.js";const n=class{constructor(e){a(this,e),this.paging=c,this.params={}}render(){return e(s,{key:"7b821154b627026ef8624af6e4759e2176004676"},e("nav",{key:"7990aee285d0cc3e6f83cb59bb216439e5364df5","aria-label":"Table pagination",class:"d-flex justify-content-end gap-3"},e("ul",{key:"02c68163934ce1aabf4abd607cc28e549e20ebe1",class:"pagination m-0"},e("li",{key:"aab661ae85fc61eecd230d058f135483796769c0",class:"page-item "+(this.paging.has_previous?"":" disabled")},e("button",{key:"ef42a41831a9890186c333418b161877761674e1",class:"page-link",onClick:a=>{a.preventDefault(),this.paging.handleClickPrevious(this.paging.start_cursor)},part:this.paging.has_previous?t:i},e("span",{key:"a898a92687e4a5fec37d9dab4208430260a9f274",class:"me-1",part:b},"«"),e("span",{key:"ecc2eeedc064d405ad178b9a98ed088e12f1b2fb",part:d},"Previous"))),e("li",{key:"56569cd9f9803ead8b1180e2f982a98d7009be1f",class:"page-item "+(this.paging.has_next?"":" disabled")},e("button",{key:"c39d389ab89609e8ce11b3dd81eb5c4a50d3521f",class:"page-link",onClick:a=>{a.preventDefault(),this.paging.handleClickNext(this.paging.end_cursor)},part:this.paging.has_next?t:i},e("span",{key:"6a01458a048a524931b03df6a964fa4a0ac403ac",part:d},"Next"),e("span",{key:"f4cb3d084647c00dff30b99f751180564463443f",class:"ms-1",part:f},"»"))))))}};export{n as pagination_menu}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as e}from"./p-CV0Pyo1O.js";import{I as a}from"./p-Ce_F4E0f.js";import{C as h}from"./p-CVaOFfrI.js";import{E as r,x as o,y as n,q as l,u as c,v as d}from"./p-DnrawQn3.js";import{F as p}from"./p-uCg79W3M.js";import{F as f}from"./p-BsQy297i.js";import"./p-CZfYo5-1.js";const m=class{constructor(i){t(this,i),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.imask=null,this.isFocused=!1,this.errorText="",this.defaultValue="0",this.inputHandler=()=>{},this.maskOptions=h.DECIMAL,this.disabled=!1,this.initializeIMask=()=>{this.textInput&&(this.imask=a(this.textInput,this.maskOptions),this.imask.on("accept",(()=>{const t=this.imask.unmaskedValue;this.inputHandler(this.name,t),this.formControlInput.emit({name:this.name,value:t})})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=t=>{const s=t.target.getAttribute("name");this.formControlInput.emit({name:s,value:this.imask.unmaskedValue})},this.updateInput=t=>{this.imask&&(this.imask.value=String(t))}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.initializeIMask(),this.updateInput(this.defaultValue)}disconnectedCallback(){var t;null===(t=this.imask)||void 0===t||t.destroy()}get inputPart(){let t=r;return this.errorText&&(t=l),this.disabled&&(t=c),this.isFocused&&(t=d),t}render(){return i(e,{key:"8ecc68592c7e6ef4418301935dde43e4ea10404d"},i("div",{key:"ba267bd049287c297aa67b761214b9d60503e605",class:"form-group d-flex flex-column"},i("label",{key:"b020e228d70145d758bf58298914ed2b3384bbbc",part:o,class:"form-label",htmlFor:this.name},this.label),i("div",{key:"08415f471180958426563cf0e47e016b292108c7",class:"input-group"},i("span",{key:"dc22d1181a2a23e77003ee67212e724e48c2201e",class:"input-group-text",part:n},"$"),i("input",{key:"3cdedc0317df58360601186dd744bcb721a68ec7",ref:t=>this.textInput=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.inputPart,class:this.errorText?"form-control monetary is-invalid":"form-control monetary",type:"text",disabled:this.disabled})),i(p,{key:"1315bdeefe7a551fbbb30680d289743a22a3792d",helpText:this.helpText,name:this.name}),i(f,{key:"7212797f21917530b6bb093f146f1ebead4c232b",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{m as form_control_monetary_provisioning}
1
+ import{r as t,c as s,h as e,H as i}from"./p-CV0Pyo1O.js";import{I as a}from"./p-Ce_F4E0f.js";import{C as h}from"./p-CVaOFfrI.js";import{E as r,x as o,y as n,q as l,u as c,v as d}from"./p-CPKMvyV_.js";import{F as p}from"./p-B5gBiARs.js";import{F as f}from"./p-Ce_W43gc.js";import"./p-CZfYo5-1.js";const m=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.imask=null,this.isFocused=!1,this.errorText="",this.defaultValue="0",this.inputHandler=()=>{},this.maskOptions=h.DECIMAL,this.disabled=!1,this.initializeIMask=()=>{this.textInput&&(this.imask=a(this.textInput,this.maskOptions),this.imask.on("accept",(()=>{const t=this.imask.unmaskedValue;this.inputHandler(this.name,t),this.formControlInput.emit({name:this.name,value:t})})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=t=>{const s=t.target.getAttribute("name");this.formControlInput.emit({name:s,value:this.imask.unmaskedValue})},this.updateInput=t=>{this.imask&&(this.imask.value=String(t))}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.initializeIMask(),this.updateInput(this.defaultValue)}disconnectedCallback(){var t;null===(t=this.imask)||void 0===t||t.destroy()}get inputPart(){let t=r;return this.errorText&&(t=l),this.disabled&&(t=c),this.isFocused&&(t=d),t}render(){return e(i,{key:"8ecc68592c7e6ef4418301935dde43e4ea10404d"},e("div",{key:"ba267bd049287c297aa67b761214b9d60503e605",class:"form-group d-flex flex-column"},e("label",{key:"b020e228d70145d758bf58298914ed2b3384bbbc",part:o,class:"form-label",htmlFor:this.name},this.label),e("div",{key:"08415f471180958426563cf0e47e016b292108c7",class:"input-group"},e("span",{key:"dc22d1181a2a23e77003ee67212e724e48c2201e",class:"input-group-text",part:n},"$"),e("input",{key:"3cdedc0317df58360601186dd744bcb721a68ec7",ref:t=>this.textInput=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.inputPart,class:this.errorText?"form-control monetary is-invalid":"form-control monetary",type:"text",disabled:this.disabled})),e(p,{key:"1315bdeefe7a551fbbb30680d289743a22a3792d",helpText:this.helpText,name:this.name}),e(f,{key:"7212797f21917530b6bb093f146f1ebead4c232b",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{m as form_control_monetary_provisioning}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as s}from"./p-CV0Pyo1O.js";import{c as a,F as i}from"./p-CKiAlBsU.js";import{y as l,z as r,h as d,l as o,j as n,v as c,A as h}from"./p-XIWgia4J.js";import{al as f}from"./p-CPKMvyV_.js";import{c as m,o as b}from"./p-BArmtmkq.js";import{P as u}from"./p-DkoufM1t.js";import{H as p}from"./p-DYHjzFnJ.js";import"./p-CZfYo5-1.js";import"./p-BFTU3MAI.js";import"./p-D8ytux5N.js";import"./p-BcNb9bVO.js";import"./p-Bt4GjEWL.js";import"./p-D8GTwl9v.js";const _=class{constructor(e){t(this,e),this.errors={},this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}componentWillLoad(){this.formController=new i(a({name:c.required("Enter full name"),address_line1:n.nullable(),address_line2:o.nullable(),address_city:d.nullable(),address_state:r.nullable(),address_postal_code:l.nullable()}));const t=m.billingFormFields;t&&Object.keys(t).some((e=>t[e]))&&this.formController.setInitialValues(t)}componentDidLoad(){this.formController.values.subscribe((t=>this.billingInfo=Object.assign({},t))),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)})),this.unsubscribeFromStore=b("billingFormFields",(t=>{this.formController.setInitialValues(t)}))}disconnectedCallback(){var t;null===(t=this.unsubscribeFromStore)||void 0===t||t.call(this)}async getValues(){return this.formController.values.getValue()}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const t=this.formController.getInitialValues();return e("div",{key:"aad27826f1ad84e4f4f7ccb6199d7bd64dde61fc",part:f,class:"mt-4"},e("form",{key:"208146fcf8c96dc78d3ede31178df8fabada001f"},e("fieldset",{key:"ba7b72b8a49b7c0720a449f71fd8a675093e52c3"},this.legend&&e("legend",{key:"ed0d19198e69ae3fa043411f08b1c333cee11329"},this.legend),e("div",{key:"3941aaf9b5abac0b5fe8a72aaebeec448bacb49b",class:"row gy-3"},e("div",{key:"6f9cb3621fdf2519e2167f4407ba0e3322c64c52",class:"col-12"},e("form-control-text",{key:"a7cf909f36506826f112f189cd9409d05a535da0",name:"name",label:"Full Name",defaultValue:t.name,errorText:this.errors.name,inputHandler:this.inputHandler}))))))}},v=class{constructor(e){t(this,e)}get showSimpleCardBillingForm(){return this.paymentMethodType===u.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===u.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.getValues()}async validate(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.validate()}render(){return e(s,null,e(this.showSimpleBankAccountBillingForm?"bank-account-billing-form-simple":this.showSimpleCardBillingForm?"card-billing-form-simple":"billing-form-full",{legend:this.legend,ref:t=>this.selectedFormRef=t}))}},y=class{constructor(e){t(this,e),this.errors={},this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}componentWillLoad(){this.formController=new i(a({name:c.required("Enter full name"),address_line1:n.required("Enter street address"),address_line2:o.nullable(),address_city:d.required("Enter city"),address_state:r.required("Select state or province"),address_postal_code:l.required("Enter postal code")}));const t=m.billingFormFields;t&&Object.keys(t).some((e=>t[e]))&&this.formController.setInitialValues(t),this.formController.values.subscribe((t=>this.billingInfo=Object.assign({},t))),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}componentDidLoad(){this.unsubscribeFromStore=b("billingFormFields",(t=>{this.formController.setInitialValues(t)}))}disconnectedCallback(){var t;null===(t=this.unsubscribeFromStore)||void 0===t||t.call(this)}async getValues(){return this.formController.values.getValue()}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){if(!this.formController)return null;const t=this.formController.getInitialValues();return e("div",{part:f,class:"mt-4"},e(p,{text:"Billing address",class:"fs-6 fw-bold lh-lg mb-4"}),e("form",null,e("fieldset",null,this.legend&&e("legend",null,this.legend),e("div",{class:"row gy-3"},e("div",{class:"col-12"},e("form-control-text",{name:"name",label:"Full Name",defaultValue:t.name,errorText:this.errors.name,inputHandler:this.inputHandler})),e("div",{class:"col-12"},e("form-control-text",{name:"address_line1",label:"Street Address",defaultValue:t.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),e("div",{class:"col-12"},e("form-control-text",{name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:t.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),e("div",{class:"col-12"},e("form-control-text",{name:"address_city",label:"City",defaultValue:t.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),e("div",{class:"col-12"},e("form-control-select",{name:"address_state",label:"State / Province",options:h,defaultValue:t.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),e("div",{class:"col-12"},e("form-control-text",{name:"address_postal_code",label:"Postal Code",defaultValue:t.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:7}))))))}},j=class{constructor(e){t(this,e),this.errors={},this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}componentWillLoad(){this.formController=new i(a({name:c.nullable(),address_line1:n.nullable(),address_line2:o.nullable(),address_city:d.nullable(),address_state:r.nullable(),address_postal_code:l.required("Enter postal code")}));const t=m.billingFormFields;t&&Object.keys(t).some((e=>t[e]))&&this.formController.setInitialValues(t)}componentDidLoad(){this.formController.values.subscribe((t=>this.billingInfo=Object.assign({},t))),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)})),this.unsubscribeFromStore=b("billingFormFields",(t=>{this.formController.setInitialValues(t)}))}disconnectedCallback(){var t;null===(t=this.unsubscribeFromStore)||void 0===t||t.call(this)}async getValues(){return this.formController.values.getValue()}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const t=this.formController.getInitialValues();return e("div",{key:"c067c5a1aab63baa994322346b7cc3d71fca5157",part:f},e("form",{key:"72a74580a254d4c940579e0c5fa781e00a6a80d6"},e("fieldset",{key:"6beea66d6a8c863e228aafbd9e7ff78f5e19b033"},this.legend&&e("legend",{key:"ba5bb1b6b8d703898424113e5787a0ffb7f534af"},this.legend),e("div",{key:"cc3bc3446e475822c45d2ae261cdfb755e6313db",class:"row gy-3"},e("div",{key:"5dd21759753d2a5378d6dcc0b3b7ffb436c052db",class:"col-12"},e("form-control-text",{key:"033d5598a3ba198712189597ed1d1efe0dc09802",name:"address_postal_code",label:"Postal Code",defaultValue:t.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:7}))))))}};export{_ as bank_account_billing_form_simple,v as billing_form,y as billing_form_full,j as card_billing_form_simple}