@justifi/webcomponents 6.14.4 → 6.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/cjs/{Analytics-CMv0MKQ4.js → Analytics-BVHauOC2.js} +2 -2
  2. package/dist/cjs/{Api-ChUqJ75C.js → Api-BzB0rppJ.js} +1 -1
  3. package/dist/cjs/additional-questions-form-step_15.cjs.entry.js +4 -4
  4. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  5. package/dist/cjs/{business.service-BSoN1ENP.js → business.service-j_VDzA2-.js} +1 -1
  6. package/dist/cjs/card-form.cjs.entry.js +2 -2
  7. package/dist/cjs/{check-pkg-version-mt-o0WFo.js → check-pkg-version-JMiLuNXu.js} +1 -1
  8. package/dist/cjs/{checkout.service-BDUrLWyA.js → checkout.service-0vHtBDZY.js} +1 -1
  9. package/dist/cjs/dispute-notification_2.cjs.entry.js +5 -5
  10. package/dist/cjs/{event-types-DlZRGu3q.js → event-types-CMpeGHw8.js} +1 -1
  11. package/dist/cjs/form-alert_3.cjs.entry.js +1 -1
  12. package/dist/cjs/{get-subaccounts-w4iQAASi.js → get-subaccounts-B7e8Eovg.js} +1 -1
  13. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +37 -19
  14. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +4 -4
  15. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +4 -4
  16. package/dist/cjs/justifi-business-details.cjs.entry.js +5 -5
  17. package/dist/cjs/justifi-business-form.cjs.entry.js +5 -5
  18. package/dist/cjs/justifi-card-form.cjs.entry.js +4 -4
  19. package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +4 -4
  20. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
  21. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +6 -6
  22. package/dist/cjs/justifi-dispute-management.cjs.entry.js +5 -5
  23. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -4
  24. package/dist/cjs/justifi-order-terminals.cjs.entry.js +6 -6
  25. package/dist/cjs/justifi-payment-details.cjs.entry.js +5 -5
  26. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -5
  27. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +5 -5
  28. package/dist/cjs/justifi-payments-list.cjs.entry.js +5 -5
  29. package/dist/cjs/justifi-payout-details.cjs.entry.js +5 -5
  30. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +5 -5
  31. package/dist/cjs/justifi-payouts-list.cjs.entry.js +6 -6
  32. package/dist/cjs/justifi-qr-terminal.cjs.entry.js +5 -5
  33. package/dist/cjs/justifi-refund-payment.cjs.entry.js +5 -5
  34. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +4 -4
  35. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +4 -4
  36. package/dist/cjs/justifi-terminals-list.cjs.entry.js +6 -6
  37. package/dist/cjs/loader.cjs.js +1 -1
  38. package/dist/cjs/{package-V2lnhWch.js → package-DfdMLmz7.js} +1 -1
  39. package/dist/cjs/{payment.service-CUuADjYH.js → payment.service-Bs3HJ4Kv.js} +1 -1
  40. package/dist/cjs/{payout.service-D_gucuzq.js → payout.service-DNWZxt3R.js} +1 -1
  41. package/dist/cjs/{plaid.service-DIPjzg_M.js → plaid.service-B_YQGBoC.js} +1 -1
  42. package/dist/cjs/{terminal.service-DVxXWBU7.js → terminal.service-CvFZEemr.js} +1 -1
  43. package/dist/cjs/webcomponents.cjs.js +1 -1
  44. package/dist/collection/components/modular-checkout/justifi-modular-checkout.js +20 -5
  45. package/dist/collection/components/modular-checkout/sub-components/justifi-sezzle-payment-method.js +12 -10
  46. package/dist/docs.json +1 -1
  47. package/dist/esm/{Analytics-C8-CZjVs.js → Analytics-Dgz_MQ1D.js} +2 -2
  48. package/dist/esm/{Api-BmZr64rt.js → Api-DScockhO.js} +1 -1
  49. package/dist/esm/additional-questions-form-step_15.entry.js +4 -4
  50. package/dist/esm/bank-account-form.entry.js +2 -2
  51. package/dist/esm/{business.service-BTTf2CSv.js → business.service-DR2ldRqG.js} +1 -1
  52. package/dist/esm/card-form.entry.js +2 -2
  53. package/dist/esm/{check-pkg-version-B697jYyG.js → check-pkg-version-CPMg0K2m.js} +1 -1
  54. package/dist/esm/{checkout.service-B3BXVtHv.js → checkout.service-CU4BnB34.js} +1 -1
  55. package/dist/esm/dispute-notification_2.entry.js +5 -5
  56. package/dist/esm/{event-types-DEIzZDtB.js → event-types-BNfdthYa.js} +1 -1
  57. package/dist/esm/form-alert_3.entry.js +1 -1
  58. package/dist/esm/{get-subaccounts-CnKtCpiU.js → get-subaccounts-BraeNX17.js} +1 -1
  59. package/dist/esm/justifi-apple-pay_11.entry.js +37 -19
  60. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +4 -4
  61. package/dist/esm/justifi-bank-account-form.entry.js +4 -4
  62. package/dist/esm/justifi-business-details.entry.js +5 -5
  63. package/dist/esm/justifi-business-form.entry.js +5 -5
  64. package/dist/esm/justifi-card-form.entry.js +4 -4
  65. package/dist/esm/justifi-checkout-qr-code.entry.js +4 -4
  66. package/dist/esm/justifi-checkout.entry.js +4 -4
  67. package/dist/esm/justifi-checkouts-list.entry.js +6 -6
  68. package/dist/esm/justifi-dispute-management.entry.js +5 -5
  69. package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
  70. package/dist/esm/justifi-order-terminals.entry.js +6 -6
  71. package/dist/esm/justifi-payment-details.entry.js +5 -5
  72. package/dist/esm/justifi-payment-provisioning.entry.js +5 -5
  73. package/dist/esm/justifi-payment-transactions-list.entry.js +5 -5
  74. package/dist/esm/justifi-payments-list.entry.js +5 -5
  75. package/dist/esm/justifi-payout-details.entry.js +5 -5
  76. package/dist/esm/justifi-payout-transactions-list.entry.js +5 -5
  77. package/dist/esm/justifi-payouts-list.entry.js +6 -6
  78. package/dist/esm/justifi-qr-terminal.entry.js +5 -5
  79. package/dist/esm/justifi-refund-payment.entry.js +5 -5
  80. package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -4
  81. package/dist/esm/justifi-terminal-orders-list.entry.js +4 -4
  82. package/dist/esm/justifi-terminals-list.entry.js +6 -6
  83. package/dist/esm/loader.js +1 -1
  84. package/dist/esm/{package-DlhPMNzz.js → package-CiypNylL.js} +1 -1
  85. package/dist/esm/{payment.service-Ciw1eGvT.js → payment.service-BxBf9T-D.js} +1 -1
  86. package/dist/esm/{payout.service-2jjZOOvC.js → payout.service-DKe3_O4y.js} +1 -1
  87. package/dist/esm/{plaid.service-CuAL_uL3.js → plaid.service-DwWljJOH.js} +1 -1
  88. package/dist/esm/{terminal.service-Di5Ma4sp.js → terminal.service-Q4KXLOka.js} +1 -1
  89. package/dist/esm/webcomponents.js +1 -1
  90. package/dist/module/justifi-modular-checkout2.js +20 -5
  91. package/dist/module/justifi-sezzle-payment-method2.js +12 -10
  92. package/dist/module/package.js +1 -1
  93. package/dist/types/components/modular-checkout/sub-components/justifi-sezzle-payment-method.d.ts +1 -1
  94. package/dist/webcomponents/{p-74de23d8.entry.js → p-027ef7e9.entry.js} +1 -1
  95. package/dist/webcomponents/{p-851a5865.entry.js → p-04153e8c.entry.js} +1 -1
  96. package/dist/webcomponents/{p-dd2654f5.entry.js → p-0d9022e5.entry.js} +1 -1
  97. package/dist/webcomponents/p-0fe976d6.entry.js +1 -0
  98. package/dist/webcomponents/{p-19721f28.entry.js → p-2128265d.entry.js} +1 -1
  99. package/dist/webcomponents/{p-40332723.entry.js → p-21a5c3d8.entry.js} +1 -1
  100. package/dist/webcomponents/{p-73f97f6a.entry.js → p-25d24964.entry.js} +1 -1
  101. package/dist/webcomponents/p-29f68bd0.entry.js +1 -0
  102. package/dist/webcomponents/p-3086ee7a.entry.js +1 -0
  103. package/dist/webcomponents/{p-8507bd99.entry.js → p-373586db.entry.js} +1 -1
  104. package/dist/webcomponents/{p-fbd08a2e.entry.js → p-3870712e.entry.js} +4 -4
  105. package/dist/webcomponents/{p-8bf07094.entry.js → p-387aba3d.entry.js} +1 -1
  106. package/dist/webcomponents/p-51714ea9.entry.js +1 -0
  107. package/dist/webcomponents/{p-63ed941e.entry.js → p-537ea763.entry.js} +1 -1
  108. package/dist/webcomponents/{p-359e35b5.entry.js → p-543fcff2.entry.js} +1 -1
  109. package/dist/webcomponents/{p-9f3b1212.entry.js → p-6884fa3d.entry.js} +1 -1
  110. package/dist/webcomponents/{p-b4d216cf.entry.js → p-9b758a11.entry.js} +1 -1
  111. package/dist/webcomponents/{p-Chs1q3Hw.js → p-BEOJqK7T.js} +1 -1
  112. package/dist/webcomponents/p-BL112JyU.js +1 -0
  113. package/dist/webcomponents/p-BlqdDtQr.js +1 -0
  114. package/dist/webcomponents/{p-D437Px2O.js → p-C0w_sG9P.js} +1 -1
  115. package/dist/webcomponents/{p-BpFSR2PV.js → p-C8g8unYJ.js} +1 -1
  116. package/dist/webcomponents/p-CiypNylL.js +1 -0
  117. package/dist/webcomponents/{p-5_w3jWjY.js → p-CnDagPty.js} +1 -1
  118. package/dist/webcomponents/{p-CfYe14W-.js → p-CnHbIkmu.js} +1 -1
  119. package/dist/webcomponents/{p-DwLofzXZ.js → p-DcA_wt-j.js} +1 -1
  120. package/dist/webcomponents/p-H4vl65HO.js +1 -0
  121. package/dist/webcomponents/{p-C1x6dkgs.js → p-WnMmPpEb.js} +1 -1
  122. package/dist/webcomponents/{p-003cd0b9.entry.js → p-a47854b9.entry.js} +1 -1
  123. package/dist/webcomponents/{p-bd46911b.entry.js → p-b9316945.entry.js} +1 -1
  124. package/dist/webcomponents/p-c0bd4006.entry.js +1 -0
  125. package/dist/webcomponents/{p-1255176f.entry.js → p-c14dde7c.entry.js} +1 -1
  126. package/dist/webcomponents/{p-11294ee2.entry.js → p-c5560a87.entry.js} +1 -1
  127. package/dist/webcomponents/{p-f9d0b34d.entry.js → p-cc5a97a0.entry.js} +1 -1
  128. package/dist/webcomponents/p-d57ae599.entry.js +1 -0
  129. package/dist/webcomponents/{p-a6f68a03.entry.js → p-e7909732.entry.js} +1 -1
  130. package/dist/webcomponents/{p-a0515894.entry.js → p-e954f46c.entry.js} +1 -1
  131. package/dist/webcomponents/{p-1a1591e3.entry.js → p-f6b900f4.entry.js} +1 -1
  132. package/dist/webcomponents/{p-0c2848c8.entry.js → p-f8cff289.entry.js} +1 -1
  133. package/dist/webcomponents/{p-546e5799.entry.js → p-f8f01bbb.entry.js} +1 -1
  134. package/dist/webcomponents/{p-BsnuluAl.js → p-rIJv0FaI.js} +1 -1
  135. package/dist/webcomponents/webcomponents.esm.js +1 -1
  136. package/package.json +1 -1
  137. package/dist/webcomponents/p-0ae95f48.entry.js +0 -1
  138. package/dist/webcomponents/p-34a4924b.entry.js +0 -1
  139. package/dist/webcomponents/p-661f50a9.entry.js +0 -1
  140. package/dist/webcomponents/p-B4Xi-t8v.js +0 -1
  141. package/dist/webcomponents/p-CumGHL0N.js +0 -1
  142. package/dist/webcomponents/p-DCwSevh5.js +0 -1
  143. package/dist/webcomponents/p-DlhPMNzz.js +0 -1
  144. package/dist/webcomponents/p-b140a8b8.entry.js +0 -1
  145. package/dist/webcomponents/p-db71a012.entry.js +0 -1
  146. package/dist/webcomponents/p-ee78df81.entry.js +0 -1
