@justifi/webcomponents 6.14.4 → 6.14.5-rc.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.
- package/dist/cjs/{Analytics-CMv0MKQ4.js → Analytics-46pgYofS.js} +2 -2
- package/dist/cjs/{Api-ChUqJ75C.js → Api-C2V2lX6a.js} +1 -1
- package/dist/cjs/additional-questions-form-step_15.cjs.entry.js +4 -4
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/{business.service-BSoN1ENP.js → business.service-COn1NkhY.js} +1 -1
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-mt-o0WFo.js → check-pkg-version-BsDr9TZT.js} +1 -1
- package/dist/cjs/{checkout.service-BDUrLWyA.js → checkout.service-DObCfUj2.js} +1 -1
- package/dist/cjs/dispute-notification_2.cjs.entry.js +5 -5
- package/dist/cjs/{event-types-DlZRGu3q.js → event-types-CmDSoKh4.js} +1 -1
- package/dist/cjs/form-alert_3.cjs.entry.js +1 -1
- package/dist/cjs/{get-subaccounts-w4iQAASi.js → get-subaccounts-CuruLv9t.js} +1 -1
- package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +37 -19
- package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +4 -4
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +4 -4
- package/dist/cjs/justifi-business-details.cjs.entry.js +5 -5
- package/dist/cjs/justifi-business-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-card-form.cjs.entry.js +4 -4
- package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +4 -4
- package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +6 -6
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +5 -5
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -4
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +6 -6
- package/dist/cjs/justifi-payment-details.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payments-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payout-details.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +6 -6
- package/dist/cjs/justifi-qr-terminal.cjs.entry.js +5 -5
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +5 -5
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +4 -4
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +6 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-V2lnhWch.js → package-Cb1-8Jj8.js} +1 -1
- package/dist/cjs/{payment.service-CUuADjYH.js → payment.service-XSIPp45g.js} +1 -1
- package/dist/cjs/{payout.service-D_gucuzq.js → payout.service-CIzggNLL.js} +1 -1
- package/dist/cjs/{plaid.service-DIPjzg_M.js → plaid.service-jphsDR0Z.js} +1 -1
- package/dist/cjs/{terminal.service-DVxXWBU7.js → terminal.service-ZyT05wTw.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/modular-checkout/justifi-modular-checkout.js +20 -5
- package/dist/collection/components/modular-checkout/sub-components/justifi-sezzle-payment-method.js +12 -10
- package/dist/docs.json +1 -1
- package/dist/esm/{Analytics-C8-CZjVs.js → Analytics-YJZMjYtq.js} +2 -2
- package/dist/esm/{Api-BmZr64rt.js → Api-od4ybwHR.js} +1 -1
- package/dist/esm/additional-questions-form-step_15.entry.js +4 -4
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/{business.service-BTTf2CSv.js → business.service-BM14Brj6.js} +1 -1
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-B697jYyG.js → check-pkg-version-DtP8CVbU.js} +1 -1
- package/dist/esm/{checkout.service-B3BXVtHv.js → checkout.service-B8kSQSsn.js} +1 -1
- package/dist/esm/dispute-notification_2.entry.js +5 -5
- package/dist/esm/{event-types-DEIzZDtB.js → event-types-DL21cZd2.js} +1 -1
- package/dist/esm/form-alert_3.entry.js +1 -1
- package/dist/esm/{get-subaccounts-CnKtCpiU.js → get-subaccounts-yZP4GBHd.js} +1 -1
- package/dist/esm/justifi-apple-pay_11.entry.js +37 -19
- package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +4 -4
- package/dist/esm/justifi-bank-account-form.entry.js +4 -4
- package/dist/esm/justifi-business-details.entry.js +5 -5
- package/dist/esm/justifi-business-form.entry.js +5 -5
- package/dist/esm/justifi-card-form.entry.js +4 -4
- package/dist/esm/justifi-checkout-qr-code.entry.js +4 -4
- package/dist/esm/justifi-checkout.entry.js +4 -4
- package/dist/esm/justifi-checkouts-list.entry.js +6 -6
- package/dist/esm/justifi-dispute-management.entry.js +5 -5
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
- package/dist/esm/justifi-order-terminals.entry.js +6 -6
- package/dist/esm/justifi-payment-details.entry.js +5 -5
- package/dist/esm/justifi-payment-provisioning.entry.js +5 -5
- package/dist/esm/justifi-payment-transactions-list.entry.js +5 -5
- package/dist/esm/justifi-payments-list.entry.js +5 -5
- package/dist/esm/justifi-payout-details.entry.js +5 -5
- package/dist/esm/justifi-payout-transactions-list.entry.js +5 -5
- package/dist/esm/justifi-payouts-list.entry.js +6 -6
- package/dist/esm/justifi-qr-terminal.entry.js +5 -5
- package/dist/esm/justifi-refund-payment.entry.js +5 -5
- package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -4
- package/dist/esm/justifi-terminal-orders-list.entry.js +4 -4
- package/dist/esm/justifi-terminals-list.entry.js +6 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-DlhPMNzz.js → package-B_uQqefL.js} +1 -1
- package/dist/esm/{payment.service-Ciw1eGvT.js → payment.service-S0sEKmRn.js} +1 -1
- package/dist/esm/{payout.service-2jjZOOvC.js → payout.service-ZABnlfYv.js} +1 -1
- package/dist/esm/{plaid.service-CuAL_uL3.js → plaid.service-qxtz2sWM.js} +1 -1
- package/dist/esm/{terminal.service-Di5Ma4sp.js → terminal.service-CB2kRLwO.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/justifi-modular-checkout2.js +20 -5
- package/dist/module/justifi-sezzle-payment-method2.js +12 -10
- package/dist/module/package.js +1 -1
- package/dist/types/components/modular-checkout/sub-components/justifi-sezzle-payment-method.d.ts +1 -1
- package/dist/webcomponents/{p-a0515894.entry.js → p-005d353c.entry.js} +1 -1
- package/dist/webcomponents/p-1208da06.entry.js +1 -0
- package/dist/webcomponents/{p-f9d0b34d.entry.js → p-13cbf119.entry.js} +1 -1
- package/dist/webcomponents/{p-19721f28.entry.js → p-1491320a.entry.js} +1 -1
- package/dist/webcomponents/{p-1255176f.entry.js → p-16471ba1.entry.js} +1 -1
- package/dist/webcomponents/p-348decec.entry.js +1 -0
- package/dist/webcomponents/{p-63ed941e.entry.js → p-3734d15d.entry.js} +1 -1
- package/dist/webcomponents/p-38bdce5d.entry.js +1 -0
- package/dist/webcomponents/{p-40332723.entry.js → p-488dc072.entry.js} +1 -1
- package/dist/webcomponents/{p-a6f68a03.entry.js → p-4d747ce5.entry.js} +1 -1
- package/dist/webcomponents/p-5f57c81c.entry.js +1 -0
- package/dist/webcomponents/p-5f7137db.entry.js +1 -0
- package/dist/webcomponents/{p-1a1591e3.entry.js → p-6ab4c4e0.entry.js} +1 -1
- package/dist/webcomponents/p-760f423b.entry.js +1 -0
- package/dist/webcomponents/p-79fd9000.entry.js +1 -0
- package/dist/webcomponents/{p-bd46911b.entry.js → p-836c4136.entry.js} +1 -1
- package/dist/webcomponents/{p-fbd08a2e.entry.js → p-88a3c0cf.entry.js} +4 -4
- package/dist/webcomponents/{p-8507bd99.entry.js → p-99d17144.entry.js} +1 -1
- package/dist/webcomponents/p-9bd0bb34.entry.js +1 -0
- package/dist/webcomponents/{p-dd2654f5.entry.js → p-9e9dcc20.entry.js} +1 -1
- package/dist/webcomponents/p-BEmZOGbG.js +1 -0
- package/dist/webcomponents/p-B_uQqefL.js +1 -0
- package/dist/webcomponents/{p-D437Px2O.js → p-BjNqkh37.js} +1 -1
- package/dist/webcomponents/{p-BpFSR2PV.js → p-BnQkpNjd.js} +1 -1
- package/dist/webcomponents/{p-B4Xi-t8v.js → p-C1PEDhkE.js} +1 -1
- package/dist/webcomponents/{p-BsnuluAl.js → p-C2l2dxvr.js} +1 -1
- package/dist/webcomponents/{p-DwLofzXZ.js → p-C3geClRX.js} +1 -1
- package/dist/webcomponents/{p-C1x6dkgs.js → p-CELpJl4Y.js} +1 -1
- package/dist/webcomponents/p-CT8oFJ_1.js +1 -0
- package/dist/webcomponents/{p-5_w3jWjY.js → p-ChiCyW0k.js} +1 -1
- package/dist/webcomponents/{p-359e35b5.entry.js → p-a1b7e2fc.entry.js} +1 -1
- package/dist/webcomponents/{p-74de23d8.entry.js → p-b6c112cd.entry.js} +1 -1
- package/dist/webcomponents/{p-b4d216cf.entry.js → p-bbd403f5.entry.js} +1 -1
- package/dist/webcomponents/{p-0c2848c8.entry.js → p-d4208a51.entry.js} +1 -1
- package/dist/webcomponents/{p-11294ee2.entry.js → p-ead927fb.entry.js} +1 -1
- package/dist/webcomponents/{p-8bf07094.entry.js → p-ecaec672.entry.js} +1 -1
- package/dist/webcomponents/{p-546e5799.entry.js → p-ecbed9bc.entry.js} +1 -1
- package/dist/webcomponents/p-ee108873.entry.js +1 -0
- package/dist/webcomponents/{p-9f3b1212.entry.js → p-f1592a71.entry.js} +1 -1
- package/dist/webcomponents/{p-CfYe14W-.js → p-gAlfGUcr.js} +1 -1
- package/dist/webcomponents/{p-Chs1q3Hw.js → p-mjjqv7AN.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +15 -15
- package/LICENSE +0 -21
- package/dist/webcomponents/p-003cd0b9.entry.js +0 -1
- package/dist/webcomponents/p-0ae95f48.entry.js +0 -1
- package/dist/webcomponents/p-34a4924b.entry.js +0 -1
- package/dist/webcomponents/p-661f50a9.entry.js +0 -1
- package/dist/webcomponents/p-73f97f6a.entry.js +0 -1
- package/dist/webcomponents/p-851a5865.entry.js +0 -1
- package/dist/webcomponents/p-CumGHL0N.js +0 -1
- package/dist/webcomponents/p-DCwSevh5.js +0 -1
- package/dist/webcomponents/p-DlhPMNzz.js +0 -1
- package/dist/webcomponents/p-b140a8b8.entry.js +0 -1
- package/dist/webcomponents/p-db71a012.entry.js +0 -1
- package/dist/webcomponents/p-ee78df81.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{m as a,C as i,b as o}from"./p-8fO8CrtQ.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as c,a as h}from"./p-D1H6VUbM.js";import{c as n}from"./p-
|
|
1
|
+
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{m as a,C as i,b as o}from"./p-8fO8CrtQ.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as c,a as h}from"./p-D1H6VUbM.js";import{c as n}from"./p-C3geClRX.js";import{J as d}from"./p-BnQkpNjd.js";import{C as p}from"./p-CT8oFJ_1.js";import{m as u,S as m}from"./p-BjNqkh37.js";import{S as b}from"./p-05AWudQe.js";import{T as f,a as l,b as y,c as g,d as k,e as j,f as v,g as C,h as _,i as w,j as T,k as S,l as P}from"./p-DZr0wLGh.js";import{T as A}from"./p-CZfYo5-1.js";import{d as D,b as O}from"./p-Ds_P-dB8.js";import{B as x,a as I}from"./p-Dz8KJn2G.js";import{a6 as E,a7 as B}from"./p-Bu7gdOaV.js";import{o as L,g as G}from"./p-CArdj6i_.js";import"./p-DgTOxu8x.js";import"./p-B_uQqefL.js";import"./p-CELpJl4Y.js";import"./p-MPer3Rw7.js";const M={created_at:()=>t("th",{part:E,scope:"col",title:"The date each checkout occurred"},"Processed On"),payment_amount:()=>t("th",{part:E,scope:"col",title:"The dollar amount of each checkout"},"Payment Amount"),payment_description:()=>t("th",{part:E,scope:"col",title:"The description of each checkout"},"Payment Description"),sub_account_name:()=>t("th",{part:E,scope:"col",title:"The sub account associated with the checkout"},"Sub Account"),payment_mode:()=>t("th",{part:E,scope:"col",title:"The payment mode of each checkout"},"Payment Mode"),status:()=>t("th",{part:E,scope:"col",title:"The current status of each checkout"},"Status")},q={created_at:(e,s)=>t("td",{part:B(s)},t("div",{class:"fw-bold"},O(e.created_at)),t("div",{class:"fw-bold"},D(e.created_at))),payment_amount:(e,s)=>t("td",{part:B(s)},e.formattedPaymentAmount(e.payment_amount)),payment_description:(e,s)=>t("td",{part:B(s)},e.payment_description),sub_account_name:(e,s)=>t("td",{part:B(s)},e.sub_account_name),payment_mode:(e,s)=>t("td",{part:B(s)},e.payment_mode),status:(e,s)=>t("td",{part:B(s)},t(I,Object.assign({},{created:{variant:x.PRIMARY,title:"The checkout has been created",text:"Created"},completed:{variant:x.SUCCESS,title:"The checkout has been completed",text:"Completed"},attempted:{variant:x.SECONDARY,title:"The checkout has been attempted",text:"Attempted"},expired:{variant:x.DANGER,title:"The checkout has expired",text:"Expired"}}[e.status])))},z=class{constructor(t){e(this,t),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.columns="created_at,payment_amount,payment_description,payment_mode,status",this.checkouts=[],this.subAccounts=[],this.loading=!0,this.paging=r,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:A.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:A.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const s=this.checkouts.find((t=>t.id===e));this.clickEvent.emit({name:A.row,data:s})}}componentWillLoad(){n(),this.analytics=new d(this),this.checkoutsTable=new f(this.checkouts,this.columns,M,q),this.initializeGetData(),this.getCheckouts&&this.fetchData(),L("set",(()=>{this.pagingParams={}})),L("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}authPropChanged(){this.initializeGetData(),this.getCheckouts&&this.fetchData()}pagingOrColumnsChanged(){this.getCheckouts&&this.fetchData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){const t=this.subAccountId||this.accountId;t&&this.authToken?this.getCheckouts=(({accountId:t,authToken:e,service:s})=>async({params:o,onSuccess:r,onError:n})=>{var d,p;try{const u=await s.fetchCheckouts(t,e,o);if(u.error)return n({error:h(u.error),code:c(null===(p=u.error)||void 0===p?void 0:p.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const e=c(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:i.ERROR})}})({accountId:t,authToken:this.authToken,service:new p}):(this.errorMessage="Account ID/Sub Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({primaryAccountId:this.accountId,authToken:this.authToken,service:new m}))}fetchData(){this.getCheckouts&&(this.loading=!0,this.getCheckouts({params:this.checkoutParams,onSuccess:async({checkouts:t,pagingInfo:e})=>{this.checkouts=t,this.paging=e,this.checkoutsTable.collectionData=this.checkouts,this.checkoutsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}))}async fetchSubAccounts(){this.getSubAccounts?this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.checkouts=this.checkouts.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}):this.loading=!1}get checkoutParams(){const t=G();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.checkouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.checkouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.checkoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(b,{key:"882db931e1e29698776ffa6c715ca4abb7d322f7"},t(l,{key:"7bb610f41ae1feab6e4a1cf8abb19fbff00914e6"},t(y,{key:"4ca7ca2a8fcb7b26cd4cdb7679ef7c3db17bb1d1"},t(g,{key:"b2fdd2852c74f066cfdf7aee27148fa36cf5df74"},t(k,{key:"688d8189928c8ee54e6b60383492cdd2e7717fcf"},this.checkoutsTable.columnData.map((t=>t)))),t(j,{key:"0e3e589b387455bdbb30c5130e206c46447d2a43"},t(v,{key:"b0d74610ef26b4b67e1c1a70b93e9932c4d47350",columnSpan:this.checkoutsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"dfc775ac8f7a47611e740e1e4b7562adfffd15d3",isEmpty:this.showEmptyState,columnSpan:this.checkoutsTable.columnKeys.length}),t(_,{key:"8ba255c49e9ea76d13644b4c5842f9c003816040",columnSpan:this.checkoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.checkoutsTable.rowData.map(((e,s)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},e)))),this.paging&&t(T,{key:"82cf7b391647fdb6cefcbdbe13113ebb6e70bf62"},t(S,{key:"6678e2573867bf3c79f266ebab392034eb143c65"},t(P,{key:"c981a304af815c314e8306922b779cea8670b825",colSpan:this.checkoutsTable.columnData.length},t("pagination-menu",{key:"ea32b8d13a5af7122095fd4081d29668019928ee",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["authPropChanged"],authToken:["authPropChanged"],subAccountId:["authPropChanged"],pagingParams:["pagingOrColumnsChanged"],columns:["pagingOrColumnsChanged"]}}};export{z as justifi_checkouts_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as t,h as i}from"./p-CV0Pyo1O.js";import{D as e,C as r,b as o,h as p}from"./p-8fO8CrtQ.js";import{J as a}from"./p-BnQkpNjd.js";import{c as h}from"./p-C3geClRX.js";import{g as n,a as d}from"./p-D1H6VUbM.js";import{D as u,a as c}from"./p-C2l2dxvr.js";import{S as m}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-B_uQqefL.js";import"./p-CELpJl4Y.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const f=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.isLoading=!0,this.showDisputeResponseForm=!1,this.fetchDisputePending=!1}scheduleFetchDispute(){this.getDispute&&!this.fetchDisputePending&&(this.fetchDisputePending=!0,queueMicrotask((()=>{this.fetchDisputePending=!1,this.getDispute&&this.fetchData()})))}disputeResponseHandler(s){s.detail.name===u.respondToDispute&&(this.showDisputeResponseForm=!0),s.detail.name===u.cancelDispute&&(this.showDisputeResponseForm=!1)}disputeSubmittedHandler(){this.fetchData()}componentWillLoad(){h(),this.analytics=new a(this),this.initializeGetDispute()}componentDidLoad(){this.scheduleFetchDispute()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetDispute(),this.scheduleFetchDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:s,authToken:t,service:i})=>async({onSuccess:o,onError:p})=>{var a;try{const h=await i.fetchDispute(s,t);if(h.error)return p({error:d(h.error),code:n(null===(a=h.error)||void 0===a?void 0:a.code),severity:r.ERROR});{const s=Object.assign({},h.page_info);o({dispute:new e(h.data),pagingInfo:s})}}catch(s){const t=n(null==s?void 0:s.code);return p({error:s.message||s,code:t,severity:r.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new c}):this.errorEvent.emit({message:"Dispute ID and Auth Token are required",errorCode:o.MISSING_PROPS,severity:r.ERROR})}fetchData(){this.getDispute&&(this.isLoading=!0,this.getDispute({onSuccess:({dispute:s})=>{this.dispute=new e(s),this.isLoading=!1,this.dispute.status!==p.needsResponse&&(this.showDisputeResponseForm=!1)},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({errorCode:t,message:s,severity:i}),this.isLoading=!1}}))}render(){return i(m,{key:"6d86218f7a7fe8ea93a377e3bf182dc67e339682"},i("div",{key:"0b51a3bbf6608671ba63773aa77665f85e88ef27"},this.showDisputeResponseForm?i("dispute-response",{disputeId:this.disputeId,disputeResponse:this.dispute.dispute_response,authToken:this.authToken}):i("dispute-notification",{dispute:this.dispute,authToken:this.authToken,isLoading:this.isLoading})))}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_dispute_management}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-CV0Pyo1O.js";import{J as a}from"./p-
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-CV0Pyo1O.js";import{J as a}from"./p-BnQkpNjd.js";import{c as s}from"./p-C3geClRX.js";import{c as d}from"./p-DNxN6bjU.js";import{c}from"./p-Bu7gdOaV.js";import{S as o}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{P as f}from"./p-DkoufM1t.js";import"./p-B_uQqefL.js";import"./p-CELpJl4Y.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const h=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event",7),this.loadedEvent=t(this,"loaded",7),this.submitEvent=t(this,"submit-event",7),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){s(),this.analytics=new a(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){d.isSubmitting=!1}checkoutError(e){d.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=e.detail.availablePaymentMethodTypes}async fillBillingForm(e){d.billingFormFields=e}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"be64697a74e404e567c718562f72ca6cf644a2a4"},i("justifi-modular-checkout",{key:"49be0912aa949927cb11bde45c6ade0eb25744be",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId,preCompleteHook:this.preCompleteHook},i("div",{key:"7ae8865515c16d119d0c951670b86f53006f5a2f",class:"row gy-3 jfi-checkout-core"},i("div",{key:"697f67f1603f78d852c3900f424fea1559dcbbc7",class:"col-12",part:c},i("justifi-header",{key:"005b320bb2318b6e5a888911fe90aeeeb8ca58f1",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"e6e4e720e0d619aa338b1a64ccc75f6bcfb53129"},i("justifi-checkout-summary",{key:"5bbc4d7223f56fe70bcc9810ebcde55264e17943"}))),i("div",{key:"7c5f714e729c26a8c3589e912100d38e61cb3846",class:"col-12 mt-4"},i("slot",{key:"ae66ebfe4a0e1456aaabd706523ef17e9c2c4b50",name:"insurance"})),i("div",{key:"3d74c4078230299a0d093568f9edf61ddede06d6",class:"col-12 mt-4"},i("justifi-header",{key:"98fad7779ad81e44f56d488f8f9bebb843c8b044",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"a522e1c11e8412c0df0b272201a9eb929e8f38a5",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"670a875b91e3c4f41cc1f99e159ddb62d5d2cd9d",class:"d-flex flex-column"},i("section",{key:"660a700bfdffa79b3e00da2ae186f98fbefc59de"},i("div",{key:"3c314f058f5a6bf745800790dcad6b0f09ec9fdf"},this.availablePaymentMethods.includes(f.APPLE_PAY)&&i("div",{key:"9b3003bc6a7e2a85c64d28ac1457871297fcb570",class:"mb-3"},i("justifi-apple-pay",{key:"25fb043d7fdd2308ceaf8cef9b8e3db72c276ec8"})),this.availablePaymentMethods.includes(f.GOOGLE_PAY)&&i("div",{key:"62ea38828ed1e7fe795cd92c1523e0a09dbb1249",class:"mb-3"},i("justifi-google-pay",Object.assign({key:"6bf9455e95950766204a4b9a16c51512961dab6d",ref:e=>this.googlePayRef=e},null!=this.googlePayEnv?{environment:this.googlePayEnv}:{}))),i("justifi-saved-payment-methods",{key:"ab59f136054cc421499002a3955aa91a679c1e16"}),this.availablePaymentMethods.includes(f.SEZZLE)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"7f51953073b94f893b197cdedc123ec273283574",name:"paymentMethodType",value:f.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===f.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(f.PLAID)&&i("justifi-radio-list-item",{key:"4ff159b8cd0eb5fe9a4e6a168a6c6b018754aad6",name:"paymentMethodType",value:f.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===f.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("justifi-tokenize-payment-method",{key:"9598c68ebb09a5fa817e9318526fa1bb6ffab5f3",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"92727d5624ed61bc3d986e495332e6a8e003dc8f",class:"mt-4"},i("justifi-button",{key:"b9b00d1bb08cb2beee1fd7e38877c5073245e4d5",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:d.isSubmitting||d.isWalletProcessing,isLoading:d.isSubmitting||d.isWalletProcessing,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{h as justifi_checkout}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as t}from"./p-CELpJl4Y.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const a=t();class n{async fetchPayouts(t,n,o){return a.get({authToken:n,endpoint:`account/${t}/payouts`,params:o})}async fetchPayout(t,n){return a.get({authToken:n,endpoint:`payouts/${t}`})}async fetchCSV(t,n){return a.get({authToken:n,endpoint:`reports/payouts/${t}`})}async fetchPayoutTransactions(t,n,o){return a.get({authToken:n,endpoint:"balance_transactions",params:o,headers:{"sub-account":t}})}}export{n as P}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={name:"@justifi/webcomponents",version:"6.14.5-rc.1"};export{e as p}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as r}from"./p-
|
|
1
|
+
import{A as r}from"./p-CELpJl4Y.js";import{S as o,C as s}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{g as t,a as n}from"./p-D1H6VUbM.js";const c=r();class a{async fetchSubAccounts(r,o,s){return c.get({authToken:o,endpoint:"sub_accounts",params:s,headers:{Account:r}})}}const e=({primaryAccountId:r,authToken:c,service:a})=>async({params:e,onSuccess:p,onError:i})=>{var u,m;try{const v=await a.fetchSubAccounts(r,c,e);if(v.error){return i({error:n(v.error),code:t(null===(m=v.error)||void 0===m?void 0:m.code),severity:s.ERROR})}{const r=Object.assign({},v.page_info);p({subAccounts:(null===(u=v.data)||void 0===u?void 0:u.map((r=>new o(r))))||[],pagingInfo:r})}}catch(r){const o=t(null==r?void 0:r.code);return i({error:r.message||r,code:o,severity:s.ERROR})}};export{a as S,e as m}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t}from"./p-
|
|
1
|
+
import{p as t}from"./p-B_uQqefL.js";import{A as s}from"./p-CELpJl4Y.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class n{constructor(t){this.eventListeners=new Map,this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("docs.justifi.tech")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{if("function"==typeof this.componentInstance.addEventListener){const s=s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),"error-event"===t&&{error:s.detail})});this.eventListeners.set(t,s),this.componentInstance.addEventListener(t,s)}}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventListeners.forEach(((t,s)=>{this.componentInstance.removeEventListener(s,t)})),this.eventListeners.clear()}}export{n as J}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as t}from"./p-
|
|
1
|
+
import{A as t}from"./p-CELpJl4Y.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const n=t();class a{async fetchPayments(t,a,s){return n.get({endpoint:`account/${t}/payments`,params:s,authToken:a})}async fetchPayment(t,a){return n.get({endpoint:`payments/${t}`,authToken:a})}async fetchPaymentTransactions(t,a,s){return n.get({endpoint:`payments/${t}/payment_balance_transactions`,params:s,authToken:a})}}export{a as P}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e}from"./p-
|
|
1
|
+
import{A as e}from"./p-CELpJl4Y.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const t=e();class s{async fetchDispute(e,s){return t.get({endpoint:`disputes/${e}`,authToken:s})}async updateDisputeResponse(e,s,n){return t.patch({endpoint:`disputes/${e}/response`,body:n,authToken:s})}async submitDisputeResponse(e,s,n){return t.post({endpoint:`disputes/${e}/response`,body:n,authToken:s})}async createDisputeEvidence(e,s,n){return t.put({endpoint:`disputes/${e}/evidence`,body:n,authToken:s})}}var n,p;!function(e){e.nextStep="nextStep",e.previousStep="previousStep",e.cancelDispute="cancelDispute",e.respondToDispute="respondToDispute",e.submit="submit"}(n||(n={})),function(e){e.disputeReason="dispute_reason",e.productOrService="product_or_service",e.customerDetails="customer_details",e.cancellationPolicy="cancellation_policy",e.refundPolicy="refund_policy",e.duplicateCharge="duplicate_charge",e.electronicEvidence="electronic_evidence",e.shippingDetails="shipping_details",e.additionalStatement="additional_statement"}(p||(p={}));export{n as D,s as a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./p-
|
|
1
|
+
import{p as e}from"./p-B_uQqefL.js";const s="__JUSTIFI_WC_VERSION__",o=async()=>{var o,t;if((()=>{if("undefined"==typeof globalThis)return;const o=e.version,t=globalThis[s];t&&t!==o?console.error(`@justifi/webcomponents: Multiple versions detected. Version ${t} was loaded first and registered all components. Version ${o} is also present but its components will NOT be used. To fix this, add to your package.json:\n"pnpm": { "overrides": { "@justifi/webcomponents": "${o}" } }`):globalThis[s]=o})(),"undefined"!=typeof process&&("test"===(null===(o=process.env)||void 0===o?void 0:o.NODE_ENV)||(null===(t=process.env)||void 0===t?void 0:t.JEST_WORKER_ID)))return;const i=e.version,n=e.name,a=await(async e=>{const s=await fetch("https://registry.npmjs.org/"+e+"/latest");return(await s.json()).version})(n),r=a.replace(/-rc.*/,""),l=i.split("."),p=a.split(".");l[0]!==p[0]&&console.warn(`The package ${n} is out of date. The latest version is ${r}. Please update.`)};export{o as c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as n,c as o}from"./p-B4vLfYnZ.js";import{g as t}from"./p-Ds_P-dB8.js";import{p as a}from"./p-
|
|
1
|
+
import{w as n,c as o}from"./p-B4vLfYnZ.js";import{g as t}from"./p-Ds_P-dB8.js";import{p as a}from"./p-B_uQqefL.js";const e=()=>{async function e(e){var s,i;const{authToken:r,endpoint:d,method:p,params:u,body:c,signal:h,headers:l}=e;await n();const m=`${o.apiOrigin}/v1/${d}`,f=u?`${m}?${new URLSearchParams(u)}`:m,y=await async function(n){return n?{Authorization:`Bearer ${n}`,"Idempotency-Key":t(),"Content-Type":"application/json","Justifi-Web-Component-Version":a.version}:{"Content-Type":"application/json","Justifi-Web-Component-Version":a.version}}(r),T=Object.assign(Object.assign({},y),l),g=await fetch(f,{method:p,headers:T,body:c,signal:h});if(!g)return void function(n){console.error(`Error fetching from ${n}`)}(f);if(204===g.status)return{};const b=await g.json().catch((()=>({})));if(!g.ok){const n=new Error((null===(s=null==b?void 0:b.error)||void 0===s?void 0:s.message)||("string"==typeof(null==b?void 0:b.error)?b.error:null)||(null==b?void 0:b.message)||`Request failed: ${g.status}`);throw n.code=null===(i=null==b?void 0:b.error)||void 0===i?void 0:i.code,n.status=g.status,n.body=b,n}return b}return{get:async function(n){const{authToken:o,endpoint:t,params:a,signal:s,headers:i}=n;return e({authToken:o,endpoint:t,method:"GET",params:a,signal:s,headers:i})},post:async function(n){const{authToken:o,endpoint:t,body:a,params:s,signal:i,headers:r}=n;return e({authToken:o,endpoint:t,method:"POST",params:s,body:JSON.stringify(a),signal:i,headers:r})},put:async function(n){const{authToken:o,endpoint:t,body:a,params:s,signal:i}=n;return e({authToken:o,endpoint:t,method:"PUT",params:s,body:JSON.stringify(a),signal:i})},patch:async function(n){const{authToken:o,endpoint:t,body:a,params:s,signal:i}=n;return e({authToken:o,endpoint:t,method:"PATCH",params:s,body:JSON.stringify(a),signal:i})},destroy:async function(n){const{authToken:o,endpoint:t,params:a,signal:s}=n;return e({authToken:o,endpoint:t,method:"DELETE",params:a,signal:s})}}};export{e as A}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as t}from"./p-CELpJl4Y.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const e=t();class o{async fetchCheckout(t,o){return e.get({endpoint:`checkouts/${o}`,authToken:t})}async fetchCheckouts(t,o,c){return e.get({endpoint:"checkouts",params:c,headers:{Account:t},authToken:o})}async complete(t,o,c){const n=`checkouts/${o}/complete`,s={payment_mode:c.payment_mode};return c.payment_token&&(s.payment_token=c.payment_token),e.post({endpoint:n,body:s,authToken:t})}}export{o as C}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e}from"./p-
|
|
1
|
+
import{A as e}from"./p-CELpJl4Y.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const r=e();class n{async fetchTerminals(e,n,t){return r.get({endpoint:"terminals",params:t,headers:{Account:e},authToken:n})}async fetchTerminal(e,n){return r.get({endpoint:`terminals/${e}`,authToken:n})}async fetchTerminalModels(e,n){return r.get({endpoint:"terminals/order_models",headers:{"sub-account":e},authToken:n})}async orderTerminals(e,n){return r.post({endpoint:"terminals/orders",body:n,headers:{"sub-account":n.sub_account_id},authToken:e})}}export{n as T}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as i,c as r}from"./p-CV0Pyo1O.js";import{S as s}from"./p-eBK-iWrz.js";import{w as e,c as a}from"./p-B4vLfYnZ.js";import{e as o}from"./p-Ds_P-dB8.js";import{c as n}from"./p-
|
|
1
|
+
import{h as t,r as i,c as r}from"./p-CV0Pyo1O.js";import{S as s}from"./p-eBK-iWrz.js";import{w as e,c as a}from"./p-B4vLfYnZ.js";import{e as o}from"./p-Ds_P-dB8.js";import{c as n}from"./p-C3geClRX.js";import{c as h}from"./p-DNxN6bjU.js";import{C as l,c,b as d}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{B as m}from"./p-CU2Dwa94.js";import"./p-CZfYo5-1.js";import"./p-Bu7gdOaV.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";import"./p-B_uQqefL.js";import"./p-DkoufM1t.js";const p=()=>t("div",{class:"container-fluid p-0"},t("div",{class:"row mb-3"},t("div",{class:"col-12 align-content-end"},t(s,{height:"18px",width:"120px"}),t(s,{height:"36px"}))),t("div",{class:"row"},t("div",{class:"col-12 align-content-end"},t(s,{height:"18px",width:"110px"}),t(s,{height:"36px"})))),u=class{constructor(t){i(this,t),this.errorEvent=r(this,"error-event",7),this.iframeState="loading",this.hasLoggedAchDisabledWarning=!1,this.reloadIframes=()=>{this.iframeState="loading",this.iframeElements.forEach((t=>t.reload())),this.watchIframesLoad()}}async componentWillLoad(){await e(),this.iframeOrigin=a.iframeOrigin,this.tabId=o(),n()}componentDidRender(){!this.loadAbortController&&this.iframeElements.every(Boolean)&&this.watchIframesLoad()}disconnectedCallback(){var t;null===(t=this.loadAbortController)||void 0===t||t.abort()}isAchDisabledForCheckout(){return h.checkoutLoaded&&!h.achPaymentsEnabled}async validate(){if(this.isAchDisabledForCheckout())return!1;const t=await this.accountNumberIframeElement.validate(),i=await this.routingNumberIframeElement.validate();return t&&i}async tokenize({clientId:t,paymentMethodMetadata:i,account:r}){return this.isAchDisabledForCheckout()?{error:{message:"ACH payments are disabled for this checkout (payment_settings.ach_payments=false)."}}:await this.accountNumberIframeElement.tokenize(t,i,r)}get isReady(){return"ready"===this.iframeState}get iframeElements(){return[this.accountNumberIframeElement,this.routingNumberIframeElement]}watchIframesLoad(){var t;null===(t=this.loadAbortController)||void 0===t||t.abort();const{signal:i}=this.loadAbortController=new AbortController,r=new Set(this.iframeElements.map((t=>t.inputId))),s=Promise.all(this.iframeElements.map((t=>new Promise((s=>{t.addEventListener("iframeLoaded",(()=>{r.delete(t.inputId),s()}),{once:!0,signal:i})}))))),e=new Promise(((t,s)=>{const e=window.setTimeout((()=>s(new Error(`Iframes failed to load: ${Array.from(r).join(", ")}`))),1e4);i.addEventListener("abort",(()=>{window.clearTimeout(e),s(new Error("iframe load watch aborted"))}),{once:!0})}));Promise.race([s,e]).then((()=>{var t;i.aborted||(this.iframeState="ready",null===(t=this.loadAbortController)||void 0===t||t.abort())})).catch((t=>{var r;i.aborted||(this.iframeState="error",null===(r=this.loadAbortController)||void 0===r||r.abort(),this.errorEvent.emit({errorCode:d.IFRAME_LOAD_ERROR,message:c.IFRAME_LOAD_ERROR,severity:l.ERROR,data:{errorMessage:t.message}}))}))}renderIframeError(){return t("div",null,t("form-alert",{text:c.IFRAME_LOAD_ERROR,hideAlert:!1}),t(m,{variant:"link",clickHandler:this.reloadIframes,"aria-label":"Reload bank account form",type:"button"},"Try again"))}render(){return this.isAchDisabledForCheckout()?(this.hasLoggedAchDisabledWarning||(console.warn("[bank-account-form] ACH payments are disabled for this checkout (payment_settings.ach_payments=false)."),this.hasLoggedAchDisabledWarning=!0),null):t("div",null,"loading"===this.iframeState&&t(p,null),"error"===this.iframeState&&this.renderIframeError(),t("hidden-input",null),t("div",{class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},t("div",{class:"row mb-3"},t("iframe-input",{inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber?tabId=${this.tabId}`})),t("div",{class:"row"},t("iframe-input",{inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber?tabId=${this.tabId}`}))))}};export{u as bank_account_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as s}from"./p-CV0Pyo1O.js";import{m as i}from"./p-Dl0CAW76.js";import{C as h}from"./p-
|
|
1
|
+
import{r as t,c as e,h as s}from"./p-CV0Pyo1O.js";import{m as i}from"./p-Dl0CAW76.js";import{C as h}from"./p-CT8oFJ_1.js";import{C as r,b as o,I as l,c as a,d as n}from"./p-8fO8CrtQ.js";import{J as c}from"./p-BnQkpNjd.js";import{c as d}from"./p-C3geClRX.js";import"./p-D1H6VUbM.js";import"./p-CELpJl4Y.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-B_uQqefL.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const u=class{constructor(s){t(this,s),this.checkoutCompleted=e(this,"checkout-completed",7),this.checkoutExpired=e(this,"checkout-expired",7),this.errorEvent=e(this,"error-event",7),this.pollIntervalMs=3e3,this.pollTimeoutMs=6e5,this.terminalState="loading",this.paymentStatus="",this.errorMessage="",this.pollIntervalHandle=null,this.pollTimeoutHandle=null,this.failedDismissHandle=null,this.seenCompletionCreatedAts=new Set,this.inFlight=!1}componentWillLoad(){d(),this.analytics=new c(this),this.initialize()}disconnectedCallback(){var t;this.stopAll(),null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.stopAll(),this.initialize()}suppressInnerErrors(t){t.stopPropagation()}get effectivePollInterval(){return Math.max(1e3,this.pollIntervalMs)}initialize(){this.authToken&&this.checkoutId?(this.terminalState="loading",this.getCheckout=i({authToken:this.authToken,checkoutId:this.checkoutId,service:new h}),this.getCheckout({onSuccess:({checkout:t})=>this.handleInitialLoad(t),onError:({error:t,code:e,severity:s})=>{this.terminalState="error",this.errorMessage=t,this.errorEvent.emit({message:t,errorCode:e,severity:s})}})):this.errorEvent.emit({message:"authToken and checkoutId are required",errorCode:o.MISSING_PROPS,severity:r.ERROR})}handleInitialLoad(t){var e;switch(t.status){case l.expired:this.terminalState="expired",this.checkoutExpired.emit({checkoutId:this.checkoutId}),this.errorEvent.emit({message:a.CHECKOUT_EXPIRED,errorCode:o.CHECKOUT_EXPIRED,severity:r.ERROR});break;case l.completed:this.terminalState="completed",this.paymentStatus=this.resolvePaymentStatus(t),this.checkoutCompleted.emit({checkoutId:this.checkoutId,paymentStatus:this.paymentStatus});break;default:(null!==(e=t.completions)&&void 0!==e?e:[]).forEach((t=>this.seenCompletionCreatedAts.add(t.created_at))),this.terminalState="ready",this.startPolling()}}startPolling(){this.pollTimeoutHandle=setTimeout((()=>{this.stopAll(),this.terminalState="error",this.errorMessage="Checkout polling timed out",this.errorEvent.emit({message:"Checkout polling timed out",errorCode:o.FETCH_ERROR,severity:r.ERROR})}),this.pollTimeoutMs),this.pollIntervalHandle=setInterval((()=>this.tick()),this.effectivePollInterval)}tick(){this.inFlight||(this.inFlight=!0,this.getCheckout({onSuccess:({checkout:t})=>{this.inFlight=!1,this.handlePollResult(t)},onError:({error:t,code:e,severity:s})=>{this.inFlight=!1,this.stopAll(),this.terminalState="error",this.errorMessage=t,this.errorEvent.emit({message:t,errorCode:e,severity:s})}}))}handlePollResult(t){var e;const s=(null!==(e=t.completions)&&void 0!==e?e:[]).filter((t=>!this.seenCompletionCreatedAts.has(t.created_at)&&"failed"===t.payment_status));if(s.forEach((t=>this.seenCompletionCreatedAts.add(t.created_at))),s.length>0&&(this.terminalState="payment-failed",this.failedDismissHandle&&clearTimeout(this.failedDismissHandle),this.failedDismissHandle=setTimeout((()=>{"payment-failed"===this.terminalState&&(this.terminalState="ready")}),3e3)),t.status===l.completed)return this.stopAll(),this.terminalState="completed",this.paymentStatus=this.resolvePaymentStatus(t),void this.checkoutCompleted.emit({checkoutId:this.checkoutId,paymentStatus:this.paymentStatus});t.status===l.expired&&(this.stopAll(),this.terminalState="expired",this.checkoutExpired.emit({checkoutId:this.checkoutId}),this.errorEvent.emit({message:a.CHECKOUT_EXPIRED,errorCode:o.CHECKOUT_EXPIRED,severity:r.ERROR}))}resolvePaymentStatus(t){var e,s;const i=null===(s=[...null!==(e=t.completions)&&void 0!==e?e:[]].sort(((t,e)=>new Date(e.updated_at).getTime()-new Date(t.updated_at).getTime()))[0])||void 0===s?void 0:s.payment_status;return i===n.succeeded||null==i&&t.successful_payment_id?"succeeded":"pending"}stopAll(){this.pollIntervalHandle&&(clearInterval(this.pollIntervalHandle),this.pollIntervalHandle=null),this.pollTimeoutHandle&&(clearTimeout(this.pollTimeoutHandle),this.pollTimeoutHandle=null),this.failedDismissHandle&&(clearTimeout(this.failedDismissHandle),this.failedDismissHandle=null),this.inFlight=!1}render(){return this.authToken&&this.checkoutId?s("div",null,"loading"===this.terminalState&&null,("ready"===this.terminalState||"payment-failed"===this.terminalState)&&s("div",null,s("justifi-checkout-qr-code",{checkoutId:this.checkoutId}),"payment-failed"===this.terminalState&&s("p",null,"Payment failed. Please try again."),"ready"===this.terminalState&&s("p",null,"Scan to pay")),"completed"===this.terminalState&&s("div",null,s("p",null,"succeeded"===this.paymentStatus?"Payment received":"Payment pending")),"expired"===this.terminalState&&s("p",null,"Checkout expired. Please create a new checkout."),"error"===this.terminalState&&s("p",null,this.errorMessage)):null}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"]}}};export{u as justifi_qr_terminal}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-
|
|
1
|
+
import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-C1PEDhkE.js";import{m as i}from"./p-CaLXuYmg.js";import{C as d,b as f,i as c,h as l}from"./p-8fO8CrtQ.js";import{J as r}from"./p-BnQkpNjd.js";import{c as h}from"./p-C3geClRX.js";import"./p-B4vLfYnZ.js";import{b as o,d as b,s as p}from"./p-Ds_P-dB8.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{P as n,M as m}from"./p-Bi_GCMx0.js";import{a as u,b as y,D as v,c as k,C as g,E as j}from"./p-Bh6Q8AqQ.js";import{S as C}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as D}from"./p-eBK-iWrz.js";import{a as w,B as x}from"./p-Dz8KJn2G.js";import"./p-CELpJl4Y.js";import"./p-B_uQqefL.js";import"./p-HXpYMWUU.js";import"./p-D1H6VUbM.js";import"./p-DgTOxu8x.js";import"./p-Bu7gdOaV.js";const P=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(D,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(D,{width:"70%"})),e("div",{class:"col-12"},e(D,{width:"40%"})),e("div",{class:"col-12"},e(D,{width:"40%"})),e("div",{class:"col-12"},e(D,{width:"100%"})),e("div",{class:"col-12"},e(D,{width:"80%"}))),B=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event",7),this.recordClickEvent=a(this,"record-click-event",7),this.loading=!0}componentWillLoad(){h(),this.analytics=new r(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?(this.getPaymentDetails=i({id:this.paymentId,authToken:this.authToken,service:new s}),this.fetchData()):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:f.MISSING_PROPS,severity:d.ERROR}))}updateOnPropChange(){this.getPaymentDetails&&this.fetchData()}fetchData(){this.loading=!0,this.getPaymentDetails({onSuccess:({payment:e})=>{this.payment=e,this.errorMessage=null},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({errorCode:t,message:e,severity:a})},final:()=>{this.loading=!1}})}get PaymentStatus(){return this.payment.status===c.disputed&&this.payment.disputes.some((e=>e.status===l.lost))?n.DISPUTE_LOST:this.payment.status}render(){return e(C,{key:"f304cb665f17ce96b6d97a38d94907629f559413"},this.loading&&e(P,{key:"709acde31230bd9e825e4e9669234492aff3cc3a"}),!this.loading&&this.errorMessage&&j(this.errorMessage),!this.loading&&!this.errorMessage&&this.payment&&e("justifi-details",{key:"09a4a2559fb89a5b4b57d81b0fd48952c219d348",errorMessage:this.errorMessage},e(u,{key:"7cbfece91ce9e5fab75d561ad369080ecbe76fa4",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},m(this.PaymentStatus),this.payment.expedited?e(w,{variant:x.WARNING,title:"Expedited",text:"Expedited"}):null),title:this.payment.formattedPaymentAmount(this.payment.amount)},e(y,{key:"4aa014d77def141d2053c3745b8215cc03a53ac7",classes:"border-1 border-end",title:"Updated At",value:`${o(this.payment.updated_at)} ${b(this.payment.updated_at)}`}),e(y,{key:"f344398f4fd4db6e1e7ca1335c3aa55630668475",classes:"border-1 border-end",title:"Created At",value:`${o(this.payment.created_at)} ${b(this.payment.created_at)}`}),e(y,{key:"a01e5a04400b996cfb2a9e563c8f383b8e8d7c66",title:"ID",value:this.payment.id})),e("div",{key:"ef0c63d53031dfa8910dfbdedede1e20ac09e78a",slot:"detail-sections"},e(v,{key:"5053784a7e3bd8932562a816921564aadd6d79c8",sectionTitle:"Details"}),e("div",{key:"43c56ee5a39589ea7a0107f32e274be439adf33a",class:"d-flex flex-column gap-2 w-100"},e(k,{key:"fcee2dd211c9bf951cdd6855ac3fa844632391ce",title:"Amount",value:this.payment.formattedPaymentAmount(this.payment.amount)}),e(k,{key:"44d055f3445f02feaeb4519b5f4777333089a8c6",title:"Fees",value:this.payment.formattedPaymentAmount(this.payment.fee_amount)}),e(k,{key:"906b584174bd5c329974274a2f1e1ef7e9e8fde0",title:"Refunded",value:this.payment.formattedPaymentAmount(this.payment.amount_refunded)}),e(k,{key:"809429e88eac8ebe8142bb0028f8b86447977697",title:"Net",value:this.payment.formattedPaymentAmount(this.payment.balance)}),e(k,{key:"e08c02efc64f105ce3180e9773584a331ae19a9b",title:"Status",value:m(this.PaymentStatus)}),e(k,{key:"fbb910b7006f9d4bff9b14ffd4fc2f7da8b68020",title:"Payment ID",value:this.payment.id}),e(k,{key:"09fefc2d1a750ab2f5dfb2043db08d5f16d6d9aa",title:"Processing Fees",value:this.payment.formattedPaymentAmount(this.payment.fee_amount)}),e(k,{key:"1d96f4557823f1d82d5c6e0e46a984c13c6f018b",title:"Statement Descriptor",value:this.payment.statement_descriptor}),e(k,{key:"51bfae7ef30f36c99c0fa1b25dc5397720ef88ff",title:"Description",value:this.payment.description}),e(k,{key:"5c44b3d40bfe6b2fbf258fee90f55ff24d0b3c28",title:"Expedited",value:this.payment.expedited?"Yes":"No"})),this.payment.payment_method.card&&[e(v,{key:"3d652ba331824448b7e7af969b2ead216f358e28",sectionTitle:"Payment Method"}),e("div",{key:"49ad00ec9d703d196a025fa17b03f4af7cdc4dc5",class:"d-flex flex-column gap-2 w-100"},e(k,{key:"2b1b3f57e74fd65dc4b82d727a94afbe14803c52",title:"ID",value:this.payment.payment_method.card.id}),e(k,{key:"b23d5263566ff11d469dea9a245d20a7689540f8",title:"Payment Type",value:"Card"}),e(k,{key:"f5f76d6d9ac609884aac18fe2743d4fad2192b86",title:"Last 4 Numbers",value:this.payment.payment_method.lastFourDigits}),e(k,{key:"22f296966b6f1aaf516b1d70144cff4f59b82c05",title:"Brand",value:p(this.payment.payment_method.card.brand)}),e(k,{key:"d7dcd0f7a74ed2cc5ba6406a7d48522ca06a7546",title:"Cardholder",value:this.payment.payment_method.payersName}))],this.payment.payment_method.bank_account&&[e(v,{key:"37a2a20c462cb94baa01ca7763d43ced04b4543c",sectionTitle:"Payment Method"}),e("div",{key:"f6de7746d5ff64d27368edef51b3c4e0ff7c658b",class:"d-flex flex-column gap-2 w-100"},e(k,{key:"34e9b26c6d20e9b5e86e4cc11fb925ff1ef5ce94",title:"ID",value:this.payment.payment_method.bank_account.id}),e(k,{key:"32cd6da4d7234aca403bd699de23e1cf889bf14f",title:"Last 4 Numbers",value:this.payment.last_four_digits}),e(k,{key:"f1313ac7c15d5ae2d9dfa2b6d3ec794d0987252b",title:"Bank Name",value:this.payment.payment_method.bank_account.brand}),e(k,{key:"76d1ac1961e530a7a6e1ba5512b982cd70df9470",title:"Account Owner",value:this.payment.payment_method.payersName}))],this.payment.metadata&&[e(v,{key:"1cff262d07acda5bc742f325a23f4199c22f3a01",sectionTitle:"Metadata"}),e("div",{key:"77379785d2559d39a26a253757fdaf02795c53a1",class:"d-table gap-2 w-100"},e(g,{key:"92cb32f3dd6b45094210194e2e40927d7f9d6bde",metadata:this.payment.metadata}))])))}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"],getPaymentDetails:["updateOnPropChange"]}}};export{B as justifi_payment_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as r}from"./p-CV0Pyo1O.js";import{J as
|
|
1
|
+
import{r as t,h as r}from"./p-CV0Pyo1O.js";import{J as a}from"./p-BnQkpNjd.js";import{c as o}from"./p-C3geClRX.js";import{w as s}from"./p-B4vLfYnZ.js";import{S as p}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-B_uQqefL.js";import"./p-CELpJl4Y.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import"./p-DgTOxu8x.js";const e=class{constructor(r){t(this,r)}async componentWillLoad(){await s(),o(),this.analytics=new a(this)}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){return this.cardFormElement.validate()}async tokenize({clientId:t,paymentMethodMetadata:r,account:a}){return this.cardFormElement.tokenize({clientId:t,paymentMethodMetadata:r,account:a})}render(){return r(p,{key:"e8591312a00d22c68812fda0b56a125ffd763e01"},r("card-form",{key:"e987ea9f3bcd2bf0aa8b2c6749bff3b902f20519",ref:t=>this.cardFormElement=t}))}};export{e as justifi_card_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i,r as s,c as t}from"./p-CV0Pyo1O.js";import{a9 as e,a8 as r,a1 as o,t as l}from"./p-Bu7gdOaV.js";import{S as d}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as
|
|
1
|
+
import{h as i,r as s,c as t}from"./p-CV0Pyo1O.js";import{a9 as e,a8 as r,a1 as o,t as l}from"./p-Bu7gdOaV.js";import{S as d}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as n}from"./p-C3geClRX.js";import{J as a}from"./p-BnQkpNjd.js";import{o as h,C as c,p as u,f as v,b as p}from"./p-8fO8CrtQ.js";import{B as m}from"./p-gAlfGUcr.js";import{B as f}from"./p-DaDqgDrb.js";import{m as g}from"./p-CMvr3y5s.js";import{S as w}from"./p-eBK-iWrz.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{g as x,a as y}from"./p-D1H6VUbM.js";import{T as b}from"./p-ChiCyW0k.js";import{k as j}from"./p-Ds_P-dB8.js";import"./p-B_uQqefL.js";import"./p-CELpJl4Y.js";import"./p-DgTOxu8x.js";const C=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(w,{width:"25%"})),i("div",{class:"col-12"},i(w,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(w,{width:"50%"}),i(w,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(w,{width:"65%"}),i(w,{width:"35%"}))),k=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(w,{width:"40%",height:"40px"})),i(C,null)),S=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(w,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(w,null),i(w,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(w,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(w,{width:"80px",height:"32px"}),i(w,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(w,null),i(w,null)))))),B=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.submitted=t(this,"submit-event",7),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new u({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?v.boardingShipping:v.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",p.MISSING_PROPS,c.ERROR)}initializeGetBusiness(){g({id:this.businessId,authToken:this.authToken,service:new m})({onSuccess:({business:i})=>{this.business=new f(i)},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t)},final:()=>{this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(i,s);if(a.error)return r({error:y(a.error),code:x(null===(n=a.error)||void 0===n?void 0:n.code),severity:c.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new h(i))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=x(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:c.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new b})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:y(d.error),code:x(null===(l=d.error)||void 0===l?void 0:l.code),severity:c.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=x(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:c.ERROR})}})({authToken:this.authToken,service:new b});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(k,null),this.loading.terminals&&i("div",{class:"mt-5"},i(S,null),i(S,null),i(S,null)))}renderBusinessDetails(){var s,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),i("div",null,j(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"1fd8c50ac4e22bb2aac46ed0379f4740737e9760"},i("div",{key:"caed839c05af25c7bcd6599c45cd5058491a1ba9",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{B as justifi_order_terminals}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as n,H as t,c as i,g as o}from"./p-CV0Pyo1O.js";import{al as r,a3 as s,q as a,v as c,w as d,x as u}from"./p-Bu7gdOaV.js";import{c as l}from"./p-DgTOxu8x.js";import{g as f}from"./p-BFTU3MAI.js";import{F as h}from"./p-CLZcevBz.js";import{p as m}from"./p-DlhPMNzz.js";const w=class{constructor(n){e(this,n)}render(){return this.text?this.hideAlert?null:n("div",{class:"alert alert-danger d-flex align-items-center",role:"alert",part:r},n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"bi bi-exclamation-triangle-fill flex-shrink-0 me-2",viewBox:"0 0 16 16",role:"img","aria-label":"Warning:"},n("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})),n("div",null,this.text)):null}},g=l({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:b,set:p}=g,y=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}focusWithoutPageScroll(e){if(e)try{e.focus({preventScroll:!0})}catch(n){const{scrollX:t,scrollY:i}=window;e.focus(),window.scrollTo(t,i)}}async componentDidLoad(){const e=await this.getBaseFontStyles();p("fontStyles",e);const n=await this.getFocusedStyles();p("focused",n);const t=await this.getFocusedAndInvalidStyles();p("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),setTimeout((()=>{this.hiddenInput.blur();const n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?s:this.errorText?a:this.isFocused?c:d}render(){return n(t,{key:"c3b2f0cb5160d888b3ecbaca95285749c0b71002"},n("input",{key:"f6d0ad00733d086dfa09b646f7599d60f91e5f50",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var v,x,k={exports:{}},z=f((v||(v=1,x=k,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,s="[iFrameSizer]",a=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},l=null,f=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){v("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){L(t,e)})).end()}):y("","Unable to bind to jQuery, it is not fully loaded.")),x.exports=H(),window.iFrameResize=window.iFrameResize||H()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){k("log",e,n,b(e))}function y(e,n){k("info",e,n,b(e))}function v(e,n){k("warn",e,n,!0)}function k(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function z(e){function n(){t("Height"),t("Width"),C((function(){R(W),T(A),f("onResized",W)}),W,"init")}function t(e){var n=Number(u[A]["max"+e]),t=Number(u[A]["min"+e]),i=e.toLowerCase(),o=Number(W[i]);p(A,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(A,"Set "+i+" to min value")),o>n&&(o=n,p(A,"Set "+i+" to max value")),W[i]=""+o}function i(e){return L.slice(L.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;N("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=W.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(A),{x:Math.floor(Number(n.left)+Number(a.x)),y:Math.floor(Number(n.top)+Number(a.y))}}function c(e){var n=e?r(W.iframe):{x:0,y:0},t={x:Number(W.width)+n.x,y:Number(W.height)+n.y};p(A,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(A,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):v(A,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===f("onScroll",a)?O():T(A)}function l(e){var n={};if(0===Number(W.width)&&0===Number(W.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:W.width,y:W.height};f(e,{iframe:W.iframe,screenX:Number(n.x),screenY:Number(n.y),type:W.type})}function f(e,n){return S(A,e,n)}var m,b,x,k,z,I,L=e.data,W={},A=null;"[iFrameResizerChild]Ready"===L?function(){for(var e in u)N("iFrame requested init",E(e),u[e].iframe,e)}():s===(""+L).slice(0,13)&&L.slice(13).split(":")[0]in u?(k=(x=L.slice(13).split(":"))[1]?parseInt(x[1],10):0,z=u[x[0]]&&u[x[0]].iframe,I=getComputedStyle(z),W={iframe:z,id:x[0],height:k+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(I)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(I),width:x[2],type:x[3]},u[A=W.id]&&(u[A].loaded=!0),(b=W.type in{true:1,false:1,undefined:1})&&p(A,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,v(W.type+" No settings for "+e+". Message was: "+L)),n}(A)&&(p(A,"Received: "+L),m=!0,null===W.iframe&&(v(A,"IFrame ("+W.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[A]&&u[A].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(A,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(A,"Checking connection is from: "+(n=u[A]&&u[A].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+W.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[A]&&u[A].firstRun&&u[A]&&(u[A].firstRun=!1),W.type){case"close":F(W.iframe);break;case"message":m=i(6),p(A,"onMessage passed: {iframe: "+W.iframe.id+", message: "+m+"}"),f("onMessage",{iframe:W.iframe,message:JSON.parse(m)}),p(A,"--");break;case"mouseenter":l("onMouseEnter");break;case"mouseleave":l("onMouseLeave");break;case"autoResize":u[A].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[A]&&u[A].iframe,A),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=A;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[A]&&u[A].stopPageInfo&&(u[A].stopPageInfo(),delete u[A].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(A,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(A,"--")):window.top===window.self?p(A,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(A,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":j(W);break;case"init":n(),f("onInit",W.iframe);break;default:0===Number(W.width)&&0===Number(W.height)?v("Unsupported message received ("+W.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,s,h,m}())):y(A,"Ignored: "+L)}function S(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function I(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==S(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){v(e)}S(t,"onClosed",t),p(t,"--"),I(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===a&&p(n,"Get page position: "+(a={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+a.y)}function T(e){null!==a&&(window.scrollTo(a.x,a.y),p(e,"Set page position: "+a.x+","+a.y),O())}function O(){a=null}function j(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),C((function(){R(e),N("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&N("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),W(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function N(e,n,t,i,o){var r,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,r)):v(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,v(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function E(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function L(t,r){function s(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],v(l,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,l=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||f.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);l in u&&"iFrameResizer"in t?v(l,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[l]=Object.create(null),u[l].iframe=t,u[l].firstRun=!0,u[l].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(s,e),function(e){for(var n in f)Object.prototype.hasOwnProperty.call(f,n)&&(u[l][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:f[n])}(e),u[l]&&(u[l].targetOrigin=!0===u[l].checkOrigin?""===(n=u[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(l,"IFrame scrolling "+(u[l]&&u[l].scrolling?"enabled":"disabled")+" for "+l),t.style.overflow=!1===(u[l]&&u[l].scrolling)?"hidden":"auto",u[l]&&u[l].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[l]?u[l].scrolling:"no"}}(),function(){function e(e){var n=u[l][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(l,"Set "+e+" = "+t.style[e]))}function n(e){if(u[l]["min"+e]>u[l]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[l]&&u[l].bodyMargin)&&"0"!==(u[l]&&u[l].bodyMargin)||(u[l].bodyMarginV1=u[l].bodyMargin,u[l].bodyMargin=u[l].bodyMargin+"px"),a=E(l),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){N("iFrame.onload",a,t,e,!0),(!u[l]||!u[l].firstRun)&&u[l]&&u[l].heightCalculationMethod in d&&j({iframe:t,height:0,width:0,type:"init"})})),N("init",a,t,e,!0),u[l]&&(u[l].iframe.iFrameResizer={close:F.bind(null,u[l].iframe),removeListeners:I.bind(null,u[l].iframe),resize:N.bind(null,"Window resize","resize",u[l].iframe),moveToAnchor:function(e){N("Move to anchor","moveToAnchor:"+e,u[l].iframe,l)},sendMessage:function(e){N("Send Message","message:"+(e=JSON.stringify(e)),u[l].iframe,l)}}))}function W(e,n){null===l&&(l=setTimeout((function(){l=null,e()}),n))}function A(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),W((function(){P("Tab Visible","resize")}),16))}function P(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&N(e,n,u[t].iframe,t)}))}function H(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),L(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",z),w(window,"resize",(function(){p("window","Trigger event: resize"),W((function(){P("Window resize","resize")}),16)})),w(document,"visibilitychange",A),w(document,"-webkit-visibilitychange",A),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&v("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),k.exports));class S{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded",7),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:m.version})}async reload(){this.iframeElement.src=this.iframeSrc}initializeFrameCommunicationService(){var e;this.frameService=new S(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?s:this.isValid?this.isFocused?c:d:a}get style(){return this.isFocused?this.isValid?b.focused:b.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(b.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}get iframeSrc(){return`${this.iframeOrigin}?${this.urlParams}`}render(){return n(t,{key:"ec85f26f88845957744034690b1ab0342009485c",class:"form-group d-flex flex-column"},n("div",{key:"e4b29dedfa037218b984bbcd00d3aed3bf6987bd",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"9e9539cc47e48b835dac8a0510899e6a2a25b46b",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"45b0ef6167e59c542b7e72e9dbdb76c9d29bcfb1",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"f52a24114c2e6de9cb110b20db28782125f3db9f",id:this.inputId,name:this.inputId,src:this.iframeSrc,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{z({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(h,{key:"6cec57e9a2d5ef4901302087e270255248cde0f1",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{w as form_alert,y as hidden_input,I as iframe_input}
|
|
1
|
+
import{r as e,h as n,H as t,c as i,g as o}from"./p-CV0Pyo1O.js";import{al as r,a3 as s,q as a,v as c,w as d,x as u}from"./p-Bu7gdOaV.js";import{c as l}from"./p-DgTOxu8x.js";import{g as f}from"./p-BFTU3MAI.js";import{F as h}from"./p-CLZcevBz.js";import{p as m}from"./p-B_uQqefL.js";const w=class{constructor(n){e(this,n)}render(){return this.text?this.hideAlert?null:n("div",{class:"alert alert-danger d-flex align-items-center",role:"alert",part:r},n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"bi bi-exclamation-triangle-fill flex-shrink-0 me-2",viewBox:"0 0 16 16",role:"img","aria-label":"Warning:"},n("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})),n("div",null,this.text)):null}},g=l({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:b,set:p}=g,y=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}focusWithoutPageScroll(e){if(e)try{e.focus({preventScroll:!0})}catch(n){const{scrollX:t,scrollY:i}=window;e.focus(),window.scrollTo(t,i)}}async componentDidLoad(){const e=await this.getBaseFontStyles();p("fontStyles",e);const n=await this.getFocusedStyles();p("focused",n);const t=await this.getFocusedAndInvalidStyles();p("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),setTimeout((()=>{this.hiddenInput.blur();const n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?s:this.errorText?a:this.isFocused?c:d}render(){return n(t,{key:"c3b2f0cb5160d888b3ecbaca95285749c0b71002"},n("input",{key:"f6d0ad00733d086dfa09b646f7599d60f91e5f50",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var v,x,k={exports:{}},z=f((v||(v=1,x=k,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,s="[iFrameSizer]",a=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},l=null,f=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){v("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){N(t,e)})).end()}):y("","Unable to bind to jQuery, it is not fully loaded.")),x.exports=H(),window.iFrameResize=window.iFrameResize||H()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){k("log",e,n,b(e))}function y(e,n){k("info",e,n,b(e))}function v(e,n){k("warn",e,n,!0)}function k(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function z(e){function n(){t("Height"),t("Width"),C((function(){R(W),T(A),f("onResized",W)}),W,"init")}function t(e){var n=Number(u[A]["max"+e]),t=Number(u[A]["min"+e]),i=e.toLowerCase(),o=Number(W[i]);p(A,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(A,"Set "+i+" to min value")),o>n&&(o=n,p(A,"Set "+i+" to max value")),W[i]=""+o}function i(e){return N.slice(N.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;E("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=W.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(A),{x:Math.floor(Number(n.left)+Number(a.x)),y:Math.floor(Number(n.top)+Number(a.y))}}function c(e){var n=e?r(W.iframe):{x:0,y:0},t={x:Number(W.width)+n.x,y:Number(W.height)+n.y};p(A,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(A,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):v(A,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===f("onScroll",a)?O():T(A)}function l(e){var n={};if(0===Number(W.width)&&0===Number(W.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:W.width,y:W.height};f(e,{iframe:W.iframe,screenX:Number(n.x),screenY:Number(n.y),type:W.type})}function f(e,n){return S(A,e,n)}var m,b,x,k,z,I,N=e.data,W={},A=null;"[iFrameResizerChild]Ready"===N?function(){for(var e in u)E("iFrame requested init",L(e),u[e].iframe,e)}():s===(""+N).slice(0,13)&&N.slice(13).split(":")[0]in u?(k=(x=N.slice(13).split(":"))[1]?parseInt(x[1],10):0,z=u[x[0]]&&u[x[0]].iframe,I=getComputedStyle(z),W={iframe:z,id:x[0],height:k+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(I)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(I),width:x[2],type:x[3]},u[A=W.id]&&(u[A].loaded=!0),(b=W.type in{true:1,false:1,undefined:1})&&p(A,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,v(W.type+" No settings for "+e+". Message was: "+N)),n}(A)&&(p(A,"Received: "+N),m=!0,null===W.iframe&&(v(A,"IFrame ("+W.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[A]&&u[A].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(A,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(A,"Checking connection is from: "+(n=u[A]&&u[A].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+W.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[A]&&u[A].firstRun&&u[A]&&(u[A].firstRun=!1),W.type){case"close":F(W.iframe);break;case"message":m=i(6),p(A,"onMessage passed: {iframe: "+W.iframe.id+", message: "+m+"}"),f("onMessage",{iframe:W.iframe,message:JSON.parse(m)}),p(A,"--");break;case"mouseenter":l("onMouseEnter");break;case"mouseleave":l("onMouseLeave");break;case"autoResize":u[A].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[A]&&u[A].iframe,A),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=A;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[A]&&u[A].stopPageInfo&&(u[A].stopPageInfo(),delete u[A].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(A,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(A,"--")):window.top===window.self?p(A,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(A,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":j(W);break;case"init":n(),f("onInit",W.iframe);break;default:0===Number(W.width)&&0===Number(W.height)?v("Unsupported message received ("+W.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,s,h,m}())):y(A,"Ignored: "+N)}function S(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function I(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==S(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){v(e)}S(t,"onClosed",t),p(t,"--"),I(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===a&&p(n,"Get page position: "+(a={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+a.y)}function T(e){null!==a&&(window.scrollTo(a.x,a.y),p(e,"Set page position: "+a.x+","+a.y),O())}function O(){a=null}function j(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),C((function(){R(e),E("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&E("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),W(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function E(e,n,t,i,o){var r,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,r)):v(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,v(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function L(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function N(t,r){function s(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],v(l,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,l=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||f.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);l in u&&"iFrameResizer"in t?v(l,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[l]=Object.create(null),u[l].iframe=t,u[l].firstRun=!0,u[l].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(s,e),function(e){for(var n in f)Object.prototype.hasOwnProperty.call(f,n)&&(u[l][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:f[n])}(e),u[l]&&(u[l].targetOrigin=!0===u[l].checkOrigin?""===(n=u[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(l,"IFrame scrolling "+(u[l]&&u[l].scrolling?"enabled":"disabled")+" for "+l),t.style.overflow=!1===(u[l]&&u[l].scrolling)?"hidden":"auto",u[l]&&u[l].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[l]?u[l].scrolling:"no"}}(),function(){function e(e){var n=u[l][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(l,"Set "+e+" = "+t.style[e]))}function n(e){if(u[l]["min"+e]>u[l]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[l]&&u[l].bodyMargin)&&"0"!==(u[l]&&u[l].bodyMargin)||(u[l].bodyMarginV1=u[l].bodyMargin,u[l].bodyMargin=u[l].bodyMargin+"px"),a=L(l),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){E("iFrame.onload",a,t,e,!0),(!u[l]||!u[l].firstRun)&&u[l]&&u[l].heightCalculationMethod in d&&j({iframe:t,height:0,width:0,type:"init"})})),E("init",a,t,e,!0),u[l]&&(u[l].iframe.iFrameResizer={close:F.bind(null,u[l].iframe),removeListeners:I.bind(null,u[l].iframe),resize:E.bind(null,"Window resize","resize",u[l].iframe),moveToAnchor:function(e){E("Move to anchor","moveToAnchor:"+e,u[l].iframe,l)},sendMessage:function(e){E("Send Message","message:"+(e=JSON.stringify(e)),u[l].iframe,l)}}))}function W(e,n){null===l&&(l=setTimeout((function(){l=null,e()}),n))}function A(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),W((function(){P("Tab Visible","resize")}),16))}function P(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&E(e,n,u[t].iframe,t)}))}function H(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),N(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",z),w(window,"resize",(function(){p("window","Trigger event: resize"),W((function(){P("Window resize","resize")}),16)})),w(document,"visibilitychange",A),w(document,"-webkit-visibilitychange",A),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&v("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),k.exports));class S{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded",7),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:m.version})}async reload(){this.iframeElement.src=this.iframeSrc}initializeFrameCommunicationService(){var e;this.frameService=new S(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?s:this.isValid?this.isFocused?c:d:a}get style(){return this.isFocused?this.isValid?b.focused:b.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(b.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}get iframeSrc(){return`${this.iframeOrigin}?${this.urlParams}`}render(){return n(t,{key:"ec85f26f88845957744034690b1ab0342009485c",class:"form-group d-flex flex-column"},n("div",{key:"e4b29dedfa037218b984bbcd00d3aed3bf6987bd",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"9e9539cc47e48b835dac8a0510899e6a2a25b46b",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"45b0ef6167e59c542b7e72e9dbdb76c9d29bcfb1",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"f52a24114c2e6de9cb110b20db28782125f3db9f",id:this.inputId,name:this.inputId,src:this.iframeSrc,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{z({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(h,{key:"6cec57e9a2d5ef4901302087e270255248cde0f1",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{w as form_alert,y as hidden_input,I as iframe_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{J as e}from"./p-
|
|
1
|
+
import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{J as e}from"./p-BnQkpNjd.js";import{C as r,b as o}from"./p-8fO8CrtQ.js";import{m as n,b as a}from"./p-DD9-ceDZ.js";import{B as h}from"./p-gAlfGUcr.js";import{A as p}from"./p-CELpJl4Y.js";import"./p-CLHwhyvu.js";import{C as l,B as m,e as d}from"./p-DaDqgDrb.js";import{c as u}from"./p-C3geClRX.js";import{l as c}from"./p-Ds_P-dB8.js";import{t as g}from"./p-Bu7gdOaV.js";import{S as v}from"./p-05AWudQe.js";import{H as f}from"./p-CZk3i5Tu.js";import"./p-CZfYo5-1.js";import{B as y}from"./p-XYgDHrVL.js";import{P as b}from"./p-B-Ik8b-s.js";import"./p-B_uQqefL.js";import"./p-D1H6VUbM.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";import"./p-eBK-iWrz.js";const j=p();class w{async postProvisioning(s,t,i){return j.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(f,{text:"Business Already Provisioned"})),s("div",{class:"col-12",part:g},s("p",null,"We have already received the onboarding information for this business."))),k=()=>s("div",{class:"row gap-3 p5"},s("div",{class:"col-12"},s(f,{text:"You're all set for now"})),s("div",{class:"col-12",part:g},s("p",null,"We're reviewing your information and working on your approval. We'll be in touch to let you know once you've been approved (or if we find anything that needs fixing). Have a good one!"))),B=()=>s("div",{class:"row gap-3 p-5"},s("div",{class:"col-12"},s(f,{text:"Something went wrong"})),s("div",{class:"col-12",part:g},s("p",null,"There was an error submitting the provisioning. Your progress has been saved — please try again later or contact the support team."))),x=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.submissionFailed=!1,this.currentStep=0,this.country=l.USA,this.allowOptionalFields=!1,this.formTitle="Business Information",this.refs=[],this.setBusinessProvisioned=()=>new Promise((s=>{this.getBusiness({onSuccess:t=>{const i=new m(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.submissionFailed=!0,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 h}),this.postProvisioning=a({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(v,null,this.businessLoading?s(b,null):this.businessProvisioned?s(C,null):this.formSubmitted?s(k,null):this.submissionFailed?s(B,null):s("div",{class:"row gap-3"},s(f,{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:g},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{x as justifi_payment_provisioning}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{j as s,C as i,b as r}from"./p-8fO8CrtQ.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{J as o}from"./p-BnQkpNjd.js";import{c}from"./p-C3geClRX.js";import{g as p,a as h}from"./p-D1H6VUbM.js";import{P as d}from"./p-C1PEDhkE.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 k,j as T,k as w,l as C}from"./p-DZr0wLGh.js";import{S as v}from"./p-05AWudQe.js";import{T as D}from"./p-CZfYo5-1.js";import{a as P}from"./p-Ds_P-dB8.js";import{a6 as R,a7 as F}from"./p-Bu7gdOaV.js";import"./p-DgTOxu8x.js";import"./p-B_uQqefL.js";import"./p-CELpJl4Y.js";import"./p-MPer3Rw7.js";const S={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"},E={created_at:(t,a)=>e("td",{part:F(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:F(a)},x[t.payment_balance_txn_type]),id:(t,a)=>e("td",{part:F(a)},t.id),amount:(t,a)=>e("td",{part:F(a),class:"text-end"},t.formattedPaymentAmount(t.amount)),balance:(t,a)=>e("td",{part:F(a),class:"text-end"},t.formattedPaymentAmount(t.balance)),currency:(t,a)=>e("td",{part:F(a)},t.currency),financial_transaction_id:(t,a)=>e("td",{part:F(a)},t.financial_transaction_id),payment_id:(t,a)=>e("td",{part:F(a)},t.payment_id),payment_balance_txn_type:(t,a)=>e("td",{part:F(a)},t.payment_balance_txn_type),source_id:(t,a)=>e("td",{part:F(a)},t.source_id),source_type:(t,a)=>e("td",{part:F(a)},t.source_type)},I=class{constructor(e){t(this,e),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=e=>{this.pagingParams={before_cursor:e},this.clickEvent.emit({name:D.previous})},this.handleClickNext=e=>{this.pagingParams={after_cursor:e},this.clickEvent.emit({name:D.next})},this.rowClickHandler=e=>{const t=e.target.closest("tr").dataset.rowEntityId;if(!t)return;const a=this.balanceTransactions.find((e=>e.id===t));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,S,E),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(v,{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(k,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},t)))),this.paging&&e(T,{key:"16ca0811bf42dc9419f8b77086e8e7e2cf6d0085"},e(w,{key:"e11be42549832c35078acf47b7c165fe1e50ea98"},e(C,{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{I as justifi_payment_transactions_list}
|
|
@@ -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-8fO8CrtQ.js";import{J as n}from"./p-
|
|
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-8fO8CrtQ.js";import{J as n}from"./p-BnQkpNjd.js";import{c as o}from"./p-C3geClRX.js";import{T as c}from"./p-ChiCyW0k.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as d,a as p}from"./p-D1H6VUbM.js";import{m,S as u}from"./p-BjNqkh37.js";import{S as l}from"./p-05AWudQe.js";import{T as f,a as b,b as v,c as g,d as k,e as j,f as y,g as C,h as T,i as _,j as w,k as D,l as S}from"./p-DZr0wLGh.js";import{T as O}from"./p-CZfYo5-1.js";import{B as P,a as A}from"./p-Dz8KJn2G.js";import{a6 as I,a7 as x}from"./p-Bu7gdOaV.js";import{j as B}from"./p-Ds_P-dB8.js";import{o as E,g as L}from"./p-BzjgvHHT.js";import"./p-B_uQqefL.js";import"./p-CELpJl4Y.js";import"./p-DgTOxu8x.js";import"./p-MPer3Rw7.js";const N={nickname:()=>t("th",{part:I,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:I,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:I,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:I,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:I,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:I,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:I,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:I,scope:"col",title:"The current status of each terminal"},"Status")},z={nickname:(e,i)=>t("td",{part:x(i)},e.nickname),model_name:(e,i)=>t("td",{part:x(i)},e.model_name),id:(e,i)=>t("td",{part:x(i)},e.id),provider:(e,i)=>t("td",{part:x(i)},B(e.provider)),provider_serial_number:(e,i)=>t("td",{part:x(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:x(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:x(i)},e.sub_account_name),status:(e,i)=>t("td",{part:x(i)},t(A,Object.assign({},{connected:{variant:P.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:P.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:P.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:P.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:P.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},G=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:O.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:O.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:O.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new f(this.terminals,this.columns,N,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=L();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(k,{key:"e0391a60a807cbdba97ef11f04275eb3072dc40c"},this.terminalsTable.columnData.map((t=>t)))),t(j,{key:"56686e423499aff459fa3d6d93fae0fd7621b10b"},t(y,{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(_,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(w,{key:"c68e2cb14c8fa6a56243803e440cc13388ffaaf4"},t(D,{key:"bcc17671c48f5a397dff15333a49305a443aef21"},t(S,{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{G as justifi_terminals_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as t}from"./p-
|
|
1
|
+
import{A as t}from"./p-CELpJl4Y.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const n=t();class e{async fetchBusiness(t,e){return n.get({endpoint:`entities/business/${t}`,authToken:e})}async patchBusiness(t,e,s){return n.patch({endpoint:`entities/business/${e}`,body:s,authToken:t})}}class s{async fetchIdentity(t,e){return n.get({endpoint:`entities/identity/${t}`,authToken:e})}async patchIdentity(t,e,s){return n.patch({endpoint:`entities/identity/${e}`,body:s,authToken:t})}async postIdentity(t,e){return n.post({endpoint:"entities/identity",body:e,authToken:t})}}class i{async postBankAccount(t,e){return n.post({endpoint:"entities/bank_accounts",body:e,authToken:t})}}class o{async postDocumentRecord(t,e){return n.post({endpoint:"entities/document",body:e,authToken:t})}}export{e as B,o as D,s as I,i as a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as n}from"./p-
|
|
1
|
+
import{A as n}from"./p-CELpJl4Y.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const t=n();class i{async getLinkToken(n,i,a,e){return t.post({endpoint:`plaid/${i}/link`,body:{checkout_id:a},authToken:n,signal:e})}async getLinkTokenForVerification(n,i,a){return t.post({endpoint:`entities/plaid/${i}/link_token`,body:{},authToken:n,signal:a})}async getBankAccountData(n,i,a){return t.get({endpoint:`entities/plaid/${i}/bank_account`,authToken:n,signal:a})}async postPlaidVerifiedBankAccountData(n,i,a,e){return t.post({endpoint:`entities/plaid/${i}/bank_account`,body:a,authToken:n,signal:e})}async tokenizeBankAccount(n,i,a,e,o,s){const c=`plaid/${i}/tokenize`,p={public_token:a};return e&&(p.link_token_id=e),o&&(p.payment_method_group_id=o),t.post({endpoint:c,body:p,authToken:n,signal:s})}}export{i as P}
|