@justifi/webcomponents 6.13.0 → 6.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/cjs/{Analytics-DaegoP5G.js → Analytics-DMppKXYI.js} +1 -1
  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-BNGOOokA.js → check-pkg-version-DcgenUqU.js} +1 -1
  5. package/dist/cjs/dispute-notification_2.cjs.entry.js +3 -3
  6. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  7. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +3 -3
  8. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +3 -3
  9. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -3
  10. package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
  11. package/dist/cjs/justifi-business-form.cjs.entry.js +3 -3
  12. package/dist/cjs/justifi-card-form.cjs.entry.js +3 -3
  13. package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +3 -3
  14. package/dist/cjs/justifi-checkout.cjs.entry.js +3 -3
  15. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
  16. package/dist/cjs/justifi-dispute-management.cjs.entry.js +3 -3
  17. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
  18. package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
  19. package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -3
  20. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +3 -3
  21. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
  22. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
  23. package/dist/cjs/justifi-payout-details.cjs.entry.js +7 -7
  24. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +3 -3
  25. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
  26. package/dist/cjs/justifi-qr-terminal.cjs.entry.js +3 -3
  27. package/dist/cjs/justifi-refund-payment.cjs.entry.js +3 -3
  28. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
  29. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
  30. package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
  31. package/dist/cjs/{package-BKwTzSig.js → package-CS22fAzw.js} +1 -1
  32. package/dist/collection/components/payout-details/justifi-payout-details.js +4 -4
  33. package/dist/docs.json +1 -1
  34. package/dist/esm/{Analytics-D_HycaxE.js → Analytics-CTY3Jgn8.js} +1 -1
  35. package/dist/esm/bank-account-form.entry.js +2 -2
  36. package/dist/esm/card-form.entry.js +2 -2
  37. package/dist/esm/{check-pkg-version-BfrWk42V.js → check-pkg-version-BOQqkWpf.js} +1 -1
  38. package/dist/esm/dispute-notification_2.entry.js +3 -3
  39. package/dist/esm/hidden-input_2.entry.js +1 -1
  40. package/dist/esm/justifi-apple-pay_11.entry.js +3 -3
  41. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +3 -3
  42. package/dist/esm/justifi-bank-account-form.entry.js +3 -3
  43. package/dist/esm/justifi-business-details.entry.js +3 -3
  44. package/dist/esm/justifi-business-form.entry.js +3 -3
  45. package/dist/esm/justifi-card-form.entry.js +3 -3
  46. package/dist/esm/justifi-checkout-qr-code.entry.js +3 -3
  47. package/dist/esm/justifi-checkout.entry.js +3 -3
  48. package/dist/esm/justifi-checkouts-list.entry.js +3 -3
  49. package/dist/esm/justifi-dispute-management.entry.js +3 -3
  50. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
  51. package/dist/esm/justifi-order-terminals.entry.js +3 -3
  52. package/dist/esm/justifi-payment-details.entry.js +3 -3
  53. package/dist/esm/justifi-payment-provisioning.entry.js +3 -3
  54. package/dist/esm/justifi-payment-transactions-list.entry.js +3 -3
  55. package/dist/esm/justifi-payments-list.entry.js +3 -3
  56. package/dist/esm/justifi-payout-details.entry.js +7 -7
  57. package/dist/esm/justifi-payout-transactions-list.entry.js +3 -3
  58. package/dist/esm/justifi-payouts-list.entry.js +3 -3
  59. package/dist/esm/justifi-qr-terminal.entry.js +3 -3
  60. package/dist/esm/justifi-refund-payment.entry.js +3 -3
  61. package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
  62. package/dist/esm/justifi-terminal-orders-list.entry.js +3 -3
  63. package/dist/esm/justifi-terminals-list.entry.js +3 -3
  64. package/dist/esm/{package-DSavNeRB.js → package-DNd24RUQ.js} +1 -1
  65. package/dist/module/justifi-payout-details.js +4 -4
  66. package/dist/module/package.js +1 -1
  67. package/dist/webcomponents/{p-70e05aec.entry.js → p-0dc3c605.entry.js} +1 -1
  68. package/dist/webcomponents/{p-1068ae13.entry.js → p-1737a7fc.entry.js} +1 -1
  69. package/dist/webcomponents/{p-d0c889e7.entry.js → p-2092b278.entry.js} +1 -1
  70. package/dist/webcomponents/{p-fdea8c57.entry.js → p-2757b61e.entry.js} +1 -1
  71. package/dist/webcomponents/{p-c885cbf6.entry.js → p-2bab43ac.entry.js} +1 -1
  72. package/dist/webcomponents/{p-c3a25333.entry.js → p-2ebc862f.entry.js} +1 -1
  73. package/dist/webcomponents/{p-3a2629a2.entry.js → p-32ee9101.entry.js} +1 -1
  74. package/dist/webcomponents/{p-a893d607.entry.js → p-5984e9df.entry.js} +1 -1
  75. package/dist/webcomponents/{p-a1885b83.entry.js → p-5d9d6dd5.entry.js} +1 -1
  76. package/dist/webcomponents/{p-e1168904.entry.js → p-6d1299db.entry.js} +1 -1
  77. package/dist/webcomponents/{p-1a30f2d9.entry.js → p-70a2f59a.entry.js} +1 -1
  78. package/dist/webcomponents/{p-d554e0bb.entry.js → p-863daddf.entry.js} +1 -1
  79. package/dist/webcomponents/{p-6bf4fea8.entry.js → p-90c5af69.entry.js} +1 -1
  80. package/dist/webcomponents/{p-2mMMaism.js → p-CQqmTKij.js} +1 -1
  81. package/dist/webcomponents/p-DNd24RUQ.js +1 -0
  82. package/dist/webcomponents/{p-DYSc8uvs.js → p-_GBnYSuR.js} +1 -1
  83. package/dist/webcomponents/p-a5913b33.entry.js +1 -0
  84. package/dist/webcomponents/{p-d7e2ce48.entry.js → p-a5cc55af.entry.js} +1 -1
  85. package/dist/webcomponents/{p-0ede7e82.entry.js → p-a7bd5651.entry.js} +1 -1
  86. package/dist/webcomponents/{p-0ea6aa9c.entry.js → p-ac08992c.entry.js} +1 -1
  87. package/dist/webcomponents/{p-a6b46f98.entry.js → p-b73c5779.entry.js} +1 -1
  88. package/dist/webcomponents/{p-ddb885c3.entry.js → p-c47db9f5.entry.js} +1 -1
  89. package/dist/webcomponents/{p-266870f0.entry.js → p-e63cd41f.entry.js} +1 -1
  90. package/dist/webcomponents/{p-0d98518e.entry.js → p-e711f221.entry.js} +1 -1
  91. package/dist/webcomponents/{p-3e56bbe5.entry.js → p-e8875186.entry.js} +1 -1
  92. package/dist/webcomponents/{p-ddffdec9.entry.js → p-ebd1c09f.entry.js} +1 -1
  93. package/dist/webcomponents/p-ec845aa4.entry.js +1 -0
  94. package/dist/webcomponents/{p-77cc572d.entry.js → p-f52fe722.entry.js} +1 -1
  95. package/dist/webcomponents/{p-5f6bc8e7.entry.js → p-f60bfe16.entry.js} +1 -1
  96. package/dist/webcomponents/{p-5218bcd0.entry.js → p-fb2e1557.entry.js} +1 -1
  97. package/dist/webcomponents/{p-27c35a85.entry.js → p-fca0ca4d.entry.js} +1 -1
  98. package/dist/webcomponents/webcomponents.esm.js +1 -1
  99. package/package.json +1 -1
  100. package/dist/webcomponents/p-015288c4.entry.js +0 -1
  101. package/dist/webcomponents/p-218b926a.entry.js +0 -1
  102. package/dist/webcomponents/p-DSavNeRB.js +0 -1