@@ -1 +1 @@
1
- import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{j as s,C as i,b as r}from"./p-8fO8CrtQ.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{J as o}from"./p-BpFSR2PV.js";import{c}from"./p-DwLofzXZ.js";import{g as p,a as h}from"./p-D1H6VUbM.js";import{P as d}from"./p-B4Xi-t8v.js";import{T as f,a as l,b as u,c as m,d as y,e as b,f as _,g,h as j,i as w,j as T,k,l as v}from"./p-DZr0wLGh.js";import{S as D}from"./p-05AWudQe.js";import{T as C}from"./p-CZfYo5-1.js";import{a as P}from"./p-Ds_P-dB8.js";import{a6 as F,a7 as R}from"./p-Bu7gdOaV.js";import"./p-DgTOxu8x.js";import"./p-DlhPMNzz.js";import"./p-C1x6dkgs.js";import"./p-MPer3Rw7.js";const S={created_at:()=>e("th",{part:F,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>e("th",{part:F,scope:"col",title:"The type of each transaction"},"Type"),id:()=>e("th",{part:F,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>e("th",{part:F,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>e("th",{part:F,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>e("th",{part:F,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>e("th",{part:F,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>e("th",{part:F,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>e("th",{part:F,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>e("th",{part:F,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>e("th",{part:F,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},x={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",platform_fee:"Platform Fee",platform_fee_return:"Platform Fee Return",processing_fee:"Processing Fee",processing_fee_return:"Processing Fee Return",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},I={created_at:(t,a)=>e("td",{part:R(a)},e("div",{class:"fw-bold"},P(t.created_at,{showDisplayDate:!0})),e("div",{class:"fw-bold"},P(t.created_at,{showTime:!0}))),type:(t,a)=>e("td",{part:R(a)},x[t.payment_balance_txn_type]),id:(t,a)=>e("td",{part:R(a)},t.id),amount:(t,a)=>e("td",{part:R(a),class:"text-end"},t.formattedPaymentAmount(t.amount)),balance:(t,a)=>e("td",{part:R(a),class:"text-end"},t.formattedPaymentAmount(t.balance)),currency:(t,a)=>e("td",{part:R(a)},t.currency),financial_transaction_id:(t,a)=>e("td",{part:R(a)},t.financial_transaction_id),payment_id:(t,a)=>e("td",{part:R(a)},t.payment_id),payment_balance_txn_type:(t,a)=>e("td",{part:R(a)},t.payment_balance_txn_type),source_id:(t,a)=>e("td",{part:R(a)},t.source_id),source_type:(t,a)=>e("td",{part:R(a)},t.source_type)},O=class{constructor(e){t(this,e),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=e=>{this.pagingParams={before_cursor:e},this.clickEvent.emit({name:C.previous})},this.handleClickNext=e=>{this.pagingParams={after_cursor:e},this.clickEvent.emit({name:C.next})},this.rowClickHandler=e=>{const t=e.target.closest("tr").dataset.rowEntityId;if(!t)return;const a=this.balanceTransactions.find((e=>e.id===t));this.clickEvent.emit({name:C.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,S,I),c(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeApi()}handleError(e,t,a){this.isLoading=!1,this.errorEvent.emit({errorCode:e,message:t,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:e,authToken:t,service:a})=>async({params:r,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(e,t,r);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:i.ERROR}):n({balanceTransactions:c.data.map((e=>new s(e))),pagingInfo:Object.assign({},c.page_info)})}catch(e){const t=p(null==e?void 0:e.code);o({error:h(e),code:t,severity:i.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:e,pagingInfo:t})=>{this.balanceTransactions=e,this.paging=t,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e.message,this.handleError(e,t,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(r.MISSING_PROPS,this.errorMessage,i.ERROR))}get entityId(){return this.balanceTransactions.map((e=>e.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return e(D,{key:"24e7a4313ab91f179fd27b6596f012487de06815"},e(l,{key:"1f9a7a56a940e41dd865bc6f3a8681ce86d60d58"},e(u,{key:"a26ce09ae4df84698be1ea37cb735e38c0a0402e"},e(m,{key:"07f8655efd483e1d9240e65b17dc13583028f376"},e(y,{key:"0b62a7700715dbaffbedc0538432d075a3158499"},this.transactionsTable.columnData.map((e=>e)))),e(b,{key:"adf75fa50ddfb5257875b2779fc6c157812d4c19"},e(_,{key:"bc77de512b3e5fd1e6c4b8cf908b46027a3bc33f",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),e(g,{key:"413d46e184399cba3993f37efd64cb0d0a10d905",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),e(j,{key:"9deaa794dc848ed7c85cbadc3b4cfe7c9fb1176f",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((t,a)=>e(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},t)))),this.paging&&e(T,{key:"16ca0811bf42dc9419f8b77086e8e7e2cf6d0085"},e(k,{key:"e11be42549832c35078acf47b7c165fe1e50ea98"},e(v,{key:"205d649068b84200b88adc1be9cfe192abfe13be",colSpan:this.transactionsTable.columnData.length},e("pagination-menu",{key:"2a28645220d4f18b7037e461bd93eefc3aed49a0",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{O as justifi_payment_transactions_list}
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{j as s,C as i,b as r}from"./p-8fO8CrtQ.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{J as o}from"./p-C8g8unYJ.js";import{c}from"./p-DcA_wt-j.js";import{g as p,a as h}from"./p-D1H6VUbM.js";import{P as d}from"./p-BL112JyU.js";import{T as f,a as l,b as u,c as m,d as y,e as b,f as _,g,h as j,i as w,j as T,k,l as v}from"./p-DZr0wLGh.js";import{S as C}from"./p-05AWudQe.js";import{T as D}from"./p-CZfYo5-1.js";import{a as P}from"./p-Ds_P-dB8.js";import{a6 as F,a7 as R}from"./p-Bu7gdOaV.js";import"./p-DgTOxu8x.js";import"./p-CiypNylL.js";import"./p-WnMmPpEb.js";import"./p-MPer3Rw7.js";const S={created_at:()=>e("th",{part:F,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>e("th",{part:F,scope:"col",title:"The type of each transaction"},"Type"),id:()=>e("th",{part:F,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>e("th",{part:F,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>e("th",{part:F,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>e("th",{part:F,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>e("th",{part:F,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>e("th",{part:F,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>e("th",{part:F,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>e("th",{part:F,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>e("th",{part:F,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},x={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",platform_fee:"Platform Fee",platform_fee_return:"Platform Fee Return",processing_fee:"Processing Fee",processing_fee_return:"Processing Fee Return",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},I={created_at:(t,a)=>e("td",{part:R(a)},e("div",{class:"fw-bold"},P(t.created_at,{showDisplayDate:!0})),e("div",{class:"fw-bold"},P(t.created_at,{showTime:!0}))),type:(t,a)=>e("td",{part:R(a)},x[t.payment_balance_txn_type]),id:(t,a)=>e("td",{part:R(a)},t.id),amount:(t,a)=>e("td",{part:R(a),class:"text-end"},t.formattedPaymentAmount(t.amount)),balance:(t,a)=>e("td",{part:R(a),class:"text-end"},t.formattedPaymentAmount(t.balance)),currency:(t,a)=>e("td",{part:R(a)},t.currency),financial_transaction_id:(t,a)=>e("td",{part:R(a)},t.financial_transaction_id),payment_id:(t,a)=>e("td",{part:R(a)},t.payment_id),payment_balance_txn_type:(t,a)=>e("td",{part:R(a)},t.payment_balance_txn_type),source_id:(t,a)=>e("td",{part:R(a)},t.source_id),source_type:(t,a)=>e("td",{part:R(a)},t.source_type)},O=class{constructor(e){t(this,e),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=e=>{this.pagingParams={before_cursor:e},this.clickEvent.emit({name:D.previous})},this.handleClickNext=e=>{this.pagingParams={after_cursor:e},this.clickEvent.emit({name:D.next})},this.rowClickHandler=e=>{const t=e.target.closest("tr").dataset.rowEntityId;if(!t)return;const a=this.balanceTransactions.find((e=>e.id===t));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,S,I),c(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeApi()}handleError(e,t,a){this.isLoading=!1,this.errorEvent.emit({errorCode:e,message:t,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:e,authToken:t,service:a})=>async({params:r,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(e,t,r);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:i.ERROR}):n({balanceTransactions:c.data.map((e=>new s(e))),pagingInfo:Object.assign({},c.page_info)})}catch(e){const t=p(null==e?void 0:e.code);o({error:h(e),code:t,severity:i.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:e,pagingInfo:t})=>{this.balanceTransactions=e,this.paging=t,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e.message,this.handleError(e,t,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(r.MISSING_PROPS,this.errorMessage,i.ERROR))}get entityId(){return this.balanceTransactions.map((e=>e.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return e(C,{key:"24e7a4313ab91f179fd27b6596f012487de06815"},e(l,{key:"1f9a7a56a940e41dd865bc6f3a8681ce86d60d58"},e(u,{key:"a26ce09ae4df84698be1ea37cb735e38c0a0402e"},e(m,{key:"07f8655efd483e1d9240e65b17dc13583028f376"},e(y,{key:"0b62a7700715dbaffbedc0538432d075a3158499"},this.transactionsTable.columnData.map((e=>e)))),e(b,{key:"adf75fa50ddfb5257875b2779fc6c157812d4c19"},e(_,{key:"bc77de512b3e5fd1e6c4b8cf908b46027a3bc33f",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),e(g,{key:"413d46e184399cba3993f37efd64cb0d0a10d905",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),e(j,{key:"9deaa794dc848ed7c85cbadc3b4cfe7c9fb1176f",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((t,a)=>e(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},t)))),this.paging&&e(T,{key:"16ca0811bf42dc9419f8b77086e8e7e2cf6d0085"},e(k,{key:"e11be42549832c35078acf47b7c165fe1e50ea98"},e(v,{key:"205d649068b84200b88adc1be9cfe192abfe13be",colSpan:this.transactionsTable.columnData.length},e("pagination-menu",{key:"2a28645220d4f18b7037e461bd93eefc3aed49a0",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{O as justifi_payment_transactions_list}
@@ -0,0 +1 @@
1
+ import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{S as a}from"./p-05AWudQe.js";import{T as r,a as i,b as o,c as d,d as h,e as n,f as c,g as p,h as l,i as m,j as f,k as u,l as b}from"./p-DZr0wLGh.js";import{T as g}from"./p-CZfYo5-1.js";import{c as y}from"./p-DcA_wt-j.js";import{a6 as v,a7 as w}from"./p-Bu7gdOaV.js";import{a as j}from"./p-Ds_P-dB8.js";import"./p-B4vLfYnZ.js";import{f as C,p as T,C as k,b as _}from"./p-8fO8CrtQ.js";import{p as O}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{B as D,a as P}from"./p-Dz8KJn2G.js";import"./p-HXpYMWUU.js";import{g as S,a as x}from"./p-D1H6VUbM.js";import{A as B}from"./p-WnMmPpEb.js";import{J as I}from"./p-C8g8unYJ.js";import{o as A,g as E}from"./p-DUtecvro.js";import"./p-MPer3Rw7.js";import"./p-CiypNylL.js";import"./p-DgTOxu8x.js";const L={created_at:()=>t("th",{part:v,scope:"col",title:"The date and time the order was created"},"Created At"),updated_at:()=>t("th",{part:v,scope:"col",title:"The date and time the order was last updated"},"Updated At"),order_status:()=>t("th",{part:v,scope:"col",title:"The current status of the order"},"Order Status"),business_id:()=>t("th",{part:v,scope:"col",title:"The business ID associated with the order"},"Business ID"),company_name:()=>t("th",{part:v,scope:"col",title:"The business name associated with the order"},"Business Name"),provider:()=>t("th",{part:v,scope:"col",title:"The provider associated with the order"},"Provider"),order_type:()=>t("th",{part:v,scope:"col",title:"The type of order"},"Order Type"),quantity:()=>t("th",{part:v,scope:"col",title:"The number of terminals associated with the order"},"Order Quantity")},q={created_at:(e,s)=>t("td",{part:w(s)},t("div",{class:"fw-bold"},j(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},j(e.created_at,{showTime:!0}))),updated_at:(e,s)=>t("td",{part:w(s)},t("div",{class:"fw-bold"},j(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},j(e.updated_at,{showTime:!0}))),order_status:(e,s)=>t("td",{part:w(s)},t(P,Object.assign({},{submitted:{variant:D.PRIMARY,title:"This order is submitted",text:"Submitted"},completed:{variant:D.SUCCESS,title:"This order has been completed",text:"Completed"},created:{variant:D.SECONDARY,title:"This order is created",text:"Created"},in_progress:{variant:D.PRIMARY,title:"This order is in progress",text:"In Progress"},on_hold:{variant:D.WARNING,title:"This order is on hold",text:"On Hold"},canceled:{variant:D.DANGER,title:"This order is canceled",text:"Canceled"}}[e.order_status]))),business_id:(e,s)=>t("td",{part:w(s)},e.business_id),company_name:(e,s)=>t("td",{part:w(s)},e.company_name),provider:(e,s)=>t("td",{part:w(s)},e.provider),order_type:(e,s)=>{let a;return e.order_type===C.boardingOnly?a="Boarding Only":e.order_type===C.boardingShipping&&(a="Boarding & Shipping"),t("td",{part:w(s)},a)},quantity:(e,s)=>t("td",{part:w(s)},e.terminals.length)},M=B();class U{async fetchTerminalOrders(t,e,s){return M.get({endpoint:"terminals/orders",params:s,headers:{account:t},authToken:e})}}const H=class{constructor(t){e(this,t),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.columns="created_at,updated_at,order_status,quantity",this.terminalOrders=[],this.loading=!0,this.paging=O,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:g.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:g.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const s=this.terminalOrders.find((t=>t.id===e));this.clickEvent.emit({name:g.row,data:s})}}componentWillLoad(){y(),this.analytics=new I(this),this.terminalOrdersTable=new r(this.terminalOrders,this.columns,L,q),this.initializeGetData(),this.getTerminalOrders&&this.fetchData(),A("set",(()=>{this.pagingParams={}})),A("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}authPropChanged(){this.initializeGetData(),this.getTerminalOrders&&this.fetchData()}pagingOrColumnsChanged(){this.getTerminalOrders&&this.fetchData()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:t,authToken:e,service:s})=>async({params:a,onSuccess:r,onError:i,final:o})=>{var d,h;try{const o=await s.fetchTerminalOrders(t,e,a);if(o.error)return i({error:x(o.error),code:S(null===(h=o.error)||void 0===h?void 0:h.code),severity:k.ERROR});{const t=Object.assign({},o.page_info);r({terminalOrders:(null===(d=o.data)||void 0===d?void 0:d.map((t=>new T(t))))||[],pagingInfo:t})}}catch(t){const e=S(null==t?void 0:t.code);return i({error:t.message||t,code:e,severity:k.ERROR})}finally{o()}})({id:this.accountId,authToken:this.authToken,service:new U}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:_.MISSING_PROPS,message:this.errorMessage,severity:k.ERROR}))}fetchData(){this.getTerminalOrders&&(this.loading=!0,this.getTerminalOrders({params:this.terminalOrderParams,onSuccess:async({terminalOrders:t,pagingInfo:e})=>{this.terminalOrders=t,this.paging=e,this.terminalOrdersTable.collectionData=this.terminalOrders},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s})},final:()=>{this.loading=!1}}))}get terminalOrderParams(){const t=E();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.terminalOrders.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalOrdersTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(a,{key:"14c0dfe45a6833251f4c2d1d27ea49568f7ac01e"},t(i,{key:"7995d0b2ccb002265769804aa112dca1178d14dd"},t(o,{key:"ddfb54945255a1ae601659b5dee46da8e7fbfb52"},t(d,{key:"26958541cd82e414d9b079ac18ff69022969a4b8"},t(h,{key:"1068214ddc3e0003bab2212c0baff74c7e086b96"},this.terminalOrdersTable.columnData.map((t=>t)))),t(n,{key:"7b043e72311e7c956855320b7293a33e41f08da2"},t(c,{key:"b2532063645be1e926cfd7dca5b33414d09e5703",columnSpan:this.terminalOrdersTable.columnKeys.length,isLoading:this.loading}),t(p,{key:"ceec3f0f885e1377afdf36ca2714ebac9b6f7bfc",isEmpty:this.showEmptyState,columnSpan:this.terminalOrdersTable.columnKeys.length}),t(l,{key:"2c35baac2f8902e8bf96844f17f57104ba253986",columnSpan:this.terminalOrdersTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalOrdersTable.rowData.map(((e,s)=>t(m,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},e)))),this.paging&&t(f,{key:"f5e1fe9ba78d5cee96e044c60ffaabe45ff3d19d"},t(u,{key:"ab8c1111b2a1124ba3f0b0bf2deb5893cf4c4ce5"},t(b,{key:"d463b0e2db8c5d093b38816d78c9176e302fe2c0",colSpan:this.terminalOrdersTable.columnData.length},t("pagination-menu",{key:"364dfccaa8480e63e51fa3bbdbf4cbb560e9fbbf",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["authPropChanged"],authToken:["authPropChanged"],pagingParams:["pagingOrColumnsChanged"],columns:["pagingOrColumnsChanged"]}}};export{H as justifi_terminal_orders_list}
@@ -0,0 +1 @@
1
+ import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-BL112JyU.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{e as i,C as r,b as o}from"./p-8fO8CrtQ.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as c,a as p}from"./p-D1H6VUbM.js";import{J as h}from"./p-C8g8unYJ.js";import{c as d}from"./p-DcA_wt-j.js";import{S as m}from"./p-05AWudQe.js";import{T as f,a as l,b as u,c as y,d as b,e as g,f as j,g as v,h as _,i as k,j as C,k as w,l as D}from"./p-DZr0wLGh.js";import{T}from"./p-CZfYo5-1.js";import{M as P}from"./p-Bi_GCMx0.js";import{a as O}from"./p-Ds_P-dB8.js";import{a6 as S,a7 as A}from"./p-Bu7gdOaV.js";import{o as M,g as B}from"./p-BLhz_ggG.js";import"./p-WnMmPpEb.js";import"./p-CiypNylL.js";import"./p-DgTOxu8x.js";import"./p-MPer3Rw7.js";import"./p-Dz8KJn2G.js";const L={created_at:()=>t("th",{part:S,scope:"col",title:"The date and time each payment was made"},"Date"),amount:()=>t("th",{part:S,scope:"col",title:"The dollar amount of each payment"},"Amount"),status:()=>t("th",{part:S,scope:"col",title:"The current status of each payment"},"Status"),payment_type:()=>t("th",{part:S,scope:"col",title:"The type of each payment"},"Type"),description:()=>t("th",{part:S,scope:"col",title:"The payment description, if you provided one"},"Description"),payers_name:()=>t("th",{part:S,scope:"col",title:"The name associated with the payment method"},"Account Holder"),last_four_digits:()=>t("th",{part:S,scope:"col",title:"The brand and last 4 digits of the payment method"},"Payment Method"),card_brand:()=>t("th",{part:S,scope:"col",title:"The brand of the payment method"},"Card Brand")},x={created_at:(e,a)=>t("td",{part:A(a)},t("div",{class:"fw-bold"},O(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},O(e.created_at,{showTime:!0}))),amount:(e,a)=>t("td",{part:A(a)},e.formattedPaymentAmount(e.amount)),status:(e,a)=>t("td",{part:A(a)},P(e.status)),payment_type:(e,a)=>t("td",{part:A(a)},e.payment_type),description:(e,a)=>t("td",{part:A(a)},e.description),payers_name:(e,a)=>t("td",{part:A(a)},e.payers_name),last_four_digits:(e,a)=>t("td",{part:A(a)},e.last_four_digits),card_brand:(e,a)=>{var s,i,r;return t("td",{part:A(a)},(r=(null===(s=e.payment_method.card)||void 0===s?void 0:s.brand)||(null===(i=e.payment_method.bank_account)||void 0===i?void 0:i.brand))?{visa:"VISA",mastercard:"Mastercard",american_express:"American Express",discover:"Discover",diners_club:"Diners Club",jcb:"JCB",china_unionpay:"China UnionPay",unknown:"Unknown"}[r.toLowerCase()]||r:"N/A")}},E=class{constructor(t){e(this,t),this.errorEvent=a(this,"error-event",7),this.clickEvent=a(this,"click-event",7),this.errorMessage=null,this.payments=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payment_type,description,payers_name,last_four_digits,card_brand",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:T.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:T.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.payments.find((t=>t.id===e));this.clickEvent.emit({name:T.row,data:a})}}componentWillLoad(){d(),this.analytics=new h(this),this.paymentsTable=new f(this.payments,this.columns,L,x),this.initializeGetPayments(),M("set",(()=>{this.pagingParams={},this.errorMessage=""})),M("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPayments()}updateOnPropChange(){this.fetchData()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:t,authToken:e,service:a})=>async({params:s,onSuccess:o,onError:n,final:h})=>{var d,m;try{const h=await a.fetchPayments(t,e,s);if(h.error)return n({error:p(h.error),code:c(null===(m=h.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},h.page_info);o({payments:(null===(d=h.data)||void 0===d?void 0:d.map((t=>new i(t))))||[],pagingInfo:t})}}catch(t){const e=c(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:r.ERROR})}finally{h()}})({id:this.accountId,authToken:this.authToken,service:new s}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}fetchData(){this.getPayments&&(this.loading=!0,this.getPayments({params:this.paymentParams,onSuccess:({payments:t,pagingInfo:e})=>{this.payments=t,this.paging=e,this.paymentsTable.collectionData=this.payments},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:a})},final:()=>{this.loading=!1}}))}get paymentParams(){const t=B();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.payments.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.paymentsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(m,{key:"b2c7bd7573c3a2cdc683e6ea0b22bc625eaddbc6"},t(l,{key:"edcc04c18ae762b75aab3cebe31a5aab824843ef"},t(u,{key:"98b6e699948ac65667497b59b0ac23e36d7ea212"},t(y,{key:"06830e440c2f5ea23acd0109f58dd6e11f6495bf"},t(b,{key:"8a29564e85eb5a870c37c58cc57a149327f5405d"},this.paymentsTable.columnData.map((t=>t)))),t(g,{key:"a03ffd7422fbf7f364a6f7545a0158fb0cd38691"},t(j,{key:"6f48d9791c28a3407edddf97fc54a1a92c5e7dbc",columnSpan:this.paymentsTable.columnData.length,isLoading:this.loading}),t(v,{key:"ab948e22cf74e5db93835df17f93c200f0caf698",isEmpty:this.showEmptyState,columnSpan:this.paymentsTable.columnData.length}),t(_,{key:"28064e964a0db825ba7d78bc84e55c88b5c8e0c3",columnSpan:this.paymentsTable.columnData.length,errorMessage:this.errorMessage}),this.showRowData&&this.paymentsTable.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(C,{key:"036c71025fb6d150a3bdaa370e84e955ecf79b66"},t(w,{key:"373d7ac9f89a226a32a26a5ee7bb2a2246f8a454"},t(D,{key:"a74ee4a4f5004dfe5e0513cfeea66c3b34b8d610",colSpan:this.paymentsTable.columnData.length},t("pagination-menu",{key:"438d49d2094bb17488b8e2aa90fd0dbce100d920",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayments:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{E as justifi_payments_list}
@@ -1 +1 @@
1
- import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{m as a,C as i,b as o}from"./p-8fO8CrtQ.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as c,a as h}from"./p-D1H6VUbM.js";import{c as n}from"./p-DwLofzXZ.js";import{J as d}from"./p-BpFSR2PV.js";import{C as p}from"./p-CumGHL0N.js";import{m as u,S as m}from"./p-D437Px2O.js";import{S as b}from"./p-05AWudQe.js";import{T as f,a as l,b as y,c as g,d as k,e as v,f as j,g as C,h as _,i as w,j as P,k as S,l as T}from"./p-DZr0wLGh.js";import{T as D}from"./p-CZfYo5-1.js";import{d as O,b as A}from"./p-Ds_P-dB8.js";import{B as x,a as I}from"./p-Dz8KJn2G.js";import{a6 as z,a7 as E}from"./p-Bu7gdOaV.js";import{o as L,g as G}from"./p-CArdj6i_.js";import"./p-DgTOxu8x.js";import"./p-DlhPMNzz.js";import"./p-C1x6dkgs.js";import"./p-MPer3Rw7.js";const M={created_at:()=>t("th",{part:z,scope:"col",title:"The date each checkout occurred"},"Processed On"),payment_amount:()=>t("th",{part:z,scope:"col",title:"The dollar amount of each checkout"},"Payment Amount"),payment_description:()=>t("th",{part:z,scope:"col",title:"The description of each checkout"},"Payment Description"),sub_account_name:()=>t("th",{part:z,scope:"col",title:"The sub account associated with the checkout"},"Sub Account"),payment_mode:()=>t("th",{part:z,scope:"col",title:"The payment mode of each checkout"},"Payment Mode"),status:()=>t("th",{part:z,scope:"col",title:"The current status of each checkout"},"Status")},B={created_at:(e,s)=>t("td",{part:E(s)},t("div",{class:"fw-bold"},A(e.created_at)),t("div",{class:"fw-bold"},O(e.created_at))),payment_amount:(e,s)=>t("td",{part:E(s)},e.formattedPaymentAmount(e.payment_amount)),payment_description:(e,s)=>t("td",{part:E(s)},e.payment_description),sub_account_name:(e,s)=>t("td",{part:E(s)},e.sub_account_name),payment_mode:(e,s)=>t("td",{part:E(s)},e.payment_mode),status:(e,s)=>t("td",{part:E(s)},t(I,Object.assign({},{created:{variant:x.PRIMARY,title:"The checkout has been created",text:"Created"},completed:{variant:x.SUCCESS,title:"The checkout has been completed",text:"Completed"},attempted:{variant:x.SECONDARY,title:"The checkout has been attempted",text:"Attempted"},expired:{variant:x.DANGER,title:"The checkout has expired",text:"Expired"}}[e.status])))},H=class{constructor(t){e(this,t),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.columns="created_at,payment_amount,payment_description,payment_mode,status",this.checkouts=[],this.subAccounts=[],this.loading=!0,this.paging=r,this.pagingParams={},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 s=this.checkouts.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:s})}}componentWillLoad(){n(),this.analytics=new d(this),this.checkoutsTable=new f(this.checkouts,this.columns,M,B),this.initializeGetData(),this.getCheckouts&&this.fetchData(),L("set",(()=>{this.pagingParams={}})),L("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}authPropChanged(){this.initializeGetData(),this.getCheckouts&&this.fetchData()}pagingOrColumnsChanged(){this.getCheckouts&&this.fetchData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){const t=this.subAccountId||this.accountId;t&&this.authToken?this.getCheckouts=(({accountId:t,authToken:e,service:s})=>async({params:o,onSuccess:r,onError:n})=>{var d,p;try{const u=await s.fetchCheckouts(t,e,o);if(u.error)return n({error:h(u.error),code:c(null===(p=u.error)||void 0===p?void 0:p.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const e=c(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:i.ERROR})}})({accountId:t,authToken:this.authToken,service:new p}):(this.errorMessage="Account ID/Sub Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({primaryAccountId:this.accountId,authToken:this.authToken,service:new m}))}fetchData(){this.getCheckouts&&(this.loading=!0,this.getCheckouts({params:this.checkoutParams,onSuccess:async({checkouts:t,pagingInfo:e})=>{this.checkouts=t,this.paging=e,this.checkoutsTable.collectionData=this.checkouts,this.checkoutsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}))}async fetchSubAccounts(){this.getSubAccounts?this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.checkouts=this.checkouts.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}):this.loading=!1}get checkoutParams(){const t=G();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.checkouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.checkouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.checkoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(b,{key:"882db931e1e29698776ffa6c715ca4abb7d322f7"},t(l,{key:"7bb610f41ae1feab6e4a1cf8abb19fbff00914e6"},t(y,{key:"4ca7ca2a8fcb7b26cd4cdb7679ef7c3db17bb1d1"},t(g,{key:"b2fdd2852c74f066cfdf7aee27148fa36cf5df74"},t(k,{key:"688d8189928c8ee54e6b60383492cdd2e7717fcf"},this.checkoutsTable.columnData.map((t=>t)))),t(v,{key:"0e3e589b387455bdbb30c5130e206c46447d2a43"},t(j,{key:"b0d74610ef26b4b67e1c1a70b93e9932c4d47350",columnSpan:this.checkoutsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"dfc775ac8f7a47611e740e1e4b7562adfffd15d3",isEmpty:this.showEmptyState,columnSpan:this.checkoutsTable.columnKeys.length}),t(_,{key:"8ba255c49e9ea76d13644b4c5842f9c003816040",columnSpan:this.checkoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.checkoutsTable.rowData.map(((e,s)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},e)))),this.paging&&t(P,{key:"82cf7b391647fdb6cefcbdbe13113ebb6e70bf62"},t(S,{key:"6678e2573867bf3c79f266ebab392034eb143c65"},t(T,{key:"c981a304af815c314e8306922b779cea8670b825",colSpan:this.checkoutsTable.columnData.length},t("pagination-menu",{key:"ea32b8d13a5af7122095fd4081d29668019928ee",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["authPropChanged"],authToken:["authPropChanged"],subAccountId:["authPropChanged"],pagingParams:["pagingOrColumnsChanged"],columns:["pagingOrColumnsChanged"]}}};export{H as justifi_checkouts_list}
1
+ import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{m as a,C as i,b as o}from"./p-8fO8CrtQ.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as c,a as h}from"./p-D1H6VUbM.js";import{c as n}from"./p-DcA_wt-j.js";import{J as d}from"./p-C8g8unYJ.js";import{C as p}from"./p-BlqdDtQr.js";import{m as u,S as m}from"./p-C0w_sG9P.js";import{S as b}from"./p-05AWudQe.js";import{T as f,a as l,b as y,c as g,d as k,e as j,f as v,g as C,h as _,i as w,j as T,k as P,l as S}from"./p-DZr0wLGh.js";import{T as D}from"./p-CZfYo5-1.js";import{d as A,b as O}from"./p-Ds_P-dB8.js";import{B as x,a as I}from"./p-Dz8KJn2G.js";import{a6 as E,a7 as G}from"./p-Bu7gdOaV.js";import{o as L,g as M}from"./p-CArdj6i_.js";import"./p-DgTOxu8x.js";import"./p-CiypNylL.js";import"./p-WnMmPpEb.js";import"./p-MPer3Rw7.js";const B={created_at:()=>t("th",{part:E,scope:"col",title:"The date each checkout occurred"},"Processed On"),payment_amount:()=>t("th",{part:E,scope:"col",title:"The dollar amount of each checkout"},"Payment Amount"),payment_description:()=>t("th",{part:E,scope:"col",title:"The description of each checkout"},"Payment Description"),sub_account_name:()=>t("th",{part:E,scope:"col",title:"The sub account associated with the checkout"},"Sub Account"),payment_mode:()=>t("th",{part:E,scope:"col",title:"The payment mode of each checkout"},"Payment Mode"),status:()=>t("th",{part:E,scope:"col",title:"The current status of each checkout"},"Status")},z={created_at:(e,s)=>t("td",{part:G(s)},t("div",{class:"fw-bold"},O(e.created_at)),t("div",{class:"fw-bold"},A(e.created_at))),payment_amount:(e,s)=>t("td",{part:G(s)},e.formattedPaymentAmount(e.payment_amount)),payment_description:(e,s)=>t("td",{part:G(s)},e.payment_description),sub_account_name:(e,s)=>t("td",{part:G(s)},e.sub_account_name),payment_mode:(e,s)=>t("td",{part:G(s)},e.payment_mode),status:(e,s)=>t("td",{part:G(s)},t(I,Object.assign({},{created:{variant:x.PRIMARY,title:"The checkout has been created",text:"Created"},completed:{variant:x.SUCCESS,title:"The checkout has been completed",text:"Completed"},attempted:{variant:x.SECONDARY,title:"The checkout has been attempted",text:"Attempted"},expired:{variant:x.DANGER,title:"The checkout has expired",text:"Expired"}}[e.status])))},W=class{constructor(t){e(this,t),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.columns="created_at,payment_amount,payment_description,payment_mode,status",this.checkouts=[],this.subAccounts=[],this.loading=!0,this.paging=r,this.pagingParams={},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 s=this.checkouts.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:s})}}componentWillLoad(){n(),this.analytics=new d(this),this.checkoutsTable=new f(this.checkouts,this.columns,B,z),this.initializeGetData(),this.getCheckouts&&this.fetchData(),L("set",(()=>{this.pagingParams={}})),L("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}authPropChanged(){this.initializeGetData(),this.getCheckouts&&this.fetchData()}pagingOrColumnsChanged(){this.getCheckouts&&this.fetchData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){const t=this.subAccountId||this.accountId;t&&this.authToken?this.getCheckouts=(({accountId:t,authToken:e,service:s})=>async({params:o,onSuccess:r,onError:n})=>{var d,p;try{const u=await s.fetchCheckouts(t,e,o);if(u.error)return n({error:h(u.error),code:c(null===(p=u.error)||void 0===p?void 0:p.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const e=c(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:i.ERROR})}})({accountId:t,authToken:this.authToken,service:new p}):(this.errorMessage="Account ID/Sub Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({primaryAccountId:this.accountId,authToken:this.authToken,service:new m}))}fetchData(){this.getCheckouts&&(this.loading=!0,this.getCheckouts({params:this.checkoutParams,onSuccess:async({checkouts:t,pagingInfo:e})=>{this.checkouts=t,this.paging=e,this.checkoutsTable.collectionData=this.checkouts,this.checkoutsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}))}async fetchSubAccounts(){this.getSubAccounts?this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.checkouts=this.checkouts.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}):this.loading=!1}get checkoutParams(){const t=M();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.checkouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.checkouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.checkoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(b,{key:"882db931e1e29698776ffa6c715ca4abb7d322f7"},t(l,{key:"7bb610f41ae1feab6e4a1cf8abb19fbff00914e6"},t(y,{key:"4ca7ca2a8fcb7b26cd4cdb7679ef7c3db17bb1d1"},t(g,{key:"b2fdd2852c74f066cfdf7aee27148fa36cf5df74"},t(k,{key:"688d8189928c8ee54e6b60383492cdd2e7717fcf"},this.checkoutsTable.columnData.map((t=>t)))),t(j,{key:"0e3e589b387455bdbb30c5130e206c46447d2a43"},t(v,{key:"b0d74610ef26b4b67e1c1a70b93e9932c4d47350",columnSpan:this.checkoutsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"dfc775ac8f7a47611e740e1e4b7562adfffd15d3",isEmpty:this.showEmptyState,columnSpan:this.checkoutsTable.columnKeys.length}),t(_,{key:"8ba255c49e9ea76d13644b4c5842f9c003816040",columnSpan:this.checkoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.checkoutsTable.rowData.map(((e,s)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},e)))),this.paging&&t(T,{key:"82cf7b391647fdb6cefcbdbe13113ebb6e70bf62"},t(P,{key:"6678e2573867bf3c79f266ebab392034eb143c65"},t(S,{key:"c981a304af815c314e8306922b779cea8670b825",colSpan:this.checkoutsTable.columnData.length},t("pagination-menu",{key:"ea32b8d13a5af7122095fd4081d29668019928ee",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["authPropChanged"],authToken:["authPropChanged"],subAccountId:["authPropChanged"],pagingParams:["pagingOrColumnsChanged"],columns:["pagingOrColumnsChanged"]}}};export{W as justifi_checkouts_list}