@justifi/webcomponents 6.0.0 → 6.0.1-rc.0

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 (232) hide show
  1. package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +2 -2
  2. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  3. package/dist/cjs/card-form.cjs.entry.js +2 -2
  4. package/dist/cjs/{check-pkg-version-7FBAUhHw.js → check-pkg-version-B48ZmuJS.js} +1 -1
  5. package/dist/cjs/checkouts-list-core.cjs.entry.js +1 -1
  6. package/dist/cjs/form-alert_5.cjs.entry.js +4 -4
  7. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  8. package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +2 -2
  9. package/dist/cjs/form-control-number-masked_2.cjs.entry.js +1 -1
  10. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  11. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +9 -9
  12. package/dist/cjs/justifi-apple-pay.cjs.entry.js +1 -1
  13. package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +6 -6
  14. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +1 -1
  17. package/dist/cjs/justifi-checkout-summary_7.cjs.entry.js +15 -7
  18. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
  19. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
  20. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
  21. package/dist/cjs/justifi-details.cjs.entry.js +1 -1
  22. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  24. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  25. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  26. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +3 -3
  27. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  28. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +1 -1
  29. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +3 -3
  30. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  31. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  32. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  33. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  34. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  35. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  36. package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
  37. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  38. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  39. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  40. package/dist/cjs/loader.cjs.js +1 -1
  41. package/dist/cjs/{package-BNN5fdIc.js → package-C3FMDKcV.js} +1 -1
  42. package/dist/cjs/pagination-menu.cjs.entry.js +3 -3
  43. package/dist/cjs/webcomponents.cjs.js +1 -1
  44. package/dist/collection/api/services/apple-pay.service.js +1 -1
  45. package/dist/collection/collection-manifest.json +1 -1
  46. package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +6 -6
  47. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +1 -1
  48. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +6 -6
  49. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +6 -6
  50. package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +1 -1
  51. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +1 -1
  52. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +6 -6
  53. package/dist/collection/components/business-forms/owner-form/owner-form.js +1 -1
  54. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +1 -1
  55. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-document-inputs.js +1 -1
  56. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-form-inputs.js +1 -1
  57. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +1 -1
  58. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
  59. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +1 -1
  60. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +1 -1
  61. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +1 -1
  62. package/dist/collection/components/business-forms/payment-provisioning/form-control-monetary-provisioning.js +2 -2
  63. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +1 -1
  64. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +1 -1
  65. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-buttons.js +1 -1
  66. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +1 -1
  67. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +1 -1
  68. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +1 -1
  69. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +2 -2
  70. package/dist/collection/components/checkout/card-form/card-form.js +2 -2
  71. package/dist/collection/components/checkout/checkout.js +2 -2
  72. package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
  73. package/dist/collection/components/checkout/saved-payment-method.js +1 -1
  74. package/dist/collection/components/checkouts-list/checkouts-list-core.js +1 -1
  75. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +1 -1
  76. package/dist/collection/components/checkouts-list/checkouts-list.js +1 -1
  77. package/dist/collection/components/modular-checkout/modular-checkout.js +15 -8
  78. package/dist/collection/components/modular-checkout/sub-components/bank-account-billing-form-simple.js +1 -1
  79. package/dist/collection/components/modular-checkout/sub-components/card-billing-form-simple.js +1 -1
  80. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +2 -3
  81. package/dist/collection/ui-components/details/details.js +1 -1
  82. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  83. package/dist/collection/ui-components/pagination-menu/pagination-menu.js +3 -3
  84. package/dist/collection/ui-components/shadow-dom-components/justifi-radio-list-item.js +1 -1
  85. package/dist/docs.json +18 -97
  86. package/dist/esm/bank-account-document-form-inputs_4.entry.js +2 -2
  87. package/dist/esm/bank-account-form.entry.js +2 -2
  88. package/dist/esm/card-form.entry.js +2 -2
  89. package/dist/esm/{check-pkg-version-BUkwdVdm.js → check-pkg-version-DSO4z-Vx.js} +1 -1
  90. package/dist/esm/checkouts-list-core.entry.js +1 -1
  91. package/dist/esm/form-alert_5.entry.js +4 -4
  92. package/dist/esm/form-control-checkbox.entry.js +2 -2
  93. package/dist/esm/form-control-monetary-provisioning.entry.js +2 -2
  94. package/dist/esm/form-control-number-masked_2.entry.js +1 -1
  95. package/dist/esm/hidden-input_2.entry.js +1 -1
  96. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +9 -9
  97. package/dist/esm/justifi-apple-pay.entry.js +1 -1
  98. package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +6 -6
  99. package/dist/esm/justifi-business-details.entry.js +2 -2
  100. package/dist/esm/justifi-business-form.entry.js +2 -2
  101. package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
  102. package/dist/esm/justifi-checkout-summary_7.entry.js +15 -7
  103. package/dist/esm/justifi-checkout.entry.js +4 -4
  104. package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
  105. package/dist/esm/justifi-checkouts-list.entry.js +3 -3
  106. package/dist/esm/justifi-details.entry.js +1 -1
  107. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  108. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  109. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  110. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  111. package/dist/esm/justifi-owner-form_3.entry.js +3 -3
  112. package/dist/esm/justifi-payment-details.entry.js +2 -2
  113. package/dist/esm/justifi-payment-provisioning-core.entry.js +1 -1
  114. package/dist/esm/justifi-payment-provisioning.entry.js +3 -3
  115. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  116. package/dist/esm/justifi-payments-list.entry.js +2 -2
  117. package/dist/esm/justifi-payout-details.entry.js +2 -2
  118. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  119. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  120. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  121. package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
  122. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  123. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  124. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  125. package/dist/esm/loader.js +1 -1
  126. package/dist/esm/{package-BBpkkt2-.js → package-tyhA5jkt.js} +1 -1
  127. package/dist/esm/pagination-menu.entry.js +3 -3
  128. package/dist/esm/webcomponents.js +1 -1
  129. package/dist/module/additional-questions.js +2 -2
  130. package/dist/module/bank-account-billing-form-simple.js +1 -1
  131. package/dist/module/bank-account-document-inputs.js +1 -1
  132. package/dist/module/bank-account-form-inputs2.js +1 -1
  133. package/dist/module/bank-account-form.js +2 -2
  134. package/dist/module/business-additional-questions-form-step.js +1 -1
  135. package/dist/module/business-bank-account-form-step.js +1 -1
  136. package/dist/module/business-core-info-form-step.js +1 -1
  137. package/dist/module/business-core-info.js +1 -1
  138. package/dist/module/business-owners-form-step.js +1 -1
  139. package/dist/module/business-representative-form-inputs.js +1 -1
  140. package/dist/module/business-representative-form-step.js +1 -1
  141. package/dist/module/business-representative.js +2 -2
  142. package/dist/module/business-terms-conditions-form-step.js +1 -1
  143. package/dist/module/card-billing-form-simple.js +1 -1
  144. package/dist/module/card-form.js +2 -2
  145. package/dist/module/checkouts-list-core2.js +1 -1
  146. package/dist/module/details.js +1 -1
  147. package/dist/module/form-control-checkbox2.js +2 -2
  148. package/dist/module/form-control-monetary-provisioning2.js +2 -2
  149. package/dist/module/identity-address-form.js +1 -1
  150. package/dist/module/justifi-apple-pay.js +1 -1
  151. package/dist/module/justifi-checkout.js +2 -2
  152. package/dist/module/justifi-checkouts-list-filters.js +1 -1
  153. package/dist/module/justifi-checkouts-list.js +1 -1
  154. package/dist/module/justifi-payment-provisioning.js +1 -1
  155. package/dist/module/justifi-radio-list-item2.js +1 -1
  156. package/dist/module/justifi-saved-payment-method.js +1 -1
  157. package/dist/module/legal-address-form-step.js +1 -1
  158. package/dist/module/legal-address-form.js +2 -2
  159. package/dist/module/modular-checkout.js +13 -5
  160. package/dist/module/owner-form-core2.js +1 -1
  161. package/dist/module/owner-form-inputs2.js +2 -2
  162. package/dist/module/owner-form.js +1 -1
  163. package/dist/module/package.js +1 -1
  164. package/dist/module/pagination-menu2.js +3 -3
  165. package/dist/module/payment-provisioning-core.js +1 -1
  166. package/dist/module/payment-provisioning-form-buttons.js +1 -1
  167. package/dist/module/payment-provisioning-form-steps.js +1 -1
  168. package/dist/module/save-new-payment-method.js +1 -1
  169. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +1 -1
  170. package/dist/types/components.d.ts +8 -10
  171. package/dist/webcomponents/{p-3152c84f.entry.js → p-037d7061.entry.js} +1 -1
  172. package/dist/webcomponents/{p-265d0a1d.entry.js → p-070c29ce.entry.js} +1 -1
  173. package/dist/webcomponents/{p-44e32f85.entry.js → p-10278c48.entry.js} +1 -1
  174. package/dist/webcomponents/p-19ccbeee.entry.js +1 -0
  175. package/dist/webcomponents/{p-9c4079cc.entry.js → p-1b3b6956.entry.js} +1 -1
  176. package/dist/webcomponents/p-1c433962.entry.js +1 -0
  177. package/dist/webcomponents/{p-a7e40e91.entry.js → p-1d7139d3.entry.js} +1 -1
  178. package/dist/webcomponents/{p-d7555ff1.entry.js → p-214fa6e0.entry.js} +1 -1
  179. package/dist/webcomponents/p-2d818d44.entry.js +1 -0
  180. package/dist/webcomponents/{p-17f7590c.entry.js → p-30147031.entry.js} +1 -1
  181. package/dist/webcomponents/{p-f7690165.entry.js → p-4215ea76.entry.js} +1 -1
  182. package/dist/webcomponents/{p-7cb6cc9f.entry.js → p-4b1abc3b.entry.js} +1 -1
  183. package/dist/webcomponents/p-4d5c71c4.entry.js +1 -0
  184. package/dist/webcomponents/p-62a16ef9.entry.js +1 -0
  185. package/dist/webcomponents/p-65286b2b.entry.js +1 -0
  186. package/dist/webcomponents/{p-f99e4566.entry.js → p-6af851c5.entry.js} +1 -1
  187. package/dist/webcomponents/{p-2a43e77f.entry.js → p-6d4ae6c7.entry.js} +1 -1
  188. package/dist/webcomponents/p-7494c1b6.entry.js +1 -0
  189. package/dist/webcomponents/p-8018523d.entry.js +1 -0
  190. package/dist/webcomponents/{p-bc3cdc7b.entry.js → p-83fa6da1.entry.js} +1 -1
  191. package/dist/webcomponents/p-84ccc7bb.entry.js +1 -0
  192. package/dist/webcomponents/p-8975bf93.entry.js +1 -0
  193. package/dist/webcomponents/{p-9fc464eb.entry.js → p-9046afd6.entry.js} +1 -1
  194. package/dist/webcomponents/{p-a928c6fb.entry.js → p-914e168d.entry.js} +1 -1
  195. package/dist/webcomponents/p-91c1e2ac.entry.js +1 -0
  196. package/dist/webcomponents/{p-146de253.entry.js → p-9f04cac4.entry.js} +1 -1
  197. package/dist/webcomponents/{p-D_5McRD_.js → p-CtA2NMVz.js} +1 -1
  198. package/dist/webcomponents/{p-82781411.entry.js → p-a0909318.entry.js} +1 -1
  199. package/dist/webcomponents/p-a57c1400.entry.js +1 -0
  200. package/dist/webcomponents/p-a85cf3e0.entry.js +1 -0
  201. package/dist/webcomponents/{p-005efe51.entry.js → p-bb03a95a.entry.js} +1 -1
  202. package/dist/webcomponents/{p-3e320c0d.entry.js → p-d2259dfd.entry.js} +1 -1
  203. package/dist/webcomponents/{p-7e04d5af.entry.js → p-d8e5d7b7.entry.js} +1 -1
  204. package/dist/webcomponents/{p-c70e1aac.entry.js → p-df385efe.entry.js} +1 -1
  205. package/dist/webcomponents/p-df7f36aa.entry.js +1 -0
  206. package/dist/webcomponents/p-e035a92e.entry.js +1 -0
  207. package/dist/webcomponents/p-e628a0c8.entry.js +1 -0
  208. package/dist/webcomponents/{p-c262d10f.entry.js → p-e7edf4f4.entry.js} +1 -1
  209. package/dist/webcomponents/p-eafd179b.entry.js +1 -0
  210. package/dist/webcomponents/{p-f8cbcbe9.entry.js → p-ffe01f1b.entry.js} +1 -1
  211. package/dist/webcomponents/p-tyhA5jkt.js +1 -0
  212. package/dist/webcomponents/webcomponents.esm.js +1 -1
  213. package/package.json +13 -13
  214. package/LICENSE +0 -21
  215. package/dist/webcomponents/p-0142114f.entry.js +0 -1
  216. package/dist/webcomponents/p-0d8fe5f2.entry.js +0 -1
  217. package/dist/webcomponents/p-20f036cc.entry.js +0 -1
  218. package/dist/webcomponents/p-25484e99.entry.js +0 -1
  219. package/dist/webcomponents/p-30c414b5.entry.js +0 -1
  220. package/dist/webcomponents/p-3906296f.entry.js +0 -1
  221. package/dist/webcomponents/p-5c3d8de5.entry.js +0 -1
  222. package/dist/webcomponents/p-6fdc03bc.entry.js +0 -1
  223. package/dist/webcomponents/p-7b103dad.entry.js +0 -1
  224. package/dist/webcomponents/p-8467851a.entry.js +0 -1
  225. package/dist/webcomponents/p-8d3f5638.entry.js +0 -1
  226. package/dist/webcomponents/p-9d7b5d07.entry.js +0 -1
  227. package/dist/webcomponents/p-BBpkkt2-.js +0 -1
  228. package/dist/webcomponents/p-b90999af.entry.js +0 -1
  229. package/dist/webcomponents/p-cecb65c4.entry.js +0 -1
  230. package/dist/webcomponents/p-df329742.entry.js +0 -1
  231. package/dist/webcomponents/p-ea2a9a81.entry.js +0 -1
  232. package/dist/webcomponents/p-f6fbd43d.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as p}from"./p-D_5McRD_.js";import{P as a}from"./p-De8UloOS.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{d as n}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as j}from"./p-C1xGBPma.js";import{S as d}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-D-JYHdJ7.js";import"./p-BBpkkt2-.js";import"./p-BUa0YOaw.js";import"./p-BHf9IqGw.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-fUtq2xDs.js";import"./p-D--yCspA.js";import"./p-RvUQ__Pq.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=l,this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new a};this.getPayouts=(({id:t,authToken:s,service:i})=>async({params:r,onSuccess:e,onError:p})=>{var a,m;try{const u=await i.fetchPayouts(t,s,r);if(u.error)return p({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);e({payouts:(null===(a=u.data)||void 0===a?void 0:a.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:o.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new j}))}render(){return i(d,{key:"73ac65b309e80186e0f7799385d012e91ceb1b8b"},i("payouts-list-core",{key:"f7767376f3155521445cb2ee48b9a20c362c8137",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_payouts_list}