@@ -1 +1 @@
1
- import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{n as s,C as a,b as r}from"./p-DXTa04jn.js";import{J as n}from"./p-DYSc8uvs.js";import{c as o}from"./p-2mMMaism.js";import{T as c}from"./p-CxBrydeX.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as d,a as p}from"./p-CdwzNfP1.js";import{m,S as u}from"./p-BUHsyQpA.js";import{S as l}from"./p-DzEdYT8R.js";import{T as f,a as b,b as v,c as g,d as y,e as k,f as j,g as C,h as w,i as T,j as _,k as S,l as D}from"./p-BICxxa69.js";import{T as P}from"./p-CZfYo5-1.js";import{B as O,a as I}from"./p-CHw7tICr.js";import{a6 as x,a7 as A}from"./p-CPKMvyV_.js";import{k as B}from"./p-BSs-2JKu.js";import{o as E,g as N}from"./p-Dw63wyhO.js";import"./p-DSavNeRB.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-CqiVXthx.js";const M={nickname:()=>t("th",{part:x,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:x,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:x,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:x,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:x,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:x,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:x,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:x,scope:"col",title:"The current status of each terminal"},"Status")},z={nickname:(e,i)=>t("td",{part:A(i)},e.nickname),model_name:(e,i)=>t("td",{part:A(i)},e.model_name),id:(e,i)=>t("td",{part:A(i)},e.id),provider:(e,i)=>t("td",{part:A(i)},B(e.provider)),provider_serial_number:(e,i)=>t("td",{part:A(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:A(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:A(i)},e.sub_account_name),status:(e,i)=>t("td",{part:A(i)},t(I,Object.assign({},{connected:{variant:O.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:O.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:O.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:O.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:O.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},V=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:P.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new f(this.terminals,this.columns,M,z),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),E("set",(()=>{this.pagingParams={}})),E("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:e,service:i})=>async({params:r,onSuccess:n,onError:o})=>{var c,h;try{const m=await i.fetchTerminals(t,e,r);if(m.error)return o({error:p(m.error),code:d(null===(h=m.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const t=Object.assign({},m.page_info);n({terminals:(null===(c=m.data)||void 0===c?void 0:c.map((t=>new s(t))))||[],pagingInfo:t})}}catch(t){const e=d(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:a.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new c}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new u}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:e})=>{this.terminals=t,this.paging=e,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}get terminalParams(){const t=N();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(l,{key:"69c475e7a428c549a05f21bbd9bd80ce6d77836b"},t(b,{key:"a3d916daff63336299366f27959b8e54134f54c5"},t(v,{key:"412538503e7a212bd7b5723dddad82abe95fc3c2"},t(g,{key:"5501e72fd1931b1ffc17e6bf0d09d692b9cfbe17"},t(y,{key:"e0391a60a807cbdba97ef11f04275eb3072dc40c"},this.terminalsTable.columnData.map((t=>t)))),t(k,{key:"56686e423499aff459fa3d6d93fae0fd7621b10b"},t(j,{key:"0b70b5a0132754b1ce14e8baaeb7a9932c73b0ad",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"1230c30259de7ad89a1ccf1bb709db5bdda9152f",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(w,{key:"fc5dbeae973d56980e077fa861d0bf95f282cbec",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((e,i)=>t(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(_,{key:"c68e2cb14c8fa6a56243803e440cc13388ffaaf4"},t(S,{key:"bcc17671c48f5a397dff15333a49305a443aef21"},t(D,{key:"92a690d558b001bb346c2e17fb1e02691ec2a029",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"2a8233397675c7af4fd95df203eb4438f1c4adbd",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{V as justifi_terminals_list}
1
+ import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{n as s,C as a,b as r}from"./p-DXTa04jn.js";import{J as n}from"./p-_GBnYSuR.js";import{c as o}from"./p-CQqmTKij.js";import{T as c}from"./p-CxBrydeX.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as d,a as p}from"./p-CdwzNfP1.js";import{m,S as u}from"./p-BUHsyQpA.js";import{S as l}from"./p-DzEdYT8R.js";import{T as f,a as b,b as v,c as g,d as y,e as k,f as j,g as C,h as T,i as w,j as _,k as S,l as D}from"./p-BICxxa69.js";import{T as P}from"./p-CZfYo5-1.js";import{B as O,a as I}from"./p-CHw7tICr.js";import{a6 as x,a7 as A}from"./p-CPKMvyV_.js";import{k as B}from"./p-BSs-2JKu.js";import{o as E,g as N}from"./p-Dw63wyhO.js";import"./p-DNd24RUQ.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-CqiVXthx.js";const z={nickname:()=>t("th",{part:x,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:x,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:x,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:x,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:x,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:x,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:x,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:x,scope:"col",title:"The current status of each terminal"},"Status")},G={nickname:(e,i)=>t("td",{part:A(i)},e.nickname),model_name:(e,i)=>t("td",{part:A(i)},e.model_name),id:(e,i)=>t("td",{part:A(i)},e.id),provider:(e,i)=>t("td",{part:A(i)},B(e.provider)),provider_serial_number:(e,i)=>t("td",{part:A(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:A(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:A(i)},e.sub_account_name),status:(e,i)=>t("td",{part:A(i)},t(I,Object.assign({},{connected:{variant:O.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:O.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:O.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:O.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:O.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},U=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:P.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new f(this.terminals,this.columns,z,G),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),E("set",(()=>{this.pagingParams={}})),E("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:e,service:i})=>async({params:r,onSuccess:n,onError:o})=>{var c,h;try{const m=await i.fetchTerminals(t,e,r);if(m.error)return o({error:p(m.error),code:d(null===(h=m.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const t=Object.assign({},m.page_info);n({terminals:(null===(c=m.data)||void 0===c?void 0:c.map((t=>new s(t))))||[],pagingInfo:t})}}catch(t){const e=d(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:a.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new c}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new u}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:e})=>{this.terminals=t,this.paging=e,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}get terminalParams(){const t=N();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(l,{key:"69c475e7a428c549a05f21bbd9bd80ce6d77836b"},t(b,{key:"a3d916daff63336299366f27959b8e54134f54c5"},t(v,{key:"412538503e7a212bd7b5723dddad82abe95fc3c2"},t(g,{key:"5501e72fd1931b1ffc17e6bf0d09d692b9cfbe17"},t(y,{key:"e0391a60a807cbdba97ef11f04275eb3072dc40c"},this.terminalsTable.columnData.map((t=>t)))),t(k,{key:"56686e423499aff459fa3d6d93fae0fd7621b10b"},t(j,{key:"0b70b5a0132754b1ce14e8baaeb7a9932c73b0ad",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"1230c30259de7ad89a1ccf1bb709db5bdda9152f",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(T,{key:"fc5dbeae973d56980e077fa861d0bf95f282cbec",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((e,i)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(_,{key:"c68e2cb14c8fa6a56243803e440cc13388ffaaf4"},t(S,{key:"bcc17671c48f5a397dff15333a49305a443aef21"},t(D,{key:"92a690d558b001bb346c2e17fb1e02691ec2a029",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"2a8233397675c7af4fd95df203eb4438f1c4adbd",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{U as justifi_terminals_list}
@@ -1 +1 @@
1
- import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{J as e}from"./p-DYSc8uvs.js";import{C as r,b as o}from"./p-DXTa04jn.js";import{m as n,b as h}from"./p-Da3fPDxu.js";import{B as a}from"./p-R_0S69Pr.js";import{A as p}from"./p-De4Pig-y.js";import"./p-CLHwhyvu.js";import{C as m,B as l,c as d}from"./p-BcNb9bVO.js";import{c as u}from"./p-2mMMaism.js";import{i as c}from"./p-BSs-2JKu.js";import{t as v}from"./p-CPKMvyV_.js";import{S as f}from"./p-DzEdYT8R.js";import{H as g}from"./p-jIDKmNHy.js";import"./p-CZfYo5-1.js";import{B as y}from"./p-XYgDHrVL.js";import{P as j}from"./p-DSclFZ32.js";import"./p-DSavNeRB.js";import"./p-CdwzNfP1.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-uZ5KAseb.js";const b=p();class w{async postProvisioning(s,t,i){return b.post({endpoint:"entities/provisioning",body:{business_id:t,product_category:i},authToken:s})}}const C=()=>s("div",{class:"row gap-3 p-5"},s("div",{class:"col-12"},s(g,{text:"Business Already Provisioned"})),s("div",{class:"col-12",part:v},s("p",null,"We have already received the onboarding information for this business."))),S=()=>s("div",{class:"row gap-3 p5"},s("div",{class:"col-12"},s(g,{text:"You're all set for now"})),s("div",{class:"col-12",part:v},s("p",null,"We're reviewing your information and working on your approval. We'll be in touch to let you know once you've been approved (or if we find anything that needs fixing). Have a good one!"))),D=class{constructor(s){t(this,s),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.submitEvent=i(this,"submit-event",7),this.loading=!1,this.businessLoading=!0,this.businessProvisioned=!1,this.formSubmitted=!1,this.currentStep=0,this.country=m.USA,this.allowOptionalFields=!1,this.formTitle="Business Information",this.refs=[],this.setBusinessProvisioned=()=>new Promise((s=>{this.getBusiness({onSuccess:t=>{const i=new l(t.data);this.businessProvisioned=d(i),this.country=i.country_of_establishment,this.businessProvisioned&&this.errorEvent.emit({message:"A request to provision payments for this business has already been submitted.",errorCode:o.PROVISIONING_REQUESTED,severity:r.INFO}),this.businessLoading=!1,s()},onError:({error:t,code:i,severity:e})=>{this.errorEvent.emit({message:t,errorCode:i,severity:e}),this.businessLoading=!1,s()}})})),this.postProvisioningData=()=>{this.postProvisioning({onSuccess:s=>{this.formSubmitted=!0,this.submitEvent.emit({response:s})},onError:({error:s,code:t,severity:i})=>{this.submitEvent.emit({response:{error:s}}),this.errorEvent.emit({message:s,errorCode:t,severity:i})}})},this.incrementSteps=()=>{if(this.currentStep<this.totalSteps)return this.currentStep++},this.decrementSteps=()=>{this.currentStep>0&&(this.currentStep-=1)},this.previousStepButtonOnClick=()=>{this.clickEvent.emit({name:y.previousStep}),this.decrementSteps()},this.nextStepButtonOnClick=(s,t)=>{s.preventDefault(),this.clickEvent.emit({name:t}),this.refs[this.currentStep].validateAndSubmit({onSuccess:this.incrementSteps})}}propChanged(){this.initializeApi()}handleFormCompleted(){this.postProvisioningData()}handleFormLoading(s){this.loading=s.detail}async componentWillLoad(){u(),this.analytics=new e(this),this.initializeApi(),this.getBusiness?await this.setBusinessProvisioned():this.businessLoading=!1,this.refs=new Array(8)}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?c(this.authToken)?this.errorEvent.emit({message:"auth-token is expired",errorCode:o.NOT_AUTHENTICATED,severity:r.ERROR}):(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new a}),this.postProvisioning=h({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new w})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:o.MISSING_PROPS,severity:r.ERROR})}get formDisabled(){return this.loading||this.businessProvisioned}get totalSteps(){return this.refs.length-1}get stepCounter(){return`Step ${this.currentStep+1} of ${this.totalSteps+1}`}render(){return s(f,null,this.businessLoading?s(j,null):this.businessProvisioned?s(C,null):this.formSubmitted?s(S,null):s("div",{class:"row gap-3"},s(g,{text:this.formTitle}),s("payment-provisioning-form-steps",{businessId:this.businessId,authToken:this.authToken,refs:this.refs,currentStep:this.currentStep,allowOptionalFields:this.allowOptionalFields,country:this.country,handleFormLoading:this.handleFormLoading}),s("div",{class:"d-flex justify-content-between align-items-center"},s("div",{class:"d-flex align-items-center",part:v},this.stepCounter),s("payment-provisioning-form-buttons",{currentStep:this.currentStep,totalSteps:this.totalSteps,formLoading:this.loading,formDisabled:this.formDisabled,previousStepButtonOnClick:this.previousStepButtonOnClick,nextStepButtonOnClick:this.nextStepButtonOnClick}))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{D as justifi_payment_provisioning}
1
+ import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{J as e}from"./p-_GBnYSuR.js";import{C as r,b as o}from"./p-DXTa04jn.js";import{m as n,b as h}from"./p-Da3fPDxu.js";import{B as a}from"./p-R_0S69Pr.js";import{A as p}from"./p-De4Pig-y.js";import"./p-CLHwhyvu.js";import{C as m,B as d,c as l}from"./p-BcNb9bVO.js";import{c as u}from"./p-CQqmTKij.js";import{i as c}from"./p-BSs-2JKu.js";import{t as v}from"./p-CPKMvyV_.js";import{S as f}from"./p-DzEdYT8R.js";import{H as g}from"./p-jIDKmNHy.js";import"./p-CZfYo5-1.js";import{B as y}from"./p-XYgDHrVL.js";import{P as j}from"./p-DSclFZ32.js";import"./p-DNd24RUQ.js";import"./p-CdwzNfP1.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-uZ5KAseb.js";const b=p();class w{async postProvisioning(s,t,i){return b.post({endpoint:"entities/provisioning",body:{business_id:t,product_category:i},authToken:s})}}const C=()=>s("div",{class:"row gap-3 p-5"},s("div",{class:"col-12"},s(g,{text:"Business Already Provisioned"})),s("div",{class:"col-12",part:v},s("p",null,"We have already received the onboarding information for this business."))),S=()=>s("div",{class:"row gap-3 p5"},s("div",{class:"col-12"},s(g,{text:"You're all set for now"})),s("div",{class:"col-12",part:v},s("p",null,"We're reviewing your information and working on your approval. We'll be in touch to let you know once you've been approved (or if we find anything that needs fixing). Have a good one!"))),k=class{constructor(s){t(this,s),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.submitEvent=i(this,"submit-event",7),this.loading=!1,this.businessLoading=!0,this.businessProvisioned=!1,this.formSubmitted=!1,this.currentStep=0,this.country=m.USA,this.allowOptionalFields=!1,this.formTitle="Business Information",this.refs=[],this.setBusinessProvisioned=()=>new Promise((s=>{this.getBusiness({onSuccess:t=>{const i=new d(t.data);this.businessProvisioned=l(i),this.country=i.country_of_establishment,this.businessProvisioned&&this.errorEvent.emit({message:"A request to provision payments for this business has already been submitted.",errorCode:o.PROVISIONING_REQUESTED,severity:r.INFO}),this.businessLoading=!1,s()},onError:({error:t,code:i,severity:e})=>{this.errorEvent.emit({message:t,errorCode:i,severity:e}),this.businessLoading=!1,s()}})})),this.postProvisioningData=()=>{this.postProvisioning({onSuccess:s=>{this.formSubmitted=!0,this.submitEvent.emit({response:s})},onError:({error:s,code:t,severity:i})=>{this.submitEvent.emit({response:{error:s}}),this.errorEvent.emit({message:s,errorCode:t,severity:i})}})},this.incrementSteps=()=>{if(this.currentStep<this.totalSteps)return this.currentStep++},this.decrementSteps=()=>{this.currentStep>0&&(this.currentStep-=1)},this.previousStepButtonOnClick=()=>{this.clickEvent.emit({name:y.previousStep}),this.decrementSteps()},this.nextStepButtonOnClick=(s,t)=>{s.preventDefault(),this.clickEvent.emit({name:t}),this.refs[this.currentStep].validateAndSubmit({onSuccess:this.incrementSteps})}}propChanged(){this.initializeApi()}handleFormCompleted(){this.postProvisioningData()}handleFormLoading(s){this.loading=s.detail}async componentWillLoad(){u(),this.analytics=new e(this),this.initializeApi(),this.getBusiness?await this.setBusinessProvisioned():this.businessLoading=!1,this.refs=new Array(8)}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?c(this.authToken)?this.errorEvent.emit({message:"auth-token is expired",errorCode:o.NOT_AUTHENTICATED,severity:r.ERROR}):(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new a}),this.postProvisioning=h({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new w})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:o.MISSING_PROPS,severity:r.ERROR})}get formDisabled(){return this.loading||this.businessProvisioned}get totalSteps(){return this.refs.length-1}get stepCounter(){return`Step ${this.currentStep+1} of ${this.totalSteps+1}`}render(){return s(f,null,this.businessLoading?s(j,null):this.businessProvisioned?s(C,null):this.formSubmitted?s(S,null):s("div",{class:"row gap-3"},s(g,{text:this.formTitle}),s("payment-provisioning-form-steps",{businessId:this.businessId,authToken:this.authToken,refs:this.refs,currentStep:this.currentStep,allowOptionalFields:this.allowOptionalFields,country:this.country,handleFormLoading:this.handleFormLoading}),s("div",{class:"d-flex justify-content-between align-items-center"},s("div",{class:"d-flex align-items-center",part:v},this.stepCounter),s("payment-provisioning-form-buttons",{currentStep:this.currentStep,totalSteps:this.totalSteps,formLoading:this.loading,formDisabled:this.formDisabled,previousStepButtonOnClick:this.previousStepButtonOnClick,nextStepButtonOnClick:this.nextStepButtonOnClick}))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{k as justifi_payment_provisioning}
@@ -1 +1 @@
1
- import{h as s,F as e,r as i,c as t}from"./p-CV0Pyo1O.js";import{E as a}from"./p-Cu7hgXL1.js";import{B as r}from"./p-R_0S69Pr.js";import{m as o}from"./p-CPJC6tlj.js";import{C as l,b as n}from"./p-DXTa04jn.js";import{J as c}from"./p-DYSc8uvs.js";import{c as d}from"./p-2mMMaism.js";import{S as h}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{S as p}from"./p-uZ5KAseb.js";import"./p-CPKMvyV_.js";import"./p-De4Pig-y.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-BSs-2JKu.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-CdwzNfP1.js";import"./p-DSavNeRB.js";const m=()=>{const i=()=>s("div",{class:"mt-5"},s(p,{width:"40%",height:"1.5rem"}),s("hr",null),s("div",{class:"row g-3"},s("div",{class:"col-12 col-md-6"},s(p,null),s(p,null),s(p,null)),s("div",{class:"col-12 col-md-6"},s(p,null),s(p,null),s(p,null))));return s(e,null,s(i,null),s(i,null),s(i,null),s(i,null))},u=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event",7),this.loading=!0}componentWillLoad(){d(),this.analytics=new c(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetBusiness()}initializeGetBusiness(){this.businessId&&this.authToken?(this.getBusiness=o({id:this.businessId,authToken:this.authToken,service:new r}),this.fetchData()):(this.errorMessage="Invalid business id or auth token",this.errorEvent.emit({errorCode:n.MISSING_PROPS,message:this.errorMessage,severity:l.ERROR}))}updateOnPropChange(){this.getBusiness&&this.fetchData()}fetchData(){this.loading=!0,this.getBusiness({onSuccess:({business:s})=>{this.business=s,this.errorMessage=null},onError:({error:s,code:e,severity:i})=>{this.errorMessage=s,this.errorEvent.emit({errorCode:e,message:s,severity:i})},final:()=>{this.loading=!1}})}render(){return s(h,{key:"7ce48e6905cdbbf8f94470913ecfa3ef8dbb76c7"},this.loading&&s(m,{key:"7c3439e0c247436cd7951d3bdc32e7672c9f8447"}),!this.loading&&this.errorMessage&&a(this.errorMessage),!this.loading&&!this.errorMessage&&this.business&&s("justifi-details",{key:"bf57dacf2067f2704014ce3e002958e3306bba73",errorMessage:this.errorMessage},s("div",{key:"46d19a178ba0d33aa21a4f3900128e3e905731a9",slot:"detail-sections"},s("core-info-details",{key:"ac217a4cfe6b45810a85ca320760b7331f76e60b",business:this.business}),s("legal-address-details",{key:"1fc1a196a43bcf5f9eafd09bfe74c8bb7c409797",legalAddress:this.business.legal_address}),s("representative-details",{key:"1e0833606b129f69a05946726172963cbec05189",representative:this.business.representative}),s("owner-details",{key:"c974111dc67a8961ef6435c34843ca927ad8a7e5",owners:this.business.owners}),s("additional-questions-details",{key:"0951d284a373457e98a1dafc80231ec3ee057e0a",additionalQuestions:this.business.additional_questions}))))}static get watchers(){return{businessId:["propChanged"],authToken:["propChanged"],getBusiness:["updateOnPropChange"]}}};export{u as justifi_business_details}
1
+ import{h as s,F as e,r as i,c as t}from"./p-CV0Pyo1O.js";import{E as a}from"./p-Cu7hgXL1.js";import{B as r}from"./p-R_0S69Pr.js";import{m as o}from"./p-CPJC6tlj.js";import{C as n,b as l}from"./p-DXTa04jn.js";import{J as d}from"./p-_GBnYSuR.js";import{c as h}from"./p-CQqmTKij.js";import{S as c}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{S as p}from"./p-uZ5KAseb.js";import"./p-CPKMvyV_.js";import"./p-De4Pig-y.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-BSs-2JKu.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-CdwzNfP1.js";import"./p-DNd24RUQ.js";const u=()=>{const i=()=>s("div",{class:"mt-5"},s(p,{width:"40%",height:"1.5rem"}),s("hr",null),s("div",{class:"row g-3"},s("div",{class:"col-12 col-md-6"},s(p,null),s(p,null),s(p,null)),s("div",{class:"col-12 col-md-6"},s(p,null),s(p,null),s(p,null))));return s(e,null,s(i,null),s(i,null),s(i,null),s(i,null))},m=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event",7),this.loading=!0}componentWillLoad(){h(),this.analytics=new d(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetBusiness()}initializeGetBusiness(){this.businessId&&this.authToken?(this.getBusiness=o({id:this.businessId,authToken:this.authToken,service:new r}),this.fetchData()):(this.errorMessage="Invalid business id or auth token",this.errorEvent.emit({errorCode:l.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}updateOnPropChange(){this.getBusiness&&this.fetchData()}fetchData(){this.loading=!0,this.getBusiness({onSuccess:({business:s})=>{this.business=s,this.errorMessage=null},onError:({error:s,code:e,severity:i})=>{this.errorMessage=s,this.errorEvent.emit({errorCode:e,message:s,severity:i})},final:()=>{this.loading=!1}})}render(){return s(c,{key:"7ce48e6905cdbbf8f94470913ecfa3ef8dbb76c7"},this.loading&&s(u,{key:"7c3439e0c247436cd7951d3bdc32e7672c9f8447"}),!this.loading&&this.errorMessage&&a(this.errorMessage),!this.loading&&!this.errorMessage&&this.business&&s("justifi-details",{key:"bf57dacf2067f2704014ce3e002958e3306bba73",errorMessage:this.errorMessage},s("div",{key:"46d19a178ba0d33aa21a4f3900128e3e905731a9",slot:"detail-sections"},s("core-info-details",{key:"ac217a4cfe6b45810a85ca320760b7331f76e60b",business:this.business}),s("legal-address-details",{key:"1fc1a196a43bcf5f9eafd09bfe74c8bb7c409797",legalAddress:this.business.legal_address}),s("representative-details",{key:"1e0833606b129f69a05946726172963cbec05189",representative:this.business.representative}),s("owner-details",{key:"c974111dc67a8961ef6435c34843ca927ad8a7e5",owners:this.business.owners}),s("additional-questions-details",{key:"0951d284a373457e98a1dafc80231ec3ee057e0a",additionalQuestions:this.business.additional_questions}))))}static get watchers(){return{businessId:["propChanged"],authToken:["propChanged"],getBusiness:["updateOnPropChange"]}}};export{m as justifi_business_details}
@@ -1 +1 @@
1
- import{h as t,r as s,c as e}from"./p-CV0Pyo1O.js";import{k as a,C as i,b as o}from"./p-DXTa04jn.js";import{J as r}from"./p-DYSc8uvs.js";import{c as h}from"./p-2mMMaism.js";import{P as c}from"./p-CO8ZGkfN.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as p,a as d}from"./p-CdwzNfP1.js";import{M as u,m}from"./p-zZn1OXja.js";import{m as f,S as l}from"./p-BUHsyQpA.js";import{S as y}from"./p-DzEdYT8R.js";import{T as b,a as v,b as g,c as j,d as C,e as _,f as k,g as w,h as S,i as T,j as P,k as O,l as D}from"./p-BICxxa69.js";import{T as A}from"./p-CZfYo5-1.js";import{a as I}from"./p-BSs-2JKu.js";import{a6 as E,a7 as V}from"./p-CPKMvyV_.js";import{o as M,g as x}from"./p-AMVhBsGv.js";import"./p-DSavNeRB.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-CHw7tICr.js";import"./p-CqiVXthx.js";const z={created_at:()=>t("th",{part:E,scope:"col",title:"The date the payout was deposited"},"Created"),sub_account_name:()=>t("th",{part:E,scope:"col",title:"The sub account associated with the payout"},"Sub Account"),payments_total:()=>t("th",{part:E,scope:"col",title:"The total payments amount associated with the payout"},"Payments"),refunds_total:()=>t("th",{part:E,scope:"col",title:"The total refunds amount associated with the payout"},"Refunds"),fees_total:()=>t("th",{part:E,scope:"col",title:"The total fees amount associated with the payout"},"Fees"),other_total:()=>t("th",{part:E,scope:"col",title:"The total other amount"},"Other"),amount:()=>t("th",{part:E,scope:"col",title:"The total amount of the payout"},"Amount"),status:()=>t("th",{part:E,scope:"col",title:"The real-time status of each payout"},"Status"),csv:()=>t("th",{part:E,scope:"col",title:"Export CSV"})},B=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event",7),this.clickEvent=e(this,"click-event",7),this.errorMessage=null,this.payouts=[],this.subAccounts=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payments_total,refunds_total,fees_total,other_total,csv",this.downloadCSV=t=>{this.getPayoutCSV({payoutId:t,onError:()=>{this.errorEvent.emit({errorCode:o.FETCH_ERROR,message:"Failed to download CSV",severity:i.ERROR})}})},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:A.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:A.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr"),e=s.dataset.rowEntityId;if(!e)return;if(s.querySelector("a")===t.target)return;const a=this.payouts.find((t=>t.id===e));this.clickEvent.emit({name:A.row,data:a})}}componentWillLoad(){var s;h(),this.analytics=new r(this),this.initializeGetData(),this.payoutsTable=new b(this.payouts,this.columns,z,(s=this.downloadCSV,{created_at:(s,e)=>t("td",{part:V(e)},t("div",{class:"fw-bold"},I(s.created_at,{showDisplayDate:!0}))),sub_account_name:(s,e)=>t("td",{part:V(e)},s.sub_account_name),payments_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.payments_total)),refunds_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.refunds_total)),fees_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.fees_total)),other_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.other_total)),amount:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.amount)),status:(s,e)=>t("td",{part:V(e)},u(s.status)),csv:(e,a)=>t("td",{part:V(a)},t("a",{href:"#",onClick:t=>{t.preventDefault(),s(e.id)}},"CSV"))})),this.getPayouts&&this.getSubAccounts&&this.fetchData(),M("set",(()=>{this.pagingParams={}})),M("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new c};this.getPayouts=(({id:t,authToken:s,service:e})=>async({params:o,onSuccess:r,onError:h})=>{var c,n;try{const u=await e.fetchPayouts(t,s,o);if(u.error)return h({error:d(u.error),code:p(null===(n=u.error)||void 0===n?void 0:n.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({payouts:(null===(c=u.data)||void 0===c?void 0:c.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const s=p(null==t?void 0:t.code);return h({error:t.message||t,code:s,severity:i.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=f({primaryAccountId:this.accountId,authToken:this.authToken,service:new l}))}fetchData(){this.loading=!0,this.getPayouts({params:this.payoutParams,onSuccess:({payouts:t,pagingInfo:s})=>{this.payouts=t,this.paging=s,this.payoutsTable.collectionData=this.payouts,this.payoutsTable.columnKeys.includes("sub_account_name")?this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.payouts=this.payouts.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get payoutParams(){const t=x();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.payouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.payouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.payoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(y,{key:"653896fabc4becf531ec119d252cbaea301a0dc6"},t(v,{key:"63787473d67118a7f092bad666c47346872a7834"},t(g,{key:"c17ecce261475c8bfe357ff30d06f189c8f96480"},t(j,{key:"cc23edeff6a1e595671b77fa51c73ff313692b16"},t(C,{key:"4ed5b5ee149538d2de60ee6e27edde55e8d11eaa"},this.payoutsTable.columnData.map((t=>t)))),t(_,{key:"a0a886e70ba99ececd78e5bc34aec065466fe6ce"},t(k,{key:"38bf9109ca73ecfd5c85529a8f7232069ffcdb00",columnSpan:this.payoutsTable.columnKeys.length,isLoading:this.loading}),t(w,{key:"6f5341305ef71f86bbf3680e2c6d0dc461f3d09f",isEmpty:this.showEmptyState,columnSpan:this.payoutsTable.columnKeys.length}),t(S,{key:"bd5e8cc72b460238636546a568645c797807f2d9",columnSpan:this.payoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.payoutsTable.rowData.map(((s,e)=>t(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[e],onClick:this.rowClickHandler},s)))),this.paging&&t(P,{key:"15145b7ef9cc37a2ad70cea5698d53df069979bf"},t(O,{key:"2d4ed5a1ab5eaf0eaae0bbe35f02edf59c23b22e"},t(D,{key:"11c8505cfd97117afaf79ea68a3fb00570a9c7cb",colSpan:this.payoutsTable.columnData.length},t("pagination-menu",{key:"b8e7e29d4d932f43b3381235de57b63cc6a5283b",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayouts:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"]}}};export{B as justifi_payouts_list}
1
+ import{h as t,r as s,c as e}from"./p-CV0Pyo1O.js";import{k as a,C as i,b as o}from"./p-DXTa04jn.js";import{J as r}from"./p-_GBnYSuR.js";import{c as h}from"./p-CQqmTKij.js";import{P as c}from"./p-CO8ZGkfN.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as p,a as d}from"./p-CdwzNfP1.js";import{M as u,m}from"./p-zZn1OXja.js";import{m as f,S as l}from"./p-BUHsyQpA.js";import{S as y}from"./p-DzEdYT8R.js";import{T as b,a as g,b as v,c as j,d as C,e as _,f as k,g as w,h as S,i as T,j as P,k as O,l as A}from"./p-BICxxa69.js";import{T as D}from"./p-CZfYo5-1.js";import{a as I}from"./p-BSs-2JKu.js";import{a6 as E,a7 as V}from"./p-CPKMvyV_.js";import{o as x,g as z}from"./p-AMVhBsGv.js";import"./p-DNd24RUQ.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-CHw7tICr.js";import"./p-CqiVXthx.js";const B={created_at:()=>t("th",{part:E,scope:"col",title:"The date the payout was deposited"},"Created"),sub_account_name:()=>t("th",{part:E,scope:"col",title:"The sub account associated with the payout"},"Sub Account"),payments_total:()=>t("th",{part:E,scope:"col",title:"The total payments amount associated with the payout"},"Payments"),refunds_total:()=>t("th",{part:E,scope:"col",title:"The total refunds amount associated with the payout"},"Refunds"),fees_total:()=>t("th",{part:E,scope:"col",title:"The total fees amount associated with the payout"},"Fees"),other_total:()=>t("th",{part:E,scope:"col",title:"The total other amount"},"Other"),amount:()=>t("th",{part:E,scope:"col",title:"The total amount of the payout"},"Amount"),status:()=>t("th",{part:E,scope:"col",title:"The real-time status of each payout"},"Status"),csv:()=>t("th",{part:E,scope:"col",title:"Export CSV"})},G=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event",7),this.clickEvent=e(this,"click-event",7),this.errorMessage=null,this.payouts=[],this.subAccounts=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payments_total,refunds_total,fees_total,other_total,csv",this.downloadCSV=t=>{this.getPayoutCSV({payoutId:t,onError:()=>{this.errorEvent.emit({errorCode:o.FETCH_ERROR,message:"Failed to download CSV",severity:i.ERROR})}})},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr"),e=s.dataset.rowEntityId;if(!e)return;if(s.querySelector("a")===t.target)return;const a=this.payouts.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){var s;h(),this.analytics=new r(this),this.initializeGetData(),this.payoutsTable=new b(this.payouts,this.columns,B,(s=this.downloadCSV,{created_at:(s,e)=>t("td",{part:V(e)},t("div",{class:"fw-bold"},I(s.created_at,{showDisplayDate:!0}))),sub_account_name:(s,e)=>t("td",{part:V(e)},s.sub_account_name),payments_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.payments_total)),refunds_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.refunds_total)),fees_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.fees_total)),other_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.other_total)),amount:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.amount)),status:(s,e)=>t("td",{part:V(e)},u(s.status)),csv:(e,a)=>t("td",{part:V(a)},t("a",{href:"#",onClick:t=>{t.preventDefault(),s(e.id)}},"CSV"))})),this.getPayouts&&this.getSubAccounts&&this.fetchData(),x("set",(()=>{this.pagingParams={}})),x("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new c};this.getPayouts=(({id:t,authToken:s,service:e})=>async({params:o,onSuccess:r,onError:h})=>{var c,n;try{const u=await e.fetchPayouts(t,s,o);if(u.error)return h({error:d(u.error),code:p(null===(n=u.error)||void 0===n?void 0:n.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({payouts:(null===(c=u.data)||void 0===c?void 0:c.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const s=p(null==t?void 0:t.code);return h({error:t.message||t,code:s,severity:i.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=f({primaryAccountId:this.accountId,authToken:this.authToken,service:new l}))}fetchData(){this.loading=!0,this.getPayouts({params:this.payoutParams,onSuccess:({payouts:t,pagingInfo:s})=>{this.payouts=t,this.paging=s,this.payoutsTable.collectionData=this.payouts,this.payoutsTable.columnKeys.includes("sub_account_name")?this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.payouts=this.payouts.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get payoutParams(){const t=z();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.payouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.payouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.payoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(y,{key:"653896fabc4becf531ec119d252cbaea301a0dc6"},t(g,{key:"63787473d67118a7f092bad666c47346872a7834"},t(v,{key:"c17ecce261475c8bfe357ff30d06f189c8f96480"},t(j,{key:"cc23edeff6a1e595671b77fa51c73ff313692b16"},t(C,{key:"4ed5b5ee149538d2de60ee6e27edde55e8d11eaa"},this.payoutsTable.columnData.map((t=>t)))),t(_,{key:"a0a886e70ba99ececd78e5bc34aec065466fe6ce"},t(k,{key:"38bf9109ca73ecfd5c85529a8f7232069ffcdb00",columnSpan:this.payoutsTable.columnKeys.length,isLoading:this.loading}),t(w,{key:"6f5341305ef71f86bbf3680e2c6d0dc461f3d09f",isEmpty:this.showEmptyState,columnSpan:this.payoutsTable.columnKeys.length}),t(S,{key:"bd5e8cc72b460238636546a568645c797807f2d9",columnSpan:this.payoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.payoutsTable.rowData.map(((s,e)=>t(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[e],onClick:this.rowClickHandler},s)))),this.paging&&t(P,{key:"15145b7ef9cc37a2ad70cea5698d53df069979bf"},t(O,{key:"2d4ed5a1ab5eaf0eaae0bbe35f02edf59c23b22e"},t(A,{key:"11c8505cfd97117afaf79ea68a3fb00570a9c7cb",colSpan:this.payoutsTable.columnData.length},t("pagination-menu",{key:"b8e7e29d4d932f43b3381235de57b63cc6a5283b",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayouts:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"]}}};export{G as justifi_payouts_list}
@@ -0,0 +1 @@
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import{P as i}from"./p-CO8ZGkfN.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{k as s,C as d,b as o}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as c,a as r}from"./p-CdwzNfP1.js";import{h,b as l,d as b}from"./p-BSs-2JKu.js";import{a as f,b as n,D as p,c as v,C as u,E as y}from"./p-Cu7hgXL1.js";import{J as m}from"./p-_GBnYSuR.js";import{m as k,M as j}from"./p-zZn1OXja.js";import{c as C}from"./p-CQqmTKij.js";import{B as g}from"./p-CHo7TfsM.js";import{S as w}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{S as x}from"./p-uZ5KAseb.js";import{a as T,B as D}from"./p-CHw7tICr.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-CPKMvyV_.js";import"./p-DNd24RUQ.js";const S=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(x,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(x,{width:"70%"})),e("div",{class:"col-12"},e(x,{width:"40%"})),e("div",{class:"col-12"},e(x,{width:"40%"})),e("div",{class:"col-12"},e(x,{width:"100%"})),e("div",{class:"col-12"},e(x,{width:"80%"}))),P=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event",7),this.recordClickEvent=a(this,"record-click-event",7),this.enableRecordClick=!1,this.loading=!0,this.errorMessage=null,this.downloadCSV=()=>{this.getPayoutCSV({payoutId:this.payout.id,onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a})}})},this.handleRecordClick=e=>{this.recordClickEvent.emit({id:e,type:"account"})}}componentWillLoad(){C(),this.analytics=new m(this),this.initializeServices(),this.getPayout&&this.fetchData()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeServices()}getPayoutWatcher(){this.fetchData()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:e,authToken:t,service:a})=>async({onSuccess:i,onError:o})=>{var h;try{const l=await a.fetchPayout(e,t);l.error?o({error:r(l.error),code:c(null===(h=l.error)||void 0===h?void 0:h.code),severity:d.ERROR}):i(new s(l.data))}catch(e){o({error:r(e),code:c(null==e?void 0:e.code),severity:d.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new i}),this.getPayoutCSV=k({authToken:this.authToken,service:new i})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:o.MISSING_PROPS,severity:d.ERROR}))}fetchData(){this.loading=!0,this.getPayout({onSuccess:e=>{this.errorMessage=null,this.payout=e,this.loading=!1},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a}),this.loading=!1}})}formatMethod(e){return"ach"===e?"ACH":h(e)}render(){var t,a,i,s;return e(w,{key:"da86ceeb41265056f9bc64c07b3bd7db4a91471c"},this.loading&&e(S,{key:"49ae2848db4a5b59770c2b84bfba745861573a6d"}),!this.loading&&this.errorMessage&&y(this.errorMessage),!this.loading&&this.payout&&e("justifi-details",{key:"b4e6740d49ae1099f28ea3d6f21fe0da48149c71",errorMessage:this.errorMessage},e(f,{key:"e9efbeeb7894996f318d90fb38826a6a9e4cc4b3",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},j(null===(t=this.payout)||void 0===t?void 0:t.status),e(T,"expedited"===this.payout.settlement_priority?{variant:D.WARNING,title:"Expedited",text:"Expedited"}:{variant:D.SECONDARY,title:"Standard",text:"Standard"})),title:this.payout.formattedPaymentAmount(this.payout.amount)},e(n,{key:"feb913d2b90e86fb4f5575379e9b9a47adfa723f",classes:"border-1 border-end",title:"Updated At",value:`${l(this.payout.updated_at)} ${b(this.payout.updated_at)}`}),e(n,{key:"9fe6da08323735948f145a72a02db26a6eb31f02",classes:"border-1 border-end",title:"Created At",value:`${l(this.payout.created_at)} ${b(this.payout.created_at)}`}),e(n,{key:"d01c4b7ea7c966b524026a6e97c0575466de3f74",title:"ID",value:this.payout.id}),e("div",{key:"4c4f73e5898caedbb1b7aba326dbfb0dcfbb59e6",class:"m-4"},e(g,{key:"622a6e8384da37f4bb3896bcafea46ef697b140e",variant:"outline-secondary",class:"btn btn-outline-secondary d-flex align-items-center",onClick:this.downloadCSV},"Export CSV"))),e("div",{key:"9b9271663673dc2e78e89bec5c7c9c47daa6761e",slot:"detail-sections"},e(p,{key:"ac5c6e1c09e63cd0616794b7df367a73889e37b2",sectionTitle:"Details"}),e("div",{key:"95f9d5a0097499fdb24f44ea87313c3b34a96068",class:"d-flex flex-column gap-2 w-100"},e(v,{key:"ecf60d4a4783c8fb52e10222dd4f6e9935cd0910",title:"Date paid",value:l(this.payout.deposits_at)}),e(v,{key:"289971a08641bc2dc725d603ef611291025cd6b4",title:"Statement Description",value:this.payout.description}),e(v,{key:"d237aacbeb9b23ac0d45aa978350aad4824b0695",title:"Payout Method",value:this.formatMethod(this.payout.delivery_method)}),e(v,{key:"744ef2b8878b742483750fb921ca9790f6aa9ec1",title:"Amount",value:this.payout.formattedPaymentAmount(this.payout.amount)}),e(v,{key:"dbf3327510523afc6edd78ea2926f99593da9748",title:"Fee",value:this.payout.formattedPaymentAmount(this.payout.fees_total)})),e(p,{key:"15983342dbe916770291f33226b744e8c4c1129e",sectionTitle:"Account"}),e("div",{key:"b3fb4353794dc490633a14abcc829ff0835d989f",class:"d-flex flex-column gap-2 w-100"},e(v,{key:"665fbe47e3b35c0b7ffb3e6c17e15c3703c90250",title:"ID",value:this.payout.account_id,onClick:this.enableRecordClick?()=>this.handleRecordClick(this.payout.account_id):void 0}),e(v,{key:"5b15d5bc8a63541ac8d77eddccb47c89659fd05a",title:"Account Type",value:null===(a=this.payout.bank_account)||void 0===a?void 0:a.account_type}),e(v,{key:"947043e3571f27a672060f2101296daba0073727",title:"Institution",value:null===(i=this.payout.bank_account)||void 0===i?void 0:i.account_type}),e(v,{key:"74ac687b37c7ca91a88863730560333c41b9413c",title:"Routing Number",value:null===(s=this.payout.bank_account)||void 0===s?void 0:s.routing_number}),e(v,{key:"43cd9aa5ac45f6efba97901e3e1386446065c28a",title:"Account Number",value:this.payout.bank_account?`**** ${this.payout.bank_account.account_number_last4}`:void 0})),this.payout.metadata&&[e(p,{key:"8bf04ae43a08d8ef624357f64df900a11b8f2dad",sectionTitle:"Metadata"}),e("div",{key:"1bf737734f34f626cbfb9dd878afbb91b6f01913",class:"d-table gap-2 w-100"},e(u,{key:"0d1481e1823e9b2f28328ebfb3cd1c92c6342cc6",metadata:this.payout.metadata}))])))}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"],getPayout:["getPayoutWatcher"]}}};export{P as justifi_payout_details}
@@ -1 +1 @@
1
- import{h as i,r as e}from"./p-CV0Pyo1O.js";import{S as a}from"./p-uZ5KAseb.js";import{w as t,c as d}from"./p-DVJaoI_m.js";import{e as c}from"./p-BSs-2JKu.js";import{c as s}from"./p-2mMMaism.js";import"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-DSavNeRB.js";const n=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(a,{height:"18px",width:"100px"}),i(a,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"80px"}),i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"30px"}),i(a,{height:"36px"}))))},r=class{constructor(i){e(this,i),this.isReady=!1}async componentWillLoad(){await t(),this.iframeOrigin=d.iframeOrigin,this.tabId=c(),s()}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((i=>new Promise((e=>{i.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const i=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),t=await this.cvvIframeElement.validate();return i&&e&&a&&t}async tokenize({clientId:i,paymentMethodMetadata:e,account:a}){return await this.cardNumberIframeElement.tokenize(i,e,a)}render(){return i("div",{key:"d3cb1fca6595f60e5f5f122b73d3d6c11a826423"},i(n,{key:"f83dcbbc214d460bb21c015ec051436ed5cf6670",isReady:this.isReady}),i("hidden-input",{key:"5fad0d06303d0ddb55c30c2cd94014255f2a8cec"}),i("div",{key:"68440756a1aad69b5c95245e7a2a5feb16899dca",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"b39eab56c79463935f1a1bb15cc867997f026e7b",class:"mb-3"},i("iframe-input",{key:"25a2390a8c3c92d5e6eceafe6b821202ecb22d76",inputId:"cardNumber",ref:i=>this.cardNumberIframeElement=i,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"68766798d954a0b3d093ae13c3c2955f819da4f2",class:"row"},i("div",{key:"05539f1ac8ebb0397574d55b4b76d7acdb7d2dca",class:"col-4 align-content-end"},i("iframe-input",{key:"4c437a4384e6c301e18824d799784c1133e70ee3",inputId:"expirationMonth",ref:i=>this.expirationMonthIframeElement=i,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"b9a5b8b5dda1d8ab6305c9dc1ef9b655eb02fb3d",class:"col-4 align-content-end"},i("iframe-input",{key:"c1a412c20e75d21c1084a4b93f22362c367c1907",inputId:"expirationYear",ref:i=>this.expirationYearIframeElement=i,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"abdfdbd7eb784871011397a7c5fdf371e3c6baf0",class:"col-4 align-content-end"},i("iframe-input",{key:"08dff072e785846d7543018c194b4df6ce5b343e",inputId:"CVV",ref:i=>this.cvvIframeElement=i,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{r as card_form}
1
+ import{h as i,r as e}from"./p-CV0Pyo1O.js";import{S as a}from"./p-uZ5KAseb.js";import{w as t,c as d}from"./p-DVJaoI_m.js";import{e as c}from"./p-BSs-2JKu.js";import{c as s}from"./p-CQqmTKij.js";import"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-DNd24RUQ.js";const n=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(a,{height:"18px",width:"100px"}),i(a,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"80px"}),i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"30px"}),i(a,{height:"36px"}))))},r=class{constructor(i){e(this,i),this.isReady=!1}async componentWillLoad(){await t(),this.iframeOrigin=d.iframeOrigin,this.tabId=c(),s()}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((i=>new Promise((e=>{i.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const i=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),t=await this.cvvIframeElement.validate();return i&&e&&a&&t}async tokenize({clientId:i,paymentMethodMetadata:e,account:a}){return await this.cardNumberIframeElement.tokenize(i,e,a)}render(){return i("div",{key:"d3cb1fca6595f60e5f5f122b73d3d6c11a826423"},i(n,{key:"f83dcbbc214d460bb21c015ec051436ed5cf6670",isReady:this.isReady}),i("hidden-input",{key:"5fad0d06303d0ddb55c30c2cd94014255f2a8cec"}),i("div",{key:"68440756a1aad69b5c95245e7a2a5feb16899dca",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"b39eab56c79463935f1a1bb15cc867997f026e7b",class:"mb-3"},i("iframe-input",{key:"25a2390a8c3c92d5e6eceafe6b821202ecb22d76",inputId:"cardNumber",ref:i=>this.cardNumberIframeElement=i,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"68766798d954a0b3d093ae13c3c2955f819da4f2",class:"row"},i("div",{key:"05539f1ac8ebb0397574d55b4b76d7acdb7d2dca",class:"col-4 align-content-end"},i("iframe-input",{key:"4c437a4384e6c301e18824d799784c1133e70ee3",inputId:"expirationMonth",ref:i=>this.expirationMonthIframeElement=i,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"b9a5b8b5dda1d8ab6305c9dc1ef9b655eb02fb3d",class:"col-4 align-content-end"},i("iframe-input",{key:"c1a412c20e75d21c1084a4b93f22362c367c1907",inputId:"expirationYear",ref:i=>this.expirationYearIframeElement=i,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"abdfdbd7eb784871011397a7c5fdf371e3c6baf0",class:"col-4 align-content-end"},i("iframe-input",{key:"08dff072e785846d7543018c194b4df6ce5b343e",inputId:"CVV",ref:i=>this.cvvIframeElement=i,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{r as card_form}
@@ -1 +1 @@
1
- import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{j as s,C as i,b as r}from"./p-DXTa04jn.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{J as o}from"./p-DYSc8uvs.js";import{c}from"./p-2mMMaism.js";import{g as p,a as h}from"./p-CdwzNfP1.js";import{P as d}from"./p-NzPaWKbY.js";import{T as f,a as l,b as u,c as m,d as y,e as b,f as _,g,h as j,i as T,j as w,k,l as v}from"./p-BICxxa69.js";import{S as C}from"./p-DzEdYT8R.js";import{T as D}from"./p-CZfYo5-1.js";import{a as P}from"./p-BSs-2JKu.js";import{a6 as S,a7 as R}from"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-DSavNeRB.js";import"./p-De4Pig-y.js";import"./p-CqiVXthx.js";const F={created_at:()=>e("th",{part:S,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>e("th",{part:S,scope:"col",title:"The type of each transaction"},"Type"),id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>e("th",{part:S,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>e("th",{part:S,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>e("th",{part:S,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>e("th",{part:S,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>e("th",{part:S,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)},E=class{constructor(e){t(this,e),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=e=>{this.pagingParams={before_cursor:e},this.clickEvent.emit({name:D.previous})},this.handleClickNext=e=>{this.pagingParams={after_cursor:e},this.clickEvent.emit({name:D.next})},this.rowClickHandler=e=>{const t=e.target.closest("tr").dataset.rowEntityId;if(!t)return;const a=this.balanceTransactions.find((e=>e.id===t));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,F,I),c(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeApi()}handleError(e,t,a){this.isLoading=!1,this.errorEvent.emit({errorCode:e,message:t,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:e,authToken:t,service:a})=>async({params:r,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(e,t,r);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:i.ERROR}):n({balanceTransactions:c.data.map((e=>new s(e))),pagingInfo:Object.assign({},c.page_info)})}catch(e){const t=p(null==e?void 0:e.code);o({error:h(e),code:t,severity:i.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:e,pagingInfo:t})=>{this.balanceTransactions=e,this.paging=t,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e.message,this.handleError(e,t,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(r.MISSING_PROPS,this.errorMessage,i.ERROR))}get entityId(){return this.balanceTransactions.map((e=>e.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return e(C,{key:"24e7a4313ab91f179fd27b6596f012487de06815"},e(l,{key:"1f9a7a56a940e41dd865bc6f3a8681ce86d60d58"},e(u,{key:"a26ce09ae4df84698be1ea37cb735e38c0a0402e"},e(m,{key:"07f8655efd483e1d9240e65b17dc13583028f376"},e(y,{key:"0b62a7700715dbaffbedc0538432d075a3158499"},this.transactionsTable.columnData.map((e=>e)))),e(b,{key:"adf75fa50ddfb5257875b2779fc6c157812d4c19"},e(_,{key:"bc77de512b3e5fd1e6c4b8cf908b46027a3bc33f",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),e(g,{key:"413d46e184399cba3993f37efd64cb0d0a10d905",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),e(j,{key:"9deaa794dc848ed7c85cbadc3b4cfe7c9fb1176f",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((t,a)=>e(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},t)))),this.paging&&e(w,{key:"16ca0811bf42dc9419f8b77086e8e7e2cf6d0085"},e(k,{key:"e11be42549832c35078acf47b7c165fe1e50ea98"},e(v,{key:"205d649068b84200b88adc1be9cfe192abfe13be",colSpan:this.transactionsTable.columnData.length},e("pagination-menu",{key:"2a28645220d4f18b7037e461bd93eefc3aed49a0",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{E as justifi_payment_transactions_list}
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{j as s,C as i,b as r}from"./p-DXTa04jn.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{J as o}from"./p-_GBnYSuR.js";import{c}from"./p-CQqmTKij.js";import{g as p,a as h}from"./p-CdwzNfP1.js";import{P as d}from"./p-NzPaWKbY.js";import{T as f,a as l,b as u,c as m,d as y,e as b,f as _,g,h as j,i as T,j as w,k,l as v}from"./p-BICxxa69.js";import{S as C}from"./p-DzEdYT8R.js";import{T as D}from"./p-CZfYo5-1.js";import{a as P}from"./p-BSs-2JKu.js";import{a6 as R,a7 as S}from"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-DNd24RUQ.js";import"./p-De4Pig-y.js";import"./p-CqiVXthx.js";const F={created_at:()=>e("th",{part:R,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>e("th",{part:R,scope:"col",title:"The type of each transaction"},"Type"),id:()=>e("th",{part:R,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>e("th",{part:R,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>e("th",{part:R,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>e("th",{part:R,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>e("th",{part:R,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>e("th",{part:R,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>e("th",{part:R,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>e("th",{part:R,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>e("th",{part:R,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},x={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",platform_fee:"Platform Fee",platform_fee_return:"Platform Fee Return",processing_fee:"Processing Fee",processing_fee_return:"Processing Fee Return",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},I={created_at:(t,a)=>e("td",{part:S(a)},e("div",{class:"fw-bold"},P(t.created_at,{showDisplayDate:!0})),e("div",{class:"fw-bold"},P(t.created_at,{showTime:!0}))),type:(t,a)=>e("td",{part:S(a)},x[t.payment_balance_txn_type]),id:(t,a)=>e("td",{part:S(a)},t.id),amount:(t,a)=>e("td",{part:S(a),class:"text-end"},t.formattedPaymentAmount(t.amount)),balance:(t,a)=>e("td",{part:S(a),class:"text-end"},t.formattedPaymentAmount(t.balance)),currency:(t,a)=>e("td",{part:S(a)},t.currency),financial_transaction_id:(t,a)=>e("td",{part:S(a)},t.financial_transaction_id),payment_id:(t,a)=>e("td",{part:S(a)},t.payment_id),payment_balance_txn_type:(t,a)=>e("td",{part:S(a)},t.payment_balance_txn_type),source_id:(t,a)=>e("td",{part:S(a)},t.source_id),source_type:(t,a)=>e("td",{part:S(a)},t.source_type)},q=class{constructor(e){t(this,e),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=e=>{this.pagingParams={before_cursor:e},this.clickEvent.emit({name:D.previous})},this.handleClickNext=e=>{this.pagingParams={after_cursor:e},this.clickEvent.emit({name:D.next})},this.rowClickHandler=e=>{const t=e.target.closest("tr").dataset.rowEntityId;if(!t)return;const a=this.balanceTransactions.find((e=>e.id===t));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,F,I),c(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeApi()}handleError(e,t,a){this.isLoading=!1,this.errorEvent.emit({errorCode:e,message:t,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:e,authToken:t,service:a})=>async({params:r,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(e,t,r);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:i.ERROR}):n({balanceTransactions:c.data.map((e=>new s(e))),pagingInfo:Object.assign({},c.page_info)})}catch(e){const t=p(null==e?void 0:e.code);o({error:h(e),code:t,severity:i.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:e,pagingInfo:t})=>{this.balanceTransactions=e,this.paging=t,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e.message,this.handleError(e,t,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(r.MISSING_PROPS,this.errorMessage,i.ERROR))}get entityId(){return this.balanceTransactions.map((e=>e.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return e(C,{key:"24e7a4313ab91f179fd27b6596f012487de06815"},e(l,{key:"1f9a7a56a940e41dd865bc6f3a8681ce86d60d58"},e(u,{key:"a26ce09ae4df84698be1ea37cb735e38c0a0402e"},e(m,{key:"07f8655efd483e1d9240e65b17dc13583028f376"},e(y,{key:"0b62a7700715dbaffbedc0538432d075a3158499"},this.transactionsTable.columnData.map((e=>e)))),e(b,{key:"adf75fa50ddfb5257875b2779fc6c157812d4c19"},e(_,{key:"bc77de512b3e5fd1e6c4b8cf908b46027a3bc33f",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),e(g,{key:"413d46e184399cba3993f37efd64cb0d0a10d905",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),e(j,{key:"9deaa794dc848ed7c85cbadc3b4cfe7c9fb1176f",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((t,a)=>e(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},t)))),this.paging&&e(w,{key:"16ca0811bf42dc9419f8b77086e8e7e2cf6d0085"},e(k,{key:"e11be42549832c35078acf47b7c165fe1e50ea98"},e(v,{key:"205d649068b84200b88adc1be9cfe192abfe13be",colSpan:this.transactionsTable.columnData.length},e("pagination-menu",{key:"2a28645220d4f18b7037e461bd93eefc3aed49a0",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{q as justifi_payment_transactions_list}
@@ -1 +1 @@
1
- import{r as t,c as n,h as r,g as e}from"./p-CV0Pyo1O.js";import{g as o}from"./p-BFTU3MAI.js";import{C as i,b as u}from"./p-DXTa04jn.js";import{J as c}from"./p-DYSc8uvs.js";import{c as s}from"./p-2mMMaism.js";import"./p-BSs-2JKu.js";import"./p-HXpYMWUU.js";import"./p-DSavNeRB.js";import"./p-De4Pig-y.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";var f,a,h={};function l(){return a?f:(a=1,f=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then})}var d,w={},p={};function v(){if(d)return p;let t;d=1;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return p.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},p.getSymbolTotalCodewords=function(t){return n[t]},p.getBCHDigit=function(t){let n=0;for(;0!==t;)n++,t>>>=1;return n},p.setToSJISFunction=function(n){if("function"!=typeof n)throw new Error('"toSJISFunc" is not a valid function.');t=n},p.isKanjiModeEnabled=function(){return void 0!==t},p.toSJIS=function(n){return t(n)},p}var m,g,E,y,A,M={};function b(){return m||(m=1,(t=M).L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}(n)}catch(t){return r}}),M;var t}var T,C,R,x,I={},U={},k={},P={};function j(){if(x)return P;x=1;const t=b(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return P.getBlocksCount=function(r,e){switch(e){case t.L:return n[4*(r-1)+0];case t.M:return n[4*(r-1)+1];case t.Q:return n[4*(r-1)+2];case t.H:return n[4*(r-1)+3];default:return}},P.getTotalCodewordsCount=function(n,e){switch(e){case t.L:return r[4*(n-1)+0];case t.M:return r[4*(n-1)+1];case t.Q:return r[4*(n-1)+2];case t.H:return r[4*(n-1)+3];default:return}},P}var N,F,B,_,D={},S={};var $,L={},Q={},q={};function J(){return $||($=1,q.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),q}var O,Z,z,H={};function V(){if(O)return H;O=1;const t="[0-9]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";H.KANJI=new RegExp(n,"g"),H.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),H.BYTE=new RegExp(r,"g"),H.NUMERIC=new RegExp(t,"g"),H.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const e=new RegExp("^"+n+"$"),o=new RegExp("^"+t+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return H.testKanji=function(t){return e.test(t)},H.testNumeric=function(t){return o.test(t)},H.testAlphanumeric=function(t){return i.test(t)},H}function Y(){return Z||(Z=1,function(t){const n=J(),r=V();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(n){return r.testNumeric(n)?t.NUMERIC:r.testAlphanumeric(n)?t.ALPHANUMERIC:r.testKanji(n)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}(n)}catch(t){return r}}}(Q)),Q}var K,W,X,G,tt,nt,rt,et,ot,it,ut,ct,st={},ft={},at={exports:{}};function ht(){return it||(it=1,function(t){var n={single_source_shortest_paths:function(t,r,e){var o={},i={};i[r]=0;var u,c,s,f,a,h,l=n.PriorityQueue.make();for(l.push(r,0);!l.empty();)for(s in f=(u=l.pop()).cost,a=t[c=u.value]||{})a.hasOwnProperty(s)&&(h=f+a[s],(void 0===i[s]||i[s]>h)&&(i[s]=h,l.push(s,h),o[s]=c));if(void 0!==e&&void 0===i[e]){var d=["Could not find a path from ",r," to ",e,"."].join("");throw new Error(d)}return o},extract_shortest_path_from_predecessor_list:function(t,n){for(var r=[],e=n;e;)r.push(e),e=t[e];return r.reverse(),r},find_path:function(t,r,e){var o=n.single_source_shortest_paths(t,r,e);return n.extract_shortest_path_from_predecessor_list(o,e)},PriorityQueue:{make:function(t){var r,e=n.PriorityQueue,o={};for(r in t=t||{},e)e.hasOwnProperty(r)&&(o[r]=e[r]);return o.queue=[],o.sorter=t.sorter||e.default_sorter,o},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){this.queue.push({value:t,cost:n}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=n}(at)),at.exports}function lt(){if(ct)return w;ct=1;const t=v(),n=b(),r=function(){if(E)return g;function t(){this.buffer=[],this.length=0}return E=1,t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let r=0;r<n;r++)this.putBit(1==(t>>>n-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},g=t}(),e=function(){if(A)return y;function t(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return A=1,t.prototype.set=function(t,n,r,e){const o=t*this.size+n;this.data[o]=r,e&&(this.reservedBit[o]=!0)},t.prototype.get=function(t,n){return this.data[t*this.size+n]},t.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},t.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},y=t}(),o=(T||(T=1,function(t){const n=v().getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const r=Math.floor(t/7)+2,e=n(t),o=145===e?26:2*Math.ceil((e-13)/(2*r-2)),i=[e-7];for(let t=1;t<r-1;t++)i[t]=i[t-1]-o;return i.push(6),i.reverse()},t.getPositions=function(n){const r=[],e=t.getRowColCoords(n),o=e.length;for(let t=0;t<o;t++)for(let n=0;n<o;n++)0===t&&0===n||0===t&&n===o-1||t===o-1&&0===n||r.push([e[t],e[n]]);return r}}(I)),I),i=function(){if(C)return U;C=1;const t=v().getSymbolSize;return U.getPositions=function(n){const r=t(n);return[[0,0],[r-7,0],[0,r-7]]},U}(),u=(R||(R=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(n,r,e){switch(n){case t.Patterns.PATTERN000:return(r+e)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return e%3==0;case t.Patterns.PATTERN011:return(r+e)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(e/3))%2==0;case t.Patterns.PATTERN101:return r*e%2+r*e%3==0;case t.Patterns.PATTERN110:return(r*e%2+r*e%3)%2==0;case t.Patterns.PATTERN111:return(r*e%3+(r+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(t){const n=t.size;let r=0,e=0,o=0,i=null,u=null;for(let c=0;c<n;c++){e=o=0,i=u=null;for(let s=0;s<n;s++){let n=t.get(c,s);n===i?e++:(e>=5&&(r+=e-5+3),i=n,e=1),n=t.get(s,c),n===u?o++:(o>=5&&(r+=o-5+3),u=n,o=1)}e>=5&&(r+=e-5+3),o>=5&&(r+=o-5+3)}return r},t.getPenaltyN2=function(t){const n=t.size;let r=0;for(let e=0;e<n-1;e++)for(let o=0;o<n-1;o++){const n=t.get(e,o)+t.get(e,o+1)+t.get(e+1,o)+t.get(e+1,o+1);4!==n&&0!==n||r++}return 3*r},t.getPenaltyN3=function(t){const n=t.size;let r=0,e=0,o=0;for(let i=0;i<n;i++){e=o=0;for(let u=0;u<n;u++)e=e<<1&2047|t.get(i,u),u>=10&&(1488===e||93===e)&&r++,o=o<<1&2047|t.get(u,i),u>=10&&(1488===o||93===o)&&r++}return 40*r},t.getPenaltyN4=function(t){let n=0;const r=t.data.length;for(let e=0;e<r;e++)n+=t.data[e];return 10*Math.abs(Math.ceil(100*n/r/5)-10)},t.applyMask=function(t,r){const e=r.size;for(let o=0;o<e;o++)for(let i=0;i<e;i++)r.isReserved(i,o)||r.xor(i,o,n(t,i,o))},t.getBestMask=function(n,r){const e=Object.keys(t.Patterns).length;let o=0,i=1/0;for(let u=0;u<e;u++){r(u),t.applyMask(u,n);const e=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(u,n),e<i&&(i=e,o=u)}return o}}(k)),k),c=j(),s=function(){if(_)return B;_=1;const t=(F||(F=1,function(t){const n=function(){if(N)return S;N=1;const t=new Uint8Array(512),n=new Uint8Array(256);return function(){let r=1;for(let e=0;e<255;e++)t[e]=r,n[r]=e,r<<=1,256&r&&(r^=285);for(let n=255;n<512;n++)t[n]=t[n-255]}(),S.log=function(t){if(t<1)throw new Error("log("+t+")");return n[t]},S.exp=function(n){return t[n]},S.mul=function(r,e){return 0===r||0===e?0:t[n[r]+n[e]]},S}();t.mul=function(t,r){const e=new Uint8Array(t.length+r.length-1);for(let o=0;o<t.length;o++)for(let i=0;i<r.length;i++)e[o+i]^=n.mul(t[o],r[i]);return e},t.mod=function(t,r){let e=new Uint8Array(t);for(;e.length-r.length>=0;){const t=e[0];for(let o=0;o<r.length;o++)e[o]^=n.mul(r[o],t);let o=0;for(;o<e.length&&0===e[o];)o++;e=e.slice(o)}return e},t.generateECPolynomial=function(r){let e=new Uint8Array([1]);for(let o=0;o<r;o++)e=t.mul(e,new Uint8Array([1,n.exp(o)]));return e}}(D)),D);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}return n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(n.length+this.degree);r.set(n);const e=t.mod(r,this.genPoly),o=this.degree-e.length;if(o>0){const t=new Uint8Array(this.degree);return t.set(e,o),t}return e},B=n}(),f=(z||(z=1,function(t){const n=v(),r=j(),e=b(),o=Y(),i=J(),u=n.getBCHDigit(7973);function c(t,n){return o.getCharCountIndicator(t,n)+4}function s(t,n){let r=0;return t.forEach((function(t){const e=c(t.mode,n);r+=e+t.getBitsLength()})),r}t.from=function(t,n){return i.isValid(t)?parseInt(t,10):n},t.getCapacity=function(t,e,u){if(!i.isValid(t))throw new Error("Invalid QR Code version");void 0===u&&(u=o.BYTE);const s=8*(n.getSymbolTotalCodewords(t)-r.getTotalCodewordsCount(t,e));if(u===o.MIXED)return s;const f=s-c(u,t);switch(u){case o.NUMERIC:return Math.floor(f/10*3);case o.ALPHANUMERIC:return Math.floor(f/11*2);case o.KANJI:return Math.floor(f/13);default:return Math.floor(f/8)}},t.getBestVersionForData=function(n,r){let i;const u=e.from(r,e.M);if(Array.isArray(n)){if(n.length>1)return function(n,r){for(let e=1;e<=40;e++)if(s(n,e)<=t.getCapacity(e,r,o.MIXED))return e}(n,u);if(0===n.length)return 1;i=n[0]}else i=n;return function(n,r,e){for(let o=1;o<=40;o++)if(r<=t.getCapacity(o,e,n))return o}(i.mode,i.getLength(),u)},t.getEncodedBits=function(t){if(!i.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;n.getBCHDigit(r)-u>=0;)r^=7973<<n.getBCHDigit(r)-u;return t<<12|r}}(L)),L),a=function(){if(K)return st;K=1;const t=v(),n=t.getBCHDigit(1335);return st.getEncodedBits=function(r,e){const o=r.bit<<3|e;let i=o<<10;for(;t.getBCHDigit(i)-n>=0;)i^=1335<<t.getBCHDigit(i)-n;return 21522^(o<<10|i)},st}(),h=Y(),l=(ut||(ut=1,function(t){const n=Y(),r=function(){if(X)return W;X=1;const t=Y();function n(n){this.mode=t.NUMERIC,this.data=n.toString()}return n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,r,e;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),e=parseInt(r,10),t.put(e,10);const o=this.data.length-n;o>0&&(r=this.data.substr(n),e=parseInt(r,10),t.put(e,3*o+1))},W=n}(),e=function(){if(tt)return G;tt=1;const t=Y(),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=t.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let e=45*n.indexOf(this.data[r]);e+=n.indexOf(this.data[r+1]),t.put(e,11)}this.data.length%2&&t.put(n.indexOf(this.data[r]),6)},G=r}(),o=function(){if(rt)return nt;rt=1;const t=Y();function n(n){this.mode=t.BYTE,this.data="string"==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}return n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,r=this.data.length;n<r;n++)t.put(this.data[n],8)},nt=n}(),i=function(){if(ot)return et;ot=1;const t=Y(),n=v();function r(n){this.mode=t.KANJI,this.data=n}return r.getBitsLength=function(t){return 13*t},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r<this.data.length;r++){let e=n.toSJIS(this.data[r]);if(e>=33088&&e<=40956)e-=33088;else{if(!(e>=57408&&e<=60351))throw new Error("Invalid SJIS character: "+this.data[r]+"\nMake sure your charset is UTF-8");e-=49472}e=192*(e>>>8&255)+(255&e),t.put(e,13)}},et=r}(),u=V(),c=v(),s=ht();function f(t){return unescape(encodeURIComponent(t)).length}function a(t,n,r){const e=[];let o;for(;null!==(o=t.exec(r));)e.push({data:o[0],index:o.index,mode:n,length:o[0].length});return e}function h(t){const r=a(u.NUMERIC,n.NUMERIC,t),e=a(u.ALPHANUMERIC,n.ALPHANUMERIC,t);let o,i;return c.isKanjiModeEnabled()?(o=a(u.BYTE,n.BYTE,t),i=a(u.KANJI,n.KANJI,t)):(o=a(u.BYTE_KANJI,n.BYTE,t),i=[]),r.concat(e,o,i).sort((function(t,n){return t.index-n.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function l(t,u){switch(u){case n.NUMERIC:return r.getBitsLength(t);case n.ALPHANUMERIC:return e.getBitsLength(t);case n.KANJI:return i.getBitsLength(t);case n.BYTE:return o.getBitsLength(t)}}function d(t,u){let s;const f=n.getBestModeForData(t);if(s=n.from(u,f),s!==n.BYTE&&s.bit<f.bit)throw new Error('"'+t+'" cannot be encoded with mode '+n.toString(s)+".\n Suggested mode is: "+n.toString(f));switch(s!==n.KANJI||c.isKanjiModeEnabled()||(s=n.BYTE),s){case n.NUMERIC:return new r(t);case n.ALPHANUMERIC:return new e(t);case n.KANJI:return new i(t);case n.BYTE:return new o(t)}}t.fromArray=function(t){return t.reduce((function(t,n){return"string"==typeof n?t.push(d(n,null)):n.data&&t.push(d(n.data,n.mode)),t}),[])},t.fromString=function(r,e){const o=function(t,r){const e={},o={start:{}};let i=["start"];for(let u=0;u<t.length;u++){const c=t[u],s=[];for(let t=0;t<c.length;t++){const f=c[t],a=""+u+t;s.push(a),e[a]={node:f,lastCount:0},o[a]={};for(let t=0;t<i.length;t++){const u=i[t];e[u]&&e[u].node.mode===f.mode?(o[u][a]=l(e[u].lastCount+f.length,f.mode)-l(e[u].lastCount,f.mode),e[u].lastCount+=f.length):(e[u]&&(e[u].lastCount=f.length),o[u][a]=l(f.length,f.mode)+4+n.getCharCountIndicator(f.mode,r))}}i=s}for(let t=0;t<i.length;t++)o[i[t]].end=0;return{map:o,table:e}}(function(t){const r=[];for(let e=0;e<t.length;e++){const o=t[e];switch(o.mode){case n.NUMERIC:r.push([o,{data:o.data,mode:n.ALPHANUMERIC,length:o.length},{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.ALPHANUMERIC:r.push([o,{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.KANJI:r.push([o,{data:o.data,mode:n.BYTE,length:f(o.data)}]);break;case n.BYTE:r.push([{data:o.data,mode:n.BYTE,length:f(o.data)}])}}return r}(h(r,c.isKanjiModeEnabled())),e),i=s.find_path(o.map,"start","end"),u=[];for(let t=1;t<i.length-1;t++)u.push(o.table[i[t]].node);return t.fromArray(u.reduce((function(t,n){const r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)}),[]))},t.rawSplit=function(n){return t.fromArray(h(n,c.isKanjiModeEnabled()))}}(ft)),ft);function d(t,n,r){const e=t.size,o=a.getEncodedBits(n,r);let i,u;for(i=0;i<15;i++)u=1==(o>>i&1),t.set(i<6?i:i<8?i+1:e-15+i,8,u,!0),t.set(8,i<8?e-i-1:i<9?15-i-1+1:15-i-1,u,!0);t.set(e-8,8,1,!0)}function p(n,a,w,p){let v;if(Array.isArray(n))v=l.fromArray(n);else{if("string"!=typeof n)throw new Error("Invalid data");{let t=a;if(!t){const r=l.rawSplit(n);t=f.getBestVersionForData(r,w)}v=l.fromString(n,t||40)}}const m=f.getBestVersionForData(v,w);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(a){if(a<m)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+m+".\n")}else a=m;const g=function(n,e,o){const i=new r;o.forEach((function(t){i.put(t.mode.bit,4),i.put(t.getLength(),h.getCharCountIndicator(t.mode,n)),t.write(i)}));const u=8*(t.getSymbolTotalCodewords(n)-c.getTotalCodewordsCount(n,e));for(i.getLengthInBits()+4<=u&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const f=(u-i.getLengthInBits())/8;for(let t=0;t<f;t++)i.put(t%2?17:236,8);return function(n,r,e){const o=t.getSymbolTotalCodewords(r),i=o-c.getTotalCodewordsCount(r,e),u=c.getBlocksCount(r,e),f=u-o%u,a=Math.floor(o/u),h=Math.floor(i/u),l=h+1,d=a-h,w=new s(d);let p=0;const v=new Array(u),m=new Array(u);let g=0;const E=new Uint8Array(n.buffer);for(let t=0;t<u;t++){const n=t<f?h:l;v[t]=E.slice(p,p+n),m[t]=w.encode(v[t]),p+=n,g=Math.max(g,n)}const y=new Uint8Array(o);let A,M,b=0;for(A=0;A<g;A++)for(M=0;M<u;M++)A<v[M].length&&(y[b++]=v[M][A]);for(A=0;A<d;A++)for(M=0;M<u;M++)y[b++]=m[M][A];return y}(i,n,e)}(a,w,v),E=t.getSymbolSize(a),y=new e(E);return function(t,n){const r=t.size,e=i.getPositions(n);for(let n=0;n<e.length;n++){const o=e[n][0],i=e[n][1];for(let n=-1;n<=7;n++)if(!(o+n<=-1||r<=o+n))for(let e=-1;e<=7;e++)i+e<=-1||r<=i+e||t.set(o+n,i+e,n>=0&&n<=6&&(0===e||6===e)||e>=0&&e<=6&&(0===n||6===n)||n>=2&&n<=4&&e>=2&&e<=4,!0)}}(y,a),function(t){const n=t.size;for(let r=8;r<n-8;r++){const n=r%2==0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}(y),function(t,n){const r=o.getPositions(n);for(let n=0;n<r.length;n++){const e=r[n][0],o=r[n][1];for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)t.set(e+n,o+r,-2===n||2===n||-2===r||2===r||0===n&&0===r,!0)}}(y,a),d(y,w,0),a>=7&&function(t,n){const r=t.size,e=f.getEncodedBits(n);let o,i,u;for(let n=0;n<18;n++)o=Math.floor(n/3),i=n%3+r-8-3,u=1==(e>>n&1),t.set(o,i,u,!0),t.set(i,o,u,!0)}(y,a),function(t,n){const r=t.size;let e=-1,o=r-1,i=7,u=0;for(let c=r-1;c>0;c-=2)for(6===c&&c--;;){for(let r=0;r<2;r++)if(!t.isReserved(o,c-r)){let e=!1;u<n.length&&(e=1==(n[u]>>>i&1)),t.set(o,c-r,e),i--,-1===i&&(u++,i=7)}if(o+=e,o<0||r<=o){o-=e,e=-e;break}}}(y,g),isNaN(p)&&(p=u.getBestMask(y,d.bind(null,y,w))),u.applyMask(p,y),d(y,w,p),{modules:y,version:a,errorCorrectionLevel:w,maskPattern:p,segments:v}}return w.create=function(r,e){if(void 0===r||""===r)throw new Error("No input text");let o,i,c=n.M;return void 0!==e&&(c=n.from(e.errorCorrectionLevel,n.M),o=f.from(e.version),i=u.from(e.maskPattern),e.toSJISFunc&&t.setToSJISFunction(e.toSJISFunc)),p(r,o,c,i)},w}var dt,wt,pt={},vt={};function mt(){return dt||(dt=1,function(t){function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||5===n.length||n.length>8)throw new Error("Invalid hex color: "+t);3!==n.length&&4!==n.length||(n=Array.prototype.concat.apply([],n.map((function(t){return[t,t]})))),6===n.length&&n.push("F","F");const r=parseInt(n.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const r=t.width&&t.width>=21?t.width:void 0;return{width:r,scale:r?4:t.scale||4,margin:null==t.margin||t.margin<0?4:t.margin,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,n){return n.width&&n.width>=t+2*n.margin?n.width/(t+2*n.margin):n.scale},t.getImageWidth=function(n,r){const e=t.getScale(n,r);return Math.floor((n+2*r.margin)*e)},t.qrToImageData=function(n,r,e){const o=r.modules.size,i=r.modules.data,u=t.getScale(o,e),c=Math.floor((o+2*e.margin)*u),s=e.margin*u,f=[e.color.light,e.color.dark];for(let t=0;t<c;t++)for(let r=0;r<c;r++){let a=4*(t*c+r),h=e.color.light;t>=s&&r>=s&&t<c-s&&r<c-s&&(h=f[i[Math.floor((t-s)/u)*o+Math.floor((r-s)/u)]?1:0]),n[a++]=h.r,n[a++]=h.g,n[a++]=h.b,n[a]=h.a}}}(vt)),vt}var gt,Et,yt={};var At=function(){if(Et)return h;Et=1;const t=l(),n=lt(),r=(wt||(wt=1,function(t){const n=mt();t.render=function(t,r,e){let o=e,i=r;void 0!==o||r&&r.getContext||(o=r,r=void 0),r||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=n.getOptions(o);const u=n.getImageWidth(t.modules.size,o),c=i.getContext("2d"),s=c.createImageData(u,u);return n.qrToImageData(s.data,t,o),function(t,n,r){t.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=r,n.width=r,n.style.height=r+"px",n.style.width=r+"px"}(c,i,u),c.putImageData(s,0,0),i},t.renderToDataURL=function(n,r,e){let o=e;return void 0!==o||r&&r.getContext||(o=r,r=void 0),o||(o={}),t.render(n,r,o).toDataURL(o.type||"image/png",(o.rendererOpts||{}).quality)}}(pt)),pt),e=function(){if(gt)return yt;gt=1;const t=mt();function n(t,n){const r=t.a/255,e=n+'="'+t.hex+'"';return r<1?e+" "+n+'-opacity="'+r.toFixed(2).slice(1)+'"':e}function r(t,n,r){let e=t+n;return void 0!==r&&(e+=" "+r),e}return yt.render=function(e,o,i){const u=t.getOptions(o),c=e.modules.size,s=e.modules.data,f=c+2*u.margin,a=u.color.light.a?"<path "+n(u.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",h="<path "+n(u.color.dark,"stroke")+' d="'+function(t,n,e){let o="",i=0,u=!1,c=0;for(let s=0;s<t.length;s++){const f=Math.floor(s%n),a=Math.floor(s/n);f||u||(u=!0),t[s]?(c++,s>0&&f>0&&t[s-1]||(o+=u?r("M",f+e,.5+a+e):r("m",i,0),i=0,u=!1),f+1<n&&t[s+1]||(o+=r("h",c),c=0)):i++}return o}(s,c,u.margin)+'"/>',l='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+'viewBox="0 0 '+f+" "+f+'" shape-rendering="crispEdges">'+a+h+"</svg>\n";return"function"==typeof i&&i(null,l),l},yt}();function o(r,e,o,i,u){const c=[].slice.call(arguments,1),s=c.length,f="function"==typeof c[s-1];if(!f&&!t())throw new Error("Callback required as last argument");if(!f){if(s<1)throw new Error("Too few arguments provided");return 1===s?(o=e,e=i=void 0):2!==s||e.getContext||(i=o,o=e,e=void 0),new Promise((function(t,u){try{const u=n.create(o,i);t(r(u,e,i))}catch(t){u(t)}}))}if(s<2)throw new Error("Too few arguments provided");2===s?(u=o,o=e,e=i=void 0):3===s&&(e.getContext&&void 0===u?(u=i,i=void 0):(u=i,i=o,o=e,e=void 0));try{const t=n.create(o,i);u(null,r(t,e,i))}catch(t){u(t)}}return h.create=n.create,h.toCanvas=o.bind(null,r.render),h.toDataURL=o.bind(null,r.renderToDataURL),h.toString=o.bind(null,(function(t,n,r){return e.render(t,r)})),h}(),Mt=o(At);const bt=class{constructor(r){t(this,r),this.errorEvent=n(this,"error-event",7),this.size=256}componentWillLoad(){s(),this.analytics=new c(this)}componentDidLoad(){this.renderQrCode()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.renderQrCode()}get checkoutUrl(){return`https://components.justifi.ai/hosted-checkout/${this.checkoutId}`}async renderQrCode(){if(!this.checkoutId)return void this.errorEvent.emit({message:"checkoutId is required",errorCode:u.MISSING_PROPS,severity:i.ERROR});if(!this.qrContainerEl)return;const t=await Mt.toString(this.checkoutUrl,{type:"svg",width:this.size,errorCorrectionLevel:"M"});this.qrContainerEl.innerHTML=t}render(){return this.checkoutId?r("div",{ref:t=>this.qrContainerEl=t}):null}get el(){return e(this)}static get watchers(){return{checkoutId:["propChanged"],size:["propChanged"]}}};export{bt as justifi_checkout_qr_code}
1
+ import{r as t,c as n,h as r,g as e}from"./p-CV0Pyo1O.js";import{g as o}from"./p-BFTU3MAI.js";import{C as i,b as u}from"./p-DXTa04jn.js";import{J as c}from"./p-_GBnYSuR.js";import{c as s}from"./p-CQqmTKij.js";import"./p-BSs-2JKu.js";import"./p-HXpYMWUU.js";import"./p-DNd24RUQ.js";import"./p-De4Pig-y.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";var f,a,h={};function l(){return a?f:(a=1,f=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then})}var d,w={},p={};function v(){if(d)return p;let t;d=1;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return p.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},p.getSymbolTotalCodewords=function(t){return n[t]},p.getBCHDigit=function(t){let n=0;for(;0!==t;)n++,t>>>=1;return n},p.setToSJISFunction=function(n){if("function"!=typeof n)throw new Error('"toSJISFunc" is not a valid function.');t=n},p.isKanjiModeEnabled=function(){return void 0!==t},p.toSJIS=function(n){return t(n)},p}var m,g,E,y,A,M={};function b(){return m||(m=1,(t=M).L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}(n)}catch(t){return r}}),M;var t}var T,C,R,U,x={},I={},j={},k={};function P(){if(U)return k;U=1;const t=b(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return k.getBlocksCount=function(r,e){switch(e){case t.L:return n[4*(r-1)+0];case t.M:return n[4*(r-1)+1];case t.Q:return n[4*(r-1)+2];case t.H:return n[4*(r-1)+3];default:return}},k.getTotalCodewordsCount=function(n,e){switch(e){case t.L:return r[4*(n-1)+0];case t.M:return r[4*(n-1)+1];case t.Q:return r[4*(n-1)+2];case t.H:return r[4*(n-1)+3];default:return}},k}var N,F,B,_,D={},Q={};var $,L={},S={},q={};function J(){return $||($=1,q.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),q}var O,Z,z,H={};function K(){if(O)return H;O=1;const t="[0-9]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";H.KANJI=new RegExp(n,"g"),H.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),H.BYTE=new RegExp(r,"g"),H.NUMERIC=new RegExp(t,"g"),H.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const e=new RegExp("^"+n+"$"),o=new RegExp("^"+t+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return H.testKanji=function(t){return e.test(t)},H.testNumeric=function(t){return o.test(t)},H.testAlphanumeric=function(t){return i.test(t)},H}function V(){return Z||(Z=1,function(t){const n=J(),r=K();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(n){return r.testNumeric(n)?t.NUMERIC:r.testAlphanumeric(n)?t.ALPHANUMERIC:r.testKanji(n)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}(n)}catch(t){return r}}}(S)),S}var Y,G,W,X,tt,nt,rt,et,ot,it,ut,ct,st={},ft={},at={exports:{}};function ht(){return it||(it=1,function(t){var n={single_source_shortest_paths:function(t,r,e){var o={},i={};i[r]=0;var u,c,s,f,a,h,l=n.PriorityQueue.make();for(l.push(r,0);!l.empty();)for(s in f=(u=l.pop()).cost,a=t[c=u.value]||{})a.hasOwnProperty(s)&&(h=f+a[s],(void 0===i[s]||i[s]>h)&&(i[s]=h,l.push(s,h),o[s]=c));if(void 0!==e&&void 0===i[e]){var d=["Could not find a path from ",r," to ",e,"."].join("");throw new Error(d)}return o},extract_shortest_path_from_predecessor_list:function(t,n){for(var r=[],e=n;e;)r.push(e),e=t[e];return r.reverse(),r},find_path:function(t,r,e){var o=n.single_source_shortest_paths(t,r,e);return n.extract_shortest_path_from_predecessor_list(o,e)},PriorityQueue:{make:function(t){var r,e=n.PriorityQueue,o={};for(r in t=t||{},e)e.hasOwnProperty(r)&&(o[r]=e[r]);return o.queue=[],o.sorter=t.sorter||e.default_sorter,o},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){this.queue.push({value:t,cost:n}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=n}(at)),at.exports}function lt(){if(ct)return w;ct=1;const t=v(),n=b(),r=function(){if(E)return g;function t(){this.buffer=[],this.length=0}return E=1,t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let r=0;r<n;r++)this.putBit(1==(t>>>n-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},g=t}(),e=function(){if(A)return y;function t(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return A=1,t.prototype.set=function(t,n,r,e){const o=t*this.size+n;this.data[o]=r,e&&(this.reservedBit[o]=!0)},t.prototype.get=function(t,n){return this.data[t*this.size+n]},t.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},t.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},y=t}(),o=(T||(T=1,function(t){const n=v().getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const r=Math.floor(t/7)+2,e=n(t),o=145===e?26:2*Math.ceil((e-13)/(2*r-2)),i=[e-7];for(let t=1;t<r-1;t++)i[t]=i[t-1]-o;return i.push(6),i.reverse()},t.getPositions=function(n){const r=[],e=t.getRowColCoords(n),o=e.length;for(let t=0;t<o;t++)for(let n=0;n<o;n++)0===t&&0===n||0===t&&n===o-1||t===o-1&&0===n||r.push([e[t],e[n]]);return r}}(x)),x),i=function(){if(C)return I;C=1;const t=v().getSymbolSize;return I.getPositions=function(n){const r=t(n);return[[0,0],[r-7,0],[0,r-7]]},I}(),u=(R||(R=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(n,r,e){switch(n){case t.Patterns.PATTERN000:return(r+e)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return e%3==0;case t.Patterns.PATTERN011:return(r+e)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(e/3))%2==0;case t.Patterns.PATTERN101:return r*e%2+r*e%3==0;case t.Patterns.PATTERN110:return(r*e%2+r*e%3)%2==0;case t.Patterns.PATTERN111:return(r*e%3+(r+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(t){const n=t.size;let r=0,e=0,o=0,i=null,u=null;for(let c=0;c<n;c++){e=o=0,i=u=null;for(let s=0;s<n;s++){let n=t.get(c,s);n===i?e++:(e>=5&&(r+=e-5+3),i=n,e=1),n=t.get(s,c),n===u?o++:(o>=5&&(r+=o-5+3),u=n,o=1)}e>=5&&(r+=e-5+3),o>=5&&(r+=o-5+3)}return r},t.getPenaltyN2=function(t){const n=t.size;let r=0;for(let e=0;e<n-1;e++)for(let o=0;o<n-1;o++){const n=t.get(e,o)+t.get(e,o+1)+t.get(e+1,o)+t.get(e+1,o+1);4!==n&&0!==n||r++}return 3*r},t.getPenaltyN3=function(t){const n=t.size;let r=0,e=0,o=0;for(let i=0;i<n;i++){e=o=0;for(let u=0;u<n;u++)e=e<<1&2047|t.get(i,u),u>=10&&(1488===e||93===e)&&r++,o=o<<1&2047|t.get(u,i),u>=10&&(1488===o||93===o)&&r++}return 40*r},t.getPenaltyN4=function(t){let n=0;const r=t.data.length;for(let e=0;e<r;e++)n+=t.data[e];return 10*Math.abs(Math.ceil(100*n/r/5)-10)},t.applyMask=function(t,r){const e=r.size;for(let o=0;o<e;o++)for(let i=0;i<e;i++)r.isReserved(i,o)||r.xor(i,o,n(t,i,o))},t.getBestMask=function(n,r){const e=Object.keys(t.Patterns).length;let o=0,i=1/0;for(let u=0;u<e;u++){r(u),t.applyMask(u,n);const e=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(u,n),e<i&&(i=e,o=u)}return o}}(j)),j),c=P(),s=function(){if(_)return B;_=1;const t=(F||(F=1,function(t){const n=function(){if(N)return Q;N=1;const t=new Uint8Array(512),n=new Uint8Array(256);return function(){let r=1;for(let e=0;e<255;e++)t[e]=r,n[r]=e,r<<=1,256&r&&(r^=285);for(let n=255;n<512;n++)t[n]=t[n-255]}(),Q.log=function(t){if(t<1)throw new Error("log("+t+")");return n[t]},Q.exp=function(n){return t[n]},Q.mul=function(r,e){return 0===r||0===e?0:t[n[r]+n[e]]},Q}();t.mul=function(t,r){const e=new Uint8Array(t.length+r.length-1);for(let o=0;o<t.length;o++)for(let i=0;i<r.length;i++)e[o+i]^=n.mul(t[o],r[i]);return e},t.mod=function(t,r){let e=new Uint8Array(t);for(;e.length-r.length>=0;){const t=e[0];for(let o=0;o<r.length;o++)e[o]^=n.mul(r[o],t);let o=0;for(;o<e.length&&0===e[o];)o++;e=e.slice(o)}return e},t.generateECPolynomial=function(r){let e=new Uint8Array([1]);for(let o=0;o<r;o++)e=t.mul(e,new Uint8Array([1,n.exp(o)]));return e}}(D)),D);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}return n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(n.length+this.degree);r.set(n);const e=t.mod(r,this.genPoly),o=this.degree-e.length;if(o>0){const t=new Uint8Array(this.degree);return t.set(e,o),t}return e},B=n}(),f=(z||(z=1,function(t){const n=v(),r=P(),e=b(),o=V(),i=J(),u=n.getBCHDigit(7973);function c(t,n){return o.getCharCountIndicator(t,n)+4}function s(t,n){let r=0;return t.forEach((function(t){const e=c(t.mode,n);r+=e+t.getBitsLength()})),r}t.from=function(t,n){return i.isValid(t)?parseInt(t,10):n},t.getCapacity=function(t,e,u){if(!i.isValid(t))throw new Error("Invalid QR Code version");void 0===u&&(u=o.BYTE);const s=8*(n.getSymbolTotalCodewords(t)-r.getTotalCodewordsCount(t,e));if(u===o.MIXED)return s;const f=s-c(u,t);switch(u){case o.NUMERIC:return Math.floor(f/10*3);case o.ALPHANUMERIC:return Math.floor(f/11*2);case o.KANJI:return Math.floor(f/13);default:return Math.floor(f/8)}},t.getBestVersionForData=function(n,r){let i;const u=e.from(r,e.M);if(Array.isArray(n)){if(n.length>1)return function(n,r){for(let e=1;e<=40;e++)if(s(n,e)<=t.getCapacity(e,r,o.MIXED))return e}(n,u);if(0===n.length)return 1;i=n[0]}else i=n;return function(n,r,e){for(let o=1;o<=40;o++)if(r<=t.getCapacity(o,e,n))return o}(i.mode,i.getLength(),u)},t.getEncodedBits=function(t){if(!i.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;n.getBCHDigit(r)-u>=0;)r^=7973<<n.getBCHDigit(r)-u;return t<<12|r}}(L)),L),a=function(){if(Y)return st;Y=1;const t=v(),n=t.getBCHDigit(1335);return st.getEncodedBits=function(r,e){const o=r.bit<<3|e;let i=o<<10;for(;t.getBCHDigit(i)-n>=0;)i^=1335<<t.getBCHDigit(i)-n;return 21522^(o<<10|i)},st}(),h=V(),l=(ut||(ut=1,function(t){const n=V(),r=function(){if(W)return G;W=1;const t=V();function n(n){this.mode=t.NUMERIC,this.data=n.toString()}return n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,r,e;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),e=parseInt(r,10),t.put(e,10);const o=this.data.length-n;o>0&&(r=this.data.substr(n),e=parseInt(r,10),t.put(e,3*o+1))},G=n}(),e=function(){if(tt)return X;tt=1;const t=V(),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=t.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let e=45*n.indexOf(this.data[r]);e+=n.indexOf(this.data[r+1]),t.put(e,11)}this.data.length%2&&t.put(n.indexOf(this.data[r]),6)},X=r}(),o=function(){if(rt)return nt;rt=1;const t=V();function n(n){this.mode=t.BYTE,this.data="string"==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}return n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,r=this.data.length;n<r;n++)t.put(this.data[n],8)},nt=n}(),i=function(){if(ot)return et;ot=1;const t=V(),n=v();function r(n){this.mode=t.KANJI,this.data=n}return r.getBitsLength=function(t){return 13*t},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r<this.data.length;r++){let e=n.toSJIS(this.data[r]);if(e>=33088&&e<=40956)e-=33088;else{if(!(e>=57408&&e<=60351))throw new Error("Invalid SJIS character: "+this.data[r]+"\nMake sure your charset is UTF-8");e-=49472}e=192*(e>>>8&255)+(255&e),t.put(e,13)}},et=r}(),u=K(),c=v(),s=ht();function f(t){return unescape(encodeURIComponent(t)).length}function a(t,n,r){const e=[];let o;for(;null!==(o=t.exec(r));)e.push({data:o[0],index:o.index,mode:n,length:o[0].length});return e}function h(t){const r=a(u.NUMERIC,n.NUMERIC,t),e=a(u.ALPHANUMERIC,n.ALPHANUMERIC,t);let o,i;return c.isKanjiModeEnabled()?(o=a(u.BYTE,n.BYTE,t),i=a(u.KANJI,n.KANJI,t)):(o=a(u.BYTE_KANJI,n.BYTE,t),i=[]),r.concat(e,o,i).sort((function(t,n){return t.index-n.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function l(t,u){switch(u){case n.NUMERIC:return r.getBitsLength(t);case n.ALPHANUMERIC:return e.getBitsLength(t);case n.KANJI:return i.getBitsLength(t);case n.BYTE:return o.getBitsLength(t)}}function d(t,u){let s;const f=n.getBestModeForData(t);if(s=n.from(u,f),s!==n.BYTE&&s.bit<f.bit)throw new Error('"'+t+'" cannot be encoded with mode '+n.toString(s)+".\n Suggested mode is: "+n.toString(f));switch(s!==n.KANJI||c.isKanjiModeEnabled()||(s=n.BYTE),s){case n.NUMERIC:return new r(t);case n.ALPHANUMERIC:return new e(t);case n.KANJI:return new i(t);case n.BYTE:return new o(t)}}t.fromArray=function(t){return t.reduce((function(t,n){return"string"==typeof n?t.push(d(n,null)):n.data&&t.push(d(n.data,n.mode)),t}),[])},t.fromString=function(r,e){const o=function(t,r){const e={},o={start:{}};let i=["start"];for(let u=0;u<t.length;u++){const c=t[u],s=[];for(let t=0;t<c.length;t++){const f=c[t],a=""+u+t;s.push(a),e[a]={node:f,lastCount:0},o[a]={};for(let t=0;t<i.length;t++){const u=i[t];e[u]&&e[u].node.mode===f.mode?(o[u][a]=l(e[u].lastCount+f.length,f.mode)-l(e[u].lastCount,f.mode),e[u].lastCount+=f.length):(e[u]&&(e[u].lastCount=f.length),o[u][a]=l(f.length,f.mode)+4+n.getCharCountIndicator(f.mode,r))}}i=s}for(let t=0;t<i.length;t++)o[i[t]].end=0;return{map:o,table:e}}(function(t){const r=[];for(let e=0;e<t.length;e++){const o=t[e];switch(o.mode){case n.NUMERIC:r.push([o,{data:o.data,mode:n.ALPHANUMERIC,length:o.length},{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.ALPHANUMERIC:r.push([o,{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.KANJI:r.push([o,{data:o.data,mode:n.BYTE,length:f(o.data)}]);break;case n.BYTE:r.push([{data:o.data,mode:n.BYTE,length:f(o.data)}])}}return r}(h(r,c.isKanjiModeEnabled())),e),i=s.find_path(o.map,"start","end"),u=[];for(let t=1;t<i.length-1;t++)u.push(o.table[i[t]].node);return t.fromArray(u.reduce((function(t,n){const r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)}),[]))},t.rawSplit=function(n){return t.fromArray(h(n,c.isKanjiModeEnabled()))}}(ft)),ft);function d(t,n,r){const e=t.size,o=a.getEncodedBits(n,r);let i,u;for(i=0;i<15;i++)u=1==(o>>i&1),t.set(i<6?i:i<8?i+1:e-15+i,8,u,!0),t.set(8,i<8?e-i-1:i<9?15-i-1+1:15-i-1,u,!0);t.set(e-8,8,1,!0)}function p(n,a,w,p){let v;if(Array.isArray(n))v=l.fromArray(n);else{if("string"!=typeof n)throw new Error("Invalid data");{let t=a;if(!t){const r=l.rawSplit(n);t=f.getBestVersionForData(r,w)}v=l.fromString(n,t||40)}}const m=f.getBestVersionForData(v,w);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(a){if(a<m)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+m+".\n")}else a=m;const g=function(n,e,o){const i=new r;o.forEach((function(t){i.put(t.mode.bit,4),i.put(t.getLength(),h.getCharCountIndicator(t.mode,n)),t.write(i)}));const u=8*(t.getSymbolTotalCodewords(n)-c.getTotalCodewordsCount(n,e));for(i.getLengthInBits()+4<=u&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const f=(u-i.getLengthInBits())/8;for(let t=0;t<f;t++)i.put(t%2?17:236,8);return function(n,r,e){const o=t.getSymbolTotalCodewords(r),i=o-c.getTotalCodewordsCount(r,e),u=c.getBlocksCount(r,e),f=u-o%u,a=Math.floor(o/u),h=Math.floor(i/u),l=h+1,d=a-h,w=new s(d);let p=0;const v=new Array(u),m=new Array(u);let g=0;const E=new Uint8Array(n.buffer);for(let t=0;t<u;t++){const n=t<f?h:l;v[t]=E.slice(p,p+n),m[t]=w.encode(v[t]),p+=n,g=Math.max(g,n)}const y=new Uint8Array(o);let A,M,b=0;for(A=0;A<g;A++)for(M=0;M<u;M++)A<v[M].length&&(y[b++]=v[M][A]);for(A=0;A<d;A++)for(M=0;M<u;M++)y[b++]=m[M][A];return y}(i,n,e)}(a,w,v),E=t.getSymbolSize(a),y=new e(E);return function(t,n){const r=t.size,e=i.getPositions(n);for(let n=0;n<e.length;n++){const o=e[n][0],i=e[n][1];for(let n=-1;n<=7;n++)if(!(o+n<=-1||r<=o+n))for(let e=-1;e<=7;e++)i+e<=-1||r<=i+e||t.set(o+n,i+e,n>=0&&n<=6&&(0===e||6===e)||e>=0&&e<=6&&(0===n||6===n)||n>=2&&n<=4&&e>=2&&e<=4,!0)}}(y,a),function(t){const n=t.size;for(let r=8;r<n-8;r++){const n=r%2==0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}(y),function(t,n){const r=o.getPositions(n);for(let n=0;n<r.length;n++){const e=r[n][0],o=r[n][1];for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)t.set(e+n,o+r,-2===n||2===n||-2===r||2===r||0===n&&0===r,!0)}}(y,a),d(y,w,0),a>=7&&function(t,n){const r=t.size,e=f.getEncodedBits(n);let o,i,u;for(let n=0;n<18;n++)o=Math.floor(n/3),i=n%3+r-8-3,u=1==(e>>n&1),t.set(o,i,u,!0),t.set(i,o,u,!0)}(y,a),function(t,n){const r=t.size;let e=-1,o=r-1,i=7,u=0;for(let c=r-1;c>0;c-=2)for(6===c&&c--;;){for(let r=0;r<2;r++)if(!t.isReserved(o,c-r)){let e=!1;u<n.length&&(e=1==(n[u]>>>i&1)),t.set(o,c-r,e),i--,-1===i&&(u++,i=7)}if(o+=e,o<0||r<=o){o-=e,e=-e;break}}}(y,g),isNaN(p)&&(p=u.getBestMask(y,d.bind(null,y,w))),u.applyMask(p,y),d(y,w,p),{modules:y,version:a,errorCorrectionLevel:w,maskPattern:p,segments:v}}return w.create=function(r,e){if(void 0===r||""===r)throw new Error("No input text");let o,i,c=n.M;return void 0!==e&&(c=n.from(e.errorCorrectionLevel,n.M),o=f.from(e.version),i=u.from(e.maskPattern),e.toSJISFunc&&t.setToSJISFunction(e.toSJISFunc)),p(r,o,c,i)},w}var dt,wt,pt={},vt={};function mt(){return dt||(dt=1,function(t){function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||5===n.length||n.length>8)throw new Error("Invalid hex color: "+t);3!==n.length&&4!==n.length||(n=Array.prototype.concat.apply([],n.map((function(t){return[t,t]})))),6===n.length&&n.push("F","F");const r=parseInt(n.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const r=t.width&&t.width>=21?t.width:void 0;return{width:r,scale:r?4:t.scale||4,margin:null==t.margin||t.margin<0?4:t.margin,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,n){return n.width&&n.width>=t+2*n.margin?n.width/(t+2*n.margin):n.scale},t.getImageWidth=function(n,r){const e=t.getScale(n,r);return Math.floor((n+2*r.margin)*e)},t.qrToImageData=function(n,r,e){const o=r.modules.size,i=r.modules.data,u=t.getScale(o,e),c=Math.floor((o+2*e.margin)*u),s=e.margin*u,f=[e.color.light,e.color.dark];for(let t=0;t<c;t++)for(let r=0;r<c;r++){let a=4*(t*c+r),h=e.color.light;t>=s&&r>=s&&t<c-s&&r<c-s&&(h=f[i[Math.floor((t-s)/u)*o+Math.floor((r-s)/u)]?1:0]),n[a++]=h.r,n[a++]=h.g,n[a++]=h.b,n[a]=h.a}}}(vt)),vt}var gt,Et,yt={};var At=function(){if(Et)return h;Et=1;const t=l(),n=lt(),r=(wt||(wt=1,function(t){const n=mt();t.render=function(t,r,e){let o=e,i=r;void 0!==o||r&&r.getContext||(o=r,r=void 0),r||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=n.getOptions(o);const u=n.getImageWidth(t.modules.size,o),c=i.getContext("2d"),s=c.createImageData(u,u);return n.qrToImageData(s.data,t,o),function(t,n,r){t.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=r,n.width=r,n.style.height=r+"px",n.style.width=r+"px"}(c,i,u),c.putImageData(s,0,0),i},t.renderToDataURL=function(n,r,e){let o=e;return void 0!==o||r&&r.getContext||(o=r,r=void 0),o||(o={}),t.render(n,r,o).toDataURL(o.type||"image/png",(o.rendererOpts||{}).quality)}}(pt)),pt),e=function(){if(gt)return yt;gt=1;const t=mt();function n(t,n){const r=t.a/255,e=n+'="'+t.hex+'"';return r<1?e+" "+n+'-opacity="'+r.toFixed(2).slice(1)+'"':e}function r(t,n,r){let e=t+n;return void 0!==r&&(e+=" "+r),e}return yt.render=function(e,o,i){const u=t.getOptions(o),c=e.modules.size,s=e.modules.data,f=c+2*u.margin,a=u.color.light.a?"<path "+n(u.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",h="<path "+n(u.color.dark,"stroke")+' d="'+function(t,n,e){let o="",i=0,u=!1,c=0;for(let s=0;s<t.length;s++){const f=Math.floor(s%n),a=Math.floor(s/n);f||u||(u=!0),t[s]?(c++,s>0&&f>0&&t[s-1]||(o+=u?r("M",f+e,.5+a+e):r("m",i,0),i=0,u=!1),f+1<n&&t[s+1]||(o+=r("h",c),c=0)):i++}return o}(s,c,u.margin)+'"/>',l='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+'viewBox="0 0 '+f+" "+f+'" shape-rendering="crispEdges">'+a+h+"</svg>\n";return"function"==typeof i&&i(null,l),l},yt}();function o(r,e,o,i,u){const c=[].slice.call(arguments,1),s=c.length,f="function"==typeof c[s-1];if(!f&&!t())throw new Error("Callback required as last argument");if(!f){if(s<1)throw new Error("Too few arguments provided");return 1===s?(o=e,e=i=void 0):2!==s||e.getContext||(i=o,o=e,e=void 0),new Promise((function(t,u){try{const u=n.create(o,i);t(r(u,e,i))}catch(t){u(t)}}))}if(s<2)throw new Error("Too few arguments provided");2===s?(u=o,o=e,e=i=void 0):3===s&&(e.getContext&&void 0===u?(u=i,i=void 0):(u=i,i=o,o=e,e=void 0));try{const t=n.create(o,i);u(null,r(t,e,i))}catch(t){u(t)}}return h.create=n.create,h.toCanvas=o.bind(null,r.render),h.toDataURL=o.bind(null,r.renderToDataURL),h.toString=o.bind(null,(function(t,n,r){return e.render(t,r)})),h}(),Mt=o(At);const bt=class{constructor(r){t(this,r),this.errorEvent=n(this,"error-event",7),this.size=256}componentWillLoad(){s(),this.analytics=new c(this)}componentDidLoad(){this.renderQrCode()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.renderQrCode()}get checkoutUrl(){return`https://components.justifi.ai/hosted-checkout/${this.checkoutId}`}async renderQrCode(){if(!this.checkoutId)return void this.errorEvent.emit({message:"checkoutId is required",errorCode:u.MISSING_PROPS,severity:i.ERROR});if(!this.qrContainerEl)return;const t=await Mt.toString(this.checkoutUrl,{type:"svg",width:this.size,errorCorrectionLevel:"M"});this.qrContainerEl.innerHTML=t}render(){return this.checkoutId?r("div",{ref:t=>this.qrContainerEl=t}):null}get el(){return e(this)}static get watchers(){return{checkoutId:["propChanged"],size:["propChanged"]}}};export{bt as justifi_checkout_qr_code}
@@ -1 +1 @@
1
- import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{c as r,a as i,F as n}from"./p-D9sqTVmd.js";import{f as o}from"./p-BSs-2JKu.js";import"./p-DVJaoI_m.js";import{R as a,C as u,b as h,q as c}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{B as l}from"./p-CHo7TfsM.js";import{S as m}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{P as d}from"./p-NzPaWKbY.js";import{m as p}from"./p-BB8Ce9rp.js";import{J as f}from"./p-DYSc8uvs.js";import{c as v}from"./p-2mMMaism.js";import{g as y,a as j}from"./p-CdwzNfP1.js";import{A as b}from"./p-De4Pig-y.js";import{S as w}from"./p-uZ5KAseb.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-D8GTwl9v.js";import"./p-CPKMvyV_.js";import"./p-DSavNeRB.js";const T=t=>{const e=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${o(e)}`,(function(t){return+t<=+e})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},C=t=>{if(t)return r({amount:T(t),description:i().optional(),reason:i().optional().oneOf([a.customerRequest,a.duplicate,a.fraudulent],"Select a reason")})},S=[{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"}],g=b();class P{async postRefund(t,e,s,r){return g.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":e},body:r,authToken:s})}}const I=b();class A{async postVoid(t,e,s){return I.post({endpoint:`payments/${t}/void`,headers:{"Sub-Account":e},authToken:s})}}const D=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),R=()=>t(m,null,t("div",{class:"row gap-5"},t(D,null),t(D,null),t(D,null))),k=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event",7),this.submitEvent=s(this,"submit-event",7),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}componentWillLoad(){v(),this.analytics=new f(this),this.initializeApi(),this.formController=new n(C())}handleError(t,e,s){this.errorEvent.emit({errorCode:t,message:e,severity:s})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(h.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",u.ERROR)}isPaymentCreatedWithin25Minutes(){var t;if(!this.payment||!(null===(t=this.payment)||void 0===t?void 0:t.created_at))return!1;const e=new Date(this.payment.created_at);return((new Date).getTime()-e.getTime())/6e4<=25}initializeFormController(){const t=this.refundPayload.amount,e=t?t.toString():"0";this.formController=new n(C(e)),this.formController.setInitialValues({amount:e}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?p({id:this.paymentId,authToken:this.authToken,service:new d})({onSuccess:({payment:t})=>{this.payment=t,this.refundPayload=new c({amount:t.amount_refundable})},onError:({error:t,code:e,severity:s})=>{this.handleError(e,t,s)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(h.MISSING_PROPS,"Payment ID and Auth Token are required",u.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const e=this.formController.values.getValue();return this.refundLoading=!0,this.isPaymentCreatedWithin25Minutes()?this.tryVoidPayment():this.processRefund(e)}async tryVoidPayment(){const t=(({authToken:t,accountId:e,paymentId:s,service:r})=>async({onSuccess:i,onError:n,final:o})=>{var a;try{const o=await r.postVoid(s,e,t);if(o.error)return n({error:j(o.error),code:y(null===(a=o.error)||void 0===a?void 0:a.code),severity:u.ERROR});i(o)}catch(t){const e=y(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:u.ERROR})}finally{o()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new A});return new Promise((e=>{let s,r=!1;const i=this.formController.values.getValue();t({onSuccess:t=>{s=t,r=!0},onError:({error:t,code:s,severity:n})=>{r=!0,this.handleError(t,s,n),this.processRefund(i).then(e)},final:()=>{s&&!s.error&&r&&(this.submitEvent.emit({response:s}),this.submitDisabled=!0,this.refundLoading=!1,e(s.data))}})}))}async processRefund(t){const e=(({authToken:t,accountId:e,paymentId:s,service:r})=>async({refundBody:i,onSuccess:n,onError:o,final:a})=>{var h;try{const a=await r.postRefund(s,e,t,i);if(a.error)return o({error:j(a.error),code:y(null===(h=a.error)||void 0===h?void 0:h.code),severity:u.ERROR});n(a)}catch(t){const e=y(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:u.ERROR})}finally{a()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new P});return new Promise((s=>{let r;e({refundBody:t,onSuccess:t=>{r=t},onError:({error:t,code:e,severity:s})=>{r=t,this.handleError(t,e,s)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,s(r.data)}})}))}render(){if(this.paymentLoading)return t(R,null);const e=this.formController.getInitialValues(),s=this.refundPayload.amount;return t(m,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:e.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:e.reason,inputHandler:this.inputHandler,options:S,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:e.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(l,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${o(+s)}`))))))}};export{k as justifi_refund_payment}
1
+ import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{c as r,a as i,F as n}from"./p-D9sqTVmd.js";import{f as o}from"./p-BSs-2JKu.js";import"./p-DVJaoI_m.js";import{R as a,C as u,b as h,q as l}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{B as c}from"./p-CHo7TfsM.js";import{S as d}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{P as m}from"./p-NzPaWKbY.js";import{m as p}from"./p-BB8Ce9rp.js";import{J as f}from"./p-_GBnYSuR.js";import{c as v}from"./p-CQqmTKij.js";import{g as y,a as j}from"./p-CdwzNfP1.js";import{A as b}from"./p-De4Pig-y.js";import{S as w}from"./p-uZ5KAseb.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-D8GTwl9v.js";import"./p-CPKMvyV_.js";import"./p-DNd24RUQ.js";const T=t=>{const e=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${o(e)}`,(function(t){return+t<=+e})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},C=t=>{if(t)return r({amount:T(t),description:i().optional(),reason:i().optional().oneOf([a.customerRequest,a.duplicate,a.fraudulent],"Select a reason")})},g=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],P=b();class S{async postRefund(t,e,s,r){return P.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":e},body:r,authToken:s})}}const I=b();class R{async postVoid(t,e,s){return I.post({endpoint:`payments/${t}/void`,headers:{"Sub-Account":e},authToken:s})}}const A=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),k=()=>t(d,null,t("div",{class:"row gap-5"},t(A,null),t(A,null),t(A,null))),x=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event",7),this.submitEvent=s(this,"submit-event",7),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}componentWillLoad(){v(),this.analytics=new f(this),this.initializeApi(),this.formController=new n(C())}handleError(t,e,s){this.errorEvent.emit({errorCode:t,message:e,severity:s})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(h.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",u.ERROR)}isPaymentCreatedWithin25Minutes(){var t;if(!this.payment||!(null===(t=this.payment)||void 0===t?void 0:t.created_at))return!1;const e=new Date(this.payment.created_at);return((new Date).getTime()-e.getTime())/6e4<=25}initializeFormController(){const t=this.refundPayload.amount,e=t?t.toString():"0";this.formController=new n(C(e)),this.formController.setInitialValues({amount:e}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?p({id:this.paymentId,authToken:this.authToken,service:new m})({onSuccess:({payment:t})=>{this.payment=t,this.refundPayload=new l({amount:t.amount_refundable})},onError:({error:t,code:e,severity:s})=>{this.handleError(e,t,s)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(h.MISSING_PROPS,"Payment ID and Auth Token are required",u.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const e=this.formController.values.getValue();return this.refundLoading=!0,this.isPaymentCreatedWithin25Minutes()?this.tryVoidPayment():this.processRefund(e)}async tryVoidPayment(){const t=(({authToken:t,accountId:e,paymentId:s,service:r})=>async({onSuccess:i,onError:n,final:o})=>{var a;try{const o=await r.postVoid(s,e,t);if(o.error)return n({error:j(o.error),code:y(null===(a=o.error)||void 0===a?void 0:a.code),severity:u.ERROR});i(o)}catch(t){const e=y(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:u.ERROR})}finally{o()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new R});return new Promise((e=>{let s,r=!1;const i=this.formController.values.getValue();t({onSuccess:t=>{s=t,r=!0},onError:({error:t,code:s,severity:n})=>{r=!0,this.handleError(t,s,n),this.processRefund(i).then(e)},final:()=>{s&&!s.error&&r&&(this.submitEvent.emit({response:s}),this.submitDisabled=!0,this.refundLoading=!1,e(s.data))}})}))}async processRefund(t){const e=(({authToken:t,accountId:e,paymentId:s,service:r})=>async({refundBody:i,onSuccess:n,onError:o,final:a})=>{var h;try{const a=await r.postRefund(s,e,t,i);if(a.error)return o({error:j(a.error),code:y(null===(h=a.error)||void 0===h?void 0:h.code),severity:u.ERROR});n(a)}catch(t){const e=y(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:u.ERROR})}finally{a()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new S});return new Promise((s=>{let r;e({refundBody:t,onSuccess:t=>{r=t},onError:({error:t,code:e,severity:s})=>{r=t,this.handleError(t,e,s)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,s(r.data)}})}))}render(){if(this.paymentLoading)return t(k,null);const e=this.formController.getInitialValues(),s=this.refundPayload.amount;return t(d,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:e.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:e.reason,inputHandler:this.inputHandler,options:g,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:e.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(c,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${o(+s)}`))))))}};export{x as justifi_refund_payment}