@justifi/webcomponents 6.13.0-rc.1 → 6.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (585) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/{Analytics-Be2I_aiS.js → Analytics-DMppKXYI.js} +5 -5
  3. package/dist/cjs/{Api-Bukk55YZ.js → Api-BioDE5he.js} +1 -1
  4. package/dist/cjs/{Plaid-Aw35bhCX.js → Plaid-QLOFOTeC.js} +13 -13
  5. package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -2
  6. package/dist/cjs/{additional-questions-form-step_14.cjs.entry.js → additional-questions-form-step_15.cjs.entry.js} +391 -175
  7. package/dist/cjs/additional-questions_5.cjs.entry.js +7 -7
  8. package/dist/cjs/additional-statement_8.cjs.entry.js +9 -9
  9. package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +10 -10
  10. package/dist/cjs/bank-account-document-form-inputs.cjs.entry.js +21 -0
  11. package/dist/cjs/bank-account-form.cjs.entry.js +34 -5
  12. package/dist/cjs/{business-form-options-D_nM7NDk.js → business-form-options-CnlrfbQ6.js} +51 -0
  13. package/dist/cjs/{business-identity-schema-DI9XFbaD.js → business-identity-schema-BA385xf-.js} +12 -8
  14. package/dist/cjs/{business.service-CylI3Qrg.js → business.service-DOGeb2O6.js} +2 -2
  15. package/dist/cjs/card-form.cjs.entry.js +5 -5
  16. package/dist/cjs/{check-pkg-version-BLLLh6v-.js → check-pkg-version-DcgenUqU.js} +1 -1
  17. package/dist/cjs/{checkout-actions-8-MUczKw.js → checkout-actions-CjR16i7o.js} +2 -2
  18. package/dist/cjs/{checkout.service-BYpinbSR.js → checkout.service-Bdr5qUHj.js} +2 -2
  19. package/dist/cjs/{checkout.store-CztwuCnG.js → checkout.store-CZHrIuaP.js} +9 -3
  20. package/dist/cjs/{country-config-D7fss2oF.js → country-config-C1bWmF8P.js} +12 -4
  21. package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
  22. package/dist/cjs/dispute-notification_2.cjs.entry.js +15 -15
  23. package/dist/cjs/{event-types-DptNnCEP.js → event-types-DWDQKDv4.js} +2 -2
  24. package/dist/cjs/form-address-fields_3.cjs.entry.js +3 -3
  25. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  26. package/dist/cjs/form-control-date.cjs.entry.js +2 -2
  27. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
  28. package/dist/cjs/form-control-file.cjs.entry.js +2 -2
  29. package/dist/cjs/form-control-monetary.cjs.entry.js +3 -3
  30. package/dist/cjs/form-control-number_2.cjs.entry.js +7 -6
  31. package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
  32. package/dist/cjs/form-control-select_2.cjs.entry.js +4 -4
  33. package/dist/cjs/{get-business-D10Tmct1.js → get-business-CrxvWZh6.js} +2 -2
  34. package/dist/cjs/{get-payment-details-BB5aa48u.js → get-payment-details-iCEkGDy4.js} +2 -2
  35. package/dist/cjs/{get-subaccounts-CSD2nAqD.js → get-subaccounts-Dgl7ECtg.js} +3 -3
  36. package/dist/cjs/hidden-input_2.cjs.entry.js +6 -6
  37. package/dist/cjs/{index.esm-C1ZPG85l.js → index.esm-BNETBIV_.js} +0 -18
  38. package/dist/cjs/{insurance-state-Xe2auE-N.js → insurance-state-B-XQRmMs.js} +1 -1
  39. package/dist/cjs/internal-button.cjs.entry.js +1 -1
  40. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +63 -38
  41. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +8 -8
  42. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +18 -8
  43. package/dist/cjs/justifi-billing-form-full.cjs.entry.js +2 -2
  44. package/dist/cjs/justifi-billing-form.cjs.entry.js +2 -2
  45. package/dist/cjs/justifi-business-details.cjs.entry.js +10 -10
  46. package/dist/cjs/justifi-business-form.cjs.entry.js +15 -15
  47. package/dist/cjs/justifi-card-billing-form-simple.cjs.entry.js +2 -2
  48. package/dist/cjs/justifi-card-form.cjs.entry.js +8 -8
  49. package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +6 -6
  50. package/dist/cjs/justifi-checkout.cjs.entry.js +10 -10
  51. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +6 -6
  52. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +12 -12
  53. package/dist/cjs/justifi-dispute-management.cjs.entry.js +10 -10
  54. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +11 -11
  55. package/dist/cjs/justifi-order-terminals.cjs.entry.js +12 -12
  56. package/dist/cjs/justifi-payment-details.cjs.entry.js +18 -18
  57. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +11 -11
  58. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +10 -10
  59. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +5 -5
  60. package/dist/cjs/justifi-payments-list.cjs.entry.js +11 -11
  61. package/dist/cjs/justifi-payout-details.cjs.entry.js +14 -14
  62. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +10 -10
  63. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +5 -5
  64. package/dist/cjs/justifi-payouts-list.cjs.entry.js +15 -15
  65. package/dist/cjs/justifi-qr-terminal.cjs.entry.js +9 -9
  66. package/dist/cjs/justifi-refund-payment.cjs.entry.js +13 -13
  67. package/dist/cjs/justifi-save-new-payment-method.cjs.entry.js +2 -2
  68. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +10 -10
  69. package/dist/cjs/justifi-skeleton.cjs.entry.js +2 -2
  70. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +7 -7
  71. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +11 -11
  72. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +5 -5
  73. package/dist/cjs/justifi-terminals-list.cjs.entry.js +14 -14
  74. package/dist/cjs/loader.cjs.js +1 -1
  75. package/dist/cjs/{lodash-CxSkBibc.js → lodash-C4mGy21w.js} +38 -27
  76. package/dist/cjs/{package-gx36QXN1.js → package-CS22fAzw.js} +1 -1
  77. package/dist/cjs/payment-method-option.cjs.entry.js +2 -2
  78. package/dist/cjs/{payment-provisioning-actions-DimM0KGV.js → payment-provisioning-actions-B4x7lnyF.js} +9 -9
  79. package/dist/cjs/payment-provisioning-form-buttons_2.cjs.entry.js +3 -2
  80. package/dist/cjs/{payment.service-fy5bXXmA.js → payment.service-a5EL3s2d.js} +2 -2
  81. package/dist/cjs/{payout.service-hp3PTXWI.js → payout.service-BJtGBHsQ.js} +2 -2
  82. package/dist/cjs/{payouts-status-CF1YT_RL.js → payouts-status-viYMBknO.js} +2 -2
  83. package/dist/cjs/{plaid.service-9PmS4X0g.js → plaid.service-DpiLY-5D.js} +2 -2
  84. package/dist/cjs/radio-list-item.cjs.entry.js +1 -1
  85. package/dist/cjs/save-new-payment-method.cjs.entry.js +2 -2
  86. package/dist/cjs/{schema-validations-_yWWnnaG.js → schema-validations-C2XsZnqK.js} +24 -10
  87. package/dist/cjs/styled-host-Ch0-dxF-.js +11 -0
  88. package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
  89. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
  90. package/dist/cjs/{terminal.service-D5D76Cnn.js → terminal.service-DN2A-bNx.js} +2 -2
  91. package/dist/cjs/{utils-Dcde8Zpt.js → utils-BVM6JCW0.js} +1 -1
  92. package/dist/cjs/{utils-BHi4j5rB.js → utils-D1CWnhex.js} +4 -4
  93. package/dist/cjs/webcomponents.cjs.js +1 -1
  94. package/dist/collection/actions/payment/get-payments.js +1 -1
  95. package/dist/collection/actions/refund/refund-actions.js +1 -1
  96. package/dist/collection/actions/terminal/get-terminal-orders.js +1 -1
  97. package/dist/collection/actions/void/void-actions.js +1 -1
  98. package/dist/collection/api/Analytics.js +2 -2
  99. package/dist/collection/api/Document.js +12 -0
  100. package/dist/collection/collection-manifest.json +3 -1
  101. package/dist/collection/components/business-details/owner-details/owner-details.js +1 -1
  102. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
  103. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +5 -3
  104. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +4 -2
  105. package/dist/collection/components/business-forms/owner-form/owner-form.js +46 -1
  106. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/additional-questions-form-step.js +2 -2
  107. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +6 -114
  108. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +2 -2
  109. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +9 -0
  110. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +4 -2
  111. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +1 -1
  112. package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.js +433 -0
  113. package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-list.js +52 -0
  114. package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-options.js +80 -0
  115. package/dist/collection/components/business-forms/payment-provisioning/justifi-payment-provisioning.js +1 -1
  116. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +1 -1
  117. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-actions.js +7 -7
  118. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +3 -2
  119. package/dist/collection/components/business-forms/schemas/business-address-schema.js +1 -1
  120. package/dist/collection/components/business-forms/schemas/business-bank-account-schema.js +10 -38
  121. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +1 -1
  122. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +7 -3
  123. package/dist/collection/components/business-forms/schemas/schema-helpers.js +1 -1
  124. package/dist/collection/components/business-forms/schemas/schema-validations.js +10 -7
  125. package/dist/collection/components/business-forms/utils/business-form-options.js +50 -0
  126. package/dist/collection/components/business-forms/utils/country-config.js +11 -4
  127. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +30 -2
  128. package/dist/collection/components/checkout/billing-form/bank-account-billing-form-simple.js +1 -1
  129. package/dist/collection/components/checkout/billing-form/billing-form-full.js +2 -2
  130. package/dist/collection/components/checkout/billing-form/billing-form-schema.js +1 -1
  131. package/dist/collection/components/checkout/billing-form/card-billing-form-simple.js +1 -1
  132. package/dist/collection/components/checkout/billing-form/justifi-billing-form.js +1 -1
  133. package/dist/collection/components/checkout/card-form/card-form.js +2 -2
  134. package/dist/collection/components/checkout/justifi-checkout.js +21 -2
  135. package/dist/collection/components/checkout/save-new-payment-method/justifi-save-new-payment-method.js +1 -1
  136. package/dist/collection/components/checkout/save-new-payment-method/save-new-payment-method.js +1 -1
  137. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +2 -2
  138. package/dist/collection/components/checkouts-list/justifi-checkouts-list.js +2 -2
  139. package/dist/collection/components/dispute-management/dispute-notification.js +3 -3
  140. package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +1 -1
  141. package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +1 -1
  142. package/dist/collection/components/dispute-management/dispute-response/customer-details.js +1 -1
  143. package/dist/collection/components/dispute-management/dispute-response/dispute-response-actions.js +3 -3
  144. package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +1 -1
  145. package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +1 -1
  146. package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +1 -1
  147. package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +1 -1
  148. package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +1 -1
  149. package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +1 -1
  150. package/dist/collection/components/dispute-management/justifi-dispute-management.js +1 -1
  151. package/dist/collection/components/filters/table-filters-menu.js +1 -1
  152. package/dist/collection/components/filters/utils.js +1 -1
  153. package/dist/collection/components/gross-payment-chart/chart-utils.js +3 -3
  154. package/dist/collection/components/insurance/insurance-state.js +1 -1
  155. package/dist/collection/components/modular-checkout/justifi-modular-checkout.js +19 -13
  156. package/dist/collection/components/modular-checkout/sub-components/justifi-apple-pay.js +0 -21
  157. package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-billing-form-simple.js +1 -1
  158. package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-form.js +11 -1
  159. package/dist/collection/components/modular-checkout/sub-components/justifi-billing-form-full.js +1 -1
  160. package/dist/collection/components/modular-checkout/sub-components/justifi-card-billing-form-simple.js +1 -1
  161. package/dist/collection/components/modular-checkout/sub-components/justifi-card-form.js +1 -1
  162. package/dist/collection/components/modular-checkout/sub-components/justifi-checkout-summary.js +1 -1
  163. package/dist/collection/components/modular-checkout/sub-components/justifi-google-pay.js +16 -10
  164. package/dist/collection/components/modular-checkout/sub-components/justifi-plaid-payment-method.js +15 -2
  165. package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
  166. package/dist/collection/components/order-terminals/justifi-order-terminals.js +1 -1
  167. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
  168. package/dist/collection/components/payment-details/justifi-payment-details.js +8 -8
  169. package/dist/collection/components/payment-transactions-list/justifi-payment-transactions-list.js +1 -1
  170. package/dist/collection/components/payments-list/justifi-payments-list-filters.js +2 -2
  171. package/dist/collection/components/payments-list/justifi-payments-list.js +1 -1
  172. package/dist/collection/components/payout-details/justifi-payout-details.js +4 -4
  173. package/dist/collection/components/payout-transactions-list/justifi-payout-transactions-list.js +1 -1
  174. package/dist/collection/components/payouts-list/justifi-payouts-list-filters.js +2 -2
  175. package/dist/collection/components/payouts-list/justifi-payouts-list.js +4 -4
  176. package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list-filters.js +3 -3
  177. package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list.js +2 -2
  178. package/dist/collection/components/terminals-list/justifi-terminals-list-filters.js +1 -1
  179. package/dist/collection/components/terminals-list/justifi-terminals-list.js +4 -4
  180. package/dist/collection/components/tokenize-payment-method/justifi-tokenize-payment-method.js +5 -3
  181. package/dist/collection/store/checkout.store.js +9 -3
  182. package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
  183. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  184. package/dist/collection/ui-components/form/form-control-date.js +2 -2
  185. package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
  186. package/dist/collection/ui-components/form/form-control-file.js +3 -3
  187. package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
  188. package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
  189. package/dist/collection/ui-components/form/form-control-number.js +2 -2
  190. package/dist/collection/ui-components/form/form-control-radio.js +2 -2
  191. package/dist/collection/ui-components/form/form-control-select.js +2 -2
  192. package/dist/collection/ui-components/form/form-control-text.js +2 -2
  193. package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
  194. package/dist/collection/ui-components/form/hidden-input.js +2 -2
  195. package/dist/collection/ui-components/form/iframe-input.js +3 -3
  196. package/dist/collection/ui-components/internal-button.js +1 -1
  197. package/dist/collection/ui-components/radio-list-item.js +1 -1
  198. package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
  199. package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
  200. package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
  201. package/dist/collection/utils/checkout-billing-state-options.js +12 -0
  202. package/dist/collection/utils/utils.js +4 -4
  203. package/dist/docs.json +537 -106
  204. package/dist/esm/{Analytics-DZWGizAK.js → Analytics-CTY3Jgn8.js} +5 -5
  205. package/dist/esm/{Api-DMd8hTI-.js → Api-DjAL73GZ.js} +1 -1
  206. package/dist/esm/{Plaid-fhlY0CIN.js → Plaid-C8qoMZLV.js} +14 -13
  207. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  208. package/dist/esm/{additional-questions-form-step_14.entry.js → additional-questions-form-step_15.entry.js} +390 -175
  209. package/dist/esm/additional-questions_5.entry.js +8 -8
  210. package/dist/esm/additional-statement_8.entry.js +9 -9
  211. package/dist/esm/bank-account-billing-form-simple_4.entry.js +10 -10
  212. package/dist/esm/bank-account-document-form-inputs.entry.js +19 -0
  213. package/dist/esm/bank-account-form.entry.js +34 -5
  214. package/dist/esm/{business-form-options-DRalxlqN.js → business-form-options-DXjZp4Rl.js} +51 -1
  215. package/dist/esm/{business-identity-schema-D-Nk9aGV.js → business-identity-schema-Csou60ZC.js} +12 -8
  216. package/dist/esm/{business.service-Crs-0Mdy.js → business.service-BGXqAyxu.js} +2 -2
  217. package/dist/esm/card-form.entry.js +5 -5
  218. package/dist/esm/{check-pkg-version-CVyuA8aH.js → check-pkg-version-BOQqkWpf.js} +1 -1
  219. package/dist/esm/{checkout-actions-BMnp3uHK.js → checkout-actions-D8JS2l5e.js} +2 -2
  220. package/dist/esm/{checkout.service-BMAQVmHa.js → checkout.service-sHKaW-M0.js} +2 -2
  221. package/dist/esm/{checkout.store-DFnkcDZ8.js → checkout.store-DibfdUMm.js} +9 -3
  222. package/dist/esm/{country-config-B_fuF6JU.js → country-config-CEJVOOGe.js} +12 -5
  223. package/dist/esm/custom-popper_2.entry.js +2 -2
  224. package/dist/esm/dispute-notification_2.entry.js +15 -15
  225. package/dist/esm/{event-types-CVVB5p_Q.js → event-types-ynZLear3.js} +2 -2
  226. package/dist/esm/form-address-fields_3.entry.js +3 -3
  227. package/dist/esm/form-control-checkbox.entry.js +2 -2
  228. package/dist/esm/form-control-date.entry.js +2 -2
  229. package/dist/esm/form-control-file-v2_2.entry.js +3 -3
  230. package/dist/esm/form-control-file.entry.js +2 -2
  231. package/dist/esm/form-control-monetary.entry.js +3 -3
  232. package/dist/esm/form-control-number_2.entry.js +7 -6
  233. package/dist/esm/form-control-radio.entry.js +2 -2
  234. package/dist/esm/form-control-select_2.entry.js +4 -4
  235. package/dist/esm/{get-business-B9ZS1tVq.js → get-business-DAv_b3vf.js} +2 -2
  236. package/dist/esm/{get-payment-details-CiR6FrkO.js → get-payment-details-Bipad3jX.js} +2 -2
  237. package/dist/esm/{get-subaccounts-VpDr7yN4.js → get-subaccounts-FqCT2s3S.js} +3 -3
  238. package/dist/esm/hidden-input_2.entry.js +6 -6
  239. package/dist/esm/{index.esm-CgNcFueq.js → index.esm-KCSohgHx.js} +1 -18
  240. package/dist/esm/{insurance-state-CLGc1-_4.js → insurance-state-C5OZqDCT.js} +1 -1
  241. package/dist/esm/internal-button.entry.js +1 -1
  242. package/dist/esm/justifi-apple-pay_11.entry.js +63 -38
  243. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +8 -8
  244. package/dist/esm/justifi-bank-account-form.entry.js +18 -8
  245. package/dist/esm/justifi-billing-form-full.entry.js +2 -2
  246. package/dist/esm/justifi-billing-form.entry.js +2 -2
  247. package/dist/esm/justifi-business-details.entry.js +10 -10
  248. package/dist/esm/justifi-business-form.entry.js +15 -15
  249. package/dist/esm/justifi-card-billing-form-simple.entry.js +2 -2
  250. package/dist/esm/justifi-card-form.entry.js +8 -8
  251. package/dist/esm/justifi-checkout-qr-code.entry.js +6 -6
  252. package/dist/esm/justifi-checkout.entry.js +10 -10
  253. package/dist/esm/justifi-checkouts-list-filters.entry.js +6 -6
  254. package/dist/esm/justifi-checkouts-list.entry.js +12 -12
  255. package/dist/esm/justifi-dispute-management.entry.js +10 -10
  256. package/dist/esm/justifi-gross-payment-chart.entry.js +11 -11
  257. package/dist/esm/justifi-order-terminals.entry.js +12 -12
  258. package/dist/esm/justifi-payment-details.entry.js +18 -18
  259. package/dist/esm/justifi-payment-provisioning.entry.js +11 -11
  260. package/dist/esm/justifi-payment-transactions-list.entry.js +10 -10
  261. package/dist/esm/justifi-payments-list-filters.entry.js +5 -5
  262. package/dist/esm/justifi-payments-list.entry.js +11 -11
  263. package/dist/esm/justifi-payout-details.entry.js +14 -14
  264. package/dist/esm/justifi-payout-transactions-list.entry.js +10 -10
  265. package/dist/esm/justifi-payouts-list-filters.entry.js +5 -5
  266. package/dist/esm/justifi-payouts-list.entry.js +15 -15
  267. package/dist/esm/justifi-qr-terminal.entry.js +9 -9
  268. package/dist/esm/justifi-refund-payment.entry.js +13 -13
  269. package/dist/esm/justifi-save-new-payment-method.entry.js +2 -2
  270. package/dist/esm/justifi-season-interruption-insurance.entry.js +10 -10
  271. package/dist/esm/justifi-skeleton.entry.js +2 -2
  272. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +7 -7
  273. package/dist/esm/justifi-terminal-orders-list.entry.js +11 -11
  274. package/dist/esm/justifi-terminals-list-filters.entry.js +5 -5
  275. package/dist/esm/justifi-terminals-list.entry.js +14 -14
  276. package/dist/esm/loader.js +1 -1
  277. package/dist/esm/{lodash-CrGKVSPp.js → lodash-BF_QgjtL.js} +38 -27
  278. package/dist/esm/{package-CZa-hHhJ.js → package-DNd24RUQ.js} +1 -1
  279. package/dist/esm/payment-method-option.entry.js +2 -2
  280. package/dist/esm/{payment-provisioning-actions-CcDadiRe.js → payment-provisioning-actions-DI3QUsjh.js} +9 -9
  281. package/dist/esm/payment-provisioning-form-buttons_2.entry.js +3 -2
  282. package/dist/esm/{payment.service-BiKQPL4M.js → payment.service-wSNYSRyl.js} +2 -2
  283. package/dist/esm/{payout.service-B9_cyUiU.js → payout.service-CTAksNmD.js} +2 -2
  284. package/dist/esm/{payouts-status-xOa5tT66.js → payouts-status-CeZoirpf.js} +2 -2
  285. package/dist/esm/{plaid.service-bU3qIoKd.js → plaid.service-5EpJEdwX.js} +2 -2
  286. package/dist/esm/radio-list-item.entry.js +1 -1
  287. package/dist/esm/save-new-payment-method.entry.js +2 -2
  288. package/dist/esm/{schema-validations-u9_XnlUL.js → schema-validations-CySYE883.js} +24 -11
  289. package/dist/esm/styled-host-D84RBv1W.js +9 -0
  290. package/dist/esm/table-filters-menu.entry.js +1 -1
  291. package/dist/esm/terminal-quantity-selector.entry.js +1 -1
  292. package/dist/esm/{terminal.service-BM6BvevW.js → terminal.service-xjfU0mJT.js} +2 -2
  293. package/dist/esm/{utils-BTtxWI2r.js → utils-CcA8Y5hs.js} +4 -4
  294. package/dist/esm/{utils-BogmBHgt.js → utils-myniydlM.js} +1 -1
  295. package/dist/esm/webcomponents.js +1 -1
  296. package/dist/module/Analytics.js +2 -2
  297. package/dist/module/Plaid.js +13 -12
  298. package/dist/module/additional-questions-form-step2.js +12 -6
  299. package/dist/module/additional-statement2.js +1 -1
  300. package/dist/module/bank-account-billing-form-simple2.js +1 -1
  301. package/dist/module/bank-account-document-form-inputs.js +55 -1
  302. package/dist/module/bank-account-form2.js +30 -2
  303. package/dist/module/billing-form-full2.js +2 -2
  304. package/dist/module/billing-form-schema.js +1 -1
  305. package/dist/module/business-address-schema.js +2 -2
  306. package/dist/module/business-bank-account-form-step2.js +25 -178
  307. package/dist/module/business-core-info-form-step2.js +3 -3
  308. package/dist/module/business-core-info-schema.js +2 -2
  309. package/dist/module/business-core-info2.js +3 -3
  310. package/dist/module/business-documents-on-file2.js +1 -1
  311. package/dist/module/business-form-options.js +51 -1
  312. package/dist/module/business-identity-schema.js +8 -4
  313. package/dist/module/business-owners-form-step2.js +9 -0
  314. package/dist/module/business-representative-form-inputs2.js +5 -3
  315. package/dist/module/business-representative-form-step2.js +1 -1
  316. package/dist/module/business-representative2.js +6 -5
  317. package/dist/module/button.js +1 -1
  318. package/dist/module/cancellation-policy2.js +1 -1
  319. package/dist/module/card-billing-form-simple2.js +1 -1
  320. package/dist/module/card-form2.js +2 -2
  321. package/dist/module/checkout.store.js +9 -3
  322. package/dist/module/country-config.js +12 -5
  323. package/dist/module/custom-popper2.js +2 -2
  324. package/dist/module/customer-details2.js +1 -1
  325. package/dist/module/dispute-notification2.js +3 -3
  326. package/dist/module/dispute-response2.js +1 -1
  327. package/dist/module/document-upload-form-step.d.ts +11 -0
  328. package/dist/module/document-upload-form-step.js +6 -0
  329. package/dist/module/document-upload-form-step2.js +403 -0
  330. package/dist/module/document-upload-list.d.ts +11 -0
  331. package/dist/module/document-upload-list.js +6 -0
  332. package/dist/module/document-upload-list2.js +46 -0
  333. package/dist/module/duplicate-charge2.js +1 -1
  334. package/dist/module/electronic-evidence2.js +1 -1
  335. package/dist/module/event-types3.js +3 -3
  336. package/dist/module/form-control-checkbox2.js +2 -2
  337. package/dist/module/form-control-date2.js +2 -2
  338. package/dist/module/form-control-file-v22.js +1 -1
  339. package/dist/module/form-control-file2.js +2 -2
  340. package/dist/module/form-control-monetary2.js +2 -2
  341. package/dist/module/form-control-number-masked2.js +2 -2
  342. package/dist/module/form-control-number2.js +3 -3
  343. package/dist/module/form-control-radio2.js +2 -2
  344. package/dist/module/form-control-select2.js +2 -2
  345. package/dist/module/form-control-text2.js +2 -2
  346. package/dist/module/form-control-textarea2.js +3 -3
  347. package/dist/module/form.js +1 -18
  348. package/dist/module/hidden-input2.js +3 -3
  349. package/dist/module/iframe-input2.js +4 -4
  350. package/dist/module/insurance-state.js +1 -1
  351. package/dist/module/internal-button2.js +1 -1
  352. package/dist/module/justifi-apple-pay2.js +0 -2
  353. package/dist/module/justifi-bank-account-billing-form-simple.js +1 -1
  354. package/dist/module/justifi-bank-account-form.js +11 -1
  355. package/dist/module/justifi-billing-form-full.js +1 -1
  356. package/dist/module/justifi-billing-form.js +1 -1
  357. package/dist/module/justifi-button2.js +1 -1
  358. package/dist/module/justifi-card-billing-form-simple.js +1 -1
  359. package/dist/module/justifi-card-form.js +1 -1
  360. package/dist/module/justifi-checkout-summary2.js +1 -1
  361. package/dist/module/justifi-checkout.js +3 -2
  362. package/dist/module/justifi-checkouts-list-filters.js +3 -3
  363. package/dist/module/justifi-checkouts-list.js +4 -4
  364. package/dist/module/justifi-dispute-management.js +2 -2
  365. package/dist/module/justifi-google-pay2.js +10 -4
  366. package/dist/module/justifi-gross-payment-chart.js +3 -3
  367. package/dist/module/justifi-header2.js +1 -1
  368. package/dist/module/justifi-modular-checkout2.js +19 -13
  369. package/dist/module/justifi-order-terminals.js +3 -3
  370. package/dist/module/justifi-payment-details.js +9 -9
  371. package/dist/module/justifi-payment-provisioning.js +33 -27
  372. package/dist/module/justifi-payment-transactions-list.js +3 -3
  373. package/dist/module/justifi-payments-list-filters.js +2 -2
  374. package/dist/module/justifi-payments-list.js +3 -3
  375. package/dist/module/justifi-payout-details.js +5 -5
  376. package/dist/module/justifi-payout-transactions-list.js +3 -3
  377. package/dist/module/justifi-payouts-list-filters.js +3 -3
  378. package/dist/module/justifi-payouts-list.js +6 -6
  379. package/dist/module/justifi-plaid-payment-method2.js +14 -2
  380. package/dist/module/justifi-qr-terminal.js +1 -1
  381. package/dist/module/justifi-refund-payment.js +3 -3
  382. package/dist/module/justifi-save-new-payment-method.js +1 -1
  383. package/dist/module/justifi-skeleton.js +1 -1
  384. package/dist/module/justifi-terminal-orders-list-filters.js +4 -4
  385. package/dist/module/justifi-terminal-orders-list.js +5 -5
  386. package/dist/module/justifi-terminals-list-filters.js +2 -2
  387. package/dist/module/justifi-terminals-list.js +6 -6
  388. package/dist/module/justifi-tokenize-payment-method2.js +5 -3
  389. package/dist/module/legal-address-form-step2.js +1 -1
  390. package/dist/module/lodash.js +38 -27
  391. package/dist/module/owner-details2.js +1 -1
  392. package/dist/module/owner-form-inputs2.js +5 -3
  393. package/dist/module/owner-form2.js +10 -1
  394. package/dist/module/package.js +1 -1
  395. package/dist/module/parts.js +1 -1
  396. package/dist/module/payment-method-option.js +1 -1
  397. package/dist/module/payment-provisioning-actions.js +8 -8
  398. package/dist/module/payment-provisioning-form-steps2.js +35 -28
  399. package/dist/module/plaid-verification2.js +1 -1
  400. package/dist/module/product-or-service2.js +1 -1
  401. package/dist/module/radio-list-item2.js +1 -1
  402. package/dist/module/refund-policy2.js +1 -1
  403. package/dist/module/save-new-payment-method2.js +1 -1
  404. package/dist/module/schema-validations.js +22 -9
  405. package/dist/module/shipping-details2.js +1 -1
  406. package/dist/module/skeleton.js +1 -1
  407. package/dist/module/styled-host.js +1 -1
  408. package/dist/module/table-filters-menu2.js +1 -1
  409. package/dist/module/table.js +1 -1
  410. package/dist/module/terminal-quantity-selector2.js +2 -2
  411. package/dist/module/utils2.js +4 -4
  412. package/dist/stencil.config.js +40 -0
  413. package/dist/types/api/Document.d.ts +13 -1
  414. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +2 -0
  415. package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +1 -12
  416. package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.d.ts +44 -0
  417. package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-list.d.ts +6 -0
  418. package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-options.d.ts +45 -0
  419. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-form-steps.d.ts +1 -0
  420. package/dist/types/components/business-forms/schemas/business-bank-account-schema.d.ts +4 -4
  421. package/dist/types/components/business-forms/utils/business-form-options.d.ts +1 -0
  422. package/dist/types/components/checkout/bank-account-form/bank-account-form.d.ts +2 -0
  423. package/dist/types/components/checkout/justifi-checkout.d.ts +2 -0
  424. package/dist/types/components/modular-checkout/sub-components/justifi-apple-pay.d.ts +0 -1
  425. package/dist/types/components/modular-checkout/sub-components/justifi-bank-account-form.d.ts +1 -1
  426. package/dist/types/components/modular-checkout/sub-components/justifi-google-pay.d.ts +4 -2
  427. package/dist/types/components/modular-checkout/sub-components/justifi-plaid-payment-method.d.ts +1 -0
  428. package/dist/types/components.d.ts +86 -13
  429. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/stencil.config.d.ts +2 -0
  430. package/dist/types/store/checkout.store.d.ts +2 -0
  431. package/dist/types/utils/checkout-billing-state-options.d.ts +9 -0
  432. package/dist/webcomponents/p-055640f9.entry.js +1 -0
  433. package/dist/webcomponents/{p-ca87c609.entry.js → p-0a4fcb15.entry.js} +1 -1
  434. package/dist/webcomponents/p-0dc3c605.entry.js +1 -0
  435. package/dist/webcomponents/p-0f2a1ac9.entry.js +1 -0
  436. package/dist/webcomponents/p-14a03ad0.entry.js +1 -0
  437. package/dist/webcomponents/p-1737a7fc.entry.js +1 -0
  438. package/dist/webcomponents/p-1b51dea9.entry.js +1 -0
  439. package/dist/webcomponents/{p-89cd31f2.entry.js → p-1de248b1.entry.js} +1 -1
  440. package/dist/webcomponents/{p-8d602e60.entry.js → p-2092b278.entry.js} +1 -1
  441. package/dist/webcomponents/p-25215ee7.entry.js +1 -0
  442. package/dist/webcomponents/p-2757b61e.entry.js +1 -0
  443. package/dist/webcomponents/{p-ff5c5499.entry.js → p-2bab43ac.entry.js} +4 -4
  444. package/dist/webcomponents/{p-37fd1862.entry.js → p-2ebc862f.entry.js} +1 -1
  445. package/dist/webcomponents/p-32ee9101.entry.js +1 -0
  446. package/dist/webcomponents/p-4791c6d7.entry.js +1 -0
  447. package/dist/webcomponents/p-49d9c0a4.entry.js +1 -0
  448. package/dist/webcomponents/p-4a30693b.entry.js +1 -0
  449. package/dist/webcomponents/p-4fab9314.entry.js +1 -0
  450. package/dist/webcomponents/{p-a80f69a9.entry.js → p-53d775b9.entry.js} +1 -1
  451. package/dist/webcomponents/{p-0fb8fb8c.entry.js → p-5984e9df.entry.js} +1 -1
  452. package/dist/webcomponents/{p-70dcd833.entry.js → p-5a58f606.entry.js} +1 -1
  453. package/dist/webcomponents/{p-392f0c1c.entry.js → p-5d9d6dd5.entry.js} +1 -1
  454. package/dist/webcomponents/p-65908b5f.entry.js +1 -0
  455. package/dist/webcomponents/{p-3d6b9434.entry.js → p-67364f1d.entry.js} +1 -1
  456. package/dist/webcomponents/p-6c3e9ebd.entry.js +1 -0
  457. package/dist/webcomponents/p-6d1299db.entry.js +1 -0
  458. package/dist/webcomponents/{p-a9695714.entry.js → p-6fe329d6.entry.js} +1 -1
  459. package/dist/webcomponents/p-70a2f59a.entry.js +1 -0
  460. package/dist/webcomponents/p-73deced9.entry.js +1 -0
  461. package/dist/webcomponents/p-762b1b7b.entry.js +1 -0
  462. package/dist/webcomponents/p-76ded81e.entry.js +1 -0
  463. package/dist/webcomponents/p-7b6cf400.entry.js +1 -0
  464. package/dist/webcomponents/p-863daddf.entry.js +1 -0
  465. package/dist/webcomponents/p-8fd18ce2.entry.js +1 -0
  466. package/dist/webcomponents/{p-bd678d4a.entry.js → p-90c5af69.entry.js} +1 -1
  467. package/dist/webcomponents/p-9c0760b9.entry.js +1 -0
  468. package/dist/webcomponents/{p-CqPcl9v7.js → p-B62JX_Dh.js} +1 -1
  469. package/dist/webcomponents/p-BB8Ce9rp.js +1 -0
  470. package/dist/webcomponents/{p-Bt4GjEWL.js → p-BBSnDYJw.js} +1 -1
  471. package/dist/webcomponents/{p-BRnBHsdq.js → p-BSs-2JKu.js} +1 -1
  472. package/dist/webcomponents/p-BUHsyQpA.js +1 -0
  473. package/dist/webcomponents/{p-D-zwk1J3.js → p-C-Jgmek8.js} +1 -1
  474. package/dist/webcomponents/p-C1gr32IS.js +1 -0
  475. package/dist/webcomponents/{p-D4E9P7df.js → p-C7hX61pS.js} +1 -1
  476. package/dist/webcomponents/p-CO8ZGkfN.js +1 -0
  477. package/dist/webcomponents/p-CPJC6tlj.js +1 -0
  478. package/dist/webcomponents/{p-DHFQtPCq.js → p-CQqmTKij.js} +1 -1
  479. package/dist/webcomponents/{p-Cg_3KsGO.js → p-CdwzNfP1.js} +1 -1
  480. package/dist/webcomponents/p-Cn7z5L7J.js +1 -0
  481. package/dist/webcomponents/{p-BGvaX-lJ.js → p-CxBrydeX.js} +1 -1
  482. package/dist/webcomponents/{p-DwoT0UoX.js → p-D9sqTVmd.js} +1 -1
  483. package/dist/webcomponents/p-DNd24RUQ.js +1 -0
  484. package/dist/webcomponents/p-DP9ysr2K.js +1 -0
  485. package/dist/webcomponents/p-DPA5TKvQ.js +1 -0
  486. package/dist/webcomponents/{p-CSgcCWLS.js → p-DXTa04jn.js} +1 -1
  487. package/dist/webcomponents/p-Da3fPDxu.js +1 -0
  488. package/dist/webcomponents/{p-CYQvLgSs.js → p-De4Pig-y.js} +1 -1
  489. package/dist/webcomponents/p-DyPk4BJt.js +1 -0
  490. package/dist/webcomponents/p-DzEdYT8R.js +1 -0
  491. package/dist/webcomponents/p-NzPaWKbY.js +1 -0
  492. package/dist/webcomponents/p-OeJ-3w3l.js +9 -0
  493. package/dist/webcomponents/{p-eK8hZOMg.js → p-R_0S69Pr.js} +1 -1
  494. package/dist/webcomponents/p-_GBnYSuR.js +1 -0
  495. package/dist/webcomponents/p-a5913b33.entry.js +1 -0
  496. package/dist/webcomponents/p-a5cc55af.entry.js +1 -0
  497. package/dist/webcomponents/p-a7bd5651.entry.js +1 -0
  498. package/dist/webcomponents/p-ac08992c.entry.js +1 -0
  499. package/dist/webcomponents/p-b03e361e.entry.js +1 -0
  500. package/dist/webcomponents/p-b73c5779.entry.js +1 -0
  501. package/dist/webcomponents/p-c47db9f5.entry.js +1 -0
  502. package/dist/webcomponents/p-c60c4bed.entry.js +1 -0
  503. package/dist/webcomponents/p-c8bcc54f.entry.js +1 -0
  504. package/dist/webcomponents/{p-22d19755.entry.js → p-debc4768.entry.js} +1 -1
  505. package/dist/webcomponents/p-e3021e22.entry.js +1 -0
  506. package/dist/webcomponents/{p-aee2295b.entry.js → p-e3f8541c.entry.js} +1 -1
  507. package/dist/webcomponents/{p-9fca25fc.entry.js → p-e63cd41f.entry.js} +1 -1
  508. package/dist/webcomponents/p-e711f221.entry.js +1 -0
  509. package/dist/webcomponents/p-e8875186.entry.js +1 -0
  510. package/dist/webcomponents/p-ebd1c09f.entry.js +1 -0
  511. package/dist/webcomponents/p-ec845aa4.entry.js +1 -0
  512. package/dist/webcomponents/{p-c1539656.entry.js → p-eccc1fc6.entry.js} +1 -1
  513. package/dist/webcomponents/{p-c4767c7b.entry.js → p-f3c40c22.entry.js} +1 -1
  514. package/dist/webcomponents/p-f4de4ac0.entry.js +1 -0
  515. package/dist/webcomponents/p-f52fe722.entry.js +1 -0
  516. package/dist/webcomponents/p-f60bfe16.entry.js +1 -0
  517. package/dist/webcomponents/p-f953fd60.entry.js +1 -0
  518. package/dist/webcomponents/{p-b20b8805.entry.js → p-fb2e1557.entry.js} +1 -1
  519. package/dist/webcomponents/p-fca0ca4d.entry.js +1 -0
  520. package/dist/webcomponents/p-z3RFjy9B.js +1 -0
  521. package/dist/webcomponents/{p-qju4tNG1.js → p-zZn1OXja.js} +1 -1
  522. package/dist/webcomponents/webcomponents.esm.js +1 -1
  523. package/package.json +16 -16
  524. package/readme.md +7 -14
  525. package/dist/cjs/styled-host-DAi5SuFa.js +0 -11
  526. package/dist/esm/styled-host-D6byRazK.js +0 -9
  527. package/dist/module/bank-account-document-form-inputs2.js +0 -57
  528. package/dist/webcomponents/p-06e8df55.entry.js +0 -1
  529. package/dist/webcomponents/p-0708cb76.entry.js +0 -1
  530. package/dist/webcomponents/p-07f2f1bf.entry.js +0 -1
  531. package/dist/webcomponents/p-10087a53.entry.js +0 -1
  532. package/dist/webcomponents/p-12ae030d.entry.js +0 -1
  533. package/dist/webcomponents/p-1d7b8c21.entry.js +0 -1
  534. package/dist/webcomponents/p-21c89e22.entry.js +0 -1
  535. package/dist/webcomponents/p-2ec7cd88.entry.js +0 -1
  536. package/dist/webcomponents/p-2qotS5d_.js +0 -1
  537. package/dist/webcomponents/p-355a5c8d.entry.js +0 -1
  538. package/dist/webcomponents/p-37b95a11.entry.js +0 -1
  539. package/dist/webcomponents/p-383b8317.entry.js +0 -1
  540. package/dist/webcomponents/p-44cf13ac.entry.js +0 -1
  541. package/dist/webcomponents/p-46477dfe.entry.js +0 -1
  542. package/dist/webcomponents/p-4ccf9cd7.entry.js +0 -1
  543. package/dist/webcomponents/p-55fdab4e.entry.js +0 -1
  544. package/dist/webcomponents/p-5ccb46ee.entry.js +0 -1
  545. package/dist/webcomponents/p-5f8dfa8d.entry.js +0 -1
  546. package/dist/webcomponents/p-63b7abf3.entry.js +0 -1
  547. package/dist/webcomponents/p-6RTf1SXX.js +0 -1
  548. package/dist/webcomponents/p-70cd2808.entry.js +0 -1
  549. package/dist/webcomponents/p-769d3d93.entry.js +0 -1
  550. package/dist/webcomponents/p-79bd744e.entry.js +0 -1
  551. package/dist/webcomponents/p-7a4cd292.entry.js +0 -1
  552. package/dist/webcomponents/p-9153c121.entry.js +0 -1
  553. package/dist/webcomponents/p-94f14640.entry.js +0 -1
  554. package/dist/webcomponents/p-98f399ec.entry.js +0 -1
  555. package/dist/webcomponents/p-9b944aa4.entry.js +0 -1
  556. package/dist/webcomponents/p-9fc7714d.entry.js +0 -1
  557. package/dist/webcomponents/p-BArmtmkq.js +0 -1
  558. package/dist/webcomponents/p-BqNNwq6C.js +0 -1
  559. package/dist/webcomponents/p-CZa-hHhJ.js +0 -1
  560. package/dist/webcomponents/p-C_ifLmT1.js +0 -9
  561. package/dist/webcomponents/p-CvgL8YaH.js +0 -1
  562. package/dist/webcomponents/p-DD-_8sbs.js +0 -1
  563. package/dist/webcomponents/p-DMqJWUK2.js +0 -1
  564. package/dist/webcomponents/p-DZAMzLxa.js +0 -1
  565. package/dist/webcomponents/p-DbOUuBHs.js +0 -1
  566. package/dist/webcomponents/p-DyucNSA4.js +0 -1
  567. package/dist/webcomponents/p-Eb1f86_V.js +0 -1
  568. package/dist/webcomponents/p-KXLYEe1D.js +0 -1
  569. package/dist/webcomponents/p-XxG-t-Sl.js +0 -1
  570. package/dist/webcomponents/p-a7a1b168.entry.js +0 -1
  571. package/dist/webcomponents/p-b0b6083f.entry.js +0 -1
  572. package/dist/webcomponents/p-b341efd6.entry.js +0 -1
  573. package/dist/webcomponents/p-b62ff001.entry.js +0 -1
  574. package/dist/webcomponents/p-bb5de874.entry.js +0 -1
  575. package/dist/webcomponents/p-c8ee1e4c.entry.js +0 -1
  576. package/dist/webcomponents/p-ce1dde85.entry.js +0 -1
  577. package/dist/webcomponents/p-d253a573.entry.js +0 -1
  578. package/dist/webcomponents/p-d620d4b4.entry.js +0 -1
  579. package/dist/webcomponents/p-dcd600ca.entry.js +0 -1
  580. package/dist/webcomponents/p-e4cb7c21.entry.js +0 -1
  581. package/dist/webcomponents/p-e5c2215a.entry.js +0 -1
  582. package/dist/webcomponents/p-e6b9dfe1.entry.js +0 -1
  583. package/dist/webcomponents/p-eCeOsPHx.js +0 -1
  584. package/dist/webcomponents/p-f1b9cbf0.entry.js +0 -1
  585. package/dist/webcomponents/p-f9aafb21.entry.js +0 -1