1
+ import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as p}from"./p-CtA2NMVz.js";import{P as a}from"./p-De8UloOS.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{d as n}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as j}from"./p-C1xGBPma.js";import{S as d}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-D-JYHdJ7.js";import"./p-tyhA5jkt.js";import"./p-BUa0YOaw.js";import"./p-BHf9IqGw.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-fUtq2xDs.js";import"./p-D--yCspA.js";import"./p-RvUQ__Pq.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=l,this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new a};this.getPayouts=(({id:t,authToken:s,service:i})=>async({params:r,onSuccess:e,onError:p})=>{var a,m;try{const u=await i.fetchPayouts(t,s,r);if(u.error)return p({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);e({payouts:(null===(a=u.data)||void 0===a?void 0:a.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:o.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new j}))}render(){return i(d,{key:"73ac65b309e80186e0f7799385d012e91ceb1b8b"},i("payouts-list-core",{key:"f7767376f3155521445cb2ee48b9a20c362c8137",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_payouts_list}
@@ -0,0 +1 @@
1
+ import{r as s,h as t}from"./p-qipqIMyC.js";import{E as i}from"./p-BIPdn2VU.js";import"./p-RvUQ__Pq.js";const a=class{constructor(t){s(this,t)}render(){return t("div",{key:"026afe404e83a58245d2c0d68b188a5b227933b4"},this.errorMessage?i(this.errorMessage):t("main",{class:"p-2"},t("slot",{name:"head-info"}),t("slot",{name:"detail-sections"})))}};export{a as justifi_details}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as r}from"./p-qipqIMyC.js";import{A as o}from"./p-BUa0YOaw.js";import{C as i,a as e}from"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as a,a as p}from"./p-D2muobcE.js";import{E as n}from"./p-BIPdn2VU.js";import{c as h,J as c}from"./p-CtA2NMVz.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-RvUQ__Pq.js";import"./p-tyhA5jkt.js";const m=o();class u{async fetchGrossVolumeChartData(t,s){return m.get({endpoint:`account/${t}/reports/gross_volume`,authToken:s})}}const d=class{constructor(r){t(this,r),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){h(),this.analytics=new c(this),this.initializeGetGrossPayment()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:t,authToken:s,service:r})=>async({onSuccess:o,onError:e})=>{var n;try{const h=await r.fetchGrossVolumeChartData(t,s);h.error?e({error:p(h.error),code:a(null===(n=h.error)||void 0===n?void 0:n.code),severity:i.ERROR}):o(h.data)}catch(t){const s=a(null==t?void 0:t.code);e({error:p(t),code:s,severity:i.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new u}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_gross_payment_chart}
@@ -0,0 +1 @@
1
+ import{h as s,r as i,c as t}from"./p-qipqIMyC.js";import{c as r,F as e}from"./p-CR9D6mKt.js";import{b as o,a}from"./p-DSP8qjHL.js";import{i as p,a as h}from"./p-PgEzcvI6.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as n,a as l}from"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import{B as m,b as c}from"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as d,J as j}from"./p-CtA2NMVz.js";import{B as u}from"./p-D6XirF21.js";import{S as f}from"./p-CLQx9p9q.js";import{H as v}from"./p-CQeex56P.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-Xv8DuU3Y.js";import{B as w}from"./p-XYgDHrVL.js";import{m as C,b as g}from"./p-5aA7gjr5.js";import{B as y}from"./p-B4idKqyn.js";import"./p-BFTU3MAI.js";import"./p-CYBR4K2p.js";import"./p-BX8GieXu.js";import"./p-yH3TC3ZQ.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-Dt-vy9Le.js";import"./p-tyhA5jkt.js";import"./p-BUa0YOaw.js";import"./p-RvUQ__Pq.js";import"./p-D2muobcE.js";const B=r(Object.assign(Object.assign({},o().fields),{legal_address:h(),additional_questions:a(),representative:p("representative")})),q=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"25%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"50%"}),s(b,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"65%"}),s(b,{width:"35%"}))),x=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(b,{width:"40%",height:"40px"})),s(q,null),s(q,null),s(q,null)),k=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event"),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.isLoading=!1,this.isSaving=!1,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new m(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new m(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){d(),this.analytics=new j(this),this.formController=new e(B),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=C({authToken:this.authToken,businessId:this.businessId,service:new y}),this.patchBusiness=g({authToken:this.authToken,businessId:this.businessId,service:new y}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:l.MISSING_PROPS,severity:n.ERROR})}handleReponse(s){s.error&&(this.errorMessage=c.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(f,null,this.isLoading?s(x,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(v,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(u,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:w.submit}),isLoading:this.isSaving},"Submit")))))}};export{k as justifi_business_form}
@@ -1 +1 @@
1
- import{r,c as s,h as t}from"./p-qipqIMyC.js";import{S as i}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{c as o,J as e}from"./p-D_5McRD_.js";import{d as a}from"./p-CaxjN6Uo.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as n,a as p}from"./p-Cjcsf8ku.js";import{h as c}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as m,a as h}from"./p-D2muobcE.js";import{A as d}from"./p-BUa0YOaw.js";import"./p-BBpkkt2-.js";import"./p-RvUQ__Pq.js";import"./p-BHf9IqGw.js";import"./p-D--yCspA.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const l=d();class f{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const j=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=a,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){o(),this.analytics=new e(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:o,onError:e,final:a})=>{var p,d;try{const a=await t.fetchTerminalOrders(r,s,i);if(a.error)return e({error:h(a.error),code:m(null===(d=a.error)||void 0===d?void 0:d.code),severity:n.ERROR});{const r=Object.assign({},a.page_info);o({terminalOrders:(null===(p=a.data)||void 0===p?void 0:p.map((r=>new c(r))))||[],pagingInfo:r})}}catch(r){const s=m(null==r?void 0:r.code);return e({error:r.message||r,code:s,severity:n.ERROR})}finally{return a()}})({id:this.accountId,authToken:this.authToken,service:new f}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return t(i,{key:"55f0bf858787e00c304972c941a477815712df9d"},t("terminal-orders-list-core",{key:"2d47e23bc2157d79254f34dfe0551fb32a9d88cc",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{j as justifi_terminal_orders_list}
1
+ import{r,c as s,h as t}from"./p-qipqIMyC.js";import{S as i}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{c as o,J as e}from"./p-CtA2NMVz.js";import{d as a}from"./p-CaxjN6Uo.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as n,a as p}from"./p-Cjcsf8ku.js";import{h as c}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as m,a as h}from"./p-D2muobcE.js";import{A as d}from"./p-BUa0YOaw.js";import"./p-tyhA5jkt.js";import"./p-RvUQ__Pq.js";import"./p-BHf9IqGw.js";import"./p-D--yCspA.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const l=d();class j{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const f=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=a,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){o(),this.analytics=new e(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:o,onError:e,final:a})=>{var p,d;try{const a=await t.fetchTerminalOrders(r,s,i);if(a.error)return e({error:h(a.error),code:m(null===(d=a.error)||void 0===d?void 0:d.code),severity:n.ERROR});{const r=Object.assign({},a.page_info);o({terminalOrders:(null===(p=a.data)||void 0===p?void 0:p.map((r=>new c(r))))||[],pagingInfo:r})}}catch(r){const s=m(null==r?void 0:r.code);return e({error:r.message||r,code:s,severity:n.ERROR})}finally{return a()}})({id:this.accountId,authToken:this.authToken,service:new j}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return t(i,{key:"55f0bf858787e00c304972c941a477815712df9d"},t("terminal-orders-list-core",{key:"2d47e23bc2157d79254f34dfe0551fb32a9d88cc",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{f as justifi_terminal_orders_list}
@@ -1 +1 @@
1
- import{r as e,h as n,H as t,c as i,g as o}from"./p-qipqIMyC.js";import{c as r}from"./p-DsAwPf2y.js";import{i as a,b as s,a as c,c as d,l as u}from"./p-RvUQ__Pq.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-DCMrHeJI.js";import{p as h}from"./p-BBpkkt2-.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:b}=m,g=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}async componentDidLoad(){const e=await this.getBaseFontStyles();b("fontStyles",e);const n=await this.getFocusedStyles();b("focused",n);const t=await this.getFocusedAndInvalidStyles();b("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.hiddenInput.focus(),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.hiddenInput.focus(),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?a:this.errorText?s:this.isFocused?c:d}render(){return n(t,{key:"bf8fcd89cdc8fcd1bfd8b9af5a7211c877e482ba"},n("input",{key:"f202d9252b60195b193a8203f750730fcf2e271b",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,a="[iFrameSizer]",s=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){A(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=L(),window.iFrameResize=window.iFrameResize||L()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function b(e,n,t){e.removeEventListener(n,t,!1)}function g(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,g(e))}function v(e,n){x("info",e,n,g(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return a+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),C((function(){R(W),T(H),l("onResized",W)}),W,"init")}function t(e){var n=Number(u[H]["max"+e]),t=Number(u[H]["min"+e]),i=e.toLowerCase(),o=Number(W[i]);p(H,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(H,"Set "+i+" to min value")),o>n&&(o=n,p(H,"Set "+i+" to max value")),W[i]=""+o}function i(e){return A.slice(A.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;E("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=W.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return S(H),{x:Math.floor(Number(n.left)+Number(s.x)),y:Math.floor(Number(n.top)+Number(s.y))}}function c(e){var n=e?r(W.iframe):{x:0,y:0},t={x:Number(W.width)+n.x,y:Number(W.height)+n.y};p(H,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(s=t,d(),p(H,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(H,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",s)?j():T(H)}function f(e){var n={};if(0===Number(W.width)&&0===Number(W.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:W.width,y:W.height};l(e,{iframe:W.iframe,screenX:Number(n.x),screenY:Number(n.y),type:W.type})}function l(e,n){return z(H,e,n)}var m,g,y,x,I,F,A=e.data,W={},H=null;"[iFrameResizerChild]Ready"===A?function(){for(var e in u)E("iFrame requested init",N(e),u[e].iframe,e)}():a===(""+A).slice(0,13)&&A.slice(13).split(":")[0]in u?(x=(y=A.slice(13).split(":"))[1]?parseInt(y[1],10):0,I=u[y[0]]&&u[y[0]].iframe,F=getComputedStyle(I),W={iframe:I,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(F)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(F),width:y[2],type:y[3]},u[H=W.id]&&(u[H].loaded=!0),(g=W.type in{true:1,false:1,undefined:1})&&p(H,"Ignoring init message from meta parent page"),!g&&function(e){var n=!0;return u[e]||(n=!1,k(W.type+" No settings for "+e+". Message was: "+A)),n}(H)&&(p(H,"Received: "+A),m=!0,null===W.iframe&&(k(H,"IFrame ("+W.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[H]&&u[H].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(H,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(H,"Checking connection is from: "+(n=u[H]&&u[H].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+W.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[H]&&u[H].firstRun&&u[H]&&(u[H].firstRun=!1),W.type){case"close":M(W.iframe);break;case"message":m=i(6),p(H,"onMessage passed: {iframe: "+W.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:W.iframe,message:JSON.parse(m)}),p(H,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[H].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[H]&&u[H].iframe,H),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",b)}var t=H;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[H]&&u[H].stopPageInfo&&(u[H].stopPageInfo(),delete u[H].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",a=decodeURIComponent(t),(h=document.getElementById(a)||document.getElementsByName(a)[0])?(e=r(h),p(H,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),s={x:e.x,y:e.y},d(),p(H,"--")):window.top===window.self?p(H,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(H,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(W);break;case"init":n(),l("onInit",W.iframe);break;default:0===Number(W.width)&&0===Number(W.height)?k("Unsupported message received ("+W.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,a,h,m}())):v(H,"Ignored: "+A)}function z(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function F(e){delete u[e.id]}function M(e){var t=e.id;if(!1!==z(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}z(t,"onClosed",t),p(t,"--"),F(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function S(n){null===s&&p(n,"Get page position: "+(s={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+s.y)}function T(e){null!==s&&(window.scrollTo(s.x,s.y),p(e,"Set page position: "+s.x+","+s.y),j())}function j(){s=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),S(e.id),C((function(){R(e),E("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&E("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),W(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function E(e,n,t,i,o){var r,s=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(a+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||s||(s=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function N(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function A(t,r){function a(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(a,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),s=N(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&M(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){E("iFrame.onload",s,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),E("init",s,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:M.bind(null,u[f].iframe),removeListeners:F.bind(null,u[f].iframe),resize:E.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){E("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){E("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function W(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function H(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),W((function(){P("Tab Visible","resize")}),16))}function P(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&E(e,n,u[t].iframe,t)}))}function L(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),A(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",I),w(window,"resize",(function(){p("window","Trigger event: resize"),W((function(){P("Window resize","resize")}),16)})),w(document,"visibilitychange",H),w(document,"-webkit-visibilitychange",H),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded"),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?a:this.isValid?this.isFocused?c:d:s}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"c8a36a456afdfd883ae2ad8e05de98d307615b4c",class:"form-group d-flex flex-column"},n("div",{key:"580cdd90dd76289f78b688fcdb1486ecb7fe6c5a",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"7df8c29c720b5edf85553e5667c14eeb0ad6e2b6",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"3caeb47ddf3940e1b1a7fe08d8bd50b8123eb2c5",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"2fdff0682753d32292431a8d62d30a1647fa62ef",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"075ca2ca25623703280fda84ff119e4820f9a5cb",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{g as hidden_input,I as iframe_input}
1
+ import{r as e,h as n,H as t,c as i,g as o}from"./p-qipqIMyC.js";import{c as r}from"./p-DsAwPf2y.js";import{i as a,b as s,a as c,c as d,l as u}from"./p-RvUQ__Pq.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-DCMrHeJI.js";import{p as h}from"./p-tyhA5jkt.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:b}=m,g=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}async componentDidLoad(){const e=await this.getBaseFontStyles();b("fontStyles",e);const n=await this.getFocusedStyles();b("focused",n);const t=await this.getFocusedAndInvalidStyles();b("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.hiddenInput.focus(),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.hiddenInput.focus(),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?a:this.errorText?s:this.isFocused?c:d}render(){return n(t,{key:"bf8fcd89cdc8fcd1bfd8b9af5a7211c877e482ba"},n("input",{key:"f202d9252b60195b193a8203f750730fcf2e271b",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,a="[iFrameSizer]",s=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){A(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=L(),window.iFrameResize=window.iFrameResize||L()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function b(e,n,t){e.removeEventListener(n,t,!1)}function g(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,g(e))}function v(e,n){x("info",e,n,g(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return a+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),C((function(){R(W),j(H),l("onResized",W)}),W,"init")}function t(e){var n=Number(u[H]["max"+e]),t=Number(u[H]["min"+e]),i=e.toLowerCase(),o=Number(W[i]);p(H,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(H,"Set "+i+" to min value")),o>n&&(o=n,p(H,"Set "+i+" to max value")),W[i]=""+o}function i(e){return A.slice(A.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;E("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=W.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return S(H),{x:Math.floor(Number(n.left)+Number(s.x)),y:Math.floor(Number(n.top)+Number(s.y))}}function c(e){var n=e?r(W.iframe):{x:0,y:0},t={x:Number(W.width)+n.x,y:Number(W.height)+n.y};p(H,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(s=t,d(),p(H,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(H,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",s)?T():j(H)}function f(e){var n={};if(0===Number(W.width)&&0===Number(W.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:W.width,y:W.height};l(e,{iframe:W.iframe,screenX:Number(n.x),screenY:Number(n.y),type:W.type})}function l(e,n){return z(H,e,n)}var m,g,y,x,I,F,A=e.data,W={},H=null;"[iFrameResizerChild]Ready"===A?function(){for(var e in u)E("iFrame requested init",N(e),u[e].iframe,e)}():a===(""+A).slice(0,13)&&A.slice(13).split(":")[0]in u?(x=(y=A.slice(13).split(":"))[1]?parseInt(y[1],10):0,I=u[y[0]]&&u[y[0]].iframe,F=getComputedStyle(I),W={iframe:I,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(F)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(F),width:y[2],type:y[3]},u[H=W.id]&&(u[H].loaded=!0),(g=W.type in{true:1,false:1,undefined:1})&&p(H,"Ignoring init message from meta parent page"),!g&&function(e){var n=!0;return u[e]||(n=!1,k(W.type+" No settings for "+e+". Message was: "+A)),n}(H)&&(p(H,"Received: "+A),m=!0,null===W.iframe&&(k(H,"IFrame ("+W.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[H]&&u[H].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(H,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(H,"Checking connection is from: "+(n=u[H]&&u[H].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+W.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[H]&&u[H].firstRun&&u[H]&&(u[H].firstRun=!1),W.type){case"close":M(W.iframe);break;case"message":m=i(6),p(H,"onMessage passed: {iframe: "+W.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:W.iframe,message:JSON.parse(m)}),p(H,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[H].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[H]&&u[H].iframe,H),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",b)}var t=H;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[H]&&u[H].stopPageInfo&&(u[H].stopPageInfo(),delete u[H].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",a=decodeURIComponent(t),(h=document.getElementById(a)||document.getElementsByName(a)[0])?(e=r(h),p(H,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),s={x:e.x,y:e.y},d(),p(H,"--")):window.top===window.self?p(H,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(H,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(W);break;case"init":n(),l("onInit",W.iframe);break;default:0===Number(W.width)&&0===Number(W.height)?k("Unsupported message received ("+W.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,a,h,m}())):v(H,"Ignored: "+A)}function z(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function F(e){delete u[e.id]}function M(e){var t=e.id;if(!1!==z(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}z(t,"onClosed",t),p(t,"--"),F(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function S(n){null===s&&p(n,"Get page position: "+(s={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+s.y)}function j(e){null!==s&&(window.scrollTo(s.x,s.y),p(e,"Set page position: "+s.x+","+s.y),T())}function T(){s=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),S(e.id),C((function(){R(e),E("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&E("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),W(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function E(e,n,t,i,o){var r,s=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(a+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||s||(s=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function N(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function A(t,r){function a(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(a,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),s=N(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&M(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){E("iFrame.onload",s,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),E("init",s,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:M.bind(null,u[f].iframe),removeListeners:F.bind(null,u[f].iframe),resize:E.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){E("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){E("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function W(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function H(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),W((function(){P("Tab Visible","resize")}),16))}function P(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&E(e,n,u[t].iframe,t)}))}function L(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),A(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",I),w(window,"resize",(function(){p("window","Trigger event: resize"),W((function(){P("Window resize","resize")}),16)})),w(document,"visibilitychange",H),w(document,"-webkit-visibilitychange",H),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded"),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?a:this.isValid?this.isFocused?c:d:s}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"c8a36a456afdfd883ae2ad8e05de98d307615b4c",class:"form-group d-flex flex-column"},n("div",{key:"580cdd90dd76289f78b688fcdb1486ecb7fe6c5a",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"7df8c29c720b5edf85553e5667c14eeb0ad6e2b6",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"3caeb47ddf3940e1b1a7fe08d8bd50b8123eb2c5",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"2fdff0682753d32292431a8d62d30a1647fa62ef",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"075ca2ca25623703280fda84ff119e4820f9a5cb",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{g as hidden_input,I as iframe_input}
@@ -0,0 +1 @@
1
+ import{h as t,r as e,c as a}from"./p-qipqIMyC.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{f as n}from"./p-c4Mh3ZZ_.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c,J as o}from"./p-CtA2NMVz.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-CpKvg1ok.js";import{T as f,l,a as u,b as m,c as y,d as b,e as _,f as j,g,h as k,i as w,j as T,k as v}from"./p-BZ7C9duj.js";import{S as C}from"./p-CLQx9p9q.js";import{T as D}from"./p-CZfYo5-1.js";import{a as F}from"./p-BHf9IqGw.js";import{N as R,O as S}from"./p-RvUQ__Pq.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-tyhA5jkt.js";import"./p-BUa0YOaw.js";import"./p-xY5RkFuA.js";const q={created_at:()=>t("th",{part:R,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>t("th",{part:R,scope:"col",title:"The type of each transaction"},"Type"),id:()=>t("th",{part:R,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>t("th",{part:R,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>t("th",{part:R,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>t("th",{part:R,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>t("th",{part:R,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>t("th",{part:R,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>t("th",{part:R,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>t("th",{part:R,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>t("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",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},A={created_at:(e,a)=>t("td",{part:S(a)},t("div",{class:"fw-bold"},F(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},F(e.created_at,{showTime:!0}))),type:(e,a)=>t("td",{part:S(a)},x[e.payment_balance_txn_type]),id:(e,a)=>t("td",{part:S(a)},e.id),amount:(e,a)=>t("td",{part:S(a),class:"text-end"},e.formattedPaymentAmount(e.amount)),balance:(e,a)=>t("td",{part:S(a),class:"text-end"},e.formattedPaymentAmount(e.balance)),currency:(e,a)=>t("td",{part:S(a)},e.currency),financial_transaction_id:(e,a)=>t("td",{part:S(a)},e.financial_transaction_id),payment_id:(e,a)=>t("td",{part:S(a)},e.payment_id),payment_balance_txn_type:(e,a)=>t("td",{part:S(a)},e.payment_balance_txn_type),source_id:(e,a)=>t("td",{part:S(a)},e.source_id),source_type:(e,a)=>t("td",{part:S(a)},e.source_type)},I=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=r,this.pagingParams={},this.columns="created_at,type,id,amount,balance",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 a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,q,A),c(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:t,authToken:e,service:a})=>async({params:i,onSuccess:r,onError:c,final:o})=>{var d;try{const o=await a.fetchPaymentTransactions(t,e,i);o.error?c({error:h(o.error),code:p(null===(d=o.error)||void 0===d?void 0:d.code),severity:s.ERROR}):r({balanceTransactions:o.data.map((t=>new n(t))),pagingInfo:Object.assign({},o.page_info)})}catch(t){const e=p(null==t?void 0:t.code);c({error:h(t),code:e,severity:s.ERROR})}finally{o()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(i.MISSING_PROPS,this.errorMessage,s.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.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 t(C,{key:"c73dfcd1d3038dbca6800b9bd0f4e6c5fba2b8bf"},t(l,{key:"66d8f92a96f2ace82c05d10a9f538d6ad22b588f"},t(u,{key:"cff0e6344efd035f264326ecc79615bddfe8d0ac"},t(m,{key:"702e53ae1d59ab674425f4753c1cf0b6415feacd"},t(y,{key:"7773de2d113af30b3a0d64405dce5d5e09a0bb8c"},this.transactionsTable.columnData.map((t=>t)))),t(b,{key:"7b86d982f52037349b5cc2f7ec5fa800e38ed519"},t(_,{key:"040c3dfb101c1ea127cfcf982e4415ae94661b2a",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(j,{key:"6d25f8a886cf9b15ea9c17c44dfe0bce6125c557",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(g,{key:"60bb435ecf7a595cdb028df4cd95c1361ce06c8d",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(k,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(w,{key:"accb2e3cb9dc8521c50db6a8ed306f91e5aa44c7"},t(T,{key:"a4408276ce552fe4c43c60f79e7a2a3602566b2c"},t(v,{key:"20b13cc71f8b62166e8b6e9fce5dea2d1b4c5ac0",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"90657ed6a805af46446bc8fb316a52252a9a2bf4",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{I as justifi_payment_transactions_list}
@@ -0,0 +1 @@
1
+ import{h as e,r as t,c as n}from"./p-qipqIMyC.js";import{A as s}from"./p-BUa0YOaw.js";import{S as i}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{S as o}from"./p-Xv8DuU3Y.js";import{c as a}from"./p-CrQgyTRz.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-RvUQ__Pq.js";import"./p-DCIW8z1f.js";var l,r,p,c,h;!function(e){e.STATUS_SUCCESS="STATUS_SUCCESS",e.STATUS_FAILURE="STATUS_FAILURE"}(l||(l={})),function(e){e.PLAIN="plain",e.BUY="buy",e.SET_UP="set-up",e.DONATE="donate",e.CHECK_OUT="check-out",e.BOOK="book",e.SUBSCRIBE="subscribe"}(r||(r={})),function(e){e.BLACK="black",e.WHITE="white",e.WHITE_OUTLINE="white-outline"}(p||(p={})),function(e){e.SUPPORTS_3DS="supports3DS",e.SUPPORTS_EMV="supportsEMV",e.SUPPORTS_CREDIT="supportsCredit",e.SUPPORTS_DEBIT="supportsDebit"}(c||(c={}));class d{constructor(e){this.merchantIdentifier=e.merchantIdentifier,this.displayName=e.displayName,this.initiative=e.initiative,this.initiativeContext=e.initiativeContext,this.buttonType=e.buttonType||r.PLAIN,this.buttonStyle=e.buttonStyle||p.BLACK,this.buttonLocale=e.buttonLocale||"en-US"}get isValid(){return!!(this.merchantIdentifier&&this.displayName&&this.initiative&&this.initiativeContext)}}class y{constructor(e){this.countryCode=e.countryCode,this.currencyCode=e.currencyCode,this.merchantCapabilities=e.merchantCapabilities,this.supportedNetworks=e.supportedNetworks,this.total=e.total,this.lineItems=e.lineItems,this.shippingMethods=e.shippingMethods,this.applicationData=e.applicationData,this.supportedCountries=e.supportedCountries}get isValid(){var e,t,n,s;return!!(this.countryCode&&this.currencyCode&&(null===(e=this.merchantCapabilities)||void 0===e?void 0:e.length)&&(null===(t=this.supportedNetworks)||void 0===t?void 0:t.length)&&(null===(n=this.total)||void 0===n?void 0:n.label)&&(null===(s=this.total)||void 0===s?void 0:s.amount))}}class u{static isApplePaySupported(){var e;return"undefined"!=typeof window&&"ApplePaySession"in window&&(null===(e=window.ApplePaySession)||void 0===e?void 0:e.supportsVersion(3))}static canMakePayments(){var e;return this.isApplePaySupported()&&(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())||!1}static async canMakePaymentsWithActiveCard(e){var t;if(!this.isApplePaySupported())return!1;try{return await(null===(t=window.ApplePaySession)||void 0===t?void 0:t.canMakePaymentsWithActiveCard(e))||!1}catch(e){return console.error("Error checking Apple Pay active card:",e),!1}}static formatAmount(e){return(e/100).toFixed(2)}static parseAmount(e){return Math.round(100*parseFloat(e))}static createLineItem(e,t,n="final"){return{label:e,amount:this.formatAmount(t),type:n}}static getDefaultSupportedNetworks(){return["amex","discover","masterCard","visa"]}static getDefaultMerchantCapabilities(){return[c.SUPPORTS_3DS,c.SUPPORTS_EMV,c.SUPPORTS_CREDIT,c.SUPPORTS_DEBIT]}}!function(e){e.UNAVAILABLE="UNAVAILABLE",e.SESSION_ERROR="SESSION_ERROR",e.MERCHANT_VALIDATION_ERROR="MERCHANT_VALIDATION_ERROR",e.PAYMENT_PROCESSING_ERROR="PAYMENT_PROCESSING_ERROR",e.USER_CANCELLED="USER_CANCELLED"}(h||(h={}));class v{constructor(){this.api=s()}initialize(e){if(this.applePayConfig=new d(e),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(e,t){try{return await this.api.post({endpoint:"apple_pay/merchant_session",authToken:e,headers:{"Sub-Account":t}})}catch(e){throw console.error("Backend validation failed:",e),new Error("Merchant validation failed")}}async processPayment(e,t,n){const s=await this.api.post({endpoint:"apple_pay/process_token",authToken:e,body:n,headers:{"Sub-Account":t}});return{success:s.id&&!!s.data.token,data:s}}isAvailable(){return u.isApplePaySupported()&&u.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await u.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(e,t,n){if(console.groupCollapsed("[ApplePayService] startPaymentSession called"),console.log("[ApplePayService] raw paymentRequest:",JSON.stringify(e,null,2)),console.log("[ApplePayService] has authToken:",Boolean(t)),console.log("[ApplePayService] accountId:",n),console.log("[ApplePayService] has config:",Boolean(this.applePayConfig)),!this.applePayConfig)throw console.error("[ApplePayService] Missing applePayConfig. Did you call initialize()?"),console.groupEnd(),new Error("Apple Pay not initialized. Call initialize() first.");const s=new y(e);if(console.log("[ApplePayService] created ApplePayPaymentRequest:",s),!s.isValid){const e=[];throw s.countryCode||e.push("countryCode"),s.currencyCode||e.push("currencyCode"),s.merchantCapabilities&&0!==s.merchantCapabilities.length||e.push("merchantCapabilities"),s.supportedNetworks&&0!==s.supportedNetworks.length||e.push("supportedNetworks"),s.total&&s.total.label&&s.total.amount||e.push("total"),console.error("[ApplePayService] Payment request is invalid. Missing/invalid:",e),console.groupEnd(),new Error("Invalid payment request provided")}return this.currentPaymentRequest=s,new Promise(((e,i)=>{try{if(console.log("[ApplePayService] About to instantiate ApplePaySession"),"undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),console.groupEnd(),i({success:!1,error:{code:h.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,s),console.log("[ApplePayService] ApplePaySession instantiated:",this.currentSession),this.setupSessionEventHandlers(e,i,t,n),console.log("[ApplePayService] Event handlers set. Beginning session..."),this.currentSession.begin(),console.log("[ApplePayService] Session.begin() called"),console.groupEnd()}catch(e){console.error("[ApplePayService] Exception while starting session:",e),console.groupEnd(),i({success:!1,error:{code:h.SESSION_ERROR,message:e instanceof Error?e.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(e,t,n,s){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest?(this.currentSession.onvalidatemerchant=async()=>{console.groupCollapsed("[ApplePayService] onvalidatemerchant");try{if(console.log("[ApplePayService] accountId:",s),!n)throw console.error("[ApplePayService] Missing authToken for merchant validation"),new Error("Authentication token not provided.");const e=await this.validateMerchant(n,s);console.log("[ApplePayService] merchantSession received");try{this.currentSession.completeMerchantValidation(e),console.log("[ApplePayService] completeMerchantValidation called")}catch(e){throw console.error("Error calling completeMerchantValidation:",e),e}}catch(e){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",e),e&&e.stack&&console.error("Error stack:",e.stack),this.currentSession.abort(),t({success:!1,error:{code:h.MERCHANT_VALIDATION_ERROR,message:e instanceof Error?e.message:"Merchant validation failed"}})}console.groupEnd()},this.currentSession.onpaymentauthorized=async i=>{var o;console.groupCollapsed("[ApplePayService] onpaymentauthorized");try{const a=i.payment;console.log("[ApplePayService] payment payload snapshot:",{hasToken:Boolean(null==a?void 0:a.token),tokenType:(null===(o=null==a?void 0:a.token)||void 0===o?void 0:o.paymentData)?"paymentData":"raw"});const r=Object.assign(Object.assign({},a.token),{product_details:{name:this.currentPaymentRequest.total.label,price:u.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}});console.log("[ApplePayService] paymentPayload prepared");const p=await this.processPayment(n,s,r);console.log("[ApplePayService] processPayment result:",p),p.success?(this.currentSession.completePayment({status:l.STATUS_SUCCESS}),console.log("[ApplePayService] Payment success; resolving"),e({success:!0,token:a.token,paymentMethodId:p.data.id})):(console.error("PSP reported payment failure:",p.data),this.currentSession.completePayment({status:l.STATUS_FAILURE}),t({success:!1,error:{code:h.PAYMENT_PROCESSING_ERROR,message:"Payment processing failed"}}))}catch(e){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",e),e&&e.stack&&console.error("Error stack:",e.stack),this.currentSession.completePayment({status:l.STATUS_FAILURE}),t({success:!1,error:{code:h.PAYMENT_PROCESSING_ERROR,message:e instanceof Error?e.message:"Payment processing failed"}})}finally{console.log("[ApplePayService] Cleaning up session state"),this.currentSession=void 0,this.currentPaymentRequest=void 0}console.groupEnd()},this.currentSession.onpaymentmethodselected=()=>{console.groupCollapsed("[ApplePayService] onpaymentmethodselected");const e={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(e),console.log("[ApplePayService] completePaymentMethodSelection called")}catch(e){console.error("Error completing payment method selection:",e),this.currentSession.abort()}console.groupEnd()},this.currentSession.onshippingmethodselected=()=>{console.groupCollapsed("[ApplePayService] onshippingmethodselected"),this.currentSession.completeShippingMethodSelection({status:l.STATUS_SUCCESS,newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]}),console.log("[ApplePayService] completeShippingMethodSelection called"),console.groupEnd()},this.currentSession.oncancel=e=>{if(console.groupCollapsed("[ApplePayService] oncancel"),e.sessionError)switch(console.error(e.sessionError),e.sessionError.code){case"unknown":console.error("Unknown error - likely merchant validation issue"),console.error("This usually means:"),console.error("1. Merchant certificate is invalid or expired"),console.error("2. Merchant identifier mismatch"),console.error("3. Backend validation endpoint issues");break;case"invalidMerchantSession":console.error("Invalid merchant session provided"),console.error("Check that the merchant session from backend is valid");break;case"userCancel":console.error("User cancelled the payment");break;default:console.error("Other error code:",e.sessionError.code)}this.currentSession=void 0,this.currentPaymentRequest=void 0,t({success:!1,error:{code:h.USER_CANCELLED,message:"User cancelled the Apple Pay session"}}),console.groupEnd()},"onerror"in this.currentSession&&(this.currentSession.onerror=e=>{console.groupCollapsed("[ApplePayService] onerror"),console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",e),this.currentSession=void 0,this.currentPaymentRequest=void 0,t({success:!1,error:{code:h.SESSION_ERROR,message:"Apple Pay session error occurred"}}),console.groupEnd()})):console.error("[ApplePayService] setupSessionEventHandlers called without required state",{hasSession:Boolean(this.currentSession),hasConfig:Boolean(this.applePayConfig),hasPaymentRequest:Boolean(this.currentPaymentRequest)})}static createPaymentRequest(e,t,n="US",s="USD"){return{countryCode:n,currencyCode:s,merchantCapabilities:u.getDefaultMerchantCapabilities(),supportedNetworks:u.getDefaultSupportedNetworks(),total:u.createLineItem(t,e)}}getApplePayConfig(){return this.applePayConfig}}const m=t=>{const{isLoading:n}=t;return n?e("div",{class:"container-fluid p-0"},e("div",{class:"row mb-3"},e("div",{class:"col-12 align-content-center"},e(o,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},b=t=>e("div",{class:"apple-pay-button-container"},e("button",Object.assign({class:(()=>{let e="apple-pay-button";switch(t.buttonStyle){case p.WHITE:e+=" apple-pay-button-white";break;case p.WHITE_OUTLINE:e+=" apple-pay-button-white-outline";break;default:e+=" apple-pay-button-black"}switch(t.buttonType){case r.BUY:e+=" apple-pay-button-type-buy";break;case r.DONATE:e+=" apple-pay-button-type-donate";break;default:e+=" apple-pay-button-type-plain"}return(t.disabled||t.isProcessing||!t.isAvailable)&&(e+=" disabled"),e})(),style:{width:t.width||"200px",height:t.height||"48px"},onClick:()=>{!t.disabled&&!t.isProcessing&&t.isAvailable&&t.clickHandler&&t.clickHandler()},disabled:t.disabled||t.isProcessing||!t.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},t),t.isProcessing&&e("div",{class:"processing-overlay"},e("div",{class:"spinner"}),e("span",null,"Processing..."))),e("style",null,"\n .apple-pay-button-container {\n display: inline-block;\n position: relative;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),P=class{constructor(e){t(this,e),this.applePayStarted=n(this,"applePayStarted"),this.applePayCompleted=n(this,"applePayCompleted"),this.applePayCancelled=n(this,"applePayCancelled"),this.applePayError=n(this,"applePayError"),this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=r.PLAIN,this.buttonStyle=p.BLACK,this.disabled=!1,this.showSkeleton=!0,this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.isConfigValid=!0,this.error=null,this.handleApplePayClick=async()=>{var e,t;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit(),console.groupCollapsed("[ApplePay Component] handleApplePayClick"),console.log("[ApplePay Component] click context:",{isProcessing:this.isProcessing,disabled:this.disabled,isAvailable:this.isAvailable,canMakePayments:this.canMakePayments,hasService:Boolean(this.applePayService)});const n={countryCode:this.countryCode,currencyCode:a.paymentCurrency,merchantCapabilities:u.getDefaultMerchantCapabilities(),supportedNetworks:u.getDefaultSupportedNetworks(),total:u.createLineItem(a.paymentDescription,a.paymentAmount)};console.log("[ApplePay Component] paymentRequest",n),console.log("[ApplePay Component] identifiers snapshot:",{authTokenLength:a.authToken?String(a.authToken).length:0,accountId:a.accountId});const s=await this.applePayService.startPaymentSession(n,a.authToken,a.accountId);console.log("[ApplePay Component] startPaymentSession result",s),s.success?this.applePayCompleted.emit({success:!0,token:s.token,paymentMethodId:s.paymentMethodId}):(this.applePayCompleted.emit({success:!1,error:s.error}),this.applePayError.emit({error:(null===(e=s.error)||void 0===e?void 0:e.message)||"Payment failed",code:(null===(t=s.error)||void 0===t?void 0:t.code)||P.ErrorCode.PAYMENT_FAILED}))}catch(e){const t=e instanceof Error?e.message:"Payment failed";this.error=t,this.applePayError.emit({error:t,code:P.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:t})}finally{this.isProcessing=!1,console.groupEnd()}}}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,console.groupCollapsed("[ApplePay Component] initializeApplePay"),console.log("[ApplePay Component] checkout state snapshot:",{paymentAmount:a.paymentAmount,paymentCurrency:a.paymentCurrency,hasAuthToken:Boolean(a.authToken),accountId:a.accountId}),!(Boolean(a.paymentAmount)&&Boolean(a.paymentCurrency)&&Boolean(a.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,console.error("Apple Pay config error: missing required values",{paymentAmount:a.paymentAmount,paymentCurrency:a.paymentCurrency,hasAuthToken:Boolean(a.authToken),accountId:a.accountId}),this.applePayError.emit({error:this.error,code:P.ErrorCode.CONFIG_ERROR}),this.isLoading=!1,void console.groupEnd();if(this.isAvailable=u.isApplePaySupported(),this.canMakePayments=u.canMakePayments(),console.log("[ApplePay Component] support check:",{isAvailable:this.isAvailable,canMakePayments:this.canMakePayments,hasApplePaySessionOnWindow:"undefined"!=typeof window&&"ApplePaySession"in window}),!this.isAvailable)return this.error="Apple Pay is not supported on this device",console.error(this.error),this.applePayError.emit({error:this.error,code:P.ErrorCode.NOT_SUPPORTED}),this.isLoading=!1,void console.groupEnd();if(!this.canMakePayments)return this.error="Apple Pay is not available",console.error(this.error),this.applePayError.emit({error:this.error,code:P.ErrorCode.NOT_AVAILABLE}),this.isLoading=!1,void console.groupEnd();const e={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};console.log("[ApplePay Component] initializing service with config:",e),this.applePayService=new v,this.applePayService.initialize(e),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(e){console.error("Apple Pay initialization error:",e),this.error=e instanceof Error?e.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:P.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1,console.groupEnd()}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?u.getDefaultSupportedNetworks():[]}async abort(){this.applePayService.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){const t=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return e(i,{key:"0610b810bc458f7382bb78ebe155e38cd39d7023"},a.checkoutLoaded&&e("script",{key:"036ba823079bb6daa62e72a8ee76cdc32dab60f0",async:!0,src:"https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",onLoad:()=>{console.log("[ApplePay Component] Apple Pay SDK script loaded"),this.initializeApplePay()}}),e("div",{key:"f5211ca2212306b7ee99dc1f6f06f56a9aa08643",class:"apple-pay-container"},e(m,{key:"bb4680ed4760d378237d36dd60e76d2db9cf0dd4",isLoading:this.isLoading}),t&&e(b,{key:"6c984f15b8ef2e629325253428c8243935328050",buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick})),e("style",{key:"670fcfa28ea2405f772238add126525ecb14841b"},"\n .apple-pay-container {\n width: 100%;\n }\n "))}};P.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};export{P as justifi_apple_pay}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{P as o}from"./p-De8UloOS.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as r,a as e}from"./p-Cjcsf8ku.js";import{d as p}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as a,a as h}from"./p-D2muobcE.js";import{E as n}from"./p-BIPdn2VU.js";import{c as m,J as c}from"./p-D_5McRD_.js";import{m as d}from"./p-DYGIC0QH.js";import"./p-BUa0YOaw.js";import"./p-BHf9IqGw.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-RvUQ__Pq.js";import"./p-BBpkkt2-.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new c(this),this.initializeServices()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:i})=>async({onSuccess:o,onError:e})=>{var n;try{const m=await i.fetchPayout(t,s);m.error?e({error:h(m.error),code:a(null===(n=m.error)||void 0===n?void 0:n.code),severity:r.ERROR}):o(new p(m.data))}catch(t){e({error:h(t),code:a(null==t?void 0:t.code),severity:r.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new o}),this.getPayoutCSV=d({authToken:this.authToken,service:new o})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:e.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):i("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_payout_details}
1
+ import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{P as o}from"./p-De8UloOS.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as r,a as e}from"./p-Cjcsf8ku.js";import{d as p}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as a,a as h}from"./p-D2muobcE.js";import{E as n}from"./p-BIPdn2VU.js";import{c as m,J as c}from"./p-CtA2NMVz.js";import{m as d}from"./p-DYGIC0QH.js";import"./p-BUa0YOaw.js";import"./p-BHf9IqGw.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-RvUQ__Pq.js";import"./p-tyhA5jkt.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new c(this),this.initializeServices()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:i})=>async({onSuccess:o,onError:e})=>{var n;try{const m=await i.fetchPayout(t,s);m.error?e({error:h(m.error),code:a(null===(n=m.error)||void 0===n?void 0:n.code),severity:r.ERROR}):o(new p(m.data))}catch(t){e({error:h(t),code:a(null==t?void 0:t.code),severity:r.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new o}),this.getPayoutCSV=d({authToken:this.authToken,service:new o})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:e.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):i("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_payout_details}
@@ -0,0 +1 @@
1
+ import{h as i,r as s,c as t}from"./p-qipqIMyC.js";import{al as e,ai as r,ae as o,z as l}from"./p-RvUQ__Pq.js";import{S as d}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{c as n,J as a}from"./p-CtA2NMVz.js";import{C as h,a as c}from"./p-Cjcsf8ku.js";import{B as v}from"./p-B4idKqyn.js";import{B as u}from"./p-BlJnA265.js";import{m as p}from"./p-DH8F0bsw.js";import{S as m}from"./p-Xv8DuU3Y.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{i as f,h as w,b as y}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{g as b,a as x}from"./p-D2muobcE.js";import{T as g}from"./p-CxzFvTgf.js";import{k as j}from"./p-BHf9IqGw.js";import"./p-tyhA5jkt.js";import"./p-BUa0YOaw.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-DsAwPf2y.js";const k=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(m,{width:"25%"})),i("div",{class:"col-12"},i(m,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"50%"}),i(m,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"65%"}),i(m,{width:"35%"}))),C=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(m,{width:"40%",height:"40px"})),i(k,null)),S=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(m,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(m,null),i(m,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(m,{width:"80px",height:"32px"}),i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(m,null),i(m,null)))))),B=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event"),this.submitted=t(this,"submit-event"),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new w({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?y.boardingShipping:y.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",c.MISSING_PROPS,h.ERROR)}initializeGetBusiness(){p({id:this.businessId,authToken:this.authToken,service:new v})({onSuccess:({business:i})=>{this.business=new u(i),this.loading.business=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(i,s);if(a.error)return r({error:x(a.error),code:b(null===(n=a.error)||void 0===n?void 0:n.code),severity:h.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new f(i))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=b(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:h.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new g})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:x(d.error),code:b(null===(l=d.error)||void 0===l?void 0:l.code),severity:h.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=b(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:h.ERROR})}})({authToken:this.authToken,service:new g});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(C,null),this.loading.terminals&&i("div",{class:"mt-5"},i(S,null),i(S,null),i(S,null)))}renderBusinessDetails(){var s,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),i("div",null,j(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"3ea6cebd4ab6bc47090056581482dab8502175c1"},i("div",{key:"383dc710920b5119841d5cf6f1b596ebc349fd5a",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{B as justifi_order_terminals}
@@ -0,0 +1 @@
1
+ import{h as e,r as i,H as a}from"./p-qipqIMyC.js";import{S as t}from"./p-Xv8DuU3Y.js";import{w as s,c}from"./p-Bp_QFeog.js";import{b as r}from"./p-BHf9IqGw.js";import"./p-RvUQ__Pq.js";import"./p-DsAwPf2y.js";import"./p-HXpYMWUU.js";const d=i=>{const{isReady:a}=i;return a?null:e("div",{class:"container-fluid p-0"},e("div",{class:"mb-3"},e(t,{height:"18px",width:"100px"}),e(t,{height:"36px"})),e("div",{class:"row"},e("div",{class:"col-4 align-content-end"},e(t,{height:"18px",width:"80px"}),e(t,{height:"36px"})),e("div",{class:"col-4 align-content-end"},e(t,{height:"36px"})),e("div",{class:"col-4 align-content-end"},e(t,{height:"18px",width:"30px"}),e(t,{height:"36px"}))))},f=class{constructor(e){i(this,e),this.isReady=!1}async componentWillLoad(){await s(),this.iframeOrigin=c.iframeOrigin,this.tabId=r()}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((e=>new Promise((i=>{e.addEventListener("iframeLoaded",(()=>{i()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const e=await this.cardNumberIframeElement.validate(),i=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),t=await this.cvvIframeElement.validate();return e&&i&&a&&t}async tokenize(e,i,a){return this.cardNumberIframeElement.tokenize(e,i,a)}render(){return e(a,{key:"4918918c10e558587e1d356cee9ec8540ed88e1c"},e(d,{key:"e61d11784aa1a9ea84fe9f0544a84f587cdf6fa4",isReady:this.isReady}),e("div",{key:"d0640890482bcb679c0d49e569ed34912aa37426",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},e("div",{key:"ef3548ee5dcf517f5c31b3aa40fc5ed5f8e37f59",class:"mb-3"},e("iframe-input",{key:"4fa52574bfe8334f3294e45b2e63bf109750f925",inputId:"cardNumber",ref:e=>this.cardNumberIframeElement=e,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),e("div",{key:"5ad5bfe88c1531a74a636e2e07572b8401095ecf",class:"d-flex align-items-start"},e("div",{key:"29d9d3e3c0080243ea44ca7515c690b90bd0d944",class:"flex-fill me-3"},e("iframe-input",{key:"01ebb2a6101d33b08135ac879fce192f57ea822e",inputId:"expirationMonth",ref:e=>this.expirationMonthIframeElement=e,label:"Exp. Month",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),e("div",{key:"769c4e873c4062ec90fae3a7b0606e8db49754c0",class:"flex-fill me-3"},e("iframe-input",{key:"a36c705e6f8231f01615ee8a878aa5427a11bcce",inputId:"expirationYear",ref:e=>this.expirationYearIframeElement=e,label:"Exp. Year",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),e("div",{key:"2923118dc4ec2f107aad34e0f77ea3d58340a734",class:"flex-fill"},e("iframe-input",{key:"ec3226c1eca1705672e8ea7f80be47ca6f81838b",inputId:"CVV",ref:e=>this.cvvIframeElement=e,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{f as card_form}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-D_5McRD_.js";import{D as a}from"./p-BH0Xfn-F.js";import{g as n,a as h}from"./p-D2muobcE.js";import{D as c}from"./p-DyOgQlh2.js";import"./p-BBpkkt2-.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new p(this),this.initializeGetDispute()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:o})=>{var p;try{const c=await i.fetchDispute(t,s);if(c.error)return o({error:h(c.error),code:n(null===(p=c.error)||void 0===p?void 0:p.code),severity:e.ERROR});{const t=Object.assign({},c.page_info);r({dispute:new a(c.data),pagingInfo:t})}}catch(t){const s=n(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new c}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return i("justifi-dispute-management-core",{key:"4087eb105a046a3cc194d9f25c80fa11298fa0a2",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_dispute_management}
1
+ import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-CtA2NMVz.js";import{D as a}from"./p-BH0Xfn-F.js";import{g as n,a as h}from"./p-D2muobcE.js";import{D as c}from"./p-DyOgQlh2.js";import"./p-tyhA5jkt.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new p(this),this.initializeGetDispute()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:o})=>{var p;try{const c=await i.fetchDispute(t,s);if(c.error)return o({error:h(c.error),code:n(null===(p=c.error)||void 0===p?void 0:p.code),severity:e.ERROR});{const t=Object.assign({},c.page_info);r({dispute:new a(c.data),pagingInfo:t})}}catch(t){const s=n(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new c}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return i("justifi-dispute-management-core",{key:"4087eb105a046a3cc194d9f25c80fa11298fa0a2",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_dispute_management}
@@ -1 +1 @@
1
- import{r as e,h as a,H as t}from"./p-qipqIMyC.js";import{au as l,C as d}from"./p-RvUQ__Pq.js";import{a as i,r as s,s as c,b as o}from"./p-yH3TC3ZQ.js";import{C as r,T as n,P as f,S as b}from"./p-B-iV5cYd.js";import{C as u}from"./p-BlJnA265.js";import{d as h}from"./p-Dt-vy9Le.js";import{S as m}from"./p-BX8GieXu.js";import{n as v}from"./p-BnjCmwMr.js";const y=class{constructor(a){e(this,a)}render(){return this.text?this.hideAlert?null:a("div",{class:"alert alert-danger d-flex align-items-center",role:"alert",part:l},a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"bi bi-exclamation-triangle-fill flex-shrink-0 me-2",viewBox:"0 0 16 16",role:"img","aria-label":"Warning:"},a("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})),a("div",null,this.text)):null}},p=class{constructor(a){e(this,a),this.errors={},this.additional_questions={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.additional_questions=Object.assign({},e.additional_questions)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{additional_questions:Object.assign(Object.assign({},this.formController.values.getValue().additional_questions),{[e]:a})}))}render(){var e,l,o,n,f,b,u,h,m,v,y,p,k,x;const j=this.formController.getInitialValues().additional_questions;return a(t,{key:"e3e354a7cf470f658e0f95d37186b1f45771b673"},a("fieldset",{key:"7fb001177a4f907d513eb5955063d446234ede0c"},a("legend",{key:"ee6b045a438be9f56345daad752e105640f1ca3d",part:d},"Additional Questions"),a("div",{key:"ed114675357f3b70c34a3eb941fdb30e6219cdc9",class:"row gy-3"},a("div",{key:"b85c27c827cf5e5d0d556c343315e5eec736f538",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"4576f67fa74ba7c2ca9730468ddc52b055a3c496",name:"business_revenue",label:"What is the business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(l=null===(e=this.errors)||void 0===e?void 0:e.additional_questions)||void 0===l?void 0:l.business_revenue,defaultValue:null==j?void 0:j.business_revenue,maskOptions:r.WHOLE})),a("div",{key:"0614c60cc7daaf890ccb4888d41b0260a26f9a0e",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"2c435c1553714d75542e0e3bcf1d723f26b37da8",name:"business_payment_volume",label:"What is the business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(n=null===(o=this.errors)||void 0===o?void 0:o.additional_questions)||void 0===n?void 0:n.business_payment_volume,defaultValue:null==j?void 0:j.business_payment_volume,maskOptions:r.WHOLE})),a("div",{key:"8d4a19eb0b6b5707f4a423543d86ae50f6492efc",class:"col-12"},a("form-control-select",{key:"2e49f907bae85cd4901e4aa4413284596fbed365",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===(b=null===(f=this.errors)||void 0===f?void 0:f.additional_questions)||void 0===b?void 0:b.business_when_service_received,options:i,defaultValue:null==j?void 0:j.business_when_service_received})),a("div",{key:"11bc4e0bbe2122b977cf8bc29ac0601ef941881c",class:"col-12"},a("form-control-select",{key:"c511b728971250dc3272c1ef9ff96131a9ac6a2e",name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.additional_questions)||void 0===h?void 0:h.business_recurring_payments,options:s,defaultValue:null==j?void 0:j.business_recurring_payments})),a("div",{key:"5a40dfe41a9fca815cdf0eb7455b41615d1e6c76",class:"col-12"},a("form-control-text",{key:"d8aaf0f6d7d44b1b15ec76af198a0117493f08c6",name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(v=null===(m=this.errors)||void 0===m?void 0:m.additional_questions)||void 0===v?void 0:v.business_recurring_payments_percentage,defaultValue:null==j?void 0:j.business_recurring_payments_percentage})),a("div",{key:"b211bb865a60baf1ea00c81f76f000ff2a31d7bd",class:"col-12"},a("form-control-select",{key:"4b693e7425e690a59e2c70646cca2b886b8a8796",name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(p=null===(y=this.errors)||void 0===y?void 0:y.additional_questions)||void 0===p?void 0:p.business_seasonal,options:c,defaultValue:null==j?void 0:j.business_seasonal})),a("div",{key:"e85b7fceb9cdc808afaf3559609b7519c9630266",class:"col-12"},a("form-control-text",{key:"ae4a6518c7499826f30376f1c902f694244059c7",name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business?",inputHandler:this.inputHandler,errorText:null===(x=null===(k=this.errors)||void 0===k?void 0:k.additional_questions)||void 0===x?void 0:x.business_other_payment_details,defaultValue:null==j?void 0:j.business_other_payment_details})))))}},k=class{constructor(a){e(this,a),this.errors={},this.coreInfo={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.values.subscribe((e=>this.coreInfo=Object.assign({},new u(e)))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:a}))}render(){const e=this.formController.getInitialValues();return a(t,{key:"75bbee71e68fb0dafa609838f4d3e22bf4388332"},a("fieldset",{key:"1e1cc71bfd46b278ad3f7d3a73d5b126fbf19533"},a("legend",{key:"341b82942f116b4a2b0b29ce505fda3a153f88ec",part:d},"General Info"),a("div",{key:"e97b3c3a38f888795c24c887d42854c79f1f7b34",class:"row gy-3"},a("div",{key:"6d560585e9843143c836a302ad83b19719732467",class:"col-12"},a("form-control-text",{key:"9868049d15e3f2552feba3ff6fa6b1ab43c7ae9c",name:"legal_name",label:"Legal Name",defaultValue:e.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler})),a("div",{key:"f77c1d66117c29b6f5963a99bbb531f76242d052",class:"col-12"},a("form-control-text",{key:"2708d678c35d4fa9838cd3fd834c77105b94feff",name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:e.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler})),a("div",{key:"bb17f23c8f7fc1be73524dce8ed11ce9a9524a21",class:"col-12 col-md-8"},a("form-control-select",{key:"bc4175a9ed29127d89cf9c6135448c80733f6959",name:"classification",label:"Business Classification",options:o,defaultValue:e.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),a("div",{key:"6c5faad25c64ec50023be5128b8b0527584f9a7c",class:"col-12 col-md-4"},a("form-control-date",{key:"54a151222d7eabc40a66ffbd5d0dba2e765cd135",name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:e.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),a("div",{key:"5a562ba1811a319d2f5dd10197be2e1ecb94da8b",class:"col-12 col-md-6"},a("form-control-text",{key:"03780a900fd4c176e5658b0784ef57eb48d2b3f7",name:"industry",label:"Industry",defaultValue:e.industry,errorText:this.errors.industry,inputHandler:this.inputHandler})),a("div",{key:"96e4110eb7b40f87a804b24a2ec94defca0be899",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"3cfda64e576a93bbed143b34c235b5388dade635",name:"tax_id",label:"Tax ID",defaultValue:e.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:n.US})),a("div",{key:"6a6e4d87838f2666c2750662c1f031f3b8d0effe",class:"col-12"},a("form-control-text",{key:"68f28a6b78e2df1cd69631097a001369722d8081",name:"website_url",label:"Website URL",defaultValue:e.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler})),a("div",{key:"8a334f64bc214d1211772e5a5018b82dadd88d1a",class:"col-12 col-md-6"},a("form-control-text",{key:"639888a2d30e785e1d403830c718b7991f28285a",name:"email",label:"Email Address",defaultValue:e.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"b4aac33c17ce96c5c9a9ce5a90f322f69941df5e",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"c384d24cc34fefca964a5eb412b28360361ab780",name:"phone",label:"Phone Number",defaultValue:e.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:f.US})))))}},x=class{constructor(a){e(this,a),this.errors={},this.representative={},this.inputHandler=(e,a)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{[e]:a})}))},this.onAddressFormUpdate=e=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{address:Object.assign(Object.assign({},this.formController.values.getValue().representative.address),e)})}))},this.onDateOfBirthUpdate=e=>{const a=h(e.detail);this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{dob_day:a.dob_day,dob_month:a.dob_month,dob_year:a.dob_year})}))}}get identificationNumberLabel(){return this.representative.ssn_last4?"Update SSN (optional)":"SSN"}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e.representative))),this.formController.values.subscribe((e=>this.representative=Object.assign({},e.representative)))}render(){const e=this.formController.getInitialValues().representative;return a(t,{key:"88bd35928331776d5cbb7d085fd55a76fde1a084"},a("fieldset",{key:"202c40f332352c2f4d3c8a136888c39c67379e5f"},a("legend",{key:"a0b5043b348b1d8632a6bf0fe2d4309a8132d1f7",part:d},"Representative"),a("div",{key:"ba50c004e2b37f384dd8af63b1e0e397abadb9de",class:"row gy-3"},a("div",{key:"b85bf5fb0da9e8feae19dbebb0a911362e914601",class:"col-12 col-md-8"},a("form-control-text",{key:"95f849c7c0ba0c67bdc0a55727e00755e03897ef",name:"name",label:"Full Name",defaultValue:null==e?void 0:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{key:"074067a3ce960b678ea38d53b84adda24e60754c",class:"col-12 col-md-4"},a("form-control-text",{key:"7ef397af32b7c0f79eeae1499bf3d3d147961c96",name:"title",label:"Title",defaultValue:null==e?void 0:e.title,errorText:this.errors.title,inputHandler:this.inputHandler})),a("div",{key:"a26bfd8a0824aaa12c6ffa48ac58c2bccc7236ef",class:"col-12 col-md-6"},a("form-control-text",{key:"39174c4b812462d1aa28824bca550e3f6e1d98b4",name:"email",label:"Email Address",defaultValue:null==e?void 0:e.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"ed0a2c52e4df0c43b2536dfd1ff3692a4e5716d9",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"07bdcc1dd2e1473b64218eb28c8cdcf1cdce2a91",name:"phone",label:"Phone Number",defaultValue:null==e?void 0:e.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:f.US})),a("div",{key:"96092fd371ec82a8f8ebbf8bc4e3064768d4ad97",class:"col-12 col-md-4"},a("form-control-date",{key:"c24980f126c056aff139e897fdef9795905ea89b",name:"dob_full",label:"Birth Date",defaultValue:null==e?void 0:e.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:this.onDateOfBirthUpdate})),a("div",{key:"9d1695fa6e68bb4ae9a8184dcb5e15d588474ab8",class:"col-12 col-md-8"},a("form-control-number-masked",{key:"8d8a56c08fb06f1a54baf3ee3d6e31a684205290",name:"identification_number",label:this.identificationNumberLabel,defaultValue:null==e?void 0:e.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:b})),a("div",{key:"22fa5e16517e14ab031aa5e7e95ea77bd7b28986",class:"col-12"},a("justifi-identity-address-form",{key:"4a990de739a0ae6fbf1f6a621ff7c0078517e970",errors:this.errors.address,defaultValues:null==e?void 0:e.address,handleFormUpdate:this.onAddressFormUpdate})))))}},j=class{constructor(a){e(this,a),this.errors={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.legal_address=Object.assign({},e.legal_address)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{legal_address:Object.assign(Object.assign({},this.formController.values.getValue().legal_address),{[e]:a})}))}render(){var e,l,i,s,c,o,r,n,f,b,u,h;const y=this.formController.getInitialValues().legal_address;return a(t,{key:"5b21d99717f9b24c0551c7a96acf68e53e7787bf"},a("fieldset",{key:"d63cbd20b2648405c50a819724e0f8cf556f7d26"},a("legend",{key:"c0acd14073f13f914015f40d39bf22fb58792434",part:d},"Business Legal Address"),a("div",{key:"ee4cee6bd662816f822ee209aeda5e9664f6a64d",class:"row gy-3"},a("div",{key:"86b258fd09e73cbd2475330419274732231f3871",class:"col-12"},a("form-control-text",{key:"8d898a9ae448f07932afe2d8cfc2314b92d9c597",name:"line1",label:"Legal Address",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.line1,errorText:null===(l=null===(e=this.errors)||void 0===e?void 0:e.legal_address)||void 0===l?void 0:l.line1})),a("div",{key:"1a50c4b86a754035f71efacd39721219fcd54d60",class:"col-12"},a("form-control-text",{key:"507b1451685e359a900f0bc7010ff39e3631daf2",name:"line2",label:"Address Line 2",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.line2,errorText:null===(s=null===(i=this.errors)||void 0===i?void 0:i.legal_address)||void 0===s?void 0:s.line2})),a("div",{key:"1446b4db5f86a3b18e3aceb78274ffe458dbd3db",class:"col-12"},a("form-control-text",{key:"e17e4bd95ad4290d18edde79cf05a6b3a105166c",name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.city,errorText:null===(o=null===(c=this.errors)||void 0===c?void 0:c.legal_address)||void 0===o?void 0:o.city})),a("div",{key:"9b880203bad9e104e6d1299ff73c83cba46ab563",class:"col-12"},a("form-control-select",{key:"24e4df10f688c9a1b5f2af5217f03919bf7abec7",name:"state",label:"State",options:m,inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.state,errorText:null===(n=null===(r=this.errors)||void 0===r?void 0:r.legal_address)||void 0===n?void 0:n.state})),a("div",{key:"71f21b19602c268e3b6a839ce41ff9d4f8ffb8c4",class:"col-12"},a("form-control-text",{key:"ca71d3e21c5a0aea5367fa28ec1a2422ba9b1cf3",name:"postal_code",label:"Postal Code",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.postal_code,errorText:null===(b=null===(f=this.errors)||void 0===f?void 0:f.legal_address)||void 0===b?void 0:b.postal_code,maxLength:5,keyDownHandler:v})),a("div",{key:"aaee0bf6a24ba182e002c1ffb49736fb622cde1f",class:"col-12"},a("form-control-select",{key:"2b6486771818e584dcc195c304e5a6e16850b4a9",name:"country",label:"Country",options:[{label:"United States",value:"USA"}],inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.country,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.legal_address)||void 0===h?void 0:h.country,disabled:!0})))))}};export{y as form_alert,p as justifi_additional_questions,k as justifi_business_core_info,x as justifi_business_representative,j as justifi_legal_address_form}
1
+ import{r as e,h as a,H as t}from"./p-qipqIMyC.js";import{au as d,C as l}from"./p-RvUQ__Pq.js";import{a as i,r as s,s as c,b as o}from"./p-yH3TC3ZQ.js";import{C as r,T as n,P as f,S as b}from"./p-B-iV5cYd.js";import{C as u}from"./p-BlJnA265.js";import{d as h}from"./p-Dt-vy9Le.js";import{S as m}from"./p-BX8GieXu.js";import{n as v}from"./p-BnjCmwMr.js";const y=class{constructor(a){e(this,a)}render(){return this.text?this.hideAlert?null:a("div",{class:"alert alert-danger d-flex align-items-center",role:"alert",part:d},a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"bi bi-exclamation-triangle-fill flex-shrink-0 me-2",viewBox:"0 0 16 16",role:"img","aria-label":"Warning:"},a("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})),a("div",null,this.text)):null}},p=class{constructor(a){e(this,a),this.errors={},this.additional_questions={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.additional_questions=Object.assign({},e.additional_questions)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{additional_questions:Object.assign(Object.assign({},this.formController.values.getValue().additional_questions),{[e]:a})}))}render(){var e,d,o,n,f,b,u,h,m,v,y,p,k,x;const j=this.formController.getInitialValues().additional_questions;return a(t,{key:"8f51222ff2a06a8636c2252a1df25803c464cd5a"},a("fieldset",{key:"c705274cb9e5cc651f8cedb5ac23714a75dca09a"},a("legend",{key:"0e865f2763c872ccd65c7d255e0a49533bf8afbe",part:l},"Additional Questions"),a("div",{key:"b5a9d2c8086820d837a6261c0fbbd1c4785e8cbe",class:"row gy-3"},a("div",{key:"b0174e926ef2726d9c1ce809d00cf8fef623207c",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"5553ed9ca690b4b7a54dfe864225fb4e10987c96",name:"business_revenue",label:"What is the business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(d=null===(e=this.errors)||void 0===e?void 0:e.additional_questions)||void 0===d?void 0:d.business_revenue,defaultValue:null==j?void 0:j.business_revenue,maskOptions:r.WHOLE})),a("div",{key:"a01e709a65772041979e7b8c057b271e26524174",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"2e56403c3eb357dac7f6791e0c5fa4fca58e6cfb",name:"business_payment_volume",label:"What is the business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(n=null===(o=this.errors)||void 0===o?void 0:o.additional_questions)||void 0===n?void 0:n.business_payment_volume,defaultValue:null==j?void 0:j.business_payment_volume,maskOptions:r.WHOLE})),a("div",{key:"74318a7f6fdcc265d96827e5fb02d797631b3fd5",class:"col-12"},a("form-control-select",{key:"d166c9a1951afc9e1876d078ddc026671e8e0dcc",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===(b=null===(f=this.errors)||void 0===f?void 0:f.additional_questions)||void 0===b?void 0:b.business_when_service_received,options:i,defaultValue:null==j?void 0:j.business_when_service_received})),a("div",{key:"e47aefb3a2274244d3e2561da7cfecb203445f1e",class:"col-12"},a("form-control-select",{key:"33978d0af775cace90de84104f74b2d6c22ae1c0",name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.additional_questions)||void 0===h?void 0:h.business_recurring_payments,options:s,defaultValue:null==j?void 0:j.business_recurring_payments})),a("div",{key:"93f996064e4055c9a81c0077a20fd878ad1a6c97",class:"col-12"},a("form-control-text",{key:"68ac25357311838b8fa9a897fbb324f45f589f5f",name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(v=null===(m=this.errors)||void 0===m?void 0:m.additional_questions)||void 0===v?void 0:v.business_recurring_payments_percentage,defaultValue:null==j?void 0:j.business_recurring_payments_percentage})),a("div",{key:"f2dfe10a8ed19faa36a38a8192268813b03d454f",class:"col-12"},a("form-control-select",{key:"1d6cf56564944d8dbef4f22c403232c9b7841018",name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(p=null===(y=this.errors)||void 0===y?void 0:y.additional_questions)||void 0===p?void 0:p.business_seasonal,options:c,defaultValue:null==j?void 0:j.business_seasonal})),a("div",{key:"fe75a54400d4614fe1d3ed9099ff5a5d3822c007",class:"col-12"},a("form-control-text",{key:"aa7609f7687a5c0666bf35119cd4af7ad4e68f89",name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business?",inputHandler:this.inputHandler,errorText:null===(x=null===(k=this.errors)||void 0===k?void 0:k.additional_questions)||void 0===x?void 0:x.business_other_payment_details,defaultValue:null==j?void 0:j.business_other_payment_details})))))}},k=class{constructor(a){e(this,a),this.errors={},this.coreInfo={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.values.subscribe((e=>this.coreInfo=Object.assign({},new u(e)))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:a}))}render(){const e=this.formController.getInitialValues();return a(t,{key:"0f01827de5a6ff9f6da4aabac4c219da9bb7f7bc"},a("fieldset",{key:"fb47f0c5e7d566fe3af06eb1f38af813ca1a5a98"},a("legend",{key:"04b3a526d159f010da3960220c6738c23ab59ae9",part:l},"General Info"),a("div",{key:"cfa7ae60828f3b7525d6582effe31e11f4940ae1",class:"row gy-3"},a("div",{key:"09f915e522f42ea60bde326b93c0acbf79914047",class:"col-12"},a("form-control-text",{key:"fcfb0a32d62173c0fd60e21410cbf8be1843855f",name:"legal_name",label:"Legal Name",defaultValue:e.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler})),a("div",{key:"be83c79addceacb5621fb480cdc606a5393778ca",class:"col-12"},a("form-control-text",{key:"e78ff2fa54cd819b9117d03976d40e5aa49e33b5",name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:e.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler})),a("div",{key:"1a17daeaac46daa23ea4a2a028d08db238cc11d9",class:"col-12 col-md-8"},a("form-control-select",{key:"c8d76e0cdb665a43162d5605bda5361969933964",name:"classification",label:"Business Classification",options:o,defaultValue:e.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),a("div",{key:"1cfd904e9c039e834e086847b296ee4a6ee3f676",class:"col-12 col-md-4"},a("form-control-date",{key:"bdd8b4b01c9bd22b4c0188d7b37ebd6228a8af45",name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:e.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),a("div",{key:"bb1aceaf0a2ea01d4116fa66e7fc086824940619",class:"col-12 col-md-6"},a("form-control-text",{key:"4fdcb1caae3cba88e8f6f9c14cb8b85c98e8a0f2",name:"industry",label:"Industry",defaultValue:e.industry,errorText:this.errors.industry,inputHandler:this.inputHandler})),a("div",{key:"238c8aae3f95286292b302efd2a490a0b7e9ce56",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"5a8e4040603858ff704da4c3c901d3903d0ed619",name:"tax_id",label:"Tax ID",defaultValue:e.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:n.US})),a("div",{key:"e3a9a7987837dbb026b3edb6c0659b8c45ddf3bc",class:"col-12"},a("form-control-text",{key:"fd826dbe012a25bfcaf456f3f2d3e300de3b81d8",name:"website_url",label:"Website URL",defaultValue:e.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler})),a("div",{key:"26cd8ff17604388d92f594193cde8a5005a727d1",class:"col-12 col-md-6"},a("form-control-text",{key:"cf5c1601d7d956656168d3819767cc912a35ea7c",name:"email",label:"Email Address",defaultValue:e.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"f94b1fa7cc39f3800404ce2ea2d46af70bf43b08",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"ea73e0093f103c7bc5913ca1dc7625fde1ff09f6",name:"phone",label:"Phone Number",defaultValue:e.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:f.US})))))}},x=class{constructor(a){e(this,a),this.errors={},this.representative={},this.inputHandler=(e,a)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{[e]:a})}))},this.onAddressFormUpdate=e=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{address:Object.assign(Object.assign({},this.formController.values.getValue().representative.address),e)})}))},this.onDateOfBirthUpdate=e=>{const a=h(e.detail);this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{dob_day:a.dob_day,dob_month:a.dob_month,dob_year:a.dob_year})}))}}get identificationNumberLabel(){return this.representative.ssn_last4?"Update SSN (optional)":"SSN"}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e.representative))),this.formController.values.subscribe((e=>this.representative=Object.assign({},e.representative)))}render(){const e=this.formController.getInitialValues().representative;return a(t,{key:"94097bf5ab94fc900918d44510ea8810f2a1984d"},a("fieldset",{key:"95619d9fa81838e5a08e191845a7343f8b3609ce"},a("legend",{key:"9ec4d2470dc31e3128c0d3351e3983dc07bca92e",part:l},"Representative"),a("div",{key:"a2b1d8ab98e3683c6ad57d6a6dfb259b27a8cd0f",class:"row gy-3"},a("div",{key:"ce36f02cde3b989b427418b7c09b92bcbc9638f1",class:"col-12 col-md-8"},a("form-control-text",{key:"7912bcd5f4f4d5870a08529d09a21994911a7262",name:"name",label:"Full Name",defaultValue:null==e?void 0:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{key:"57f138c87e53aa0b555dc5d7ebe699c6207e5825",class:"col-12 col-md-4"},a("form-control-text",{key:"d98d5cfcb5f4a7e1dd9eb0e55844bb8a210bd305",name:"title",label:"Title",defaultValue:null==e?void 0:e.title,errorText:this.errors.title,inputHandler:this.inputHandler})),a("div",{key:"08093caed32f9124c48fc73e05b2e5ec698fac5d",class:"col-12 col-md-6"},a("form-control-text",{key:"ef868e698b2369934bfeee522d8f4a7ff4924074",name:"email",label:"Email Address",defaultValue:null==e?void 0:e.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"ffb1c8a6ccd2df1a198f679ad02d3921821939b9",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"ce4cd6e4edacdc536f74b85341fe35dc4aae435e",name:"phone",label:"Phone Number",defaultValue:null==e?void 0:e.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:f.US})),a("div",{key:"27d97a8149ba81e7576e850c8c273298c8394f51",class:"col-12 col-md-4"},a("form-control-date",{key:"5cd76163b49822f9dcbd3339c89a0afffcc4247f",name:"dob_full",label:"Birth Date",defaultValue:null==e?void 0:e.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:this.onDateOfBirthUpdate})),a("div",{key:"62bd3c48ccc31d7f36a00bc27eafefc3369226e3",class:"col-12 col-md-8"},a("form-control-number-masked",{key:"7d43730b2615e7b515ca6c66d90ceeb573e61d6a",name:"identification_number",label:this.identificationNumberLabel,defaultValue:null==e?void 0:e.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:b})),a("div",{key:"ec6cb5f493f5335f6b0490894577eb401f1c150a",class:"col-12"},a("justifi-identity-address-form",{key:"6ecffcd10914504148573e99a708cae6d6976cd2",errors:this.errors.address,defaultValues:null==e?void 0:e.address,handleFormUpdate:this.onAddressFormUpdate})))))}},j=class{constructor(a){e(this,a),this.errors={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.legal_address=Object.assign({},e.legal_address)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{legal_address:Object.assign(Object.assign({},this.formController.values.getValue().legal_address),{[e]:a})}))}render(){var e,d,i,s,c,o,r,n,f,b,u,h;const y=this.formController.getInitialValues().legal_address;return a(t,{key:"3b391bb2404c911e1663835acf0d13e7aab73735"},a("fieldset",{key:"f5db5dd65ba422e05728b38e562d1140777f4208"},a("legend",{key:"a1e464501561d649b6b514de45967d84d5f69f2a",part:l},"Business Legal Address"),a("div",{key:"f64e06197c22f9d0cddb7b78d181aec203070612",class:"row gy-3"},a("div",{key:"0c5ed4640de17b420021beedf69fbf6fedc16b5e",class:"col-12"},a("form-control-text",{key:"449f633ae6ff84855258898a90f9adfc028b9685",name:"line1",label:"Legal Address",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.line1,errorText:null===(d=null===(e=this.errors)||void 0===e?void 0:e.legal_address)||void 0===d?void 0:d.line1})),a("div",{key:"6cdc7bd96fbcdccf3d2da67ce2c0c110be6f215f",class:"col-12"},a("form-control-text",{key:"5d179741b7462cd569f43aaa16ea78a89dd2f7dd",name:"line2",label:"Address Line 2",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.line2,errorText:null===(s=null===(i=this.errors)||void 0===i?void 0:i.legal_address)||void 0===s?void 0:s.line2})),a("div",{key:"55df7defd5dff8f7b56d639319c4067b53ce8fb8",class:"col-12"},a("form-control-text",{key:"dfb822432d69a8e53424faa4e5ffb00d25601836",name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.city,errorText:null===(o=null===(c=this.errors)||void 0===c?void 0:c.legal_address)||void 0===o?void 0:o.city})),a("div",{key:"533670b7a9b60d45bf05684b48c2034f99d4b484",class:"col-12"},a("form-control-select",{key:"f10ed112c00c798c1b482f8893ef04737deb1dc5",name:"state",label:"State",options:m,inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.state,errorText:null===(n=null===(r=this.errors)||void 0===r?void 0:r.legal_address)||void 0===n?void 0:n.state})),a("div",{key:"7d67e97ebbb48402ede6aed07fe72154cf3424fa",class:"col-12"},a("form-control-text",{key:"5bccb6167aac8b9f64254dc93376f51b6489c0c9",name:"postal_code",label:"Postal Code",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.postal_code,errorText:null===(b=null===(f=this.errors)||void 0===f?void 0:f.legal_address)||void 0===b?void 0:b.postal_code,maxLength:5,keyDownHandler:v})),a("div",{key:"8a03c711d712e013590d5489d3bffa5145ac0a7a",class:"col-12"},a("form-control-select",{key:"e58697ad7a448ab860a8f72a053dbaf030faabbd",name:"country",label:"Country",options:[{label:"United States",value:"USA"}],inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.country,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.legal_address)||void 0===h?void 0:h.country,disabled:!0})))))}};export{y as form_alert,p as justifi_additional_questions,k as justifi_business_core_info,x as justifi_business_representative,j as justifi_legal_address_form}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as i,H as o}from"./p-qipqIMyC.js";import{C as s}from"./p-ZpPDShvP.js";import{r as a}from"./p-RvUQ__Pq.js";import"./p-HXpYMWUU.js";const d=class{constructor(i){e(this,i),this.paymentMethodOptionSelected=t(this,"paymentMethodOptionSelected"),this.onPaymentMethodOptionClick=e=>{e.preventDefault(),this.paymentMethodOptionSelected.emit(this.paymentMethodOption)}}async resolvePaymentMethod(e){var t;return e.isValid?{token:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id}:{validationError:!0}}render(){var e,t,d;return i(o,{key:"5ec0e8509e57396844602de87fde994f5da2ba83",class:"payment-method"},i("div",{key:"f2a45d84e969cd04aca91d61f5819bfc85f558c9",class:"radio-list-item p-3",part:a,onClick:this.onPaymentMethodOptionClick},i("form-control-radio",{key:"1f4c35b2b6faa8ee42a1ee7347ddf2238b47fe50",name:"paymentMethodType",value:null===(e=this.paymentMethodOption)||void 0===e?void 0:e.id,checked:this.isSelected,label:`${s[null===(t=this.paymentMethodOption)||void 0===t?void 0:t.brand]||""} *${null===(d=this.paymentMethodOption)||void 0===d?void 0:d.acct_last_four}`})))}};export{d as justifi_saved_payment_method}
@@ -1 +1 @@
1
- import{r as t,c as s,h as e,H as i}from"./p-qipqIMyC.js";import{I as a}from"./p-Ce_F4E0f.js";import{C as r}from"./p-B-iV5cYd.js";import{a2 as h,l as o,U as n,b as l,T as c,a as f}from"./p-RvUQ__Pq.js";import{F as d}from"./p-oGKW57R8.js";import{F as p}from"./p-DCMrHeJI.js";import"./p-CZfYo5-1.js";const m=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.imask=null,this.isFocused=!1,this.maskOptions=r.DECIMAL,this.initializeIMask=()=>{this.textInput&&(this.imask=a(this.textInput,this.maskOptions),this.imask.on("accept",(()=>{const t=this.imask.unmaskedValue;this.inputHandler(this.name,t),this.formControlInput.emit({name:this.name,value:t})})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=t=>{const s=t.target.getAttribute("name");this.formControlInput.emit({name:s,value:this.imask.unmaskedValue})},this.updateInput=t=>{this.imask&&(this.imask.value=String(t))}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.initializeIMask(),this.updateInput(this.defaultValue)}disconnectedCallback(){var t;null===(t=this.imask)||void 0===t||t.destroy()}get inputPart(){let t=h;return this.errorText&&(t=l),this.disabled&&(t=c),this.isFocused&&(t=f),t}render(){return e(i,{key:"59e5e4d46e7d4ece898464d846505756611f6635"},e("div",{key:"e82201d6777584666ec5ca04ad9e02b83fa956c0",class:"form-group d-flex flex-column"},e("label",{key:"9bbb22bb201d3db07670e4f26521593ff229f583",part:o,class:"form-label",htmlFor:this.name},this.label),e("div",{key:"61909b4796f78e22d9e6508d9257cdf16220e675",class:"input-group"},e("span",{key:"152a4f1a6323e55bf6f48aa25353939569acc419",class:"input-group-text",part:n},"$"),e("input",{key:"cc8055c02a4ccb4f63553f45b5ded4ee3d8cf972",ref:t=>this.textInput=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.inputPart,class:this.errorText?"form-control monetary is-invalid":"form-control monetary",type:"text",disabled:this.disabled})),e(d,{key:"776dfb4a9d74342ba139dda6706af8e60b4700fc",helpText:this.helpText,name:this.name}),e(p,{key:"74e503b7e525aeeb994b1ae94941f07365d2460e",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{m as form_control_monetary_provisioning}
1
+ import{r as t,c as s,h as i,H as a}from"./p-qipqIMyC.js";import{I as e}from"./p-Ce_F4E0f.js";import{C as r}from"./p-B-iV5cYd.js";import{a2 as h,l as o,U as n,b as c,T as l,a as f}from"./p-RvUQ__Pq.js";import{F as d}from"./p-oGKW57R8.js";import{F as p}from"./p-DCMrHeJI.js";import"./p-CZfYo5-1.js";const m=class{constructor(i){t(this,i),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.imask=null,this.isFocused=!1,this.maskOptions=r.DECIMAL,this.initializeIMask=()=>{this.textInput&&(this.imask=e(this.textInput,this.maskOptions),this.imask.on("accept",(()=>{const t=this.imask.unmaskedValue;this.inputHandler(this.name,t),this.formControlInput.emit({name:this.name,value:t})})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=t=>{const s=t.target.getAttribute("name");this.formControlInput.emit({name:s,value:this.imask.unmaskedValue})},this.updateInput=t=>{this.imask&&(this.imask.value=String(t))}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.initializeIMask(),this.updateInput(this.defaultValue)}disconnectedCallback(){var t;null===(t=this.imask)||void 0===t||t.destroy()}get inputPart(){let t=h;return this.errorText&&(t=c),this.disabled&&(t=l),this.isFocused&&(t=f),t}render(){return i(a,{key:"8378b6d06aeeb48d1e3efed4d16b22655e2c23ff"},i("div",{key:"cc432cb0a138c336def8b55ac06aa933407d38ef",class:"form-group d-flex flex-column"},i("label",{key:"08119d56a108275c4f25d28f7b8074ca134c3b72",part:o,class:"form-label",htmlFor:this.name},this.label),i("div",{key:"bcf621d3cae2636304185197cb8d3f40f3f0f173",class:"input-group"},i("span",{key:"3ee602416b555c9bf561abc4055f0a2485762551",class:"input-group-text",part:n},"$"),i("input",{key:"54c1257a97daae319f5c0ce7556638790e3f286b",ref:t=>this.textInput=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.inputPart,class:this.errorText?"form-control monetary is-invalid":"form-control monetary",type:"text",disabled:this.disabled})),i(d,{key:"b7458313a43d454ad8988f1e4548c7034a5d09d8",helpText:this.helpText,name:this.name}),i(p,{key:"8e59747949f4fa6697a3b7c083bcd6584d1f5411",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{m as form_control_monetary_provisioning}
@@ -1 +1 @@
1
- import{p as t}from"./p-BBpkkt2-.js";import{A as s}from"./p-BUa0YOaw.js";import"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class o{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("storybook")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters&&this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{var s,i;if("undefined"!=typeof process&&("test"===(null===(s=process.env)||void 0===s?void 0:s.NODE_ENV)||(null===(i=process.env)||void 0===i?void 0:i.JEST_WORKER_ID)))return;const e=t.version,o=t.name,n=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(o),r=n.replace(/-rc.*/,""),a=e.split("."),c=n.split(".");a[0]!==c[0]&&console.warn(`The package ${o} is out of date. The latest version is ${r}. Please update.`)};export{o as J,n as c}
1
+ import{p as t}from"./p-tyhA5jkt.js";import{A as s}from"./p-BUa0YOaw.js";import"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class o{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("storybook")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters&&this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{var s,i;if("undefined"!=typeof process&&("test"===(null===(s=process.env)||void 0===s?void 0:s.NODE_ENV)||(null===(i=process.env)||void 0===i?void 0:i.JEST_WORKER_ID)))return;const e=t.version,o=t.name,n=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(o),r=n.replace(/-rc.*/,""),a=e.split("."),c=n.split(".");a[0]!==c[0]&&console.warn(`The package ${o} is out of date. The latest version is ${r}. Please update.`)};export{o as J,n as c}
@@ -1 +1 @@
1
- import{h as t,r as s,c as e}from"./p-qipqIMyC.js";import{c as r,a as i,F as o}from"./p-CR9D6mKt.js";import{f as n}from"./p-BHf9IqGw.js";import"./p-Bp_QFeog.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,j as m}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{B as h}from"./p-D6XirF21.js";import{S as p}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-CpKvg1ok.js";import{m as d}from"./p-CU4XQ3fO.js";import{c as f,J as v}from"./p-D_5McRD_.js";import{g as j,a as y}from"./p-D2muobcE.js";import{A as b}from"./p-BUa0YOaw.js";import{S as w}from"./p-Xv8DuU3Y.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-RvUQ__Pq.js";import"./p-BBpkkt2-.js";const g=t=>{const s=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${n(s)}`,(function(t){return+t<=+s})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},C=t=>{if(t)return r({amount:g(t),description:i().optional(),reason:i().optional().oneOf([l.customerRequest,l.duplicate,l.fraudulent],"Select a reason")})},B=[{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"}],k=b();class x{async postRefund(t,s,e,r){return k.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":s},body:r,authToken:e})}}const A=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),R=()=>t(p,null,t("div",{class:"row gap-5"},t(A,null),t(A,null),t(A,null))),q=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,s)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:s}))}}componentWillLoad(){f(),this.analytics=new v(this),this.initializeApi(),this.formController=new o(C())}handleError(t,s,e){this.errorEvent.emit({errorCode:t,message:s,severity:e})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(u.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",a.ERROR)}initializeFormController(){const t=this.refundPayload.amount,s=t?t.toString():"0";this.formController=new o(C(s)),this.formController.setInitialValues({amount:s}),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?d({id:this.paymentId,authToken:this.authToken,service:new c})({onSuccess:({payment:t})=>{this.refundPayload=new m({amount:t.amount_refundable})},onError:({error:t,code:s,severity:e})=>{this.handleError(s,t,e)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(u.MISSING_PROPS,"Payment ID and Auth Token are required",a.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const s=(({authToken:t,accountId:s,paymentId:e,service:r})=>async({refundBody:i,onSuccess:o,onError:n,final:u})=>{var l;try{const u=await r.postRefund(e,s,t,i);if(u.error)return n({error:y(u.error),code:j(null===(l=u.error)||void 0===l?void 0:l.code),severity:a.ERROR});o(u)}catch(t){const s=j(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:a.ERROR})}finally{return u()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new x}),e=this.formController.values.getValue();return this.refundLoading=!0,new Promise((t=>{let r;s({refundBody:e,onSuccess:t=>{r=t},onError:({error:t,code:s,severity:e})=>{r=t,this.handleError(t,s,e)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,t(r.data)}})}))}render(){if(this.paymentLoading)return t(R,null);const s=this.formController.getInitialValues(),e=this.refundPayload.amount;return t(p,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:s.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:s.reason,inputHandler:this.inputHandler,options:B,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:s.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(h,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${n(+e)}`))))))}};export{q as justifi_refund_payment}
1
+ import{h as t,r as s,c as e}from"./p-qipqIMyC.js";import{c as r,a as i,F as o}from"./p-CR9D6mKt.js";import{f as n}from"./p-BHf9IqGw.js";import"./p-Bp_QFeog.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,j as m}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{B as h}from"./p-D6XirF21.js";import{S as p}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-CpKvg1ok.js";import{m as d}from"./p-CU4XQ3fO.js";import{c as f,J as v}from"./p-CtA2NMVz.js";import{g as j,a as y}from"./p-D2muobcE.js";import{A as b}from"./p-BUa0YOaw.js";import{S as w}from"./p-Xv8DuU3Y.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-RvUQ__Pq.js";import"./p-tyhA5jkt.js";const C=t=>{const s=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${n(s)}`,(function(t){return+t<=+s})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},g=t=>{if(t)return r({amount:C(t),description:i().optional(),reason:i().optional().oneOf([l.customerRequest,l.duplicate,l.fraudulent],"Select a reason")})},A=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],x=b();class k{async postRefund(t,s,e,r){return x.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":s},body:r,authToken:e})}}const B=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),R=()=>t(p,null,t("div",{class:"row gap-5"},t(B,null),t(B,null),t(B,null))),q=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,s)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:s}))}}componentWillLoad(){f(),this.analytics=new v(this),this.initializeApi(),this.formController=new o(g())}handleError(t,s,e){this.errorEvent.emit({errorCode:t,message:s,severity:e})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(u.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",a.ERROR)}initializeFormController(){const t=this.refundPayload.amount,s=t?t.toString():"0";this.formController=new o(g(s)),this.formController.setInitialValues({amount:s}),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?d({id:this.paymentId,authToken:this.authToken,service:new c})({onSuccess:({payment:t})=>{this.refundPayload=new m({amount:t.amount_refundable})},onError:({error:t,code:s,severity:e})=>{this.handleError(s,t,e)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(u.MISSING_PROPS,"Payment ID and Auth Token are required",a.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const s=(({authToken:t,accountId:s,paymentId:e,service:r})=>async({refundBody:i,onSuccess:o,onError:n,final:u})=>{var l;try{const u=await r.postRefund(e,s,t,i);if(u.error)return n({error:y(u.error),code:j(null===(l=u.error)||void 0===l?void 0:l.code),severity:a.ERROR});o(u)}catch(t){const s=j(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:a.ERROR})}finally{return u()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new k}),e=this.formController.values.getValue();return this.refundLoading=!0,new Promise((t=>{let r;s({refundBody:e,onSuccess:t=>{r=t},onError:({error:t,code:s,severity:e})=>{r=t,this.handleError(t,s,e)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,t(r.data)}})}))}render(){if(this.paymentLoading)return t(R,null);const s=this.formController.getInitialValues(),e=this.refundPayload.amount;return t(p,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:s.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:s.reason,inputHandler:this.inputHandler,options:A,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:s.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(h,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${n(+e)}`))))))}};export{q as justifi_refund_payment}
@@ -0,0 +1 @@
1
+ import{r as e,h as a}from"./p-qipqIMyC.js";import{u as d,a as t,b as c}from"./p-1ydcg9ti.js";import{P as s,S as i}from"./p-B-iV5cYd.js";import{C as l}from"./p-RvUQ__Pq.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const o=class{constructor(a){e(this,a),this.inputHandler=(e,a)=>{d(this.formController,{[e]:a})},this.onAddressFormUpdate=e=>{t(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))}}render(){var e,d,t,o,r,f,n;return a("form",{key:"a2c558b8a6b66d7257fa86ef5f9c1d56a7a273db"},a("fieldset",{key:"23cb7f2debd4692c39cfe2311ce0d2549ca94ebc"},a("div",{key:"0c6e94b6a9da6924673f5ebeed93f237ff22a013",class:"d-flex align-items-center gap-2"},a("legend",{key:"a165d7dc17dddde2d6ce35af9d836a989f02ffaf",class:"mb-0",part:l},"Representative"),a("form-control-tooltip",{key:"5c2c29ae9ea82acc6c923c870f4ece5db5e7afb9",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."})),a("hr",{key:"bc481e820461c6ec2088f2879cb9a5837ed02884",class:"mt-2"}),a("div",{key:"ff4b0731213ddc42ebabb79d49984b83d376f742",class:"row gy-3"},a("div",{key:"99cac91d3657bce68ce97028342d49cb8a2bb314",class:"col-12 col-md-8"},a("form-control-text",{key:"534e81b075f732ae3953d8f904199d61a43de4bb",name:"name",label:"Full Name",defaultValue:null===(e=this.representativeDefaultValue)||void 0===e?void 0:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{key:"6070fdff99a868b50deb59c9d006d3c4775a50bd",class:"col-12 col-md-4"},a("form-control-text",{key:"c92477cc30c5a9c7d99842dff2855edce67185f9",name:"title",label:"Title",defaultValue:null===(d=this.representativeDefaultValue)||void 0===d?void 0:d.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),a("div",{key:"14d953417a1ec0292d75251b37b580361def0fb3",class:"col-12 col-md-6"},a("form-control-text",{key:"42562735066b104619b8aa4da966aaec462f177b",name:"email",label:"Email Address",defaultValue:null===(t=this.representativeDefaultValue)||void 0===t?void 0:t.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"cb7f6173a31fac67edf74844f0807ea94446c59b",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"42b0833d545243c11f515d320aac5408bb744e89",name:"phone",label:"Phone Number",defaultValue:null===(o=this.representativeDefaultValue)||void 0===o?void 0:o.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:s.US})),a("div",{key:"a9468f20a7d832ae44d771c3b8913c32cf0ef2ab",class:"col-12 col-md-4"},a("form-control-date",{key:"1f739c1d3bb814710ee159740e459bde72a0e790",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:e=>c(e,this.formController),helpText:"Must be 18 or older."})),a("div",{key:"e2ecd87320422e1712138115291016f8c1c61ac2",class:"col-12 col-md-8"},a("form-control-number-masked",{key:"dd91ffa7877d84cfe315849d18c7cec5bf79b1de",name:"identification_number",label:"SSN",defaultValue:null===(f=this.representativeDefaultValue)||void 0===f?void 0:f.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:i,helpText:"Enter your full Social Security Number. It is required for Federal OFAC check."})),a("div",{key:"ef502c55424287c5c81ca88593f5836d21a2f945",class:"col-12"},a("justifi-identity-address-form",{key:"26295cbccf0ca23415b4d7c12dc42eb2dbb0d229",errors:this.errors.address,defaultValues:null===(n=this.representativeDefaultValue)||void 0===n?void 0:n.address,handleFormUpdate:this.onAddressFormUpdate})))))}};export{o as justifi_business_representative_form_inputs}
@@ -0,0 +1 @@
1
+ import{h as t,r as s,c as i}from"./p-qipqIMyC.js";import{A as e}from"./p-BUa0YOaw.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{c,J as l}from"./p-CtA2NMVz.js";import{c as h}from"./p-CrQgyTRz.js";import{p,f as d,r as u,i as v}from"./p-BHf9IqGw.js";import{v as m,i as y,a as f,H as j}from"./p-Bvp7uul3.js";import{z as _,A as g}from"./p-RvUQ__Pq.js";import{S as w}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{S as C}from"./p-Xv8DuU3Y.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-tyhA5jkt.js";import"./p-DCIW8z1f.js";import"./p-HXpYMWUU.js";const k=e();class b{async fetchQuote(t,s){return k.post({endpoint:"insurance/quotes",body:s,authToken:t})}async toggleCoverage(t,s,i){return k.post({endpoint:`insurance/quotes/${s}/toggle`,body:i,authToken:t})}}const q=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(C,{width:"35%",height:"30px"})),t("div",{class:"col-12"},t(C,{width:"70%"})),t("div",{class:"col-12"},t(C,{width:"40%"})),t("div",{class:"col-12"},t(C,{width:"40%"})),t("div",{class:"col-12"},t(C,{width:"100%"})),t("div",{class:"col-12"},t(C,{width:"80%"}))),T=class{constructor(t){s(this,t),this.insuranceUpdated=i(this,"insurance-updated"),this.errorEvent=i(this,"error-event"),this.isLoading=!0}async validate(){return m()}processHTMLContent(t){return p(t,[t=>u(t,"style"),t=>v(t,"a","part",_),t=>v(t,"p","part",_)])}componentWillLoad(){c(),this.analytics=new l(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}initializeServiceMethods(){const t=this.authToken||h.authToken;if(!t)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:r.ERROR});const s={authToken:t,service:new b};this.getQuote=(({authToken:t,service:s})=>async({payload:i,onSuccess:e,onError:o})=>{var c;try{const l=await s.fetchQuote(t,i);if(l.error)return o({error:n(l.error),code:a(null===(c=l.error)||void 0===c?void 0:c.code),severity:r.ERROR});e({quote:l.data})}catch(t){const s=a(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:r.ERROR})}})(s),this.toggleCoverage=(({authToken:t,service:s})=>async({quoteId:i,payload:e,onSuccess:o,onError:c})=>{var l;try{const h=await s.toggleCoverage(t,i,e);if(h.error)return c({error:n(h.error),code:a(null===(l=h.error)||void 0===l?void 0:l.code),severity:r.ERROR});o({quote:h.data})}catch(t){const s=a(null==t?void 0:t.code);return c({error:t.message||t,code:s,severity:r.ERROR})}})(s)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||h.checkoutId,policy_type:"season_interruption",primary_identity:{state:this.primaryIdentityState,email:this.primaryIdentityEmailAddress,first_name:this.primaryIdentityFirstName,last_name:this.primaryIdentityLastName,postal_code:this.primaryIdentityPostalCode,country:this.primaryIdentityCountry},policy_attributes:{insurable_amount:this.policyAttributesInsurableAmount,start_date:this.policyAttributesStartDate,end_date:this.policyAttributesEndDate,covered_identity:{first_name:this.coveredIdentityFirstName,last_name:this.coveredIdentityLastName}}},onSuccess:({quote:t})=>{this.quote=t,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),y[t.policy_type]=t.accepted,this.isLoading=!1},onError:({error:t,code:s,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:s,message:t,severity:i})}})}onChangeHandler(t,s){this.accepted=s,f[this.quote.policy_type]=!1,this.toggleCoverage({quoteId:this.quote.id,payload:{accepted:this.accepted},onSuccess:()=>{this.insuranceUpdated.emit(),y[this.quote.policy_type]=this.accepted},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({errorCode:s,message:t,severity:i})}})}get error(){var t;return f[null===(t=this.quote)||void 0===t?void 0:t.policy_type]}render(){var s,i,e,r;return h&&!1===h.insuranceEnabled?(console.warn("[justifi-season-interruption-insurance] Insurance is disabled for this checkout (payment_settings.insurance_payments=false)."),null):t(w,null,this.isLoading?t(q,null):t("div",null,t(j,{text:null===(s=this.quote)||void 0===s?void 0:s.product.title,class:"fs-5 fw-bold pb-3"}),t("small",{part:_,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),t("form-control-radio",{label:`Accept coverage for ${d(null===(e=this.quote)||void 0===e?void 0:e.total_cents)}`,name:"opt-in",value:"true",checked:"true"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),t("form-control-radio",{label:"Decline coverage",name:"opt-in",value:"false",checked:"false"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),t("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:g},"Please select an option"),t("small",{part:_,innerHTML:null===(r=this.quote)||void 0===r?void 0:r.product.legal_disclaimer})))}};export{T as justifi_season_interruption_insurance}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i}from"./p-qipqIMyC.js";import{c as a,J as s}from"./p-D_5McRD_.js";import{c as d}from"./p-CrQgyTRz.js";import{d as o}from"./p-RvUQ__Pq.js";import{S as c}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{P as h}from"./p-DCIW8z1f.js";import"./p-BBpkkt2-.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const r=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event"),this.loadedEvent=t(this,"loaded"),this.submitEvent=t(this,"submit-event"),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){a(),this.analytics=new s(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disableBnpl=this.disableBnpl,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(c,{key:"8967ceca5773c0f5913b893f8b626ef2eb58abe8"},i("justifi-modular-checkout",{key:"74294e37e359e68601699a543751c0835f074d47",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId},i("div",{key:"9daf1561a627f0a84dd7390c7d44ffab15a4a746",class:"row gy-3 jfi-checkout-core"},i("div",{key:"1f45fa61d3fa5f3e21d3086123aef3137734a363",class:"col-12",part:o},i("justifi-header",{key:"812d922d688bb5e00eaff3f967350b705454a06c",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"9c8cfe346833339197f3922dcbee7230308064e6"},i("justifi-checkout-summary",{key:"8b6410ed811ff2793167ab8b21954d6bbb52c3d8"}))),i("div",{key:"87413afe99372a8523b25b8e3fe14b17666328ac",class:"col-12 mt-4"},i("slot",{key:"f8342527afd4e86abda3275db447e82f72e13e03",name:"insurance"})),i("div",{key:"97b39e4f03829ea5d1d29b2b1be3066ff4100ac7",class:"col-12 mt-4"},i("justifi-header",{key:"2b3196519d949d534595767879102951caad5788",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"c40bbfddfb990feda4aa75ab4caa38b4376b4a04",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"c323e2e892985b02a607253355b0b72eb5bfe9e9",class:"d-flex flex-column"},i("section",{key:"c85bb72343b256d072a086a4974167d421154023"},i("div",{key:"f4cb5c3b7fa4facbff7882b769da2bf9b9d01811"},i("justifi-saved-payment-methods",{key:"087cbde10cb23af391eb848f53a3732cdd528cd0"}),this.availablePaymentMethods.includes(h.SEZZLE)&&i("justifi-radio-list-item",{key:"35c7b0484cbec62b115aa8851c8266cd4d39b2b6",name:"paymentMethodType",value:h.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===h.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(h.PLAID)&&i("justifi-radio-list-item",{key:"a7ec30342cbb3453b460e72d60a1c726e3a3efa3",name:"paymentMethodType",value:h.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===h.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("justifi-tokenize-payment-method",{key:"590b2085e9aee9a06f5ee1755aeeb41aa3448699",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"b725e958faa55605e4542f59d461780eeced96fe",class:"mt-4"},i("justifi-button",{key:"119f7879620fc6dd06517c7a894ec05b60b1d4f8",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disableBnpl:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{r as justifi_checkout}
1
+ import{r as e,c as t,h as i}from"./p-qipqIMyC.js";import{c as a,J as s}from"./p-CtA2NMVz.js";import{c as d}from"./p-CrQgyTRz.js";import{d as c}from"./p-RvUQ__Pq.js";import{S as o}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{P as h}from"./p-DCIW8z1f.js";import"./p-tyhA5jkt.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const r=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event"),this.loadedEvent=t(this,"loaded"),this.submitEvent=t(this,"submit-event"),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){a(),this.analytics=new s(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disableBnpl=this.disableBnpl,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"65e97b6e7b25f885beda63487d96877ac4785847"},i("justifi-modular-checkout",{key:"dc009a2897ae02dfaa9ca7694dc20a588bca5b8a",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId},i("div",{key:"8c8536f5139ad2d05316546a5442552e87992d89",class:"row gy-3 jfi-checkout-core"},i("div",{key:"20135fb737963df1d2c5e790881b98d6efa8c04b",class:"col-12",part:c},i("justifi-header",{key:"4fa1fdcad237ce5014266adbd6fec1fa766c3e44",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"44a694a98e30ebd21e1f3d2beaafe8d5d11f1a36"},i("justifi-checkout-summary",{key:"1ff39b9c2d31649f2346d0aa666168d1cbe1deca"}))),i("div",{key:"6401bebd557fcf9ef73746c2ee4f2d67ccccf73b",class:"col-12 mt-4"},i("slot",{key:"72d1e32aaed73232cf2b2d247ab5e7fc19a36092",name:"insurance"})),i("div",{key:"2fea8b30dd19032afc7a5b37abe897aa1aee1362",class:"col-12 mt-4"},i("justifi-header",{key:"8b2d443e9e5db4ba95ab72983e737a7579824e69",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"67a2c1a30841a789b9b2ee2d16209373ad055783",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"1fdb903931cd73a801975eabd12d7ad43cefcb97",class:"d-flex flex-column"},i("section",{key:"29b3a041e397aebae60106ac508188d6b4770f1f"},i("div",{key:"0ab54f7a284a59d8bcae57df1abe8e8347628fc2"},i("justifi-saved-payment-methods",{key:"b8f73b6e8992e99332dc55cf6ed099ccb60953c3"}),this.availablePaymentMethods.includes(h.SEZZLE)&&i("justifi-radio-list-item",{key:"d87bd60da7d44160a56de342fcbe6c505e8d79e5",name:"paymentMethodType",value:h.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===h.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(h.PLAID)&&i("justifi-radio-list-item",{key:"9d0527fe516eaee74a10314a6f7a866cf40a6942",name:"paymentMethodType",value:h.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===h.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("justifi-tokenize-payment-method",{key:"fd29144c8e488ee48361df556bde824a80d1a207",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"9f3cc42ae66e37193ab0b6df7f5235aaf8cc3c84",class:"mt-4"},i("justifi-button",{key:"2cbd13a7bde5ce0478e948456edb2191f9b96c0b",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disableBnpl:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{r as justifi_checkout}