@@ -1 +1 @@
1
- import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{n as s,C as a,b as r}from"./p-CSgcCWLS.js";import{J as n}from"./p-DbOUuBHs.js";import{c as o}from"./p-DHFQtPCq.js";import{T as c}from"./p-BGvaX-lJ.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as d,a as p}from"./p-Cg_3KsGO.js";import{m,S as u}from"./p-Eb1f86_V.js";import{S as l}from"./p-BqNNwq6C.js";import{T as b,a as f,b as v,c as g,d as k,e as y,f as C,g as j,h as _,i as w,j as T,k as S,l as O}from"./p-BICxxa69.js";import{T as D}from"./p-CZfYo5-1.js";import{B as P,a as I}from"./p-CHw7tICr.js";import{a6 as x,a7 as A}from"./p-CPKMvyV_.js";import{k as B}from"./p-BRnBHsdq.js";import{o as E,g as H}from"./p-Dw63wyhO.js";import"./p-CZa-hHhJ.js";import"./p-CYQvLgSs.js";import"./p-D8GTwl9v.js";import"./p-CqiVXthx.js";const N={nickname:()=>t("th",{part:x,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:x,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:x,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:x,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:x,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:x,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:x,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:x,scope:"col",title:"The current status of each terminal"},"Status")},q={nickname:(e,i)=>t("td",{part:A(i)},e.nickname),model_name:(e,i)=>t("td",{part:A(i)},e.model_name),id:(e,i)=>t("td",{part:A(i)},e.id),provider:(e,i)=>t("td",{part:A(i)},B(e.provider)),provider_serial_number:(e,i)=>t("td",{part:A(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:A(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:A(i)},e.sub_account_name),status:(e,i)=>t("td",{part:A(i)},t(I,Object.assign({},{connected:{variant:P.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:P.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:P.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:P.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:P.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},G=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new b(this.terminals,this.columns,N,q),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),E("set",(()=>{this.pagingParams={}})),E("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:e,service:i})=>async({params:r,onSuccess:n,onError:o})=>{var c,h;try{const m=await i.fetchTerminals(t,e,r);if(m.error)return o({error:p(m.error),code:d(null===(h=m.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const t=Object.assign({},m.page_info);n({terminals:(null===(c=m.data)||void 0===c?void 0:c.map((t=>new s(t))))||[],pagingInfo:t})}}catch(t){const e=d(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:a.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new c}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new u}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:e})=>{this.terminals=t,this.paging=e,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}get terminalParams(){const t=H();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){let t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(l,{key:"6388e9b0b7c6dcedc9f3db534d3a30d0a748929c"},t(f,{key:"e11b994e16e657aaaa7c6f29197865d0d6bfd1ba"},t(v,{key:"340980f75fef37841907835378d9c0ced1992b5c"},t(g,{key:"fdd3d1569b6a3df9d5d31fb2cc602ab054529fc6"},t(k,{key:"440d602ac5746635f92445c6216c807b9b13517e"},this.terminalsTable.columnData.map((t=>t)))),t(y,{key:"ccef66a47be1cfca09f10d450fb7eeaf241a17e0"},t(C,{key:"aea6e2f33e07c717f50065c12211f9f2d9266bec",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(j,{key:"7c92ba6cd398bae23587a2e1771bba7b75dc680c",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(_,{key:"3155cf655f5b8e4290e8cabdcdbd534159f22ddd",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((e,i)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(T,{key:"da9172d4bf4439456894b53a0cf13a82081909f0"},t(S,{key:"e6c0847dc330a0e32228f2020d22bbaf0e4ad439"},t(O,{key:"6761f623d70d13b13e92ec73c9b936d5bf85dd70",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"4b490b5834be42664ebbc27b7c7a1b0c10bd433b",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{G as justifi_terminals_list}
1
+ import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{n as s,C as a,b as r}from"./p-DXTa04jn.js";import{J as n}from"./p-_GBnYSuR.js";import{c as o}from"./p-CQqmTKij.js";import{T as c}from"./p-CxBrydeX.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as d,a as p}from"./p-CdwzNfP1.js";import{m,S as u}from"./p-BUHsyQpA.js";import{S as l}from"./p-DzEdYT8R.js";import{T as f,a as b,b as v,c as g,d as y,e as k,f as j,g as C,h as T,i as w,j as _,k as S,l as D}from"./p-BICxxa69.js";import{T as P}from"./p-CZfYo5-1.js";import{B as O,a as I}from"./p-CHw7tICr.js";import{a6 as x,a7 as A}from"./p-CPKMvyV_.js";import{k as B}from"./p-BSs-2JKu.js";import{o as E,g as N}from"./p-Dw63wyhO.js";import"./p-DNd24RUQ.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-CqiVXthx.js";const z={nickname:()=>t("th",{part:x,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:x,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:x,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:x,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:x,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:x,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:x,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:x,scope:"col",title:"The current status of each terminal"},"Status")},G={nickname:(e,i)=>t("td",{part:A(i)},e.nickname),model_name:(e,i)=>t("td",{part:A(i)},e.model_name),id:(e,i)=>t("td",{part:A(i)},e.id),provider:(e,i)=>t("td",{part:A(i)},B(e.provider)),provider_serial_number:(e,i)=>t("td",{part:A(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:A(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:A(i)},e.sub_account_name),status:(e,i)=>t("td",{part:A(i)},t(I,Object.assign({},{connected:{variant:O.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:O.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:O.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:O.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:O.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},U=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:P.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new f(this.terminals,this.columns,z,G),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),E("set",(()=>{this.pagingParams={}})),E("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:e,service:i})=>async({params:r,onSuccess:n,onError:o})=>{var c,h;try{const m=await i.fetchTerminals(t,e,r);if(m.error)return o({error:p(m.error),code:d(null===(h=m.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const t=Object.assign({},m.page_info);n({terminals:(null===(c=m.data)||void 0===c?void 0:c.map((t=>new s(t))))||[],pagingInfo:t})}}catch(t){const e=d(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:a.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new c}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new u}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:e})=>{this.terminals=t,this.paging=e,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}get terminalParams(){const t=N();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(l,{key:"69c475e7a428c549a05f21bbd9bd80ce6d77836b"},t(b,{key:"a3d916daff63336299366f27959b8e54134f54c5"},t(v,{key:"412538503e7a212bd7b5723dddad82abe95fc3c2"},t(g,{key:"5501e72fd1931b1ffc17e6bf0d09d692b9cfbe17"},t(y,{key:"e0391a60a807cbdba97ef11f04275eb3072dc40c"},this.terminalsTable.columnData.map((t=>t)))),t(k,{key:"56686e423499aff459fa3d6d93fae0fd7621b10b"},t(j,{key:"0b70b5a0132754b1ce14e8baaeb7a9932c73b0ad",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"1230c30259de7ad89a1ccf1bb709db5bdda9152f",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(T,{key:"fc5dbeae973d56980e077fa861d0bf95f282cbec",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((e,i)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(_,{key:"c68e2cb14c8fa6a56243803e440cc13388ffaaf4"},t(S,{key:"bcc17671c48f5a397dff15333a49305a443aef21"},t(D,{key:"92a690d558b001bb346c2e17fb1e02691ec2a029",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"2a8233397675c7af4fd95df203eb4438f1c4adbd",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{U as justifi_terminals_list}
@@ -0,0 +1 @@
1
+ import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{J as e}from"./p-_GBnYSuR.js";import{C as r,b as o}from"./p-DXTa04jn.js";import{m as n,b as h}from"./p-Da3fPDxu.js";import{B as a}from"./p-R_0S69Pr.js";import{A as p}from"./p-De4Pig-y.js";import"./p-CLHwhyvu.js";import{C as m,B as d,c as l}from"./p-BcNb9bVO.js";import{c as u}from"./p-CQqmTKij.js";import{i as c}from"./p-BSs-2JKu.js";import{t as v}from"./p-CPKMvyV_.js";import{S as f}from"./p-DzEdYT8R.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-DNd24RUQ.js";import"./p-CdwzNfP1.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-uZ5KAseb.js";const b=p();class w{async postProvisioning(s,t,i){return b.post({endpoint:"entities/provisioning",body:{business_id:t,product_category:i},authToken:s})}}const C=()=>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."))),S=()=>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!"))),k=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 d(t.data);this.businessProvisioned=l(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(8)}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 w})):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(C,null):this.formSubmitted?s(S,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{k as justifi_payment_provisioning}
@@ -0,0 +1 @@
1
+ import{h as s,F as e,r as i,c as t}from"./p-CV0Pyo1O.js";import{E as a}from"./p-Cu7hgXL1.js";import{B as r}from"./p-R_0S69Pr.js";import{m as o}from"./p-CPJC6tlj.js";import{C as n,b as l}from"./p-DXTa04jn.js";import{J as d}from"./p-_GBnYSuR.js";import{c as h}from"./p-CQqmTKij.js";import{S as c}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{S as p}from"./p-uZ5KAseb.js";import"./p-CPKMvyV_.js";import"./p-De4Pig-y.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-BSs-2JKu.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-CdwzNfP1.js";import"./p-DNd24RUQ.js";const u=()=>{const i=()=>s("div",{class:"mt-5"},s(p,{width:"40%",height:"1.5rem"}),s("hr",null),s("div",{class:"row g-3"},s("div",{class:"col-12 col-md-6"},s(p,null),s(p,null),s(p,null)),s("div",{class:"col-12 col-md-6"},s(p,null),s(p,null),s(p,null))));return s(e,null,s(i,null),s(i,null),s(i,null),s(i,null))},m=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event",7),this.loading=!0}componentWillLoad(){h(),this.analytics=new d(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetBusiness()}initializeGetBusiness(){this.businessId&&this.authToken?(this.getBusiness=o({id:this.businessId,authToken:this.authToken,service:new r}),this.fetchData()):(this.errorMessage="Invalid business id or auth token",this.errorEvent.emit({errorCode:l.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}updateOnPropChange(){this.getBusiness&&this.fetchData()}fetchData(){this.loading=!0,this.getBusiness({onSuccess:({business:s})=>{this.business=s,this.errorMessage=null},onError:({error:s,code:e,severity:i})=>{this.errorMessage=s,this.errorEvent.emit({errorCode:e,message:s,severity:i})},final:()=>{this.loading=!1}})}render(){return s(c,{key:"7ce48e6905cdbbf8f94470913ecfa3ef8dbb76c7"},this.loading&&s(u,{key:"7c3439e0c247436cd7951d3bdc32e7672c9f8447"}),!this.loading&&this.errorMessage&&a(this.errorMessage),!this.loading&&!this.errorMessage&&this.business&&s("justifi-details",{key:"bf57dacf2067f2704014ce3e002958e3306bba73",errorMessage:this.errorMessage},s("div",{key:"46d19a178ba0d33aa21a4f3900128e3e905731a9",slot:"detail-sections"},s("core-info-details",{key:"ac217a4cfe6b45810a85ca320760b7331f76e60b",business:this.business}),s("legal-address-details",{key:"1fc1a196a43bcf5f9eafd09bfe74c8bb7c409797",legalAddress:this.business.legal_address}),s("representative-details",{key:"1e0833606b129f69a05946726172963cbec05189",representative:this.business.representative}),s("owner-details",{key:"c974111dc67a8961ef6435c34843ca927ad8a7e5",owners:this.business.owners}),s("additional-questions-details",{key:"0951d284a373457e98a1dafc80231ec3ee057e0a",additionalQuestions:this.business.additional_questions}))))}static get watchers(){return{businessId:["propChanged"],authToken:["propChanged"],getBusiness:["updateOnPropChange"]}}};export{m as justifi_business_details}
@@ -0,0 +1 @@
1
+ import{h as t,r as s,c as e}from"./p-CV0Pyo1O.js";import{k as a,C as i,b as o}from"./p-DXTa04jn.js";import{J as r}from"./p-_GBnYSuR.js";import{c as h}from"./p-CQqmTKij.js";import{P as c}from"./p-CO8ZGkfN.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as p,a as d}from"./p-CdwzNfP1.js";import{M as u,m}from"./p-zZn1OXja.js";import{m as f,S as l}from"./p-BUHsyQpA.js";import{S as y}from"./p-DzEdYT8R.js";import{T as b,a as g,b as v,c as j,d as C,e as _,f as k,g as w,h as S,i as T,j as P,k as O,l as A}from"./p-BICxxa69.js";import{T as D}from"./p-CZfYo5-1.js";import{a as I}from"./p-BSs-2JKu.js";import{a6 as E,a7 as V}from"./p-CPKMvyV_.js";import{o as x,g as z}from"./p-AMVhBsGv.js";import"./p-DNd24RUQ.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-CHw7tICr.js";import"./p-CqiVXthx.js";const B={created_at:()=>t("th",{part:E,scope:"col",title:"The date the payout was deposited"},"Created"),sub_account_name:()=>t("th",{part:E,scope:"col",title:"The sub account associated with the payout"},"Sub Account"),payments_total:()=>t("th",{part:E,scope:"col",title:"The total payments amount associated with the payout"},"Payments"),refunds_total:()=>t("th",{part:E,scope:"col",title:"The total refunds amount associated with the payout"},"Refunds"),fees_total:()=>t("th",{part:E,scope:"col",title:"The total fees amount associated with the payout"},"Fees"),other_total:()=>t("th",{part:E,scope:"col",title:"The total other amount"},"Other"),amount:()=>t("th",{part:E,scope:"col",title:"The total amount of the payout"},"Amount"),status:()=>t("th",{part:E,scope:"col",title:"The real-time status of each payout"},"Status"),csv:()=>t("th",{part:E,scope:"col",title:"Export CSV"})},G=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event",7),this.clickEvent=e(this,"click-event",7),this.errorMessage=null,this.payouts=[],this.subAccounts=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payments_total,refunds_total,fees_total,other_total,csv",this.downloadCSV=t=>{this.getPayoutCSV({payoutId:t,onError:()=>{this.errorEvent.emit({errorCode:o.FETCH_ERROR,message:"Failed to download CSV",severity:i.ERROR})}})},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr"),e=s.dataset.rowEntityId;if(!e)return;if(s.querySelector("a")===t.target)return;const a=this.payouts.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){var s;h(),this.analytics=new r(this),this.initializeGetData(),this.payoutsTable=new b(this.payouts,this.columns,B,(s=this.downloadCSV,{created_at:(s,e)=>t("td",{part:V(e)},t("div",{class:"fw-bold"},I(s.created_at,{showDisplayDate:!0}))),sub_account_name:(s,e)=>t("td",{part:V(e)},s.sub_account_name),payments_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.payments_total)),refunds_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.refunds_total)),fees_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.fees_total)),other_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.other_total)),amount:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.amount)),status:(s,e)=>t("td",{part:V(e)},u(s.status)),csv:(e,a)=>t("td",{part:V(a)},t("a",{href:"#",onClick:t=>{t.preventDefault(),s(e.id)}},"CSV"))})),this.getPayouts&&this.getSubAccounts&&this.fetchData(),x("set",(()=>{this.pagingParams={}})),x("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new c};this.getPayouts=(({id:t,authToken:s,service:e})=>async({params:o,onSuccess:r,onError:h})=>{var c,n;try{const u=await e.fetchPayouts(t,s,o);if(u.error)return h({error:d(u.error),code:p(null===(n=u.error)||void 0===n?void 0:n.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({payouts:(null===(c=u.data)||void 0===c?void 0:c.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const s=p(null==t?void 0:t.code);return h({error:t.message||t,code:s,severity:i.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=f({primaryAccountId:this.accountId,authToken:this.authToken,service:new l}))}fetchData(){this.loading=!0,this.getPayouts({params:this.payoutParams,onSuccess:({payouts:t,pagingInfo:s})=>{this.payouts=t,this.paging=s,this.payoutsTable.collectionData=this.payouts,this.payoutsTable.columnKeys.includes("sub_account_name")?this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.payouts=this.payouts.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get payoutParams(){const t=z();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.payouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.payouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.payoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(y,{key:"653896fabc4becf531ec119d252cbaea301a0dc6"},t(g,{key:"63787473d67118a7f092bad666c47346872a7834"},t(v,{key:"c17ecce261475c8bfe357ff30d06f189c8f96480"},t(j,{key:"cc23edeff6a1e595671b77fa51c73ff313692b16"},t(C,{key:"4ed5b5ee149538d2de60ee6e27edde55e8d11eaa"},this.payoutsTable.columnData.map((t=>t)))),t(_,{key:"a0a886e70ba99ececd78e5bc34aec065466fe6ce"},t(k,{key:"38bf9109ca73ecfd5c85529a8f7232069ffcdb00",columnSpan:this.payoutsTable.columnKeys.length,isLoading:this.loading}),t(w,{key:"6f5341305ef71f86bbf3680e2c6d0dc461f3d09f",isEmpty:this.showEmptyState,columnSpan:this.payoutsTable.columnKeys.length}),t(S,{key:"bd5e8cc72b460238636546a568645c797807f2d9",columnSpan:this.payoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.payoutsTable.rowData.map(((s,e)=>t(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[e],onClick:this.rowClickHandler},s)))),this.paging&&t(P,{key:"15145b7ef9cc37a2ad70cea5698d53df069979bf"},t(O,{key:"2d4ed5a1ab5eaf0eaae0bbe35f02edf59c23b22e"},t(A,{key:"11c8505cfd97117afaf79ea68a3fb00570a9c7cb",colSpan:this.payoutsTable.columnData.length},t("pagination-menu",{key:"b8e7e29d4d932f43b3381235de57b63cc6a5283b",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayouts:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"]}}};export{G as justifi_payouts_list}
@@ -0,0 +1 @@
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import{P as i}from"./p-CO8ZGkfN.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{k as s,C as d,b as o}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as c,a as r}from"./p-CdwzNfP1.js";import{h,b as l,d as b}from"./p-BSs-2JKu.js";import{a as f,b as n,D as p,c as v,C as u,E as y}from"./p-Cu7hgXL1.js";import{J as m}from"./p-_GBnYSuR.js";import{m as k,M as j}from"./p-zZn1OXja.js";import{c as C}from"./p-CQqmTKij.js";import{B as g}from"./p-CHo7TfsM.js";import{S as w}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{S as x}from"./p-uZ5KAseb.js";import{a as T,B as D}from"./p-CHw7tICr.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-CPKMvyV_.js";import"./p-DNd24RUQ.js";const S=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(x,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(x,{width:"70%"})),e("div",{class:"col-12"},e(x,{width:"40%"})),e("div",{class:"col-12"},e(x,{width:"40%"})),e("div",{class:"col-12"},e(x,{width:"100%"})),e("div",{class:"col-12"},e(x,{width:"80%"}))),P=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event",7),this.recordClickEvent=a(this,"record-click-event",7),this.enableRecordClick=!1,this.loading=!0,this.errorMessage=null,this.downloadCSV=()=>{this.getPayoutCSV({payoutId:this.payout.id,onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a})}})},this.handleRecordClick=e=>{this.recordClickEvent.emit({id:e,type:"account"})}}componentWillLoad(){C(),this.analytics=new m(this),this.initializeServices(),this.getPayout&&this.fetchData()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeServices()}getPayoutWatcher(){this.fetchData()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:e,authToken:t,service:a})=>async({onSuccess:i,onError:o})=>{var h;try{const l=await a.fetchPayout(e,t);l.error?o({error:r(l.error),code:c(null===(h=l.error)||void 0===h?void 0:h.code),severity:d.ERROR}):i(new s(l.data))}catch(e){o({error:r(e),code:c(null==e?void 0:e.code),severity:d.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new i}),this.getPayoutCSV=k({authToken:this.authToken,service:new i})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:o.MISSING_PROPS,severity:d.ERROR}))}fetchData(){this.loading=!0,this.getPayout({onSuccess:e=>{this.errorMessage=null,this.payout=e,this.loading=!1},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a}),this.loading=!1}})}formatMethod(e){return"ach"===e?"ACH":h(e)}render(){var t,a,i,s;return e(w,{key:"da86ceeb41265056f9bc64c07b3bd7db4a91471c"},this.loading&&e(S,{key:"49ae2848db4a5b59770c2b84bfba745861573a6d"}),!this.loading&&this.errorMessage&&y(this.errorMessage),!this.loading&&this.payout&&e("justifi-details",{key:"b4e6740d49ae1099f28ea3d6f21fe0da48149c71",errorMessage:this.errorMessage},e(f,{key:"e9efbeeb7894996f318d90fb38826a6a9e4cc4b3",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},j(null===(t=this.payout)||void 0===t?void 0:t.status),e(T,"expedited"===this.payout.settlement_priority?{variant:D.WARNING,title:"Expedited",text:"Expedited"}:{variant:D.SECONDARY,title:"Standard",text:"Standard"})),title:this.payout.formattedPaymentAmount(this.payout.amount)},e(n,{key:"feb913d2b90e86fb4f5575379e9b9a47adfa723f",classes:"border-1 border-end",title:"Updated At",value:`${l(this.payout.updated_at)} ${b(this.payout.updated_at)}`}),e(n,{key:"9fe6da08323735948f145a72a02db26a6eb31f02",classes:"border-1 border-end",title:"Created At",value:`${l(this.payout.created_at)} ${b(this.payout.created_at)}`}),e(n,{key:"d01c4b7ea7c966b524026a6e97c0575466de3f74",title:"ID",value:this.payout.id}),e("div",{key:"4c4f73e5898caedbb1b7aba326dbfb0dcfbb59e6",class:"m-4"},e(g,{key:"622a6e8384da37f4bb3896bcafea46ef697b140e",variant:"outline-secondary",class:"btn btn-outline-secondary d-flex align-items-center",onClick:this.downloadCSV},"Export CSV"))),e("div",{key:"9b9271663673dc2e78e89bec5c7c9c47daa6761e",slot:"detail-sections"},e(p,{key:"ac5c6e1c09e63cd0616794b7df367a73889e37b2",sectionTitle:"Details"}),e("div",{key:"95f9d5a0097499fdb24f44ea87313c3b34a96068",class:"d-flex flex-column gap-2 w-100"},e(v,{key:"ecf60d4a4783c8fb52e10222dd4f6e9935cd0910",title:"Date paid",value:l(this.payout.deposits_at)}),e(v,{key:"289971a08641bc2dc725d603ef611291025cd6b4",title:"Statement Description",value:this.payout.description}),e(v,{key:"d237aacbeb9b23ac0d45aa978350aad4824b0695",title:"Payout Method",value:this.formatMethod(this.payout.delivery_method)}),e(v,{key:"744ef2b8878b742483750fb921ca9790f6aa9ec1",title:"Amount",value:this.payout.formattedPaymentAmount(this.payout.amount)}),e(v,{key:"dbf3327510523afc6edd78ea2926f99593da9748",title:"Fee",value:this.payout.formattedPaymentAmount(this.payout.fees_total)})),e(p,{key:"15983342dbe916770291f33226b744e8c4c1129e",sectionTitle:"Account"}),e("div",{key:"b3fb4353794dc490633a14abcc829ff0835d989f",class:"d-flex flex-column gap-2 w-100"},e(v,{key:"665fbe47e3b35c0b7ffb3e6c17e15c3703c90250",title:"ID",value:this.payout.account_id,onClick:this.enableRecordClick?()=>this.handleRecordClick(this.payout.account_id):void 0}),e(v,{key:"5b15d5bc8a63541ac8d77eddccb47c89659fd05a",title:"Account Type",value:null===(a=this.payout.bank_account)||void 0===a?void 0:a.account_type}),e(v,{key:"947043e3571f27a672060f2101296daba0073727",title:"Institution",value:null===(i=this.payout.bank_account)||void 0===i?void 0:i.account_type}),e(v,{key:"74ac687b37c7ca91a88863730560333c41b9413c",title:"Routing Number",value:null===(s=this.payout.bank_account)||void 0===s?void 0:s.routing_number}),e(v,{key:"43cd9aa5ac45f6efba97901e3e1386446065c28a",title:"Account Number",value:this.payout.bank_account?`**** ${this.payout.bank_account.account_number_last4}`:void 0})),this.payout.metadata&&[e(p,{key:"8bf04ae43a08d8ef624357f64df900a11b8f2dad",sectionTitle:"Metadata"}),e("div",{key:"1bf737734f34f626cbfb9dd878afbb91b6f01913",class:"d-table gap-2 w-100"},e(u,{key:"0d1481e1823e9b2f28328ebfb3cd1c92c6342cc6",metadata:this.payout.metadata}))])))}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"],getPayout:["getPayoutWatcher"]}}};export{P as justifi_payout_details}
@@ -1 +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}
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 l,v as c}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=l),this.isFocused&&(t=c),t}render(){var t;return s(a,{key:"bf6556107b1f272aa6bc4f89cb0f2a889f8b9d1d"},s("div",{key:"be1644d78987676c9af452831e25c3effc31a67c",class:"form-group d-flex flex-column"},s("div",{key:"62eaea4bdbee959d6e785c00c4f41f642c0a16af",class:"d-flex align-items-start gap-2"},s("label",{key:"641ada798c78ca0c649ec76029c157069636838b",part:h,class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"3a04fe21799a54e402e8afead34b60898c804af4",helpText:this.helpText})),s("select",{key:"54188864be36aed540647275cd84eae738eb633f",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:"387753bf79494f44a91858175af74d48a9e9c051",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?l:this.isFocused?c:o}render(){return s(a,{key:"5732a2a92dd945b8520e277bf10e22ea296b0949"},s("div",{key:"9f58456015584c0cd945686e8bc7d629f46a39a2",class:"form-group d-flex flex-column"},s("div",{key:"1dccca5e3f97a41e895e7572f24f0e21d2b912c1",class:"d-flex align-items-start gap-2"},s("label",{key:"54d52a444a22f460579911ecf869633b041bcab9",part:h,class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"65f9c29cb659be24d88697c72dac422c70431209",helpText:this.helpText})),s("input",{key:"ba4b46b0e3e66112ed90e64425de6fd9c97559d2",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:"f7bf2c8f5f1c30cfdc4e6c2927434a50f7f58add",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{n as form_control_select,d as form_control_text}
@@ -1 +1 @@
1
- import{r as e,c as t,h as a}from"./p-CV0Pyo1O.js";import{S as s}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";const o=class{constructor(a){e(this,a),this.checkboxChanged=t(this,"checkboxChanged",7),this.label="Save New Payment Method"}render(){return a(s,{key:"b3a21f76759593ab02d71ed9a708982bdad5f0c3"},a("save-new-payment-method",{key:"ce0aa2bb711293144c835e9779b39a122017b544",label:this.label,hidden:this.hidden,onCheckboxChanged:e=>this.checkboxChanged.emit(e.detail)}))}};export{o as justifi_save_new_payment_method}
1
+ import{r as e,c as t,h as a}from"./p-CV0Pyo1O.js";import{S as s}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";const o=class{constructor(a){e(this,a),this.checkboxChanged=t(this,"checkboxChanged",7),this.label="Save New Payment Method"}render(){return a(s,{key:"58ca6f98ace8aba5658fa38215b0c0756907ce9f"},a("save-new-payment-method",{key:"6bfd3950c0bdf26bca6866ebf1b155ac39466516",label:this.label,hidden:this.hidden,onCheckboxChanged:e=>this.checkboxChanged.emit(e.detail)}))}};export{o as justifi_save_new_payment_method}
@@ -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,b as r,B as n,x as o,y as l,z as h}from"./p-DXTa04jn.js";import{m as c,a as d,c as u,d as m,e as b,f as p,g as f}from"./p-Da3fPDxu.js";import{B as v,a as y,D as g,I as k}from"./p-R_0S69Pr.js";import{a as w,d as _,b as T,g as C,h as x}from"./p-C1gr32IS.js";import{F as L,c as O,a as S,b as j}from"./p-D9sqTVmd.js";import{A,C as D,e as E,R as I,f as V,O as P}from"./p-BcNb9bVO.js";import{C as H,P as N,I as B}from"./p-CVaOFfrI.js";import{b as M,a0 as R,C as F,x as W,u as z,D as q,aa as U,a6 as Z,aj as G,am as Y,A as $,a1 as K}from"./p-CPKMvyV_.js";import{P as X}from"./p-DSclFZ32.js";import{a as J,c as Q,d as tt,b as et}from"./p-BBSnDYJw.js";import{a as st,B as it}from"./p-XYgDHrVL.js";import{n as at}from"./p-BnjCmwMr.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{B as rt,C as nt,v as ot,D as lt,E as ht,F as ct,G as dt}from"./p-z3RFjy9B.js";import{B as ut}from"./p-CHo7TfsM.js";import"./p-CZfYo5-1.js";import{c as mt}from"./p-DPA5TKvQ.js";import{s as bt,b as pt,d as ft}from"./p-BSs-2JKu.js";import{S as vt}from"./p-uZ5KAseb.js";import{u as yt,a as gt,b as kt}from"./p-C6o0liMT.js";import{A as wt}from"./p-De4Pig-y.js";import{S as _t}from"./p-DzEdYT8R.js";import{P as Tt}from"./p-DP9ysr2K.js";import"./p-CdwzNfP1.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 xt=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 A(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:st.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 A(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 A(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new L(w(this.allowOptionalFields))}componentDidLoad(){this.getBusiness&&this.getData(),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):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(X,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Additional Questions"),s("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-monetary-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:H.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:H.WHOLE})),s("div",{class:"col-12"},s("form-control-number",{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:J,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"]}}},Lt=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:Q,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:at,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:at,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))}},Ot=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:Q,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:at,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:at,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:at,helpText:"Please copy the account number as shown on your statement. Do not include spaces or dashes."})))}},St=t=>t?{bank_name:ht.nullable(),nickname:lt.nullable(),account_owner_name:ot.nullable(),account_type:nt.nullable(),account_number:rt.nullable()}:{bank_name:ht.required("Enter bank name"),nickname:lt.required("Enter nickname"),account_owner_name:ot.required("Enter account owner name"),account_type:nt.required("Select account type"),account_number:rt.required("Enter account number")},jt={[D.USA]:t=>(t=>{const e=Object.assign(Object.assign({},St(t)),(t=>t?{routing_number:dt.nullable()}:{routing_number:dt.required("Enter routing number")})(t));return O().shape(e)})(t),[D.CAN]:t=>(t=>{const e=Object.assign(Object.assign({},St(t)),(t=>{const e=S().length(3,"Institution number must be 3 digits").matches(ct,"Enter valid institution number"),s=S().length(5,"Transit number must be 5 digits").matches(ct,"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")}})(t));return O().shape(e)})(t)},At=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.isLoading=!1,this.viewMode="manual",this.bankAccountVerification=!1,this.platformAccountId=null,this.getSchema=()=>(0,jt[this.country])(this.allowOptionalFields),this.initializeFormController=()=>{this.formController=new L(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.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.initializeFormController()},this.handleCancel=()=>{this.viewMode=this.existingBankAccount?"readonly":"plaid",this.initializeFormController()},this.handleToggleToManualEntry=()=>{this.viewMode="manual"},this.handleToggleToPlaidVerification=()=>{this.viewMode="plaid"},this.handleSaveBankAccount=async()=>{this.formController.validateAndSubmit((()=>{this.sendData((()=>{}))}))}}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 L(this.getSchema())}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.postBankAccount=u({authToken:this.authToken,service:new y})):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,settings:s,platform_account_id:i}=t;e.length>0?this.bankAccount=new Ct(e[e.length-1]):(this.bankAccount=new Ct({}),this.bankAccount.business_id=this.businessId),this.bankAccountVerification=!0===s.bank_account_verification,this.platformAccountId=i}determineViewMode(){this.viewMode=this.existingBankAccount?"readonly":this.plaidAvailable?"plaid":"manual"}async sendData(t){try{if("manual"===this.viewMode){if(!await this.postBankAccountData())return;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:st.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()}})}))}renderBankAccountInputs(t){const e=this.formController.getInitialValues();return s(this.country===D.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(ut,{variant:"secondary",type:"button",onClick:this.handleChangeBankAccount,disabled:this.isLoading,part:R},"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(ut,{type:"button",variant:"link",className:"p-0",onClick:this.handleToggleToManualEntry,disabled:this.isLoading,part:F},"Enter bank details manually (document upload required)")))}renderManualEntryView(){return s("div",null,this.plaidAvailable&&s("div",{class:"mb-3"},s(ut,{type:"button",variant:"secondary",onClick:this.handleToggleToPlaidVerification,disabled:this.isLoading,part:R},"Link bank account with Plaid instead")),this.renderBankAccountInputs(!1),s("div",{class:"mt-3 d-flex gap-2"},this.showCancel&&s(ut,{variant:"secondary",type:"button",onClick:this.handleCancel,disabled:this.isLoading,part:R},"Cancel"),s(ut,{variant:"primary",type:"button",onClick:this.handleSaveBankAccount,disabled:this.isLoading,isLoading:this.isLoading},"Save Bank Account")))}render(){return this.isLoading?s(X,null):s("form",null,s("fieldset",{class:"mb-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Bank Account Info"),s("form-control-tooltip",{helpText:"This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),s("hr",{class:"mt-2"}),"readonly"===this.viewMode&&this.renderReadonlyView(),"plaid"===this.viewMode&&this.renderPlaidView(),"manual"===this.viewMode&&this.renderManualEntryView()))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],isLoading:["watchHandler"]}}},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.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 E(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:st.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 E(this.formController.values.getValue()).payload}componentWillLoad(){this.initializeApi();const t=this.country===D.CAN?_(this.allowOptionalFields):T(this.allowOptionalFields);this.formController=new L(t),this.getData()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):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(X,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Business Information")),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 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:tt,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:mt[this.country].taxIdLabelOptional||mt[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:"000000000",helpText:mt[this.country].taxIdHelpText}):s("div",null,s("label",{class:"form-label",part:W},mt[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:R,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:N.US})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},Et=class{constructor(e){t(this,e),this.documents=[],this.isLoading=!1}render(){return this.isLoading?s(vt,{height:"50px"}):this.documents.length?s(i,null,s("div",{class:"card",part:q},s("div",{class:"card-body"},s("h5",{class:"card-title",part:M},"Documents Already on File"),s("div",{class:"table-responsive"},s("table",{class:"table table-sm table-borderless",part:U},s("thead",null,s("tr",null,s("th",{style:{width:"25%"},part:Z,scope:"col"},"File Name"),s("th",{style:{width:"25%"},part:Z,scope:"col"},"File Type"),s("th",{style:{width:"25%"},part:Z,scope:"col"},"Document Type"),s("th",{style:{width:"25%"},part:Z,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:G},t.file_name),s("td",{part:G},t.file_type),s("td",{part:G},bt(t.document_type)),s("td",{part:G},`${pt(t.created_at)} - ${ft(t.created_at)}`))))))))),s("hr",null)):null}},It=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 I(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:st.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=t=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],t&&this.clickEvent.emit({name:it.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;if(!this.allowOptionalFields&&100!==(await Promise.all(this.refs.map((t=>t.getOwnershipPercentage())))).reduce(((t,e)=>t+(parseFloat(e)||0)),0))return void await Promise.all(this.refs.map((t=>t.setOwnershipPercentageError("Ownership percentages must total 100%"))));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=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):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(X,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:M},"Owners"),s("form-control-tooltip",{helpText:"For partnerships, LLCs or privately held corporations, the business is required to apply with all individuals with 25% or more ownership to the application. For charities and registered non-profits, the business is required to apply with 1 individual with substantial control over the entity, such as a board member or director."})),s("hr",{class:"mt-2"}),e&&s("div",{class:"alert alert-warning mb-3",part:Y},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(ut,{variant:"primary",onClick:()=>this.handleRepresentativeIsOwnerChange(!0)},"Yes"),s(ut,{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(ut,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner")))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],ownersPayload:["ownersWatcher"]}}},Vt=class{constructor(e){t(this,e),this.isEditingIdentification=!1,this.inputHandler=(t,e)=>{yt(this.formController,{[t]:e})},this.onAddressFormUpdate=t=>{gt(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),t))}}render(){var t,e,i,a,r,n,o,l,h;return s("form",{key:"2346f250e4e2982b5b5b2624d039f551b5b5ed4e"},s("fieldset",{key:"7b496e6157e5eec02ef0d263c68fbd1e001c75ac"},s("div",{key:"b86d993c7fbee2269e48c7d4ea51826f199fecd4",class:"d-flex align-items-center gap-2"},s("legend",{key:"2b013e6068bbbca54a0852093ab4a2fae4ce64d2",class:"mb-0",part:M},"Representative"),s("form-control-tooltip",{key:"01e0f1d6ba2d5ee852593f7015a3ba7e0d980df9",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:"4bec34756ec7081e01809175bc3d2b6af0532537",class:"mt-2"}),s("div",{key:"6965720fabb1f12c6bb3c5a81f74ae12f44037b2",class:"row gy-3"},s("div",{key:"efbb768ba1e66d5ef47f792c39a17921b40e0eba",class:"col-12 col-md-8"},s("form-control-text",{key:"28477d3798ba7d14aee9201e84b276d8e85a21df",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:"28f17ccbe4da476256acd9c5a4e78a6a641ba6e9",class:"col-12 col-md-4"},s("form-control-select",{key:"dae6a93a0bc057abb97024277be0f10de01514e2",name:"title",label:"Title",options:et,defaultValue:null===(e=this.representativeDefaultValue)||void 0===e?void 0:e.title,errorText:this.errors.title,inputHandler:this.inputHandler})),s("div",{key:"2f9a45774adaa0040df2da1a8000d1ee61e16bf5",class:"col-12 col-md-6"},s("form-control-text",{key:"66a2a1ea8b54c03c012d76a74654ee19a9f958a7",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:"3b34f0cb11d358db2220c01aac90e8b7ba3cc01b",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"52c62ec653fb917a248a302f7cb5ad46dc7bcc23",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:N.US})),s("div",{key:"d287ec225af1541cca227d3b8bc54466cbb86b07",class:"col-12 col-md-4"},s("form-control-date",{key:"7e1ff6cc40b01dc7f6ad0ad84d73c0e59eea0d6f",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=>kt(t,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"283b09c845f1a12f4974f82a26fffbf7c5f608ba",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:this.country===D.CAN?mt[this.country].idNumberLabelOptional:mt[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:B[this.country],helpText:mt[this.country].identityHelpText}):s("div",null,s("label",{class:"form-label",part:W},this.country===D.CAN?mt[this.country].idNumberLabelOptional:mt[this.country].idNumberLabel),s("div",{class:"input-group mb-3"},s("input",{type:"text",class:"form-control",part:z,value:`****${null===(l=this.representativeDefaultValue)||void 0===l?void 0:l.ssn_last4}`,disabled:!0}),s("button",{class:"btn btn-secondary",type:"button",part:R,onClick:()=>{this.isEditingIdentification=!0,yt(this.formController,{identification_number:"",ssn_last4:null})}},"Change")))),s("div",{key:"0a40679570df7b85faa7530797ebc21ca8794263",class:"col-12"},s("identity-address-form",{key:"5a1590251365260413ab63ce9a417d3d71c71e84",errors:this.errors.address,defaultValues:null===(h=this.representativeDefaultValue)||void 0===h?void 0:h.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},Pt=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 I(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:st.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=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}initializeForm(){const t=C[this.country];t?(this.formController=new L(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 I(this.formController.values.getValue()).payload}}render(){return!this.formController||this.isLoading?s(X,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"]}}},Ht=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=wt(),this.formController=new L((t=>{const e=O({accepted:j().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),s=O({accepted:j().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:st.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:t}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:st.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:M},"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})))))}},Nt=[{label:"Select a document type",value:""},{label:"Articles of Incorporation",value:"articles_of_incorporation"},{label:"Business Registration",value:"business_registration"}],Bt=[{label:"Select a document type",value:""},{label:"Voided Check",value:"voided_check"},{label:"Bank Statement",value:"bank_statement"}],Mt=[{label:"Select a document type",value:""},{label:"Voided Check",value:"voided_check"},{label:"Bank Letter",value:"bank_statement"}],Rt=[{label:"Select a document type",value:""},{label:"Canadian Passport",value:"passport"},{label:"Canadian Driver's License",value:"driver_license"},{label:"Canadian Government Issued ID Card",value:"government_id"},{label:"Permanent Resident Card",value:"resident_card"},{label:"Certificate of Indian Status",value:"status_card"},{label:"US State Issued Driver's License",value:"driver_license"}],Ft=[{label:"Select a document type",value:""},{label:"Nexus Card (Photo ID)",value:"nexus_card"},{label:"Canadian Citizenship/Naturalization Card or Certificate",value:"citizenship_card"},{label:"Foreign Passport",value:"foreign_passport"},{label:"Canadian Birth Certificate",value:"birth_certificate"},{label:"Social Insurance Number (SIN) Card",value:"sin_card"},{label:"Social Security Number (SSN) Card",value:"ssn_card"}];function Wt(t){return[{label:"Business Document",value:"business_document",docTypeOptions:Nt},{label:"Financial Document",value:"financial_document",docTypeOptions:t===D.CAN?Mt:Bt}]}const zt=[{label:"Financial Document",value:"financial_document",docTypeOptions:Bt}],qt=new Set(Rt.filter((t=>t.value)).map((t=>t.value))),Ut=new Set(Ft.filter((t=>t.value)).map((t=>t.value))),Zt=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.owners=[],this.existingDocuments=[],this.selectedCategory="",this.selectedDocType="",this.uploadQueue=[],this.isLoading=!1,this.errors={},this.fileInputKey=0,this.categories=[],this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:t=>{const{owners:e,documents:s}=t.data;var i;this.owners=e||[],this.existingDocuments=s||[],this.categories=(i=this.country)===D.USA?zt:[...Wt(i),{label:"Identity Document - Group 1",value:"personal_group1",docTypeOptions:Rt},{label:"Identity Document - Group 2",value:"personal_group2",docTypeOptions:Ft}]},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.isLoading=!1}})},this.handleCategoryChange=(t,e)=>{this.selectedCategory=e,this.selectedDocType=""},this.handleDocTypeChange=(t,e)=>{e.startsWith("_")&&e.endsWith("_header")||(this.selectedDocType=e)},this.handleFileSelected=async t=>{const e=Array.from(t.detail.fileList),s=this.categories.find((t=>t.value===this.selectedCategory));if(!s)return;const i=s.docTypeOptions.find((t=>t.value===this.selectedDocType)),a=(null==i?void 0:i.label)||this.selectedDocType,r=e.map((t=>({categoryLabel:s.label,categoryValue:s.value,docTypeLabel:a,docTypeValue:this.selectedDocType,fileName:t.name,file:t,status:"uploading"}))),o=this.uploadQueue.length;this.uploadQueue=[...this.uploadQueue,...r],this.selectedCategory="",this.selectedDocType="",this.fileInputKey++,await Promise.all(r.map((async(t,e)=>{const s=o+e;try{const e=new n({file:t.file,document_type:t.docTypeValue},this.businessId);if(!await this.postDocumentRecordData(e))return void(this.uploadQueue=this.uploadQueue.map(((t,e)=>e===s?Object.assign(Object.assign({},t),{status:"error"}):t)));const i=await this.uploadDocument(e);this.uploadQueue=this.uploadQueue.map(((t,e)=>e===s?Object.assign(Object.assign({},t),{status:i?"uploaded":"error"}):t))}catch(t){this.uploadQueue=this.uploadQueue.map(((t,e)=>e===s?Object.assign(Object.assign({},t),{status:"error"}):t))}})))},this.postDocumentRecordData=async t=>{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();return!!(await fetch(t.presigned_url,{method:"PUT",body:e})).ok||(this.errorEvent.emit({errorCode:r.POST_ERROR,message:"Failed to upload document",severity:a.ERROR}),!1)}}propChanged(){this.initializeApi()}watchHandler(t){this.formLoading.emit(t)}async validateAndSubmit({onSuccess:t}){const e=this.validate();Object.keys(e).length>0?this.errors=e:(this.errors={},this.stepCompleteEvent.emit({response:null,formStep:st.documentUpload}),t())}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.postDocumentRecord=m({authToken:this.authToken,service:new g})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}get categoryOptions(){return[{label:"Select a category",value:""},...this.categories.map((t=>({label:t.label,value:t.value})))]}get docTypeOptions(){if(!this.selectedCategory)return[{label:"Select a category first",value:""}];const t=this.categories.find((t=>t.value===this.selectedCategory));return(null==t?void 0:t.docTypeOptions)||[{label:"Select a category first",value:""}]}validate(){if(this.allowOptionalFields)return{};const t={},e=t=>this.existingDocuments.some((e=>t.includes(e.document_type))),s=t=>this.uploadQueue.some((e=>e.categoryValue===t&&"uploaded"===e.status));if(s("financial_document")||e(["voided_check","bank_statement"])||(t.financial_document="Please upload a financial document"),this.country===D.CAN){const i=["articles_of_incorporation","business_registration"];s("business_document")||e(i)||(t.business_document="Please upload a business document");const a=this.owners.length,r=this.uploadQueue.filter((t=>"personal_group1"===t.categoryValue&&"uploaded"===t.status)).length,n=this.existingDocuments.filter((t=>qt.has(t.document_type))).length;r+n<a&&(t.personal_group1=`Please upload ${a} Group 1 identity document(s) (${r+n} of ${a} provided)`);const o=this.uploadQueue.filter((t=>"personal_group2"===t.categoryValue&&"uploaded"===t.status)).length,l=this.existingDocuments.filter((t=>Ut.has(t.document_type))).length;o+l<a&&(t.personal_group2=`Please upload ${a} Group 2 identity document(s) (${o+l} of ${a} provided)`)}return t}render(){return this.isLoading?s(X,null):s("form",null,s("fieldset",null,s("legend",{class:"mb-0",part:M},"Document Uploads"),s("hr",{class:"mt-2"}),s("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading})),this.country===D.CAN&&this.owners.length>0&&s("div",{class:"alert alert-info mt-3"},"One document from each group (Group 1 and Group 2) is required for each owner (",this.owners.length," owner(s))."),s("fieldset",{class:"mt-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Add Document"),s("form-control-tooltip",{helpText:"Upload documents one at a time. Select the category and type, then choose a file. For Canadian businesses, one Group 1 and one Group 2 identity document is required for each owner."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-select",{name:"document_category",label:"Document Category",options:this.categoryOptions,defaultValue:this.selectedCategory,inputHandler:this.handleCategoryChange})),s("div",{class:"col-12 col-md-6"},s("form-control-select",{name:"document_type",label:"Document Type",options:this.docTypeOptions,defaultValue:this.selectedDocType,inputHandler:this.handleDocTypeChange,disabled:!this.selectedCategory})),s("div",{class:"col-12"},s("form-control-file",{key:this.fileInputKey,name:"document_file",label:"Upload Document",documentType:this.selectedDocType,onFileSelected:this.handleFileSelected,disabled:!this.selectedDocType,multiple:!1})))),s("document-upload-list",{documents:this.uploadQueue}),Object.keys(this.errors).length>0&&s("div",{class:"alert alert-danger mt-3"},s("ul",{class:"mb-0"},Object.values(this.errors).map((t=>s("li",null,t))))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],isLoading:["watchHandler"]}}},Gt=class{constructor(e){t(this,e),this.documents=[]}renderStatus(t){switch(t){case"uploading":return s("span",{class:"badge bg-info"},"Uploading...");case"uploaded":return s("span",{class:"badge bg-success"},"Uploaded");case"error":return s("span",{class:"badge bg-danger"},"Error")}}render(){return this.documents.length?s("div",{class:"mt-4"},s("div",{class:"card",part:q},s("div",{class:"card-body"},s("h5",{class:"card-title",part:M},"Uploaded Documents"),s("div",{class:"table-responsive"},s("table",{class:"table table-sm table-borderless",part:U},s("thead",null,s("tr",null,s("th",{style:{width:"25%"},part:Z,scope:"col"},"Category"),s("th",{style:{width:"25%"},part:Z,scope:"col"},"Document Type"),s("th",{style:{width:"30%"},part:Z,scope:"col"},"File Name"),s("th",{style:{width:"20%"},part:Z,scope:"col"},"Status"))),s("tbody",null,this.documents.map(((t,e)=>s("tr",{class:0===e?"border-bottom border-top":"border-bottom"},s("td",{part:G},t.categoryLabel),s("td",{part:G},t.docTypeLabel),s("td",{part:G},t.fileName),s("td",{part:G},this.renderStatus(t.status))))))))))):null}},Yt=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 V((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:st.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 V(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new L((0,x[this.country])(this.allowOptionalFields)),this.getData()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):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(X,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Legal Address of your Business"),s("form-control-tooltip",{helpText:"No PO Boxes."})),s("hr",{class:"mt-2"}),s("form-address-fields",{country:this.country,errors:this.errors,defaultValues:e,inputHandler:this.inputHandler})))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},$t=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 P(t)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?it.updateOwner:it.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:it.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 getOwnershipPercentage(){var t;return(null===(t=this.formController.values.getValue())||void 0===t?void 0:t.ownership_percentage)||null}async setOwnershipPercentageError(t){this.formController.setFieldError("ownership_percentage",t)}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 P(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 L((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=b({authToken:this.authToken,identityId:this.ownerId,service:new k}),this.patchOwner=p({authToken:this.authToken,identityId:this.ownerId,service:new k}),this.postOwner=f({authToken:this.authToken,service:new k}))}render(){return s(i,{key:"b168e9f5a52416984e6a04ab5f0771b63ee28b2e",style:{display:"block"}},s("form",{key:"d22a6aae3f5debd30d87b3bd37c67390a46c4590",onSubmit:this.validateAndSubmit},s("fieldset",{key:"30597bc1f4983bddbdc0ed45e6be7e715d0b9b8e"},s("legend",{key:"055ca2b6bbfa4e86591411668eaead3bd0d95ea8",class:"fw-semibold fs-5 w-100",part:$},this.formTitle),s("br",{key:"f0d2d9624611ee888ff318ec1525281bf007e346"}),s("div",{key:"2c38a166f681404c2ab303630217e54c15f1e5f2",class:"row gy-3"},s("owner-form-inputs",{key:"05253624d3d79f0ba7a4ec49b387e252e796e5b6",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController,country:this.country}),s("div",{key:"8e0e67966f047c3f9a4b30f28983f67db2372c0c",class:"d-flex gap-2 justify-content-start"},s(ut,{key:"e33368a968efe5faf52a08e36bb2bef215625c4a",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(ut,{key:"7bb79b0624dfb3a8645182432c484f288cc73692",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"ef4f86dd1b1878e92c98e4a826f9fbad808e15b7"}))))}static get watchers(){return{isLoading:["loadingWatcher"]}}},Kt=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 Tt,this.abortController=null,this.timeoutId=null,this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:h.PLAID_SDK_LOAD_FAILED,message:l[h.PLAID_SDK_LOAD_FAILED],severity:o[h.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:h.PLAID_LINK_TOKEN_FAILED,message:l[h.PLAID_LINK_TOKEN_FAILED],severity:o[h.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:h.PLAID_LINK_INIT_FAILED,message:l[h.PLAID_LINK_INIT_FAILED],severity:o[h.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:h.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=h.PLAID_LINK_TOKEN_FAILED,n=l[r],c=!0;"AbortError"===a.name?(r=h.PLAID_TIMEOUT,n=l[r],c=!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=h.PLAID_NETWORK_ERROR,n=l[r],c=!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=h.PLAID_INVALID_CREDENTIALS,n="Authentication failed. Please check your credentials.",c=!1),this.handleError({code:r,message:n,severity:o[r],originalError:a,retryable:c,userAction:c?"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:h.PLAID_AUTHENTICATION_FAILED,message:(null==t?void 0:t.message)||"Failed to verify bank account",severity:o[h.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=h.PLAID_AUTHENTICATION_FAILED,s=l[e],i=!0,a="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=h.PLAID_INVALID_CREDENTIALS,s=l[e],i=!0;break;case"ITEM_LOGIN_REQUIRED":e=h.PLAID_INVALID_CREDENTIALS,s="Your bank requires re-authentication. Please try again.",i=!0;break;case"ITEM_LOCKED":e=h.PLAID_ACCOUNT_LOCKED,s=l[e],i=!1,a="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=h.PLAID_MAINTENANCE,s=l[e],i=!0;break;case"RATE_LIMIT_EXCEEDED":e=h.PLAID_RATE_LIMITED,s=l[e],i=!0;break;default:t.error_message&&(s=t.error_message)}this.handleError({code:e,message:s,severity:o[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:h.PLAID_SDK_LOAD_FAILED,message:l[h.PLAID_SDK_LOAD_FAILED],severity:o[h.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(_t,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(ut,{variant:"primary",type:"button",onClick:t=>{t.preventDefault(),this.openPlaidLink()},disabled:this.isLoading,part:K},"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{xt as additional_questions_form_step,Lt as bank_account_form_inputs,Ot as bank_account_form_inputs_canada,At as business_bank_account_form_step,Dt as business_core_info_form_step,Et as business_documents_on_file,It as business_owners_form_step,Vt as business_representative_form_inputs,Pt as business_representative_form_step,Ht as business_terms_conditions_form_step,Zt as document_upload_form_step,Gt as document_upload_list,Yt as legal_address_form_step,$t as owner_form,Kt as plaid_verification}
@@ -0,0 +1 @@
1
+ import{h as i,r as e}from"./p-CV0Pyo1O.js";import{S as a}from"./p-uZ5KAseb.js";import{w as t,c as d}from"./p-DVJaoI_m.js";import{e as c}from"./p-BSs-2JKu.js";import{c as s}from"./p-CQqmTKij.js";import"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-DNd24RUQ.js";const n=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(a,{height:"18px",width:"100px"}),i(a,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"80px"}),i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"30px"}),i(a,{height:"36px"}))))},r=class{constructor(i){e(this,i),this.isReady=!1}async componentWillLoad(){await t(),this.iframeOrigin=d.iframeOrigin,this.tabId=c(),s()}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((i=>new Promise((e=>{i.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const i=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),t=await this.cvvIframeElement.validate();return i&&e&&a&&t}async tokenize({clientId:i,paymentMethodMetadata:e,account:a}){return await this.cardNumberIframeElement.tokenize(i,e,a)}render(){return i("div",{key:"d3cb1fca6595f60e5f5f122b73d3d6c11a826423"},i(n,{key:"f83dcbbc214d460bb21c015ec051436ed5cf6670",isReady:this.isReady}),i("hidden-input",{key:"5fad0d06303d0ddb55c30c2cd94014255f2a8cec"}),i("div",{key:"68440756a1aad69b5c95245e7a2a5feb16899dca",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"b39eab56c79463935f1a1bb15cc867997f026e7b",class:"mb-3"},i("iframe-input",{key:"25a2390a8c3c92d5e6eceafe6b821202ecb22d76",inputId:"cardNumber",ref:i=>this.cardNumberIframeElement=i,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"68766798d954a0b3d093ae13c3c2955f819da4f2",class:"row"},i("div",{key:"05539f1ac8ebb0397574d55b4b76d7acdb7d2dca",class:"col-4 align-content-end"},i("iframe-input",{key:"4c437a4384e6c301e18824d799784c1133e70ee3",inputId:"expirationMonth",ref:i=>this.expirationMonthIframeElement=i,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"b9a5b8b5dda1d8ab6305c9dc1ef9b655eb02fb3d",class:"col-4 align-content-end"},i("iframe-input",{key:"c1a412c20e75d21c1084a4b93f22362c367c1907",inputId:"expirationYear",ref:i=>this.expirationYearIframeElement=i,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"abdfdbd7eb784871011397a7c5fdf371e3c6baf0",class:"col-4 align-content-end"},i("iframe-input",{key:"08dff072e785846d7543018c194b4df6ce5b343e",inputId:"CVV",ref:i=>this.cvvIframeElement=i,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{r as card_form}
@@ -0,0 +1 @@
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{j as s,C as i,b as r}from"./p-DXTa04jn.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{J as o}from"./p-_GBnYSuR.js";import{c}from"./p-CQqmTKij.js";import{g as p,a as h}from"./p-CdwzNfP1.js";import{P as d}from"./p-NzPaWKbY.js";import{T as f,a as l,b as u,c as m,d as y,e as b,f as _,g,h as j,i as T,j as w,k,l as v}from"./p-BICxxa69.js";import{S as C}from"./p-DzEdYT8R.js";import{T as D}from"./p-CZfYo5-1.js";import{a as P}from"./p-BSs-2JKu.js";import{a6 as R,a7 as S}from"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-DNd24RUQ.js";import"./p-De4Pig-y.js";import"./p-CqiVXthx.js";const F={created_at:()=>e("th",{part:R,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>e("th",{part:R,scope:"col",title:"The type of each transaction"},"Type"),id:()=>e("th",{part:R,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>e("th",{part:R,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>e("th",{part:R,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>e("th",{part:R,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>e("th",{part:R,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>e("th",{part:R,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>e("th",{part:R,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>e("th",{part:R,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>e("th",{part:R,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},x={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",platform_fee:"Platform Fee",platform_fee_return:"Platform Fee Return",processing_fee:"Processing Fee",processing_fee_return:"Processing Fee Return",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},I={created_at:(t,a)=>e("td",{part:S(a)},e("div",{class:"fw-bold"},P(t.created_at,{showDisplayDate:!0})),e("div",{class:"fw-bold"},P(t.created_at,{showTime:!0}))),type:(t,a)=>e("td",{part:S(a)},x[t.payment_balance_txn_type]),id:(t,a)=>e("td",{part:S(a)},t.id),amount:(t,a)=>e("td",{part:S(a),class:"text-end"},t.formattedPaymentAmount(t.amount)),balance:(t,a)=>e("td",{part:S(a),class:"text-end"},t.formattedPaymentAmount(t.balance)),currency:(t,a)=>e("td",{part:S(a)},t.currency),financial_transaction_id:(t,a)=>e("td",{part:S(a)},t.financial_transaction_id),payment_id:(t,a)=>e("td",{part:S(a)},t.payment_id),payment_balance_txn_type:(t,a)=>e("td",{part:S(a)},t.payment_balance_txn_type),source_id:(t,a)=>e("td",{part:S(a)},t.source_id),source_type:(t,a)=>e("td",{part:S(a)},t.source_type)},q=class{constructor(e){t(this,e),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=e=>{this.pagingParams={before_cursor:e},this.clickEvent.emit({name:D.previous})},this.handleClickNext=e=>{this.pagingParams={after_cursor:e},this.clickEvent.emit({name:D.next})},this.rowClickHandler=e=>{const t=e.target.closest("tr").dataset.rowEntityId;if(!t)return;const a=this.balanceTransactions.find((e=>e.id===t));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,F,I),c(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeApi()}handleError(e,t,a){this.isLoading=!1,this.errorEvent.emit({errorCode:e,message:t,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:e,authToken:t,service:a})=>async({params:r,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(e,t,r);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:i.ERROR}):n({balanceTransactions:c.data.map((e=>new s(e))),pagingInfo:Object.assign({},c.page_info)})}catch(e){const t=p(null==e?void 0:e.code);o({error:h(e),code:t,severity:i.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:e,pagingInfo:t})=>{this.balanceTransactions=e,this.paging=t,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e.message,this.handleError(e,t,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(r.MISSING_PROPS,this.errorMessage,i.ERROR))}get entityId(){return this.balanceTransactions.map((e=>e.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return e(C,{key:"24e7a4313ab91f179fd27b6596f012487de06815"},e(l,{key:"1f9a7a56a940e41dd865bc6f3a8681ce86d60d58"},e(u,{key:"a26ce09ae4df84698be1ea37cb735e38c0a0402e"},e(m,{key:"07f8655efd483e1d9240e65b17dc13583028f376"},e(y,{key:"0b62a7700715dbaffbedc0538432d075a3158499"},this.transactionsTable.columnData.map((e=>e)))),e(b,{key:"adf75fa50ddfb5257875b2779fc6c157812d4c19"},e(_,{key:"bc77de512b3e5fd1e6c4b8cf908b46027a3bc33f",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),e(g,{key:"413d46e184399cba3993f37efd64cb0d0a10d905",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),e(j,{key:"9deaa794dc848ed7c85cbadc3b4cfe7c9fb1176f",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((t,a)=>e(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},t)))),this.paging&&e(w,{key:"16ca0811bf42dc9419f8b77086e8e7e2cf6d0085"},e(k,{key:"e11be42549832c35078acf47b7c165fe1e50ea98"},e(v,{key:"205d649068b84200b88adc1be9cfe192abfe13be",colSpan:this.transactionsTable.columnData.length},e("pagination-menu",{key:"2a28645220d4f18b7037e461bd93eefc3aed49a0",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{q as justifi_payment_transactions_list}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as a}from"./p-CV0Pyo1O.js";import{B as s,C as c,D as f}from"./p-CPKMvyV_.js";const d=class{constructor(a){e(this,a),this.selectedQuantityChange=t(this,"selectedQuantityChange",7),this.limit=1/0,this.selectedQuantity=0,this.removeUnit=()=>{this.selectedQuantity>0&&(this.selectedQuantity--,this.selectedQuantityChange.emit({modelName:this.modelName,quantity:this.selectedQuantity}))},this.addUnit=()=>{this.limit>0&&(this.selectedQuantity++,this.selectedQuantityChange.emit({modelName:this.modelName,quantity:this.selectedQuantity}))}}render(){return a("div",{key:"1704fa75958fcfd09f49a3c0fe8116d573bfa2ed",class:"rounded shadow-sm card p-2",part:f},a("div",{key:"0efa6cc9b68c077928f808ae87de23bfdae8d114",class:"d-flex gap-3"},a("div",{key:"bffacd3f4efa0f4836df925c71cda7b557041041",class:"d-flex align-items-center"},a("img",{key:"5d2d65f2e080408fce1c036f95b19829de05ec21",src:this.imageUrl,alt:this.modelName,height:75,width:75,part:s})),a("div",{key:"8c97aca0bf669cbd0b19f6d7eafffd36b20fd14e",class:"d-flex flex-column flex-grow-1 gap-3 p-4 justify-content-center"},a("div",{key:"96ec8a7338c8d3bcaa032a8dd0f68a331901ba57",class:"row"},a("div",{key:"85cf477f4bc74ef873d7087e8e087728f80d9412",class:"col-6 d-flex gap-2"},this.modelName,a("form-control-tooltip",{key:"50357d9dad8c03ff4112a8a5f95aa8ccf99ea640",helpText:this.description})),a("div",{key:"598a1cd15123c470dcd3bc602a988ad335f07f39",class:"col-6 d-flex justify-content-end align-items-center"},a("button",{key:"6868ee6d61d15ff37d01432e40126ae4f77a97cb",class:"p-0 minus btn",onClick:this.removeUnit,part:c},"-"),a("div",{key:"dff94157f9c0cf1afbe60ee655568cd6b109fc1f",class:"w-25 text-center"},this.selectedQuantity),a("button",{key:"12aa22434ff134acd554a7eeb9782c81d14d7f02",class:"p-0 plus btn",onClick:this.addUnit,part:c},"+"))))))}};export{d as terminal_quantity_selector}
@@ -1 +1 @@
1
- import{r as t,c as n,h as r,g as e}from"./p-CV0Pyo1O.js";import{g as o}from"./p-BFTU3MAI.js";import{C as i,b as u}from"./p-CSgcCWLS.js";import{J as c}from"./p-DbOUuBHs.js";import{c as s}from"./p-DHFQtPCq.js";import"./p-BRnBHsdq.js";import"./p-HXpYMWUU.js";import"./p-CZa-hHhJ.js";import"./p-CYQvLgSs.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";var f,a,h={};function l(){return a?f:(a=1,f=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then})}var d,w={},p={};function v(){if(d)return p;let t;d=1;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return p.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},p.getSymbolTotalCodewords=function(t){return n[t]},p.getBCHDigit=function(t){let n=0;for(;0!==t;)n++,t>>>=1;return n},p.setToSJISFunction=function(n){if("function"!=typeof n)throw new Error('"toSJISFunc" is not a valid function.');t=n},p.isKanjiModeEnabled=function(){return void 0!==t},p.toSJIS=function(n){return t(n)},p}var m,g,E,y,A,M={};function b(){return m||(m=1,(t=M).L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}(n)}catch(t){return r}}),M;var t}var C,T,R,U,x={},I={},k={},P={};function F(){if(U)return P;U=1;const t=b(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return P.getBlocksCount=function(r,e){switch(e){case t.L:return n[4*(r-1)+0];case t.M:return n[4*(r-1)+1];case t.Q:return n[4*(r-1)+2];case t.H:return n[4*(r-1)+3];default:return}},P.getTotalCodewordsCount=function(n,e){switch(e){case t.L:return r[4*(n-1)+0];case t.M:return r[4*(n-1)+1];case t.Q:return r[4*(n-1)+2];case t.H:return r[4*(n-1)+3];default:return}},P}var j,B,N,_,L={},Q={};var S,$={},q={},D={};function H(){return S||(S=1,D.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),D}var J,O,Z,z={};function V(){if(J)return z;J=1;const t="[0-9]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";z.KANJI=new RegExp(n,"g"),z.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),z.BYTE=new RegExp(r,"g"),z.NUMERIC=new RegExp(t,"g"),z.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const e=new RegExp("^"+n+"$"),o=new RegExp("^"+t+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return z.testKanji=function(t){return e.test(t)},z.testNumeric=function(t){return o.test(t)},z.testAlphanumeric=function(t){return i.test(t)},z}function W(){return O||(O=1,function(t){const n=H(),r=V();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(n){return r.testNumeric(n)?t.NUMERIC:r.testAlphanumeric(n)?t.ALPHANUMERIC:r.testKanji(n)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}(n)}catch(t){return r}}}(q)),q}var Y,G,K,X,tt,nt,rt,et,ot,it,ut,ct,st={},ft={},at={exports:{}};function ht(){return it||(it=1,function(t){var n={single_source_shortest_paths:function(t,r,e){var o={},i={};i[r]=0;var u,c,s,f,a,h,l=n.PriorityQueue.make();for(l.push(r,0);!l.empty();)for(s in f=(u=l.pop()).cost,a=t[c=u.value]||{})a.hasOwnProperty(s)&&(h=f+a[s],(void 0===i[s]||i[s]>h)&&(i[s]=h,l.push(s,h),o[s]=c));if(void 0!==e&&void 0===i[e]){var d=["Could not find a path from ",r," to ",e,"."].join("");throw new Error(d)}return o},extract_shortest_path_from_predecessor_list:function(t,n){for(var r=[],e=n;e;)r.push(e),e=t[e];return r.reverse(),r},find_path:function(t,r,e){var o=n.single_source_shortest_paths(t,r,e);return n.extract_shortest_path_from_predecessor_list(o,e)},PriorityQueue:{make:function(t){var r,e=n.PriorityQueue,o={};for(r in t=t||{},e)e.hasOwnProperty(r)&&(o[r]=e[r]);return o.queue=[],o.sorter=t.sorter||e.default_sorter,o},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){this.queue.push({value:t,cost:n}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=n}(at)),at.exports}function lt(){if(ct)return w;ct=1;const t=v(),n=b(),r=function(){if(E)return g;function t(){this.buffer=[],this.length=0}return E=1,t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let r=0;r<n;r++)this.putBit(1==(t>>>n-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},g=t}(),e=function(){if(A)return y;function t(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return A=1,t.prototype.set=function(t,n,r,e){const o=t*this.size+n;this.data[o]=r,e&&(this.reservedBit[o]=!0)},t.prototype.get=function(t,n){return this.data[t*this.size+n]},t.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},t.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},y=t}(),o=(C||(C=1,function(t){const n=v().getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const r=Math.floor(t/7)+2,e=n(t),o=145===e?26:2*Math.ceil((e-13)/(2*r-2)),i=[e-7];for(let t=1;t<r-1;t++)i[t]=i[t-1]-o;return i.push(6),i.reverse()},t.getPositions=function(n){const r=[],e=t.getRowColCoords(n),o=e.length;for(let t=0;t<o;t++)for(let n=0;n<o;n++)0===t&&0===n||0===t&&n===o-1||t===o-1&&0===n||r.push([e[t],e[n]]);return r}}(x)),x),i=function(){if(T)return I;T=1;const t=v().getSymbolSize;return I.getPositions=function(n){const r=t(n);return[[0,0],[r-7,0],[0,r-7]]},I}(),u=(R||(R=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(n,r,e){switch(n){case t.Patterns.PATTERN000:return(r+e)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return e%3==0;case t.Patterns.PATTERN011:return(r+e)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(e/3))%2==0;case t.Patterns.PATTERN101:return r*e%2+r*e%3==0;case t.Patterns.PATTERN110:return(r*e%2+r*e%3)%2==0;case t.Patterns.PATTERN111:return(r*e%3+(r+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(t){const n=t.size;let r=0,e=0,o=0,i=null,u=null;for(let c=0;c<n;c++){e=o=0,i=u=null;for(let s=0;s<n;s++){let n=t.get(c,s);n===i?e++:(e>=5&&(r+=e-5+3),i=n,e=1),n=t.get(s,c),n===u?o++:(o>=5&&(r+=o-5+3),u=n,o=1)}e>=5&&(r+=e-5+3),o>=5&&(r+=o-5+3)}return r},t.getPenaltyN2=function(t){const n=t.size;let r=0;for(let e=0;e<n-1;e++)for(let o=0;o<n-1;o++){const n=t.get(e,o)+t.get(e,o+1)+t.get(e+1,o)+t.get(e+1,o+1);4!==n&&0!==n||r++}return 3*r},t.getPenaltyN3=function(t){const n=t.size;let r=0,e=0,o=0;for(let i=0;i<n;i++){e=o=0;for(let u=0;u<n;u++)e=e<<1&2047|t.get(i,u),u>=10&&(1488===e||93===e)&&r++,o=o<<1&2047|t.get(u,i),u>=10&&(1488===o||93===o)&&r++}return 40*r},t.getPenaltyN4=function(t){let n=0;const r=t.data.length;for(let e=0;e<r;e++)n+=t.data[e];return 10*Math.abs(Math.ceil(100*n/r/5)-10)},t.applyMask=function(t,r){const e=r.size;for(let o=0;o<e;o++)for(let i=0;i<e;i++)r.isReserved(i,o)||r.xor(i,o,n(t,i,o))},t.getBestMask=function(n,r){const e=Object.keys(t.Patterns).length;let o=0,i=1/0;for(let u=0;u<e;u++){r(u),t.applyMask(u,n);const e=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(u,n),e<i&&(i=e,o=u)}return o}}(k)),k),c=F(),s=function(){if(_)return N;_=1;const t=(B||(B=1,function(t){const n=function(){if(j)return Q;j=1;const t=new Uint8Array(512),n=new Uint8Array(256);return function(){let r=1;for(let e=0;e<255;e++)t[e]=r,n[r]=e,r<<=1,256&r&&(r^=285);for(let n=255;n<512;n++)t[n]=t[n-255]}(),Q.log=function(t){if(t<1)throw new Error("log("+t+")");return n[t]},Q.exp=function(n){return t[n]},Q.mul=function(r,e){return 0===r||0===e?0:t[n[r]+n[e]]},Q}();t.mul=function(t,r){const e=new Uint8Array(t.length+r.length-1);for(let o=0;o<t.length;o++)for(let i=0;i<r.length;i++)e[o+i]^=n.mul(t[o],r[i]);return e},t.mod=function(t,r){let e=new Uint8Array(t);for(;e.length-r.length>=0;){const t=e[0];for(let o=0;o<r.length;o++)e[o]^=n.mul(r[o],t);let o=0;for(;o<e.length&&0===e[o];)o++;e=e.slice(o)}return e},t.generateECPolynomial=function(r){let e=new Uint8Array([1]);for(let o=0;o<r;o++)e=t.mul(e,new Uint8Array([1,n.exp(o)]));return e}}(L)),L);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}return n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(n.length+this.degree);r.set(n);const e=t.mod(r,this.genPoly),o=this.degree-e.length;if(o>0){const t=new Uint8Array(this.degree);return t.set(e,o),t}return e},N=n}(),f=(Z||(Z=1,function(t){const n=v(),r=F(),e=b(),o=W(),i=H(),u=n.getBCHDigit(7973);function c(t,n){return o.getCharCountIndicator(t,n)+4}function s(t,n){let r=0;return t.forEach((function(t){const e=c(t.mode,n);r+=e+t.getBitsLength()})),r}t.from=function(t,n){return i.isValid(t)?parseInt(t,10):n},t.getCapacity=function(t,e,u){if(!i.isValid(t))throw new Error("Invalid QR Code version");void 0===u&&(u=o.BYTE);const s=8*(n.getSymbolTotalCodewords(t)-r.getTotalCodewordsCount(t,e));if(u===o.MIXED)return s;const f=s-c(u,t);switch(u){case o.NUMERIC:return Math.floor(f/10*3);case o.ALPHANUMERIC:return Math.floor(f/11*2);case o.KANJI:return Math.floor(f/13);default:return Math.floor(f/8)}},t.getBestVersionForData=function(n,r){let i;const u=e.from(r,e.M);if(Array.isArray(n)){if(n.length>1)return function(n,r){for(let e=1;e<=40;e++)if(s(n,e)<=t.getCapacity(e,r,o.MIXED))return e}(n,u);if(0===n.length)return 1;i=n[0]}else i=n;return function(n,r,e){for(let o=1;o<=40;o++)if(r<=t.getCapacity(o,e,n))return o}(i.mode,i.getLength(),u)},t.getEncodedBits=function(t){if(!i.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;n.getBCHDigit(r)-u>=0;)r^=7973<<n.getBCHDigit(r)-u;return t<<12|r}}($)),$),a=function(){if(Y)return st;Y=1;const t=v(),n=t.getBCHDigit(1335);return st.getEncodedBits=function(r,e){const o=r.bit<<3|e;let i=o<<10;for(;t.getBCHDigit(i)-n>=0;)i^=1335<<t.getBCHDigit(i)-n;return 21522^(o<<10|i)},st}(),h=W(),l=(ut||(ut=1,function(t){const n=W(),r=function(){if(K)return G;K=1;const t=W();function n(n){this.mode=t.NUMERIC,this.data=n.toString()}return n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,r,e;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),e=parseInt(r,10),t.put(e,10);const o=this.data.length-n;o>0&&(r=this.data.substr(n),e=parseInt(r,10),t.put(e,3*o+1))},G=n}(),e=function(){if(tt)return X;tt=1;const t=W(),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=t.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let e=45*n.indexOf(this.data[r]);e+=n.indexOf(this.data[r+1]),t.put(e,11)}this.data.length%2&&t.put(n.indexOf(this.data[r]),6)},X=r}(),o=function(){if(rt)return nt;rt=1;const t=W();function n(n){this.mode=t.BYTE,this.data="string"==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}return n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,r=this.data.length;n<r;n++)t.put(this.data[n],8)},nt=n}(),i=function(){if(ot)return et;ot=1;const t=W(),n=v();function r(n){this.mode=t.KANJI,this.data=n}return r.getBitsLength=function(t){return 13*t},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r<this.data.length;r++){let e=n.toSJIS(this.data[r]);if(e>=33088&&e<=40956)e-=33088;else{if(!(e>=57408&&e<=60351))throw new Error("Invalid SJIS character: "+this.data[r]+"\nMake sure your charset is UTF-8");e-=49472}e=192*(e>>>8&255)+(255&e),t.put(e,13)}},et=r}(),u=V(),c=v(),s=ht();function f(t){return unescape(encodeURIComponent(t)).length}function a(t,n,r){const e=[];let o;for(;null!==(o=t.exec(r));)e.push({data:o[0],index:o.index,mode:n,length:o[0].length});return e}function h(t){const r=a(u.NUMERIC,n.NUMERIC,t),e=a(u.ALPHANUMERIC,n.ALPHANUMERIC,t);let o,i;return c.isKanjiModeEnabled()?(o=a(u.BYTE,n.BYTE,t),i=a(u.KANJI,n.KANJI,t)):(o=a(u.BYTE_KANJI,n.BYTE,t),i=[]),r.concat(e,o,i).sort((function(t,n){return t.index-n.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function l(t,u){switch(u){case n.NUMERIC:return r.getBitsLength(t);case n.ALPHANUMERIC:return e.getBitsLength(t);case n.KANJI:return i.getBitsLength(t);case n.BYTE:return o.getBitsLength(t)}}function d(t,u){let s;const f=n.getBestModeForData(t);if(s=n.from(u,f),s!==n.BYTE&&s.bit<f.bit)throw new Error('"'+t+'" cannot be encoded with mode '+n.toString(s)+".\n Suggested mode is: "+n.toString(f));switch(s!==n.KANJI||c.isKanjiModeEnabled()||(s=n.BYTE),s){case n.NUMERIC:return new r(t);case n.ALPHANUMERIC:return new e(t);case n.KANJI:return new i(t);case n.BYTE:return new o(t)}}t.fromArray=function(t){return t.reduce((function(t,n){return"string"==typeof n?t.push(d(n,null)):n.data&&t.push(d(n.data,n.mode)),t}),[])},t.fromString=function(r,e){const o=function(t,r){const e={},o={start:{}};let i=["start"];for(let u=0;u<t.length;u++){const c=t[u],s=[];for(let t=0;t<c.length;t++){const f=c[t],a=""+u+t;s.push(a),e[a]={node:f,lastCount:0},o[a]={};for(let t=0;t<i.length;t++){const u=i[t];e[u]&&e[u].node.mode===f.mode?(o[u][a]=l(e[u].lastCount+f.length,f.mode)-l(e[u].lastCount,f.mode),e[u].lastCount+=f.length):(e[u]&&(e[u].lastCount=f.length),o[u][a]=l(f.length,f.mode)+4+n.getCharCountIndicator(f.mode,r))}}i=s}for(let t=0;t<i.length;t++)o[i[t]].end=0;return{map:o,table:e}}(function(t){const r=[];for(let e=0;e<t.length;e++){const o=t[e];switch(o.mode){case n.NUMERIC:r.push([o,{data:o.data,mode:n.ALPHANUMERIC,length:o.length},{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.ALPHANUMERIC:r.push([o,{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.KANJI:r.push([o,{data:o.data,mode:n.BYTE,length:f(o.data)}]);break;case n.BYTE:r.push([{data:o.data,mode:n.BYTE,length:f(o.data)}])}}return r}(h(r,c.isKanjiModeEnabled())),e),i=s.find_path(o.map,"start","end"),u=[];for(let t=1;t<i.length-1;t++)u.push(o.table[i[t]].node);return t.fromArray(u.reduce((function(t,n){const r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)}),[]))},t.rawSplit=function(n){return t.fromArray(h(n,c.isKanjiModeEnabled()))}}(ft)),ft);function d(t,n,r){const e=t.size,o=a.getEncodedBits(n,r);let i,u;for(i=0;i<15;i++)u=1==(o>>i&1),t.set(i<6?i:i<8?i+1:e-15+i,8,u,!0),t.set(8,i<8?e-i-1:i<9?15-i-1+1:15-i-1,u,!0);t.set(e-8,8,1,!0)}function p(n,a,w,p){let v;if(Array.isArray(n))v=l.fromArray(n);else{if("string"!=typeof n)throw new Error("Invalid data");{let t=a;if(!t){const r=l.rawSplit(n);t=f.getBestVersionForData(r,w)}v=l.fromString(n,t||40)}}const m=f.getBestVersionForData(v,w);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(a){if(a<m)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+m+".\n")}else a=m;const g=function(n,e,o){const i=new r;o.forEach((function(t){i.put(t.mode.bit,4),i.put(t.getLength(),h.getCharCountIndicator(t.mode,n)),t.write(i)}));const u=8*(t.getSymbolTotalCodewords(n)-c.getTotalCodewordsCount(n,e));for(i.getLengthInBits()+4<=u&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const f=(u-i.getLengthInBits())/8;for(let t=0;t<f;t++)i.put(t%2?17:236,8);return function(n,r,e){const o=t.getSymbolTotalCodewords(r),i=o-c.getTotalCodewordsCount(r,e),u=c.getBlocksCount(r,e),f=u-o%u,a=Math.floor(o/u),h=Math.floor(i/u),l=h+1,d=a-h,w=new s(d);let p=0;const v=new Array(u),m=new Array(u);let g=0;const E=new Uint8Array(n.buffer);for(let t=0;t<u;t++){const n=t<f?h:l;v[t]=E.slice(p,p+n),m[t]=w.encode(v[t]),p+=n,g=Math.max(g,n)}const y=new Uint8Array(o);let A,M,b=0;for(A=0;A<g;A++)for(M=0;M<u;M++)A<v[M].length&&(y[b++]=v[M][A]);for(A=0;A<d;A++)for(M=0;M<u;M++)y[b++]=m[M][A];return y}(i,n,e)}(a,w,v),E=t.getSymbolSize(a),y=new e(E);return function(t,n){const r=t.size,e=i.getPositions(n);for(let n=0;n<e.length;n++){const o=e[n][0],i=e[n][1];for(let n=-1;n<=7;n++)if(!(o+n<=-1||r<=o+n))for(let e=-1;e<=7;e++)i+e<=-1||r<=i+e||t.set(o+n,i+e,n>=0&&n<=6&&(0===e||6===e)||e>=0&&e<=6&&(0===n||6===n)||n>=2&&n<=4&&e>=2&&e<=4,!0)}}(y,a),function(t){const n=t.size;for(let r=8;r<n-8;r++){const n=r%2==0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}(y),function(t,n){const r=o.getPositions(n);for(let n=0;n<r.length;n++){const e=r[n][0],o=r[n][1];for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)t.set(e+n,o+r,-2===n||2===n||-2===r||2===r||0===n&&0===r,!0)}}(y,a),d(y,w,0),a>=7&&function(t,n){const r=t.size,e=f.getEncodedBits(n);let o,i,u;for(let n=0;n<18;n++)o=Math.floor(n/3),i=n%3+r-8-3,u=1==(e>>n&1),t.set(o,i,u,!0),t.set(i,o,u,!0)}(y,a),function(t,n){const r=t.size;let e=-1,o=r-1,i=7,u=0;for(let c=r-1;c>0;c-=2)for(6===c&&c--;;){for(let r=0;r<2;r++)if(!t.isReserved(o,c-r)){let e=!1;u<n.length&&(e=1==(n[u]>>>i&1)),t.set(o,c-r,e),i--,-1===i&&(u++,i=7)}if(o+=e,o<0||r<=o){o-=e,e=-e;break}}}(y,g),isNaN(p)&&(p=u.getBestMask(y,d.bind(null,y,w))),u.applyMask(p,y),d(y,w,p),{modules:y,version:a,errorCorrectionLevel:w,maskPattern:p,segments:v}}return w.create=function(r,e){if(void 0===r||""===r)throw new Error("No input text");let o,i,c=n.M;return void 0!==e&&(c=n.from(e.errorCorrectionLevel,n.M),o=f.from(e.version),i=u.from(e.maskPattern),e.toSJISFunc&&t.setToSJISFunction(e.toSJISFunc)),p(r,o,c,i)},w}var dt,wt,pt={},vt={};function mt(){return dt||(dt=1,function(t){function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||5===n.length||n.length>8)throw new Error("Invalid hex color: "+t);3!==n.length&&4!==n.length||(n=Array.prototype.concat.apply([],n.map((function(t){return[t,t]})))),6===n.length&&n.push("F","F");const r=parseInt(n.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const r=t.width&&t.width>=21?t.width:void 0;return{width:r,scale:r?4:t.scale||4,margin:null==t.margin||t.margin<0?4:t.margin,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,n){return n.width&&n.width>=t+2*n.margin?n.width/(t+2*n.margin):n.scale},t.getImageWidth=function(n,r){const e=t.getScale(n,r);return Math.floor((n+2*r.margin)*e)},t.qrToImageData=function(n,r,e){const o=r.modules.size,i=r.modules.data,u=t.getScale(o,e),c=Math.floor((o+2*e.margin)*u),s=e.margin*u,f=[e.color.light,e.color.dark];for(let t=0;t<c;t++)for(let r=0;r<c;r++){let a=4*(t*c+r),h=e.color.light;t>=s&&r>=s&&t<c-s&&r<c-s&&(h=f[i[Math.floor((t-s)/u)*o+Math.floor((r-s)/u)]?1:0]),n[a++]=h.r,n[a++]=h.g,n[a++]=h.b,n[a]=h.a}}}(vt)),vt}var gt,Et,yt={};var At=function(){if(Et)return h;Et=1;const t=l(),n=lt(),r=(wt||(wt=1,function(t){const n=mt();t.render=function(t,r,e){let o=e,i=r;void 0!==o||r&&r.getContext||(o=r,r=void 0),r||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=n.getOptions(o);const u=n.getImageWidth(t.modules.size,o),c=i.getContext("2d"),s=c.createImageData(u,u);return n.qrToImageData(s.data,t,o),function(t,n,r){t.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=r,n.width=r,n.style.height=r+"px",n.style.width=r+"px"}(c,i,u),c.putImageData(s,0,0),i},t.renderToDataURL=function(n,r,e){let o=e;return void 0!==o||r&&r.getContext||(o=r,r=void 0),o||(o={}),t.render(n,r,o).toDataURL(o.type||"image/png",(o.rendererOpts||{}).quality)}}(pt)),pt),e=function(){if(gt)return yt;gt=1;const t=mt();function n(t,n){const r=t.a/255,e=n+'="'+t.hex+'"';return r<1?e+" "+n+'-opacity="'+r.toFixed(2).slice(1)+'"':e}function r(t,n,r){let e=t+n;return void 0!==r&&(e+=" "+r),e}return yt.render=function(e,o,i){const u=t.getOptions(o),c=e.modules.size,s=e.modules.data,f=c+2*u.margin,a=u.color.light.a?"<path "+n(u.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",h="<path "+n(u.color.dark,"stroke")+' d="'+function(t,n,e){let o="",i=0,u=!1,c=0;for(let s=0;s<t.length;s++){const f=Math.floor(s%n),a=Math.floor(s/n);f||u||(u=!0),t[s]?(c++,s>0&&f>0&&t[s-1]||(o+=u?r("M",f+e,.5+a+e):r("m",i,0),i=0,u=!1),f+1<n&&t[s+1]||(o+=r("h",c),c=0)):i++}return o}(s,c,u.margin)+'"/>',l='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+'viewBox="0 0 '+f+" "+f+'" shape-rendering="crispEdges">'+a+h+"</svg>\n";return"function"==typeof i&&i(null,l),l},yt}();function o(r,e,o,i,u){const c=[].slice.call(arguments,1),s=c.length,f="function"==typeof c[s-1];if(!f&&!t())throw new Error("Callback required as last argument");if(!f){if(s<1)throw new Error("Too few arguments provided");return 1===s?(o=e,e=i=void 0):2!==s||e.getContext||(i=o,o=e,e=void 0),new Promise((function(t,u){try{const u=n.create(o,i);t(r(u,e,i))}catch(t){u(t)}}))}if(s<2)throw new Error("Too few arguments provided");2===s?(u=o,o=e,e=i=void 0):3===s&&(e.getContext&&void 0===u?(u=i,i=void 0):(u=i,i=o,o=e,e=void 0));try{const t=n.create(o,i);u(null,r(t,e,i))}catch(t){u(t)}}return h.create=n.create,h.toCanvas=o.bind(null,r.render),h.toDataURL=o.bind(null,r.renderToDataURL),h.toString=o.bind(null,(function(t,n,r){return e.render(t,r)})),h}(),Mt=o(At);const bt=class{constructor(r){t(this,r),this.errorEvent=n(this,"error-event",7),this.size=256}componentWillLoad(){s(),this.analytics=new c(this)}componentDidLoad(){this.renderQrCode()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.renderQrCode()}get checkoutUrl(){return`https://components.justifi.ai/hosted-checkout/${this.checkoutId}`}async renderQrCode(){if(!this.checkoutId)return void this.errorEvent.emit({message:"checkoutId is required",errorCode:u.MISSING_PROPS,severity:i.ERROR});if(!this.qrContainerEl)return;const t=await Mt.toString(this.checkoutUrl,{type:"svg",width:this.size,errorCorrectionLevel:"M"});this.qrContainerEl.innerHTML=t}render(){return this.checkoutId?r("div",{ref:t=>this.qrContainerEl=t}):null}get el(){return e(this)}static get watchers(){return{checkoutId:["propChanged"],size:["propChanged"]}}};export{bt as justifi_checkout_qr_code}
1
+ import{r as t,c as n,h as r,g as e}from"./p-CV0Pyo1O.js";import{g as o}from"./p-BFTU3MAI.js";import{C as i,b as u}from"./p-DXTa04jn.js";import{J as c}from"./p-_GBnYSuR.js";import{c as s}from"./p-CQqmTKij.js";import"./p-BSs-2JKu.js";import"./p-HXpYMWUU.js";import"./p-DNd24RUQ.js";import"./p-De4Pig-y.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";var f,a,h={};function l(){return a?f:(a=1,f=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then})}var d,w={},p={};function v(){if(d)return p;let t;d=1;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return p.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},p.getSymbolTotalCodewords=function(t){return n[t]},p.getBCHDigit=function(t){let n=0;for(;0!==t;)n++,t>>>=1;return n},p.setToSJISFunction=function(n){if("function"!=typeof n)throw new Error('"toSJISFunc" is not a valid function.');t=n},p.isKanjiModeEnabled=function(){return void 0!==t},p.toSJIS=function(n){return t(n)},p}var m,g,E,y,A,M={};function b(){return m||(m=1,(t=M).L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}(n)}catch(t){return r}}),M;var t}var T,C,R,U,x={},I={},j={},k={};function P(){if(U)return k;U=1;const t=b(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return k.getBlocksCount=function(r,e){switch(e){case t.L:return n[4*(r-1)+0];case t.M:return n[4*(r-1)+1];case t.Q:return n[4*(r-1)+2];case t.H:return n[4*(r-1)+3];default:return}},k.getTotalCodewordsCount=function(n,e){switch(e){case t.L:return r[4*(n-1)+0];case t.M:return r[4*(n-1)+1];case t.Q:return r[4*(n-1)+2];case t.H:return r[4*(n-1)+3];default:return}},k}var N,F,B,_,D={},Q={};var $,L={},S={},q={};function J(){return $||($=1,q.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),q}var O,Z,z,H={};function K(){if(O)return H;O=1;const t="[0-9]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";H.KANJI=new RegExp(n,"g"),H.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),H.BYTE=new RegExp(r,"g"),H.NUMERIC=new RegExp(t,"g"),H.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const e=new RegExp("^"+n+"$"),o=new RegExp("^"+t+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return H.testKanji=function(t){return e.test(t)},H.testNumeric=function(t){return o.test(t)},H.testAlphanumeric=function(t){return i.test(t)},H}function V(){return Z||(Z=1,function(t){const n=J(),r=K();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(n){return r.testNumeric(n)?t.NUMERIC:r.testAlphanumeric(n)?t.ALPHANUMERIC:r.testKanji(n)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}(n)}catch(t){return r}}}(S)),S}var Y,G,W,X,tt,nt,rt,et,ot,it,ut,ct,st={},ft={},at={exports:{}};function ht(){return it||(it=1,function(t){var n={single_source_shortest_paths:function(t,r,e){var o={},i={};i[r]=0;var u,c,s,f,a,h,l=n.PriorityQueue.make();for(l.push(r,0);!l.empty();)for(s in f=(u=l.pop()).cost,a=t[c=u.value]||{})a.hasOwnProperty(s)&&(h=f+a[s],(void 0===i[s]||i[s]>h)&&(i[s]=h,l.push(s,h),o[s]=c));if(void 0!==e&&void 0===i[e]){var d=["Could not find a path from ",r," to ",e,"."].join("");throw new Error(d)}return o},extract_shortest_path_from_predecessor_list:function(t,n){for(var r=[],e=n;e;)r.push(e),e=t[e];return r.reverse(),r},find_path:function(t,r,e){var o=n.single_source_shortest_paths(t,r,e);return n.extract_shortest_path_from_predecessor_list(o,e)},PriorityQueue:{make:function(t){var r,e=n.PriorityQueue,o={};for(r in t=t||{},e)e.hasOwnProperty(r)&&(o[r]=e[r]);return o.queue=[],o.sorter=t.sorter||e.default_sorter,o},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){this.queue.push({value:t,cost:n}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=n}(at)),at.exports}function lt(){if(ct)return w;ct=1;const t=v(),n=b(),r=function(){if(E)return g;function t(){this.buffer=[],this.length=0}return E=1,t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let r=0;r<n;r++)this.putBit(1==(t>>>n-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},g=t}(),e=function(){if(A)return y;function t(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return A=1,t.prototype.set=function(t,n,r,e){const o=t*this.size+n;this.data[o]=r,e&&(this.reservedBit[o]=!0)},t.prototype.get=function(t,n){return this.data[t*this.size+n]},t.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},t.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},y=t}(),o=(T||(T=1,function(t){const n=v().getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const r=Math.floor(t/7)+2,e=n(t),o=145===e?26:2*Math.ceil((e-13)/(2*r-2)),i=[e-7];for(let t=1;t<r-1;t++)i[t]=i[t-1]-o;return i.push(6),i.reverse()},t.getPositions=function(n){const r=[],e=t.getRowColCoords(n),o=e.length;for(let t=0;t<o;t++)for(let n=0;n<o;n++)0===t&&0===n||0===t&&n===o-1||t===o-1&&0===n||r.push([e[t],e[n]]);return r}}(x)),x),i=function(){if(C)return I;C=1;const t=v().getSymbolSize;return I.getPositions=function(n){const r=t(n);return[[0,0],[r-7,0],[0,r-7]]},I}(),u=(R||(R=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(n,r,e){switch(n){case t.Patterns.PATTERN000:return(r+e)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return e%3==0;case t.Patterns.PATTERN011:return(r+e)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(e/3))%2==0;case t.Patterns.PATTERN101:return r*e%2+r*e%3==0;case t.Patterns.PATTERN110:return(r*e%2+r*e%3)%2==0;case t.Patterns.PATTERN111:return(r*e%3+(r+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(t){const n=t.size;let r=0,e=0,o=0,i=null,u=null;for(let c=0;c<n;c++){e=o=0,i=u=null;for(let s=0;s<n;s++){let n=t.get(c,s);n===i?e++:(e>=5&&(r+=e-5+3),i=n,e=1),n=t.get(s,c),n===u?o++:(o>=5&&(r+=o-5+3),u=n,o=1)}e>=5&&(r+=e-5+3),o>=5&&(r+=o-5+3)}return r},t.getPenaltyN2=function(t){const n=t.size;let r=0;for(let e=0;e<n-1;e++)for(let o=0;o<n-1;o++){const n=t.get(e,o)+t.get(e,o+1)+t.get(e+1,o)+t.get(e+1,o+1);4!==n&&0!==n||r++}return 3*r},t.getPenaltyN3=function(t){const n=t.size;let r=0,e=0,o=0;for(let i=0;i<n;i++){e=o=0;for(let u=0;u<n;u++)e=e<<1&2047|t.get(i,u),u>=10&&(1488===e||93===e)&&r++,o=o<<1&2047|t.get(u,i),u>=10&&(1488===o||93===o)&&r++}return 40*r},t.getPenaltyN4=function(t){let n=0;const r=t.data.length;for(let e=0;e<r;e++)n+=t.data[e];return 10*Math.abs(Math.ceil(100*n/r/5)-10)},t.applyMask=function(t,r){const e=r.size;for(let o=0;o<e;o++)for(let i=0;i<e;i++)r.isReserved(i,o)||r.xor(i,o,n(t,i,o))},t.getBestMask=function(n,r){const e=Object.keys(t.Patterns).length;let o=0,i=1/0;for(let u=0;u<e;u++){r(u),t.applyMask(u,n);const e=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(u,n),e<i&&(i=e,o=u)}return o}}(j)),j),c=P(),s=function(){if(_)return B;_=1;const t=(F||(F=1,function(t){const n=function(){if(N)return Q;N=1;const t=new Uint8Array(512),n=new Uint8Array(256);return function(){let r=1;for(let e=0;e<255;e++)t[e]=r,n[r]=e,r<<=1,256&r&&(r^=285);for(let n=255;n<512;n++)t[n]=t[n-255]}(),Q.log=function(t){if(t<1)throw new Error("log("+t+")");return n[t]},Q.exp=function(n){return t[n]},Q.mul=function(r,e){return 0===r||0===e?0:t[n[r]+n[e]]},Q}();t.mul=function(t,r){const e=new Uint8Array(t.length+r.length-1);for(let o=0;o<t.length;o++)for(let i=0;i<r.length;i++)e[o+i]^=n.mul(t[o],r[i]);return e},t.mod=function(t,r){let e=new Uint8Array(t);for(;e.length-r.length>=0;){const t=e[0];for(let o=0;o<r.length;o++)e[o]^=n.mul(r[o],t);let o=0;for(;o<e.length&&0===e[o];)o++;e=e.slice(o)}return e},t.generateECPolynomial=function(r){let e=new Uint8Array([1]);for(let o=0;o<r;o++)e=t.mul(e,new Uint8Array([1,n.exp(o)]));return e}}(D)),D);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}return n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(n.length+this.degree);r.set(n);const e=t.mod(r,this.genPoly),o=this.degree-e.length;if(o>0){const t=new Uint8Array(this.degree);return t.set(e,o),t}return e},B=n}(),f=(z||(z=1,function(t){const n=v(),r=P(),e=b(),o=V(),i=J(),u=n.getBCHDigit(7973);function c(t,n){return o.getCharCountIndicator(t,n)+4}function s(t,n){let r=0;return t.forEach((function(t){const e=c(t.mode,n);r+=e+t.getBitsLength()})),r}t.from=function(t,n){return i.isValid(t)?parseInt(t,10):n},t.getCapacity=function(t,e,u){if(!i.isValid(t))throw new Error("Invalid QR Code version");void 0===u&&(u=o.BYTE);const s=8*(n.getSymbolTotalCodewords(t)-r.getTotalCodewordsCount(t,e));if(u===o.MIXED)return s;const f=s-c(u,t);switch(u){case o.NUMERIC:return Math.floor(f/10*3);case o.ALPHANUMERIC:return Math.floor(f/11*2);case o.KANJI:return Math.floor(f/13);default:return Math.floor(f/8)}},t.getBestVersionForData=function(n,r){let i;const u=e.from(r,e.M);if(Array.isArray(n)){if(n.length>1)return function(n,r){for(let e=1;e<=40;e++)if(s(n,e)<=t.getCapacity(e,r,o.MIXED))return e}(n,u);if(0===n.length)return 1;i=n[0]}else i=n;return function(n,r,e){for(let o=1;o<=40;o++)if(r<=t.getCapacity(o,e,n))return o}(i.mode,i.getLength(),u)},t.getEncodedBits=function(t){if(!i.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;n.getBCHDigit(r)-u>=0;)r^=7973<<n.getBCHDigit(r)-u;return t<<12|r}}(L)),L),a=function(){if(Y)return st;Y=1;const t=v(),n=t.getBCHDigit(1335);return st.getEncodedBits=function(r,e){const o=r.bit<<3|e;let i=o<<10;for(;t.getBCHDigit(i)-n>=0;)i^=1335<<t.getBCHDigit(i)-n;return 21522^(o<<10|i)},st}(),h=V(),l=(ut||(ut=1,function(t){const n=V(),r=function(){if(W)return G;W=1;const t=V();function n(n){this.mode=t.NUMERIC,this.data=n.toString()}return n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,r,e;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),e=parseInt(r,10),t.put(e,10);const o=this.data.length-n;o>0&&(r=this.data.substr(n),e=parseInt(r,10),t.put(e,3*o+1))},G=n}(),e=function(){if(tt)return X;tt=1;const t=V(),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=t.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let e=45*n.indexOf(this.data[r]);e+=n.indexOf(this.data[r+1]),t.put(e,11)}this.data.length%2&&t.put(n.indexOf(this.data[r]),6)},X=r}(),o=function(){if(rt)return nt;rt=1;const t=V();function n(n){this.mode=t.BYTE,this.data="string"==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}return n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,r=this.data.length;n<r;n++)t.put(this.data[n],8)},nt=n}(),i=function(){if(ot)return et;ot=1;const t=V(),n=v();function r(n){this.mode=t.KANJI,this.data=n}return r.getBitsLength=function(t){return 13*t},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r<this.data.length;r++){let e=n.toSJIS(this.data[r]);if(e>=33088&&e<=40956)e-=33088;else{if(!(e>=57408&&e<=60351))throw new Error("Invalid SJIS character: "+this.data[r]+"\nMake sure your charset is UTF-8");e-=49472}e=192*(e>>>8&255)+(255&e),t.put(e,13)}},et=r}(),u=K(),c=v(),s=ht();function f(t){return unescape(encodeURIComponent(t)).length}function a(t,n,r){const e=[];let o;for(;null!==(o=t.exec(r));)e.push({data:o[0],index:o.index,mode:n,length:o[0].length});return e}function h(t){const r=a(u.NUMERIC,n.NUMERIC,t),e=a(u.ALPHANUMERIC,n.ALPHANUMERIC,t);let o,i;return c.isKanjiModeEnabled()?(o=a(u.BYTE,n.BYTE,t),i=a(u.KANJI,n.KANJI,t)):(o=a(u.BYTE_KANJI,n.BYTE,t),i=[]),r.concat(e,o,i).sort((function(t,n){return t.index-n.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function l(t,u){switch(u){case n.NUMERIC:return r.getBitsLength(t);case n.ALPHANUMERIC:return e.getBitsLength(t);case n.KANJI:return i.getBitsLength(t);case n.BYTE:return o.getBitsLength(t)}}function d(t,u){let s;const f=n.getBestModeForData(t);if(s=n.from(u,f),s!==n.BYTE&&s.bit<f.bit)throw new Error('"'+t+'" cannot be encoded with mode '+n.toString(s)+".\n Suggested mode is: "+n.toString(f));switch(s!==n.KANJI||c.isKanjiModeEnabled()||(s=n.BYTE),s){case n.NUMERIC:return new r(t);case n.ALPHANUMERIC:return new e(t);case n.KANJI:return new i(t);case n.BYTE:return new o(t)}}t.fromArray=function(t){return t.reduce((function(t,n){return"string"==typeof n?t.push(d(n,null)):n.data&&t.push(d(n.data,n.mode)),t}),[])},t.fromString=function(r,e){const o=function(t,r){const e={},o={start:{}};let i=["start"];for(let u=0;u<t.length;u++){const c=t[u],s=[];for(let t=0;t<c.length;t++){const f=c[t],a=""+u+t;s.push(a),e[a]={node:f,lastCount:0},o[a]={};for(let t=0;t<i.length;t++){const u=i[t];e[u]&&e[u].node.mode===f.mode?(o[u][a]=l(e[u].lastCount+f.length,f.mode)-l(e[u].lastCount,f.mode),e[u].lastCount+=f.length):(e[u]&&(e[u].lastCount=f.length),o[u][a]=l(f.length,f.mode)+4+n.getCharCountIndicator(f.mode,r))}}i=s}for(let t=0;t<i.length;t++)o[i[t]].end=0;return{map:o,table:e}}(function(t){const r=[];for(let e=0;e<t.length;e++){const o=t[e];switch(o.mode){case n.NUMERIC:r.push([o,{data:o.data,mode:n.ALPHANUMERIC,length:o.length},{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.ALPHANUMERIC:r.push([o,{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.KANJI:r.push([o,{data:o.data,mode:n.BYTE,length:f(o.data)}]);break;case n.BYTE:r.push([{data:o.data,mode:n.BYTE,length:f(o.data)}])}}return r}(h(r,c.isKanjiModeEnabled())),e),i=s.find_path(o.map,"start","end"),u=[];for(let t=1;t<i.length-1;t++)u.push(o.table[i[t]].node);return t.fromArray(u.reduce((function(t,n){const r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)}),[]))},t.rawSplit=function(n){return t.fromArray(h(n,c.isKanjiModeEnabled()))}}(ft)),ft);function d(t,n,r){const e=t.size,o=a.getEncodedBits(n,r);let i,u;for(i=0;i<15;i++)u=1==(o>>i&1),t.set(i<6?i:i<8?i+1:e-15+i,8,u,!0),t.set(8,i<8?e-i-1:i<9?15-i-1+1:15-i-1,u,!0);t.set(e-8,8,1,!0)}function p(n,a,w,p){let v;if(Array.isArray(n))v=l.fromArray(n);else{if("string"!=typeof n)throw new Error("Invalid data");{let t=a;if(!t){const r=l.rawSplit(n);t=f.getBestVersionForData(r,w)}v=l.fromString(n,t||40)}}const m=f.getBestVersionForData(v,w);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(a){if(a<m)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+m+".\n")}else a=m;const g=function(n,e,o){const i=new r;o.forEach((function(t){i.put(t.mode.bit,4),i.put(t.getLength(),h.getCharCountIndicator(t.mode,n)),t.write(i)}));const u=8*(t.getSymbolTotalCodewords(n)-c.getTotalCodewordsCount(n,e));for(i.getLengthInBits()+4<=u&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const f=(u-i.getLengthInBits())/8;for(let t=0;t<f;t++)i.put(t%2?17:236,8);return function(n,r,e){const o=t.getSymbolTotalCodewords(r),i=o-c.getTotalCodewordsCount(r,e),u=c.getBlocksCount(r,e),f=u-o%u,a=Math.floor(o/u),h=Math.floor(i/u),l=h+1,d=a-h,w=new s(d);let p=0;const v=new Array(u),m=new Array(u);let g=0;const E=new Uint8Array(n.buffer);for(let t=0;t<u;t++){const n=t<f?h:l;v[t]=E.slice(p,p+n),m[t]=w.encode(v[t]),p+=n,g=Math.max(g,n)}const y=new Uint8Array(o);let A,M,b=0;for(A=0;A<g;A++)for(M=0;M<u;M++)A<v[M].length&&(y[b++]=v[M][A]);for(A=0;A<d;A++)for(M=0;M<u;M++)y[b++]=m[M][A];return y}(i,n,e)}(a,w,v),E=t.getSymbolSize(a),y=new e(E);return function(t,n){const r=t.size,e=i.getPositions(n);for(let n=0;n<e.length;n++){const o=e[n][0],i=e[n][1];for(let n=-1;n<=7;n++)if(!(o+n<=-1||r<=o+n))for(let e=-1;e<=7;e++)i+e<=-1||r<=i+e||t.set(o+n,i+e,n>=0&&n<=6&&(0===e||6===e)||e>=0&&e<=6&&(0===n||6===n)||n>=2&&n<=4&&e>=2&&e<=4,!0)}}(y,a),function(t){const n=t.size;for(let r=8;r<n-8;r++){const n=r%2==0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}(y),function(t,n){const r=o.getPositions(n);for(let n=0;n<r.length;n++){const e=r[n][0],o=r[n][1];for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)t.set(e+n,o+r,-2===n||2===n||-2===r||2===r||0===n&&0===r,!0)}}(y,a),d(y,w,0),a>=7&&function(t,n){const r=t.size,e=f.getEncodedBits(n);let o,i,u;for(let n=0;n<18;n++)o=Math.floor(n/3),i=n%3+r-8-3,u=1==(e>>n&1),t.set(o,i,u,!0),t.set(i,o,u,!0)}(y,a),function(t,n){const r=t.size;let e=-1,o=r-1,i=7,u=0;for(let c=r-1;c>0;c-=2)for(6===c&&c--;;){for(let r=0;r<2;r++)if(!t.isReserved(o,c-r)){let e=!1;u<n.length&&(e=1==(n[u]>>>i&1)),t.set(o,c-r,e),i--,-1===i&&(u++,i=7)}if(o+=e,o<0||r<=o){o-=e,e=-e;break}}}(y,g),isNaN(p)&&(p=u.getBestMask(y,d.bind(null,y,w))),u.applyMask(p,y),d(y,w,p),{modules:y,version:a,errorCorrectionLevel:w,maskPattern:p,segments:v}}return w.create=function(r,e){if(void 0===r||""===r)throw new Error("No input text");let o,i,c=n.M;return void 0!==e&&(c=n.from(e.errorCorrectionLevel,n.M),o=f.from(e.version),i=u.from(e.maskPattern),e.toSJISFunc&&t.setToSJISFunction(e.toSJISFunc)),p(r,o,c,i)},w}var dt,wt,pt={},vt={};function mt(){return dt||(dt=1,function(t){function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||5===n.length||n.length>8)throw new Error("Invalid hex color: "+t);3!==n.length&&4!==n.length||(n=Array.prototype.concat.apply([],n.map((function(t){return[t,t]})))),6===n.length&&n.push("F","F");const r=parseInt(n.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const r=t.width&&t.width>=21?t.width:void 0;return{width:r,scale:r?4:t.scale||4,margin:null==t.margin||t.margin<0?4:t.margin,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,n){return n.width&&n.width>=t+2*n.margin?n.width/(t+2*n.margin):n.scale},t.getImageWidth=function(n,r){const e=t.getScale(n,r);return Math.floor((n+2*r.margin)*e)},t.qrToImageData=function(n,r,e){const o=r.modules.size,i=r.modules.data,u=t.getScale(o,e),c=Math.floor((o+2*e.margin)*u),s=e.margin*u,f=[e.color.light,e.color.dark];for(let t=0;t<c;t++)for(let r=0;r<c;r++){let a=4*(t*c+r),h=e.color.light;t>=s&&r>=s&&t<c-s&&r<c-s&&(h=f[i[Math.floor((t-s)/u)*o+Math.floor((r-s)/u)]?1:0]),n[a++]=h.r,n[a++]=h.g,n[a++]=h.b,n[a]=h.a}}}(vt)),vt}var gt,Et,yt={};var At=function(){if(Et)return h;Et=1;const t=l(),n=lt(),r=(wt||(wt=1,function(t){const n=mt();t.render=function(t,r,e){let o=e,i=r;void 0!==o||r&&r.getContext||(o=r,r=void 0),r||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=n.getOptions(o);const u=n.getImageWidth(t.modules.size,o),c=i.getContext("2d"),s=c.createImageData(u,u);return n.qrToImageData(s.data,t,o),function(t,n,r){t.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=r,n.width=r,n.style.height=r+"px",n.style.width=r+"px"}(c,i,u),c.putImageData(s,0,0),i},t.renderToDataURL=function(n,r,e){let o=e;return void 0!==o||r&&r.getContext||(o=r,r=void 0),o||(o={}),t.render(n,r,o).toDataURL(o.type||"image/png",(o.rendererOpts||{}).quality)}}(pt)),pt),e=function(){if(gt)return yt;gt=1;const t=mt();function n(t,n){const r=t.a/255,e=n+'="'+t.hex+'"';return r<1?e+" "+n+'-opacity="'+r.toFixed(2).slice(1)+'"':e}function r(t,n,r){let e=t+n;return void 0!==r&&(e+=" "+r),e}return yt.render=function(e,o,i){const u=t.getOptions(o),c=e.modules.size,s=e.modules.data,f=c+2*u.margin,a=u.color.light.a?"<path "+n(u.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",h="<path "+n(u.color.dark,"stroke")+' d="'+function(t,n,e){let o="",i=0,u=!1,c=0;for(let s=0;s<t.length;s++){const f=Math.floor(s%n),a=Math.floor(s/n);f||u||(u=!0),t[s]?(c++,s>0&&f>0&&t[s-1]||(o+=u?r("M",f+e,.5+a+e):r("m",i,0),i=0,u=!1),f+1<n&&t[s+1]||(o+=r("h",c),c=0)):i++}return o}(s,c,u.margin)+'"/>',l='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+'viewBox="0 0 '+f+" "+f+'" shape-rendering="crispEdges">'+a+h+"</svg>\n";return"function"==typeof i&&i(null,l),l},yt}();function o(r,e,o,i,u){const c=[].slice.call(arguments,1),s=c.length,f="function"==typeof c[s-1];if(!f&&!t())throw new Error("Callback required as last argument");if(!f){if(s<1)throw new Error("Too few arguments provided");return 1===s?(o=e,e=i=void 0):2!==s||e.getContext||(i=o,o=e,e=void 0),new Promise((function(t,u){try{const u=n.create(o,i);t(r(u,e,i))}catch(t){u(t)}}))}if(s<2)throw new Error("Too few arguments provided");2===s?(u=o,o=e,e=i=void 0):3===s&&(e.getContext&&void 0===u?(u=i,i=void 0):(u=i,i=o,o=e,e=void 0));try{const t=n.create(o,i);u(null,r(t,e,i))}catch(t){u(t)}}return h.create=n.create,h.toCanvas=o.bind(null,r.render),h.toDataURL=o.bind(null,r.renderToDataURL),h.toString=o.bind(null,(function(t,n,r){return e.render(t,r)})),h}(),Mt=o(At);const bt=class{constructor(r){t(this,r),this.errorEvent=n(this,"error-event",7),this.size=256}componentWillLoad(){s(),this.analytics=new c(this)}componentDidLoad(){this.renderQrCode()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.renderQrCode()}get checkoutUrl(){return`https://components.justifi.ai/hosted-checkout/${this.checkoutId}`}async renderQrCode(){if(!this.checkoutId)return void this.errorEvent.emit({message:"checkoutId is required",errorCode:u.MISSING_PROPS,severity:i.ERROR});if(!this.qrContainerEl)return;const t=await Mt.toString(this.checkoutUrl,{type:"svg",width:this.size,errorCorrectionLevel:"M"});this.qrContainerEl.innerHTML=t}render(){return this.checkoutId?r("div",{ref:t=>this.qrContainerEl=t}):null}get el(){return e(this)}static get watchers(){return{checkoutId:["propChanged"],size:["propChanged"]}}};export{bt as justifi_checkout_qr_code}
@@ -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-D9sqTVmd.js";import{f as o}from"./p-BSs-2JKu.js";import"./p-DVJaoI_m.js";import{R as a,C as u,b as h,q as l}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{B as c}from"./p-CHo7TfsM.js";import{S as d}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{P as m}from"./p-NzPaWKbY.js";import{m as p}from"./p-BB8Ce9rp.js";import{J as f}from"./p-_GBnYSuR.js";import{c as v}from"./p-CQqmTKij.js";import{g as y,a as j}from"./p-CdwzNfP1.js";import{A as b}from"./p-De4Pig-y.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-DNd24RUQ.js";const T=t=>{const e=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${o(e)}`,(function(t){return+t<=+e})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},C=t=>{if(t)return r({amount:T(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"}],P=b();class S{async postRefund(t,e,s,r){return P.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":e},body:r,authToken:s})}}const I=b();class R{async postVoid(t,e,s){return I.post({endpoint:`payments/${t}/void`,headers:{"Sub-Account":e},authToken:s})}}const A=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),k=()=>t(d,null,t("div",{class:"row gap-5"},t(A,null),t(A,null),t(A,null))),x=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(C())}handleError(t,e,s){this.errorEvent.emit({errorCode:t,message:e,severity:s})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(h.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",u.ERROR)}isPaymentCreatedWithin25Minutes(){var t;if(!this.payment||!(null===(t=this.payment)||void 0===t?void 0:t.created_at))return!1;const e=new Date(this.payment.created_at);return((new Date).getTime()-e.getTime())/6e4<=25}initializeFormController(){const t=this.refundPayload.amount,e=t?t.toString():"0";this.formController=new n(C(e)),this.formController.setInitialValues({amount:e}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?p({id:this.paymentId,authToken:this.authToken,service:new m})({onSuccess:({payment:t})=>{this.payment=t,this.refundPayload=new l({amount:t.amount_refundable})},onError:({error:t,code:e,severity:s})=>{this.handleError(e,t,s)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(h.MISSING_PROPS,"Payment ID and Auth Token are required",u.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const e=this.formController.values.getValue();return this.refundLoading=!0,this.isPaymentCreatedWithin25Minutes()?this.tryVoidPayment():this.processRefund(e)}async tryVoidPayment(){const t=(({authToken:t,accountId:e,paymentId:s,service:r})=>async({onSuccess:i,onError:n,final:o})=>{var a;try{const o=await r.postVoid(s,e,t);if(o.error)return n({error:j(o.error),code: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{o()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new R});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{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(k,null);const e=this.formController.getInitialValues(),s=this.refundPayload.amount;return t(d,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:e.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:e.reason,inputHandler:this.inputHandler,options: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{x as justifi_refund_payment}
@@ -0,0 +1 @@
1
+ import{a as e}from"./p-D9sqTVmd.js";import{P as a,a as t}from"./p-DPA5TKvQ.js";import{S as s,C as r}from"./p-BcNb9bVO.js";import{a as n,c as i}from"./p-BBSnDYJw.js";const l=[{label:"Choose state / province",value:""},...s.filter((e=>""!==e.value)),...a.filter((e=>""!==e.value))],d=e=>""===e?null:e,o=/^\d+$/,c=/P\.?\s?O\.?\s?Box|Postal\sBox/i,u=e().email("Enter valid email").transform(d),m=e().matches(/^\d{10}$/,"Enter valid phone number").transform(d),b=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(d),v=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(d),h=e().matches(/^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/,"Enter valid website url").transform(d),N=e().transform(d),E=e().min(2,"Industry must be at least 2 characters").max(50,"Industry must be less than 50 characters").transform(d),p=e().matches(o,"Enter valid tax id, SSN, or EIN").test("not-repeat","Enter valid tax id, SSN, or EIN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid tax id, SSN, or EIN",(e=>"123456789"!==e)).transform(d),S=a=>e().matches(t[a].postalRegex,"Enter valid postal code").transform(d),B=a=>a===r.CAN?e().matches(o,"Enter valid SIN").length(t[a].identityDigits,"Enter valid SIN").test("not-repeat","Enter valid SIN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid SIN",(e=>"123456789"!==e)).transform(d):y,A=a=>a===r.CAN?e().matches(o,"Enter valid Business Number (BN)").length(t[a].taxIdDigits,"Enter valid Business Number (BN)").test("not-repeat","Enter valid Business Number (BN)",(e=>!e||!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid Business Number (BN)",(e=>!e||"123456789"!==e)).transform(d):p,w=e().test("not-future","Date of incorporation cannot be in the future",(e=>new Date(e)<=new Date)).transform(d),g=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(d),x=e().min(2,"Title must be at least 2 characters").max(50,"Title must be less than 50 characters").transform(d),$=a=>e().test("min","Enter a valid date",(e=>new Date(e)>=new Date("1902-01-01"))).test("age",`${a} must be at least 18 years old`,(e=>{const a=new Date(e),t=new Date;return t.setFullYear(t.getFullYear()-18),a<=t})).transform(d),y=e().matches(/^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/,"Enter valid SSN").when("ssn_last4",{is:e=>!e||0===e.length,then:e=>e.required("Enter SSN"),otherwise:e=>e.nullable()}).test("not-repeat","Enter valid SSN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid SSN",(e=>"123456789"!==e)).transform(d),D=e().matches(o,"Enter valid percentage").test("min","Percentage must be at least 0",(e=>!e||parseFloat(e)>=0)).test("max","Percentage must be at most 100",(e=>!e||parseFloat(e)<=100)).transform(d),f=e().min(5,"Address must be at least 5 characters").max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!c.test(e))).transform(d),I=e().max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!c.test(e))).transform(d),P=e().min(2,"City must be at least 2 characters").max(50,"City must be less than 50 characters").transform(d),q=e().oneOf(l.map((e=>e.value)),"Select a valid state or province").transform(d),j=e().matches(/^((\d{5}-\d{4})|(\d{5})|([A-Z]\d[A-Z]\s\d[A-Z]\d))$/,"Enter valid postal code").transform(d),C=e().matches(o,"Enter valid revenue").transform(d),Z=e().matches(o,"Enter valid payment volume").transform(d),z=e().oneOf(n.map((e=>e.value)),"Select when service is received").transform(d),O=e().transform(d),T=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(d),F=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(d),_=e().oneOf(i.map((e=>e.value)),"Select account type").transform(d),V=e().min(4,"Account number must be at least 4 digits").max(17,"Account number must be less than 17 digits").matches(o,"Enter valid account number").test("not-repeat","Enter valid account number",(e=>!/^(\d)\1+$/.test(e))).transform(d),k=e().length(9,"Routing number must be 9 digits").matches(o,"Enter valid routing number").test("not-repeat","Enter valid routing number",(e=>!e||!/^(\d)\1+$/.test(e))).test("valid","Enter valid routing number",(e=>!e||(e=>{if(!e)return!1;const a=Array.from(String(e),Number);return 9===a.length&&0==(3*(a[0]+a[3]+a[6])+7*(a[1]+a[4]+a[7])+(a[2]+a[5]+a[8]))%10})(e))).transform(d);export{l as A,V as B,_ as C,F as D,T as E,o as F,k as G,v as a,N as b,b as c,w as d,u as e,z as f,Z as g,P as h,E as i,f as j,S as k,I as l,A as m,D as n,O as o,m as p,$ as q,C as r,y as s,p as t,x as u,g as v,h as w,B as x,j as y,q as z}
@@ -1 +1 @@
1
- import{C as t}from"./p-CSgcCWLS.js";import{g as a,a as e}from"./p-Cg_3KsGO.js";import{h as r}from"./p-CV0Pyo1O.js";import{B as n,a as i}from"./p-CHw7tICr.js";const o=({authToken:r,service:n})=>async({payoutId:i,onError:o})=>{try{const{data:t}=await n.fetchCSV(i,r),a=document.createElement("a");a.href=t.csv_url,a.click()}catch(r){o({error:e(r),code:a(null==r?void 0:r.code),severity:t.ERROR})}},d=t=>r(i,Object.assign({},{canceled:{variant:n.DANGER,title:"Transfer to your bank account failed",text:"Canceled"},failed:{variant:n.DANGER,title:"Transfer to your bank account failed",text:"Failed"},forwarded:{variant:n.SECONDARY,title:"This payout initially failed; the funds have been forwarded to your next successful payout",text:"Forwarded"},in_transit:{variant:n.PRIMARY,title:"Transfer to your bank account has been initiated",text:"In Transit"},paid:{variant:n.SUCCESS,title:"Successfully deposited into your bank account",text:"Paid"},pending:{variant:n.PRIMARY,title:"Batched and scheduled to be transferred",text:"Pending"},scheduled:{variant:n.PRIMARY,title:"Batched and scheduled to be transferred",text:"Scheduled"},withdrawn:{variant:n.SUCCESS,title:"Negative payout balance successfully withdrawn from your bank account",text:"Withdrawn"}}[t]));export{d as M,o as m}
1
+ import{C as t}from"./p-DXTa04jn.js";import{g as a,a as e}from"./p-CdwzNfP1.js";import{h as r}from"./p-CV0Pyo1O.js";import{B as n,a as i}from"./p-CHw7tICr.js";const o=({authToken:r,service:n})=>async({payoutId:i,onError:o})=>{try{const{data:t}=await n.fetchCSV(i,r),a=document.createElement("a");a.href=t.csv_url,a.click()}catch(r){o({error:e(r),code:a(null==r?void 0:r.code),severity:t.ERROR})}},d=t=>r(i,Object.assign({},{canceled:{variant:n.DANGER,title:"Transfer to your bank account failed",text:"Canceled"},failed:{variant:n.DANGER,title:"Transfer to your bank account failed",text:"Failed"},forwarded:{variant:n.SECONDARY,title:"This payout initially failed; the funds have been forwarded to your next successful payout",text:"Forwarded"},in_transit:{variant:n.PRIMARY,title:"Transfer to your bank account has been initiated",text:"In Transit"},paid:{variant:n.SUCCESS,title:"Successfully deposited into your bank account",text:"Paid"},pending:{variant:n.PRIMARY,title:"Batched and scheduled to be transferred",text:"Pending"},scheduled:{variant:n.PRIMARY,title:"Batched and scheduled to be transferred",text:"Scheduled"},withdrawn:{variant:n.SUCCESS,title:"Negative payout balance successfully withdrawn from your bank account",text:"Withdrawn"}}[t]));export{d as M,o as m}