@justifi/webcomponents 6.12.4 → 6.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Analytics-BERGweGK.js → Analytics-CITnMj7H.js} +3 -3
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +1 -1
- package/dist/cjs/additional-questions-form-step_14.cjs.entry.js +4 -3
- package/dist/cjs/additional-questions_5.cjs.entry.js +1 -1
- package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +5 -5
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/{business-identity-schema-DI9XFbaD.js → business-identity-schema-DuFGX6_i.js} +2 -2
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-ByKpJklZ.js → check-pkg-version-CZMgXZID.js} +1 -1
- package/dist/cjs/{country-config-D7fss2oF.js → country-config-aJp8ScEs.js} +1 -0
- package/dist/cjs/dispute-notification_2.cjs.entry.js +3 -3
- package/dist/cjs/form-address-fields_3.cjs.entry.js +1 -1
- package/dist/cjs/form-control-number_2.cjs.entry.js +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +3 -3
- package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +3 -3
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +6 -6
- package/dist/cjs/justifi-card-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +3 -3
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +3 -3
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
- package/dist/cjs/{package-B6L3zyfG.js → package-DOiqjXmm.js} +1 -1
- package/dist/cjs/{schema-validations-_yWWnnaG.js → schema-validations-DNPcvDh5.js} +13 -2
- package/dist/collection/api/Analytics.js +2 -2
- package/dist/collection/components/business-details/owner-details/owner-details.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +1 -0
- package/dist/collection/components/business-forms/schemas/schema-validations.js +2 -2
- package/dist/collection/components/checkout/billing-form/billing-form-full.js +2 -2
- package/dist/collection/components/checkout/billing-form/billing-form-schema.js +1 -1
- package/dist/collection/utils/checkout-billing-state-options.js +12 -0
- package/dist/docs.json +1 -1
- package/dist/esm/{Analytics-B1bQP71R.js → Analytics-Cg17Xhj_.js} +3 -3
- package/dist/esm/additional-questions-details_5.entry.js +1 -1
- package/dist/esm/additional-questions-form-step_14.entry.js +5 -4
- package/dist/esm/additional-questions_5.entry.js +1 -1
- package/dist/esm/additional-statement_8.entry.js +1 -1
- package/dist/esm/bank-account-billing-form-simple_4.entry.js +6 -6
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/{business-identity-schema-D-Nk9aGV.js → business-identity-schema-0Q3kck3C.js} +3 -3
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-CNwUC4SV.js → check-pkg-version-D-rHqtUI.js} +1 -1
- package/dist/esm/{country-config-B_fuF6JU.js → country-config-CdvhLcnT.js} +1 -1
- package/dist/esm/dispute-notification_2.entry.js +3 -3
- package/dist/esm/form-address-fields_3.entry.js +1 -1
- package/dist/esm/form-control-number_2.entry.js +1 -1
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/{index.esm-CgNcFueq.js → index.esm-BHdVU4hV.js} +1 -1
- package/dist/esm/justifi-apple-pay_11.entry.js +3 -3
- package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +3 -3
- package/dist/esm/justifi-bank-account-form.entry.js +3 -3
- package/dist/esm/justifi-business-details.entry.js +3 -3
- package/dist/esm/justifi-business-form.entry.js +7 -7
- package/dist/esm/justifi-card-form.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +3 -3
- package/dist/esm/justifi-checkouts-list.entry.js +3 -3
- package/dist/esm/justifi-dispute-management.entry.js +3 -3
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
- package/dist/esm/justifi-order-terminals.entry.js +3 -3
- package/dist/esm/justifi-payment-details.entry.js +3 -3
- package/dist/esm/justifi-payment-provisioning.entry.js +3 -3
- package/dist/esm/justifi-payment-transactions-list.entry.js +3 -3
- package/dist/esm/justifi-payments-list.entry.js +3 -3
- package/dist/esm/justifi-payout-details.entry.js +3 -3
- package/dist/esm/justifi-payout-transactions-list.entry.js +3 -3
- package/dist/esm/justifi-payouts-list.entry.js +3 -3
- package/dist/esm/justifi-refund-payment.entry.js +4 -4
- package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list.entry.js +3 -3
- package/dist/esm/justifi-terminals-list.entry.js +3 -3
- package/dist/esm/{package-OGt0dCJl.js → package-B6YPrwyC.js} +1 -1
- package/dist/esm/{schema-validations-u9_XnlUL.js → schema-validations-A1o1biOB.js} +14 -4
- package/dist/module/Analytics.js +2 -2
- package/dist/module/billing-form-full2.js +2 -2
- package/dist/module/billing-form-schema.js +1 -1
- package/dist/module/business-address-schema.js +1 -1
- package/dist/module/business-bank-account-form-step2.js +1 -1
- package/dist/module/business-core-info-schema.js +1 -1
- package/dist/module/business-identity-schema.js +1 -1
- package/dist/module/business-owners-form-step2.js +1 -0
- package/dist/module/country-config.js +1 -1
- package/dist/module/owner-details2.js +1 -1
- package/dist/module/package.js +1 -1
- package/dist/module/schema-validations.js +13 -3
- package/dist/types/utils/checkout-billing-state-options.d.ts +9 -0
- package/dist/webcomponents/{p-8aa53ef2.entry.js → p-0ce6c1b1.entry.js} +1 -1
- package/dist/webcomponents/{p-215c6b6b.entry.js → p-137a36a4.entry.js} +1 -1
- package/dist/webcomponents/{p-07236291.entry.js → p-1d294e34.entry.js} +1 -1
- package/dist/webcomponents/{p-383b8317.entry.js → p-1f34b2f7.entry.js} +1 -1
- package/dist/webcomponents/{p-35dd1fc0.entry.js → p-1f7f2436.entry.js} +1 -1
- package/dist/webcomponents/{p-b341efd6.entry.js → p-2aac2ab6.entry.js} +1 -1
- package/dist/webcomponents/{p-a1dcdc8b.entry.js → p-397b28ba.entry.js} +4 -4
- package/dist/webcomponents/{p-a80f69a9.entry.js → p-3cefb032.entry.js} +1 -1
- package/dist/webcomponents/{p-45c0fb53.entry.js → p-45668f01.entry.js} +1 -1
- package/dist/webcomponents/{p-3d6b9434.entry.js → p-5ec9634c.entry.js} +1 -1
- package/dist/webcomponents/{p-ae91fc9b.entry.js → p-60c65da4.entry.js} +1 -1
- package/dist/webcomponents/{p-b272a29d.entry.js → p-63e88b48.entry.js} +1 -1
- package/dist/webcomponents/{p-91aef5bf.entry.js → p-65281b33.entry.js} +1 -1
- package/dist/webcomponents/{p-f3ff7e00.entry.js → p-7ff9ce05.entry.js} +1 -1
- package/dist/webcomponents/{p-c8f3656f.entry.js → p-89844a98.entry.js} +1 -1
- package/dist/webcomponents/{p-69fdd137.entry.js → p-8d6856e7.entry.js} +1 -1
- package/dist/webcomponents/{p-7119fddd.entry.js → p-8e821593.entry.js} +1 -1
- package/dist/webcomponents/{p-9d021e10.entry.js → p-90f2f71d.entry.js} +1 -1
- package/dist/webcomponents/p-91940d05.entry.js +1 -0
- package/dist/webcomponents/{p-8d173a7c.entry.js → p-95317547.entry.js} +1 -1
- package/dist/webcomponents/p-B6YPrwyC.js +1 -0
- package/dist/webcomponents/{p-DwoT0UoX.js → p-CKiAlBsU.js} +1 -1
- package/dist/webcomponents/p-D8ytux5N.js +1 -0
- package/dist/webcomponents/p-DO9lqnbB.js +1 -0
- package/dist/webcomponents/{p-mF5zKtkx.js → p-DjjAx7PF.js} +1 -1
- package/dist/webcomponents/p-DrMJliVY.js +1 -0
- package/dist/webcomponents/p-XIWgia4J.js +1 -0
- package/dist/webcomponents/{p-ea0d7a98.entry.js → p-afe714cb.entry.js} +1 -1
- package/dist/webcomponents/p-b192f251.entry.js +1 -0
- package/dist/webcomponents/{p-daaa2a99.entry.js → p-b436a7d2.entry.js} +1 -1
- package/dist/webcomponents/{p-c9fe4f33.entry.js → p-bde7fe69.entry.js} +1 -1
- package/dist/webcomponents/{p-6220a384.entry.js → p-c108cd71.entry.js} +1 -1
- package/dist/webcomponents/{p-d24240a5.entry.js → p-c4415366.entry.js} +1 -1
- package/dist/webcomponents/{p-f30069ea.entry.js → p-c8bc235f.entry.js} +1 -1
- package/dist/webcomponents/{p-4ec433f4.entry.js → p-d1eabad2.entry.js} +1 -1
- package/dist/webcomponents/{p-49a4123c.entry.js → p-d5e7291a.entry.js} +1 -1
- package/dist/webcomponents/p-e17b92ec.entry.js +1 -0
- package/dist/webcomponents/{p-cde76bf8.entry.js → p-e322dcba.entry.js} +1 -1
- package/dist/webcomponents/p-e6ec9e6d.entry.js +1 -0
- package/dist/webcomponents/{p-9fc7714d.entry.js → p-ff8cf16c.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -2
- package/readme.md +7 -14
- package/dist/webcomponents/p-31452258.entry.js +0 -1
- package/dist/webcomponents/p-3f5e9afb.entry.js +0 -1
- package/dist/webcomponents/p-6RTf1SXX.js +0 -1
- package/dist/webcomponents/p-Cz_7BuGW.js +0 -1
- package/dist/webcomponents/p-DyucNSA4.js +0 -1
- package/dist/webcomponents/p-KXLYEe1D.js +0 -1
- package/dist/webcomponents/p-OGt0dCJl.js +0 -1
- package/dist/webcomponents/p-e4cb7c21.entry.js +0 -1
- package/dist/webcomponents/p-ef85717f.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as s,c as a}from"./p-CV0Pyo1O.js";import{C as i}from"./p-BcNb9bVO.js";import{n as d}from"./p-BnjCmwMr.js";import{b as o,
|
|
1
|
+
import{r as e,h as t,H as s,c as a}from"./p-CV0Pyo1O.js";import{C as i}from"./p-BcNb9bVO.js";import{n as d}from"./p-BnjCmwMr.js";import{b as o,c as l}from"./p-D8ytux5N.js";import{I as r}from"./p-Ce_F4E0f.js";import{q as c,u as h,v as n,w as f,x as b}from"./p-CPKMvyV_.js";import{F as u}from"./p-Ce_W43gc.js";import"./p-CZfYo5-1.js";const m=class{constructor(t){e(this,t),this.country=i.USA}render(){var e,a,r,c,h,n,f,b,u,m;const v=l[this.country],p=o[this.country];return t(s,{key:"9b18ac26cce34bd3008146f106a260d9cb99de12"},t("div",{key:"c234c03bc4a3dbe74a0946af78aaed5992c3406c",class:"row gy-3"},t("div",{key:"0ce04acdf48726866bd6beecc25d0008b754984f",class:"col-12"},t("form-control-text",{key:"4d4b5098ebc39e52d0f17c677c4e92980793f46b",name:"line1",label:"Street Address",inputHandler:this.inputHandler,defaultValue:null===(e=this.defaultValues)||void 0===e?void 0:e.line1,errorText:null===(a=this.errors)||void 0===a?void 0:a.line1,helpText:"No PO Boxes."})),t("div",{key:"4133b38343c52135f2457bd7a9ad91b094422fb5",class:"col-12"},t("form-control-text",{key:"7e60be69dad198d488030ece4296326bb6368f2c",name:"line2",label:"Address Line 2 (optional)",inputHandler:this.inputHandler,defaultValue:null===(r=this.defaultValues)||void 0===r?void 0:r.line2,errorText:null===(c=this.errors)||void 0===c?void 0:c.line2})),t("div",{key:"a34a4e57cbd168bbbe065329bcfb393473b0def1",class:"col-12"},t("form-control-text",{key:"46e3005ef99ec988726ffcc37ec73756f002880d",name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null===(h=this.defaultValues)||void 0===h?void 0:h.city,errorText:null===(n=this.errors)||void 0===n?void 0:n.city})),t("div",{key:"2bf3389786351f2338cde13cbf87d28260444174",class:"col-12 col-md-6"},t("form-control-select",{key:"18a2a403d20af45965877601fa8d44a5aea48894",name:"state",label:v.stateLabel,options:p.stateOptions,inputHandler:this.inputHandler,defaultValue:null===(f=this.defaultValues)||void 0===f?void 0:f.state,errorText:null===(b=this.errors)||void 0===b?void 0:b.state})),t("div",{key:"1548ad58c0bd3b96067055601a006fc137ca31a3",class:"col-12 col-md-6"},t("form-control-text",{key:"8e8193efa81f1f5d8c626f76d75d15aba60ac921",name:"postal_code",label:v.postalLabel,inputHandler:this.inputHandler,defaultValue:null===(u=this.defaultValues)||void 0===u?void 0:u.postal_code,errorText:null===(m=this.errors)||void 0===m?void 0:m.postal_code,maxLength:this.country===i.USA?5:7,keyDownHandler:this.country===i.USA?d:void 0}))))}},v=class{constructor(t){e(this,t),this.formControlInput=a(this,"formControlInput",7),this.formControlBlur=a(this,"formControlBlur",7),this.imask=null,this.isFocused=!1,this.inputHandler=()=>{},this.disabled=!1,this.initializeIMask=()=>{this.textInput&&(this.imask=r(this.textInput,{mask:this.mask}),this.imask.on("accept",(()=>{var e;const t=null===(e=this.imask)||void 0===e?void 0:e.unmaskedValue;void 0!==t&&this.inputHandler(this.name,t)})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=e=>{var t;const s=e.target,a=s.getAttribute("name"),i=(null===(t=this.imask)||void 0===t?void 0:t.unmaskedValue)||s.value;this.formControlInput.emit({name:a,value:i})},this.updateInput=e=>{this.imask&&e&&(this.imask.value=String(e))}}handleDefaultValueChange(e){this.initializeIMask(),this.updateInput(e)}disconnectedCallback(){var e;null===(e=this.imask)||void 0===e||e.destroy()}componentDidLoad(){this.textInput&&(this.initializeIMask(),this.updateInput(this.defaultValue))}get part(){return this.errorText?c:this.disabled?h:this.isFocused?n:f}render(){return t(s,{key:"c70d3fcce4d3e1e120008b03a708bb3d1038777b"},t("div",{key:"fc3c3cf5637121a7c6f662649a1b3910ec503afa",class:"form-group d-flex flex-column"},t("div",{key:"c06e87a0d72942e421c37ab406b7f71d4e7f2c54",class:"d-flex align-items-start gap-2"},t("label",{key:"eedeec0161e3085cd65ea08b3fb4517ff62c6ffc",part:b,class:"form-label",htmlFor:this.name},this.label),t("form-control-tooltip",{key:"9fb05bd91836ca51750f30a714a7940493bfad8b",helpText:this.helpText})),t("input",{key:"ef12caf83b42b0de0c33ece690bdd927b9b9a02c",ref:e=>this.textInput=e,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled}),t(u,{key:"8791f48bed5d6508b7cccad7bba8da7d65f96ffc",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}},p=class{constructor(t){e(this,t),this.address={},this.inputHandler=(e,t)=>{this.address[e]=t,this.address=Object.assign({},this.address)}}handleAddressChange(e){this.handleFormUpdate(e)}render(){return t(s,{key:"71100bc3742c3efaa9c3a948bf3ac5c69281c559"},t("form-address-fields",{key:"e5e5399686aa272a9cbe45d6914ebeda6a1966f4",country:this.country,errors:this.errors,defaultValues:this.defaultValues,inputHandler:this.inputHandler}))}static get watchers(){return{address:["handleAddressChange"]}}};export{m as form_address_fields,v as form_control_number_masked,p as identity_address_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as s}from"./p-CV0Pyo1O.js";import{f as i}from"./p-BRnBHsdq.js";import{t as a,a8 as r}from"./p-CPKMvyV_.js";import{B as d}from"./p-CHo7TfsM.js";import{S as c}from"./p-uZ5KAseb.js";import"./p-CZfYo5-1.js";import{C as o,e as n}from"./p-NZS8uCtH.js";import{g as h,a as p}from"./p-Cm9f5fyh.js";import{D as l,a as f}from"./p-oTtn8xDw.js";import{c as u}from"./p-mF5zKtkx.js";import{J as b}from"./p-Cz_7BuGW.js";import"./p-HXpYMWUU.js";import"./p-CYQvLgSs.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-OGt0dCJl.js";const y=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:p(d.error),code:h(null===(c=d.error)||void 0===c?void 0:c.code),severity:o.ERROR})}a(d)}catch(e){const t=h(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:o.ERROR})}finally{return d()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7)}acceptDispute(){y({disputeId:this.dispute.id,authToken:this.authToken,service:new f})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:l.respondToDispute})}isDueDatePassed(){var e;if(!(null===(e=this.dispute)||void 0===e?void 0:e.due_date))return!1;const t=new Date(this.dispute.due_date.replace(/-/g,"/").replace(/T.+/,"")),s=new Date;return s.setHours(0,0,0,0),t.setHours(0,0,0,0),t<s}render(){var e,t,o,n,h,p,l,f,u;return s("div",{key:"c5963c0823e635ee0c2e88979b174c89c96af134",class:"dispute-notification-root"},this.isLoading&&s("div",{key:"4de146d999a16e1b4ad3e393285a843d86febdda",style:{marginBottom:"8px"}},s(c,{key:"ccbf1fe76ac5582cb2536548901c12768096e867",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"06ede07362fe88dfd4ec6b38c80bf619b9c7a134",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"768613c5b20ef403c468b12d5dacbea4b211ebef",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"a22e18df2764ddb6bee0db7e4da388bd9aec0d99",part:a},s("h1",{key:"b602464b54aacc6c0776975921dbe3fceeda1f04",class:"h4",part:r},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"e4b8615f75914e7aa613f6120172bc2cc0f6dd31"},"You can no longer submit evidence to counter this dispute.")),(null===(o=this.dispute)||void 0===o?void 0:o.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"2b09cc88b63ca582e2ef8cb83ef4455d4af493cc",part:a},s("h1",{key:"74ac700bc104aac085712a30da0b968a1bec41fe",class:"h4",part:r},"This payment is disputed"),s("p",{key:"2d133967991c3ee44f022ac925c873c198b71315"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"376936590aaeb5903f430eedb84984704966563d",class:"h5"},"Dispute details"),s("div",{key:"8afea9772ee48495c8b731ba8602c48e00061f8c",class:"d-table gap-2"},s("div",{key:"14630372fff051e1baadb7239ced63ae56edaf7e",class:"d-table-row gap-2"},s("span",{key:"4ec3fc5233e87b07021eeb78ac7d4e09666502c7",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"fe19ae497136c8ef5511a0197952c6d3cd889b84",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(n=this.dispute)||void 0===n?void 0:n.amount))),s("div",{key:"0f955e0707a9b8126868a34dafa39320e00d7706",class:"d-table-row gap-2"},s("span",{key:"63dc2ebf125f6ec52a155ced1324a02b0735c78b",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"5a6e543559e873811348fa0b68d21fe0f1dac781",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.reason)),s("div",{key:"7656de07c60c137dd7005f96370a71442dcdb526",class:"d-table-row gap-2"},s("span",{key:"817a89c84f605cbfac346f0d39790b35a73d51a4",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"e0e7c74f85934f6a1d2e02bc24d5563e1a37222e",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.due_date))),s("div",{key:"2ef721cebd617709242a0b4b9713ff264f73eac0",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"530f16709538e4146e542b88177145e4b2c9808a",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"a498af8eb2d5a41e75a8fb044b981463b8e3bbd4",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"f01a89cda469402b5543b64b02ddfc9ec66cc62b",part:a},s("h1",{key:"15f0173bdfc20dea6fb16b030479f8554e40b716",class:"h4",part:r},"This payment is disputed and under review"),s("p",{key:"a444d77fad985cddf37a0386db7ee65f321fa11c"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"08bf0f31e5fe43dbf1058709f500d0b592827dcb",part:a},s("h1",{key:"e9925566140ac26b9fb42026258f3ca2bebc002f",class:"h4",part:r},"This payment was disputed"),s("p",{key:"b0dd7cec8cad943d46d7e2d7d919f15b29d08fbd"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(u=this.dispute)||void 0===u?void 0:u.lost)&&s("div",{key:"4b037a462c3e9b3c7b7296e15b443c94a4310f46",part:a},s("h1",{key:"b614282d90adb69e9c638ed7a6f80566033c69ed",class:"h4",part:r},"This payment was disputed"),s("p",{key:"3808b99fb69241784c6f3e09bbd6b13636cb26a3"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},m=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.errorMessage=null,this.disputeResponse={},this.apiOrigin="https://wc-proxy.justifi.ai",this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:l.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}componentWillLoad(){u(),this.analytics=new b(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:p(d.error),code:h(null===(c=d.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(d)}catch(e){const t=h(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:o.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:p(d.error),code:h(null===(c=d.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(d)}catch(e){const t=h(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:o.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.submitDisputeResponse=y({disputeId:this.disputeId,authToken:this.authToken,service:new f})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:n.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"50f6bf79c7590ef3591e2163dbcd89241ca17b62",class:"dispute-response-root"},s("div",{key:"5345d5a3c5e7ff2d4c56f438fe623578e3d2029e",class:"row gy-3"},s("div",{key:"8925276a290105b2fde5cd6bfdf0390c3a0c95f9",class:"col-12"},s("h1",{key:"b8eb14deedc748b3612f11fad9d94fa38020a7f8",class:"h4",part:r},"Counter dispute")),s("div",{key:"50afe487bdb21d3ea2dc149c662a284f5ebb4d9b",class:"col-12"},this.currentStepComponent),s("div",{key:"cde242630fdc12e82ee5a77a199c4f6a7858371e",class:"col-12"},s("div",{key:"ce548b753ec56df34e23eb33649a27449d49b712",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next")))))}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{v as dispute_notification,m as dispute_response}
|
|
1
|
+
import{r as e,c as t,h as s}from"./p-CV0Pyo1O.js";import{f as i}from"./p-BRnBHsdq.js";import{t as a,a8 as r}from"./p-CPKMvyV_.js";import{B as d}from"./p-CHo7TfsM.js";import{S as c}from"./p-uZ5KAseb.js";import"./p-CZfYo5-1.js";import{C as o,e as n}from"./p-NZS8uCtH.js";import{g as h,a as p}from"./p-Cm9f5fyh.js";import{D as l,a as f}from"./p-oTtn8xDw.js";import{c as u}from"./p-DjjAx7PF.js";import{J as b}from"./p-DO9lqnbB.js";import"./p-HXpYMWUU.js";import"./p-CYQvLgSs.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-B6YPrwyC.js";const y=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:p(d.error),code:h(null===(c=d.error)||void 0===c?void 0:c.code),severity:o.ERROR})}a(d)}catch(e){const t=h(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:o.ERROR})}finally{return d()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7)}acceptDispute(){y({disputeId:this.dispute.id,authToken:this.authToken,service:new f})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:l.respondToDispute})}isDueDatePassed(){var e;if(!(null===(e=this.dispute)||void 0===e?void 0:e.due_date))return!1;const t=new Date(this.dispute.due_date.replace(/-/g,"/").replace(/T.+/,"")),s=new Date;return s.setHours(0,0,0,0),t.setHours(0,0,0,0),t<s}render(){var e,t,o,n,h,p,l,f,u;return s("div",{key:"c5963c0823e635ee0c2e88979b174c89c96af134",class:"dispute-notification-root"},this.isLoading&&s("div",{key:"4de146d999a16e1b4ad3e393285a843d86febdda",style:{marginBottom:"8px"}},s(c,{key:"ccbf1fe76ac5582cb2536548901c12768096e867",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"06ede07362fe88dfd4ec6b38c80bf619b9c7a134",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"768613c5b20ef403c468b12d5dacbea4b211ebef",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"a22e18df2764ddb6bee0db7e4da388bd9aec0d99",part:a},s("h1",{key:"b602464b54aacc6c0776975921dbe3fceeda1f04",class:"h4",part:r},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"e4b8615f75914e7aa613f6120172bc2cc0f6dd31"},"You can no longer submit evidence to counter this dispute.")),(null===(o=this.dispute)||void 0===o?void 0:o.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"2b09cc88b63ca582e2ef8cb83ef4455d4af493cc",part:a},s("h1",{key:"74ac700bc104aac085712a30da0b968a1bec41fe",class:"h4",part:r},"This payment is disputed"),s("p",{key:"2d133967991c3ee44f022ac925c873c198b71315"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"376936590aaeb5903f430eedb84984704966563d",class:"h5"},"Dispute details"),s("div",{key:"8afea9772ee48495c8b731ba8602c48e00061f8c",class:"d-table gap-2"},s("div",{key:"14630372fff051e1baadb7239ced63ae56edaf7e",class:"d-table-row gap-2"},s("span",{key:"4ec3fc5233e87b07021eeb78ac7d4e09666502c7",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"fe19ae497136c8ef5511a0197952c6d3cd889b84",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(n=this.dispute)||void 0===n?void 0:n.amount))),s("div",{key:"0f955e0707a9b8126868a34dafa39320e00d7706",class:"d-table-row gap-2"},s("span",{key:"63dc2ebf125f6ec52a155ced1324a02b0735c78b",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"5a6e543559e873811348fa0b68d21fe0f1dac781",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.reason)),s("div",{key:"7656de07c60c137dd7005f96370a71442dcdb526",class:"d-table-row gap-2"},s("span",{key:"817a89c84f605cbfac346f0d39790b35a73d51a4",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"e0e7c74f85934f6a1d2e02bc24d5563e1a37222e",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.due_date))),s("div",{key:"2ef721cebd617709242a0b4b9713ff264f73eac0",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"530f16709538e4146e542b88177145e4b2c9808a",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"a498af8eb2d5a41e75a8fb044b981463b8e3bbd4",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"f01a89cda469402b5543b64b02ddfc9ec66cc62b",part:a},s("h1",{key:"15f0173bdfc20dea6fb16b030479f8554e40b716",class:"h4",part:r},"This payment is disputed and under review"),s("p",{key:"a444d77fad985cddf37a0386db7ee65f321fa11c"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"08bf0f31e5fe43dbf1058709f500d0b592827dcb",part:a},s("h1",{key:"e9925566140ac26b9fb42026258f3ca2bebc002f",class:"h4",part:r},"This payment was disputed"),s("p",{key:"b0dd7cec8cad943d46d7e2d7d919f15b29d08fbd"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(u=this.dispute)||void 0===u?void 0:u.lost)&&s("div",{key:"4b037a462c3e9b3c7b7296e15b443c94a4310f46",part:a},s("h1",{key:"b614282d90adb69e9c638ed7a6f80566033c69ed",class:"h4",part:r},"This payment was disputed"),s("p",{key:"3808b99fb69241784c6f3e09bbd6b13636cb26a3"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},m=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.errorMessage=null,this.disputeResponse={},this.apiOrigin="https://wc-proxy.justifi.ai",this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:l.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}componentWillLoad(){u(),this.analytics=new b(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:p(d.error),code:h(null===(c=d.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(d)}catch(e){const t=h(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:o.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:p(d.error),code:h(null===(c=d.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(d)}catch(e){const t=h(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:o.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.submitDisputeResponse=y({disputeId:this.disputeId,authToken:this.authToken,service:new f})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:n.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"50f6bf79c7590ef3591e2163dbcd89241ca17b62",class:"dispute-response-root"},s("div",{key:"5345d5a3c5e7ff2d4c56f438fe623578e3d2029e",class:"row gy-3"},s("div",{key:"8925276a290105b2fde5cd6bfdf0390c3a0c95f9",class:"col-12"},s("h1",{key:"b8eb14deedc748b3612f11fad9d94fa38020a7f8",class:"h4",part:r},"Counter dispute")),s("div",{key:"50afe487bdb21d3ea2dc149c662a284f5ebb4d9b",class:"col-12"},this.currentStepComponent),s("div",{key:"cde242630fdc12e82ee5a77a199c4f6a7858371e",class:"col-12"},s("div",{key:"ce548b753ec56df34e23eb33649a27449d49b712",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next")))))}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{v as dispute_notification,m as dispute_response}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,h as i,H as t}from"./p-CV0Pyo1O.js";import{c as e,D as s}from"./p-Cu7hgXL1.js";import{m as o,s as d,n as v}from"./p-BRnBHsdq.js";import"./p-CPKMvyV_.js";import"./p-HXpYMWUU.js";const u=class{constructor(i){l(this,i)}render(){return!this.additionalQuestions||o(this.additionalQuestions)?null:i("div",null,i(s,{sectionTitle:"Additional Questions"}),i("div",{class:"d-flex flex-column gap-2 w-100 mt-3"},i("div",{class:"row gy-3"},i("div",{class:"col-12 col-md-6"},i(e,{title:"Business Revenue",value:this.additionalQuestions.business_revenue}),i(e,{title:"Business Payment Volume",value:this.additionalQuestions.business_payment_volume})))))}},a=class{constructor(i){l(this,i)}render(){return this.business?i("div",null,i(s,{sectionTitle:"Business Core Info Details"}),i("div",{class:"d-table gap-2 w-100 mt-3"},i("div",{class:"row gy-3"},i("div",{class:"col-12 col-md-6"},i(e,{title:"Legal Name",value:this.business.legal_name}),i(e,{title:"Doing Business As (DBA)",value:this.business.doing_business_as}),i(e,{title:"Business Classification",value:d(this.business.classification)}),i(e,{title:"Industry",value:this.business.industry})),i("div",{class:"col-12 col-md-6"},i(e,{title:"Tax ID",value:this.business.tax_id}),i(e,{title:"Website URL",value:this.business.website_url}),i(e,{title:"Email Address",value:this.business.email}),i(e,{title:"Phone Number",value:this.business.phone}))))):null}},n=class{constructor(i){l(this,i)}render(){var l,t,d,v,u,a,n;return!this.legalAddress||o(this.legalAddress)?null:i("div",null,i(s,{sectionTitle:"Business Legal Address Details"}),i("div",{class:"d-table gap-2 w-100 mt-3"},i("div",{class:"row gy-3"},i("div",{class:"col-12 col-md-6"},i(e,{title:"Country",value:null===(l=this.legalAddress)||void 0===l?void 0:l.country}),i(e,{title:"Legal Address",value:null===(t=this.legalAddress)||void 0===t?void 0:t.line1}),i(e,{title:"Address Line 2",value:null===(d=this.legalAddress)||void 0===d?void 0:d.line2})),i("div",{class:"col-12 col-md-6"},i(e,{title:"City",value:null===(v=this.legalAddress)||void 0===v?void 0:v.city}),i(e,{title:"State",value:null===(u=this.legalAddress)||void 0===u?void 0:u.state}),i(e,{title:"Postal Code",value:null===(n=null===(a=this.legalAddress)||void 0===a?void 0:a.postal_code)||void 0===n?void 0:n.toString()})))))}},r=class{constructor(i){l(this,i)}render(){var l;return(null===(l=null==this?void 0:this.owners)||void 0===l?void 0:l.length)?i(t,null,!!(null==this?void 0:this.owners.length)&&this.owners.map((l=>{var t,o,d,u,a;return[i(s,{sectionTitle:`Owner ${null==l?void 0:l.name}'s Details`}),i("div",{class:"d-flex flex-column gap-2 w-100 mt-3"},i("div",{class:"col-md-6"},i(e,{title:"Name",value:null==l?void 0:l.name}),i(e,{title:"Title",value:null==l?void 0:l.title}),i(e,{title:"Email",value:null==l?void 0:l.email}),i(e,{title:"Phone",value:null==l?void 0:l.phone}),i(e,{title:"Date of Birth",value:v(new Date(Number(null==l?void 0:l.
|
|
1
|
+
import{r as l,h as i,H as t}from"./p-CV0Pyo1O.js";import{c as e,D as s}from"./p-Cu7hgXL1.js";import{m as o,s as d,n as v}from"./p-BRnBHsdq.js";import"./p-CPKMvyV_.js";import"./p-HXpYMWUU.js";const u=class{constructor(i){l(this,i)}render(){return!this.additionalQuestions||o(this.additionalQuestions)?null:i("div",null,i(s,{sectionTitle:"Additional Questions"}),i("div",{class:"d-flex flex-column gap-2 w-100 mt-3"},i("div",{class:"row gy-3"},i("div",{class:"col-12 col-md-6"},i(e,{title:"Business Revenue",value:this.additionalQuestions.business_revenue}),i(e,{title:"Business Payment Volume",value:this.additionalQuestions.business_payment_volume})))))}},a=class{constructor(i){l(this,i)}render(){return this.business?i("div",null,i(s,{sectionTitle:"Business Core Info Details"}),i("div",{class:"d-table gap-2 w-100 mt-3"},i("div",{class:"row gy-3"},i("div",{class:"col-12 col-md-6"},i(e,{title:"Legal Name",value:this.business.legal_name}),i(e,{title:"Doing Business As (DBA)",value:this.business.doing_business_as}),i(e,{title:"Business Classification",value:d(this.business.classification)}),i(e,{title:"Industry",value:this.business.industry})),i("div",{class:"col-12 col-md-6"},i(e,{title:"Tax ID",value:this.business.tax_id}),i(e,{title:"Website URL",value:this.business.website_url}),i(e,{title:"Email Address",value:this.business.email}),i(e,{title:"Phone Number",value:this.business.phone}))))):null}},n=class{constructor(i){l(this,i)}render(){var l,t,d,v,u,a,n;return!this.legalAddress||o(this.legalAddress)?null:i("div",null,i(s,{sectionTitle:"Business Legal Address Details"}),i("div",{class:"d-table gap-2 w-100 mt-3"},i("div",{class:"row gy-3"},i("div",{class:"col-12 col-md-6"},i(e,{title:"Country",value:null===(l=this.legalAddress)||void 0===l?void 0:l.country}),i(e,{title:"Legal Address",value:null===(t=this.legalAddress)||void 0===t?void 0:t.line1}),i(e,{title:"Address Line 2",value:null===(d=this.legalAddress)||void 0===d?void 0:d.line2})),i("div",{class:"col-12 col-md-6"},i(e,{title:"City",value:null===(v=this.legalAddress)||void 0===v?void 0:v.city}),i(e,{title:"State",value:null===(u=this.legalAddress)||void 0===u?void 0:u.state}),i(e,{title:"Postal Code",value:null===(n=null===(a=this.legalAddress)||void 0===a?void 0:a.postal_code)||void 0===n?void 0:n.toString()})))))}},r=class{constructor(i){l(this,i)}render(){var l;return(null===(l=null==this?void 0:this.owners)||void 0===l?void 0:l.length)?i(t,null,!!(null==this?void 0:this.owners.length)&&this.owners.map((l=>{var t,o,d,u,a;return[i(s,{sectionTitle:`Owner ${null==l?void 0:l.name}'s Details`}),i("div",{class:"d-flex flex-column gap-2 w-100 mt-3"},i("div",{class:"col-md-6"},i(e,{title:"Name",value:null==l?void 0:l.name}),i(e,{title:"Title",value:null==l?void 0:l.title}),i(e,{title:"Email",value:null==l?void 0:l.email}),i(e,{title:"Phone",value:null==l?void 0:l.phone}),i(e,{title:"Date of Birth",value:v(new Date(Number(null==l?void 0:l.dob_year),Number(null==l?void 0:l.dob_month)-1,Number(null==l?void 0:l.dob_day)))}),i(e,{title:"Identification Number",value:`********${null==l?void 0:l.ssn_last4}`}),i(e,{title:"Line 1",value:null===(t=null==l?void 0:l.address)||void 0===t?void 0:t.line1}),i(e,{title:"Line 2",value:null===(o=null==l?void 0:l.address)||void 0===o?void 0:o.line2}),i(e,{title:"City",value:null===(d=null==l?void 0:l.address)||void 0===d?void 0:d.city}),i(e,{title:"State",value:null===(u=null==l?void 0:l.address)||void 0===u?void 0:u.state}),i(e,{title:"Zip",value:null===(a=null==l?void 0:l.address)||void 0===a?void 0:a.postal_code})))]}))):null}},c=class{constructor(i){l(this,i)}render(){var l,t,d,u,a,n,r,c,h,m,p,f,g,w;return!this.representative||o(this.representative)?null:i("div",null,i(s,{sectionTitle:"Representative Details"}),i("div",{class:"d-flex flex-column gap-2 w-100 mt-3"},i("div",{class:"row gy-3"},i("div",{class:"col-12 col-md-6"},i(e,{title:"Name",value:null===(l=this.representative)||void 0===l?void 0:l.name}),i(e,{title:"ID",value:null===(t=this.representative)||void 0===t?void 0:t.id}),i(e,{title:"Address",value:null===(u=null===(d=this.representative)||void 0===d?void 0:d.address)||void 0===u?void 0:u.line1}),i(e,{title:"Created At",value:(null===(a=this.representative)||void 0===a?void 0:a.created_at)&&v(null===(n=this.representative)||void 0===n?void 0:n.created_at)})),i("div",{class:"col-12 col-md-6"},i(e,{title:"Title",value:null===(r=this.representative)||void 0===r?void 0:r.title}),i(e,{title:"Is Owner?",value:null===(c=this.representative)||void 0===c?void 0:c.is_owner.toString()}),i(e,{title:"Date Of Birth",value:this.representative&&v(new Date(Number(null===(h=this.representative)||void 0===h?void 0:h.dob_year),Number(null===(m=this.representative)||void 0===m?void 0:m.dob_month)-1,Number(null===(p=this.representative)||void 0===p?void 0:p.dob_day)))}),i(e,{title:"Email",value:null===(f=this.representative)||void 0===f?void 0:f.email}),i(e,{title:"Phone",value:null===(g=this.representative)||void 0===g?void 0:g.phone}),i(e,{title:"Updated At",value:this.representative&&v(null===(w=this.representative)||void 0===w?void 0:w.updated_at)})))))}};export{u as additional_questions_details,a as core_info_details,n as legal_address_details,r as owner_details,c as representative_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i,r as e}from"./p-CV0Pyo1O.js";import{S as a}from"./p-uZ5KAseb.js";import{w as t,c}from"./p-DVJaoI_m.js";import{e as s}from"./p-BRnBHsdq.js";import{c as d}from"./p-
|
|
1
|
+
import{h as i,r as e}from"./p-CV0Pyo1O.js";import{S as a}from"./p-uZ5KAseb.js";import{w as t,c}from"./p-DVJaoI_m.js";import{e as s}from"./p-BRnBHsdq.js";import{c as d}from"./p-DjjAx7PF.js";import"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-B6YPrwyC.js";const n=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(a,{height:"18px",width:"100px"}),i(a,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"80px"}),i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"30px"}),i(a,{height:"36px"}))))},r=class{constructor(i){e(this,i),this.isReady=!1}async componentWillLoad(){await t(),this.iframeOrigin=c.iframeOrigin,this.tabId=s(),d()}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((i=>new Promise((e=>{i.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const i=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),t=await this.cvvIframeElement.validate();return i&&e&&a&&t}async tokenize({clientId:i,paymentMethodMetadata:e,account:a}){return await this.cardNumberIframeElement.tokenize(i,e,a)}render(){return i("div",{key:"cef558344c088e6e0bccb49b99c8a47c76200467"},i(n,{key:"f35bad214bc4d7657b7ab8a097a76602df877bcf",isReady:this.isReady}),i("hidden-input",{key:"d3791651ad279e2e0ad169012f4d066a44bbfa66"}),i("div",{key:"37318e633f9ab08bfbc95750466c054158e5e4ff",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"d5eccc9c8a496f3f264a1bd01bb065e823aa01b5",class:"mb-3"},i("iframe-input",{key:"2ec07c9bf1ea18ed354cd036e2c7876f974a30ed",inputId:"cardNumber",ref:i=>this.cardNumberIframeElement=i,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"2959894ab0721d9bffccb0c16ecfb71bd3488518",class:"row"},i("div",{key:"dea7afd2515c4faa4927fd6cb32678fc782b9b5a",class:"col-4 align-content-end"},i("iframe-input",{key:"7d95eff6c6765ff996c1c497866ad01216b2cc4f",inputId:"expirationMonth",ref:i=>this.expirationMonthIframeElement=i,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"00b02deefe877431409ef584662fc07e4a20cc3c",class:"col-4 align-content-end"},i("iframe-input",{key:"4860f042f29eb1d3db0e5ad4cb7c9471b8536ce6",inputId:"expirationYear",ref:i=>this.expirationYearIframeElement=i,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"c69f9be6e581e683b757e89000ef1ba385c5f57b",class:"col-4 align-content-end"},i("iframe-input",{key:"e5fbb8e78af5c8c6ed74db18aeb226bfba5d083f",inputId:"CVV",ref:i=>this.cvvIframeElement=i,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{r as card_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as 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-CPKMvyV_.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as n}from"./p-
|
|
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-CPKMvyV_.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as n}from"./p-DjjAx7PF.js";import{J as a}from"./p-DO9lqnbB.js";import{m as h,C as c,n as v,c as u,e as p}from"./p-NZS8uCtH.js";import{B as m}from"./p-BJu1-9kE.js";import{B as f}from"./p-BcNb9bVO.js";import{m as w}from"./p-Aacb4jqT.js";import{S as b}from"./p-uZ5KAseb.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{g as y,a as x}from"./p-Cm9f5fyh.js";import{T as g}from"./p-Ba8jdOkX.js";import{l as j}from"./p-BRnBHsdq.js";import"./p-B6YPrwyC.js";import"./p-CYQvLgSs.js";import"./p-D8GTwl9v.js";const C=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(b,{width:"25%"})),i("div",{class:"col-12"},i(b,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(b,{width:"50%"}),i(b,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(b,{width:"65%"}),i(b,{width:"35%"}))),S=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(b,{width:"40%",height:"40px"})),i(C,null)),k=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(b,{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(b,null),i(b,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(b,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(b,{width:"80px",height:"32px"}),i(b,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(b,null),i(b,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 v({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?u.boardingShipping:u.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(){w({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:x(a.error),code:y(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=y(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 g})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:x(d.error),code:y(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=y(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:c.ERROR})}})({authToken:this.authToken,service:new g});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(S,null),this.loading.terminals&&i("div",{class:"mt-5"},i(k,null),i(k,null),i(k,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:"a6d128c8f7075ba4bf6dc033e357dac187cdb965"},i("div",{key:"9e726c70efc7e9b9163ded2ca1e88dc4303b2f21",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{B as justifi_order_terminals}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as t,h as i}from"./p-CV0Pyo1O.js";import{D as e,C as r,e as o,f as h}from"./p-NZS8uCtH.js";import{J as p}from"./p-
|
|
1
|
+
import{r as s,c as t,h as i}from"./p-CV0Pyo1O.js";import{D as e,C as r,e as o,f as h}from"./p-NZS8uCtH.js";import{J as p}from"./p-DO9lqnbB.js";import{c as a}from"./p-DjjAx7PF.js";import{g as n,a as c}from"./p-Cm9f5fyh.js";import{D as d,a as u}from"./p-oTtn8xDw.js";import{S as m}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import"./p-BRnBHsdq.js";import"./p-HXpYMWUU.js";import"./p-B6YPrwyC.js";import"./p-CYQvLgSs.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const j=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===d.respondToDispute&&(this.showDisputeResponseForm=!0),s.detail.name===d.cancelDispute&&(this.showDisputeResponseForm=!1)}disputeSubmittedHandler(){this.fetchData()}componentWillLoad(){a(),this.analytics=new p(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:h})=>{var p;try{const a=await i.fetchDispute(s,t);if(a.error)return h({error:c(a.error),code:n(null===(p=a.error)||void 0===p?void 0:p.code),severity:r.ERROR});{const s=Object.assign({},a.page_info);o({dispute:new e(a.data),pagingInfo:s})}}catch(s){const t=n(null==s?void 0:s.code);return h({error:s.message||s,code:t,severity:r.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new u}):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!==h.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:"a9185f55e6f2704ec8ba85c5061e8c46338481e3"},i("div",{key:"e4851b3fa85ec428929b7868c0748b56c0172c8b"},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{j as justifi_dispute_management}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as s,c as e}from"./p-CV0Pyo1O.js";import{i as a,C as i,e as o}from"./p-NZS8uCtH.js";import{J as r}from"./p-
|
|
1
|
+
import{h as t,r as s,c as e}from"./p-CV0Pyo1O.js";import{i as a,C as i,e as o}from"./p-NZS8uCtH.js";import{J as r}from"./p-DO9lqnbB.js";import{c as h}from"./p-DjjAx7PF.js";import{P as c}from"./p-Dk26hk5T.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as p,a as d}from"./p-Cm9f5fyh.js";import{M as u,m}from"./p-BXyADlAH.js";import{m as l,S as f}from"./p-BxKbnILQ.js";import{S as y}from"./p-BqNNwq6C.js";import{T as b,a as v,b as g,c as C,d as j,e as _,f as k,g as w,h as S,i as T,j as P,k as A,l as O}from"./p-BICxxa69.js";import{T as D}from"./p-CZfYo5-1.js";import{a as I}from"./p-BRnBHsdq.js";import{a6 as B,a7 as V}from"./p-CPKMvyV_.js";import{o as x,g as E}from"./p-AMVhBsGv.js";import"./p-B6YPrwyC.js";import"./p-CYQvLgSs.js";import"./p-D8GTwl9v.js";import"./p-CHw7tICr.js";import"./p-CqiVXthx.js";const q={created_at:()=>t("th",{part:B,scope:"col",title:"The date the payout was deposited"},"Created"),sub_account_name:()=>t("th",{part:B,scope:"col",title:"The sub account associated with the payout"},"Sub Account"),payments_total:()=>t("th",{part:B,scope:"col",title:"The total payments amount associated with the payout"},"Payments"),refunds_total:()=>t("th",{part:B,scope:"col",title:"The total refunds amount associated with the payout"},"Refunds"),fees_total:()=>t("th",{part:B,scope:"col",title:"The total fees amount associated with the payout"},"Fees"),other_total:()=>t("th",{part:B,scope:"col",title:"The total other amount"},"Other"),amount:()=>t("th",{part:B,scope:"col",title:"The total amount of the payout"},"Amount"),status:()=>t("th",{part:B,scope:"col",title:"The real-time status of each payout"},"Status"),csv:()=>t("th",{part:B,scope:"col",title:"Export CSV"})},H=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event",7),this.clickEvent=e(this,"click-event",7),this.errorMessage=null,this.payouts=[],this.subAccounts=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payments_total,refunds_total,fees_total,other_total,csv",this.downloadCSV=t=>{this.getPayoutCSV({payoutId:t,onError:()=>{this.errorEvent.emit({errorCode:o.FETCH_ERROR,message:"Failed to download CSV",severity:i.ERROR})}})},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr"),e=s.dataset.rowEntityId;if(!e)return;if(s.querySelector("a")===t.target)return;const a=this.payouts.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){var s;h(),this.analytics=new r(this),this.initializeGetData(),this.payoutsTable=new b(this.payouts,this.columns,q,(s=this.downloadCSV,{created_at:(s,e)=>t("td",{part:V(e)},t("div",{class:"fw-bold"},I(s.created_at,{showDisplayDate:!0}))),sub_account_name:(s,e)=>t("td",{part:V(e)},s.sub_account_name),payments_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.payments_total)),refunds_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.refunds_total)),fees_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.fees_total)),other_total:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.other_total)),amount:(s,e)=>t("td",{part:V(e)},s.formattedPaymentAmount(s.amount)),status:(s,e)=>t("td",{part:V(e)},u(s.status)),csv:(e,a)=>t("td",{part:V(a)},t("a",{href:"#",onClick:t=>{t.preventDefault(),s(e.id)}},"CSV"))})),this.getPayouts&&this.getSubAccounts&&this.fetchData(),x("set",(()=>{this.pagingParams={}})),x("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new c};this.getPayouts=(({id:t,authToken:s,service:e})=>async({params:o,onSuccess:r,onError:h})=>{var c,n;try{const u=await e.fetchPayouts(t,s,o);if(u.error)return h({error:d(u.error),code:p(null===(n=u.error)||void 0===n?void 0:n.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({payouts:(null===(c=u.data)||void 0===c?void 0:c.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const s=p(null==t?void 0:t.code);return h({error:t.message||t,code:s,severity:i.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=l({primaryAccountId:this.accountId,authToken:this.authToken,service:new f}))}fetchData(){this.loading=!0,this.getPayouts({params:this.payoutParams,onSuccess:({payouts:t,pagingInfo:s})=>{this.payouts=t,this.paging=s,this.payoutsTable.collectionData=this.payouts,this.payoutsTable.columnKeys.includes("sub_account_name")?this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.payouts=this.payouts.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get payoutParams(){const t=E();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){let t=this.payouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.payouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.payoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(y,{key:"679d6c6e77a02a30223a98d2acc5904866d19f80"},t(v,{key:"9e26d69955fd836451c6468946d7fa512ad84fde"},t(g,{key:"a73a478f2c40d1b95c5a8bc7039496a2caa4bd40"},t(C,{key:"369b1f0a4827fed6ff8f0c6f030bbe54843e1356"},t(j,{key:"c4be14ee6c9401e8a5e6e3318c7e2754f2457151"},this.payoutsTable.columnData.map((t=>t)))),t(_,{key:"5401abd534d1035ffc5177bb091cb63628e250de"},t(k,{key:"386a988c540a87dea5f6574f0e073ed26607c528",columnSpan:this.payoutsTable.columnKeys.length,isLoading:this.loading}),t(w,{key:"6855b88d7ca2e75f39aee058de13f56fd81f1811",isEmpty:this.showEmptyState,columnSpan:this.payoutsTable.columnKeys.length}),t(S,{key:"186e8f3a48b5362a07b88192617d88d466ae11c2",columnSpan:this.payoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.payoutsTable.rowData.map(((s,e)=>t(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[e],onClick:this.rowClickHandler},s)))),this.paging&&t(P,{key:"ad5e63f894c990d5b87a5d39e4164d4248bc7b1a"},t(A,{key:"57cab389b166b282bbf6506d08a368f0cc4c750b"},t(O,{key:"8f8893d6f3ffe796ebe77fb33e1e0f6a3f364408",colSpan:this.payoutsTable.columnData.length},t("pagination-menu",{key:"640555ff74d52f27b06d3588f411e235b23436ad",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayouts:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"]}}};export{H as justifi_payouts_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{k as a,C as i,e as o}from"./p-NZS8uCtH.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as c,a as h}from"./p-Cm9f5fyh.js";import{c as n}from"./p-
|
|
1
|
+
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{k as a,C as i,e as o}from"./p-NZS8uCtH.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as c,a as h}from"./p-Cm9f5fyh.js";import{c as n}from"./p-DjjAx7PF.js";import{J as p}from"./p-DO9lqnbB.js";import{C as d}from"./p-fE5A37L5.js";import{m as u,S as m}from"./p-BxKbnILQ.js";import{S as f}from"./p-BqNNwq6C.js";import{T as b,a as l,b as y,c as k,d as g,e as C,f as v,g as j,h as _,i as w,j as S,k as T,l as P}from"./p-BICxxa69.js";import{T as x}from"./p-CZfYo5-1.js";import{d as A,b as I}from"./p-BRnBHsdq.js";import{B as O,a as D}from"./p-CHw7tICr.js";import{a6 as B,a7 as E}from"./p-CPKMvyV_.js";import{o as q,g as H}from"./p-CpGEMRkH.js";import"./p-D8GTwl9v.js";import"./p-B6YPrwyC.js";import"./p-CYQvLgSs.js";import"./p-CqiVXthx.js";const L={created_at:()=>t("th",{part:B,scope:"col",title:"The date each checkout occurred"},"Processed On"),payment_amount:()=>t("th",{part:B,scope:"col",title:"The dollar amount of each checkout"},"Payment Amount"),payment_description:()=>t("th",{part:B,scope:"col",title:"The description of each checkout"},"Payment Description"),sub_account_name:()=>t("th",{part:B,scope:"col",title:"The sub account associated with the checkout"},"Sub Account"),payment_mode:()=>t("th",{part:B,scope:"col",title:"The payment mode of each checkout"},"Payment Mode"),status:()=>t("th",{part:B,scope:"col",title:"The current status of each checkout"},"Status")},G={created_at:(e,s)=>t("td",{part:E(s)},t("div",{class:"fw-bold"},I(e.created_at)),t("div",{class:"fw-bold"},A(e.created_at))),payment_amount:(e,s)=>t("td",{part:E(s)},e.formattedPaymentAmount(e.payment_amount)),payment_description:(e,s)=>t("td",{part:E(s)},e.payment_description),sub_account_name:(e,s)=>t("td",{part:E(s)},e.sub_account_name),payment_mode:(e,s)=>t("td",{part:E(s)},e.payment_mode),status:(e,s)=>t("td",{part:E(s)},t(D,Object.assign({},{created:{variant:O.PRIMARY,title:"The checkout has been created",text:"Created"},completed:{variant:O.SUCCESS,title:"The checkout has been completed",text:"Completed"},attempted:{variant:O.SECONDARY,title:"The checkout has been attempted",text:"Attempted"},expired:{variant:O.DANGER,title:"The checkout has expired",text:"Expired"}}[e.status])))},M=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:x.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:x.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:x.row,data:s})}}componentWillLoad(){n(),this.analytics=new p(this),this.checkoutsTable=new b(this.checkouts,this.columns,L,G),this.initializeGetData(),this.getCheckouts&&this.fetchData(),q("set",(()=>{this.pagingParams={}})),q("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 p,d;try{const u=await s.fetchCheckouts(t,e,o);if(u.error)return n({error:h(u.error),code:c(null===(d=u.error)||void 0===d?void 0:d.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({checkouts:(null===(p=u.data)||void 0===p?void 0:p.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 d}):(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=H();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(f,{key:"2f9efac8723333029415ef131516946912bb313c"},t(l,{key:"024c7a532533721acda9740a0888b1c15fa624fe"},t(y,{key:"06bf1c6db731eb5857b08615222ca47a85ffc4a8"},t(k,{key:"0754f9cd87a3b32a5368e7fb7538071cf6be0505"},t(g,{key:"5db4c5beea0e6e9afc29e16b5789a32ad94509dd"},this.checkoutsTable.columnData.map((t=>t)))),t(C,{key:"9140294035b04b549578d74374271f8a9fd78162"},t(v,{key:"bf495d00b9bc4ee28b67c8f1b3258306f9202142",columnSpan:this.checkoutsTable.columnKeys.length,isLoading:this.loading}),t(j,{key:"92f8a1245cc022fa3b254bb1fe8d659f75c62923",isEmpty:this.showEmptyState,columnSpan:this.checkoutsTable.columnKeys.length}),t(_,{key:"2e6ab100026afb29f199dd33e52de5ae77e6576c",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(S,{key:"3a1b55572eb0fc2ffcef1a39f6bfae5693056752"},t(T,{key:"f61a3cc86fda3ec95075381403916f5fb1c46ca6"},t(P,{key:"7d937a0d228062f42f49dca5bdb436d54354563e",colSpan:this.checkoutsTable.columnData.length},t("pagination-menu",{key:"05454876b7faeeb73fb8f896a2425e5f9db12ee3",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{M as justifi_checkouts_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s,F as e,r as t,c as i}from"./p-CV0Pyo1O.js";import{E as a}from"./p-Cu7hgXL1.js";import{B as r}from"./p-BJu1-9kE.js";import{m as o}from"./p-Aacb4jqT.js";import{C as
|
|
1
|
+
import{h as s,F as e,r as t,c as i}from"./p-CV0Pyo1O.js";import{E as a}from"./p-Cu7hgXL1.js";import{B as r}from"./p-BJu1-9kE.js";import{m as o}from"./p-Aacb4jqT.js";import{C as n,e as l}from"./p-NZS8uCtH.js";import{J as h}from"./p-DO9lqnbB.js";import{c}from"./p-DjjAx7PF.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as p}from"./p-uZ5KAseb.js";import"./p-CPKMvyV_.js";import"./p-CYQvLgSs.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-BRnBHsdq.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-Cm9f5fyh.js";import"./p-B6YPrwyC.js";const u=()=>{const t=()=>s("div",{class:"mt-5"},s(p,{width:"40%",height:"1.5rem"}),s("hr",null),s("div",{class:"row g-3"},s("div",{class:"col-12 col-md-6"},s(p,null),s(p,null),s(p,null)),s("div",{class:"col-12 col-md-6"},s(p,null),s(p,null),s(p,null))));return s(e,null,s(t,null),s(t,null),s(t,null),s(t,null))},m=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.loading=!0}componentWillLoad(){c(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetBusiness()}initializeGetBusiness(){this.businessId&&this.authToken?(this.getBusiness=o({id:this.businessId,authToken:this.authToken,service:new r}),this.fetchData()):(this.errorMessage="Invalid business id or auth token",this.errorEvent.emit({errorCode:l.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}updateOnPropChange(){this.getBusiness&&this.fetchData()}fetchData(){this.loading=!0,this.getBusiness({onSuccess:({business:s})=>{this.business=s,this.errorMessage=null},onError:({error:s,code:e,severity:t})=>{this.errorMessage=s,this.errorEvent.emit({errorCode:e,message:s,severity:t})},final:()=>{this.loading=!1}})}render(){return s(d,{key:"7ce48e6905cdbbf8f94470913ecfa3ef8dbb76c7"},this.loading&&s(u,{key:"7c3439e0c247436cd7951d3bdc32e7672c9f8447"}),!this.loading&&this.errorMessage&&a(this.errorMessage),!this.loading&&!this.errorMessage&&this.business&&s("justifi-details",{key:"bf57dacf2067f2704014ce3e002958e3306bba73",errorMessage:this.errorMessage},s("div",{key:"46d19a178ba0d33aa21a4f3900128e3e905731a9",slot:"detail-sections"},s("core-info-details",{key:"ac217a4cfe6b45810a85ca320760b7331f76e60b",business:this.business}),s("legal-address-details",{key:"1fc1a196a43bcf5f9eafd09bfe74c8bb7c409797",legalAddress:this.business.legal_address}),s("representative-details",{key:"1e0833606b129f69a05946726172963cbec05189",representative:this.business.representative}),s("owner-details",{key:"c974111dc67a8961ef6435c34843ca927ad8a7e5",owners:this.business.owners}),s("additional-questions-details",{key:"0951d284a373457e98a1dafc80231ec3ee057e0a",additionalQuestions:this.business.additional_questions}))))}static get watchers(){return{businessId:["propChanged"],authToken:["propChanged"],getBusiness:["updateOnPropChange"]}}};export{m as justifi_business_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{l as s,C as a,e as r}from"./p-NZS8uCtH.js";import{J as n}from"./p-
|
|
1
|
+
import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{l as s,C as a,e as r}from"./p-NZS8uCtH.js";import{J as n}from"./p-DO9lqnbB.js";import{c as o}from"./p-DjjAx7PF.js";import{T as c}from"./p-Ba8jdOkX.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as d,a as p}from"./p-Cm9f5fyh.js";import{m,S as l}from"./p-BxKbnILQ.js";import{S as u}from"./p-BqNNwq6C.js";import{T as b,a as f,b as v,c as g,d as y,e as k,f as j,g as C,h as w,i as _,j as T,k as S,l as O}from"./p-BICxxa69.js";import{T as D}from"./p-CZfYo5-1.js";import{B as P,a as I}from"./p-CHw7tICr.js";import{a6 as x,a7 as A}from"./p-CPKMvyV_.js";import{k as B}from"./p-BRnBHsdq.js";import{o as N,g as q}from"./p-Dw63wyhO.js";import"./p-B6YPrwyC.js";import"./p-CYQvLgSs.js";import"./p-D8GTwl9v.js";import"./p-CqiVXthx.js";const E={nickname:()=>t("th",{part:x,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:x,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:x,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:x,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:x,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:x,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:x,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:x,scope:"col",title:"The current status of each terminal"},"Status")},H={nickname:(e,i)=>t("td",{part:A(i)},e.nickname),model_name:(e,i)=>t("td",{part:A(i)},e.model_name),id:(e,i)=>t("td",{part:A(i)},e.id),provider:(e,i)=>t("td",{part:A(i)},B(e.provider)),provider_serial_number:(e,i)=>t("td",{part:A(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:A(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:A(i)},e.sub_account_name),status:(e,i)=>t("td",{part:A(i)},t(I,Object.assign({},{connected:{variant:P.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:P.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:P.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:P.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:P.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},L=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new b(this.terminals,this.columns,E,H),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),N("set",(()=>{this.pagingParams={}})),N("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 l}))}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=q();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){let t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(u,{key:"6388e9b0b7c6dcedc9f3db534d3a30d0a748929c"},t(f,{key:"e11b994e16e657aaaa7c6f29197865d0d6bfd1ba"},t(v,{key:"340980f75fef37841907835378d9c0ced1992b5c"},t(g,{key:"fdd3d1569b6a3df9d5d31fb2cc602ab054529fc6"},t(y,{key:"440d602ac5746635f92445c6216c807b9b13517e"},this.terminalsTable.columnData.map((t=>t)))),t(k,{key:"ccef66a47be1cfca09f10d450fb7eeaf241a17e0"},t(j,{key:"aea6e2f33e07c717f50065c12211f9f2d9266bec",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"7c92ba6cd398bae23587a2e1771bba7b75dc680c",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(w,{key:"3155cf655f5b8e4290e8cabdcdbd534159f22ddd",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(T,{key:"da9172d4bf4439456894b53a0cf13a82081909f0"},t(S,{key:"e6c0847dc330a0e32228f2020d22bbaf0e4ad439"},t(O,{key:"6761f623d70d13b13e92ec73c9b936d5bf85dd70",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"4b490b5834be42664ebbc27b7c7a1b0c10bd433b",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{L as justifi_terminals_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,h as i}from"./p-CV0Pyo1O.js";import{J as o}from"./p-
|
|
1
|
+
import{r as s,h as i}from"./p-CV0Pyo1O.js";import{J as o}from"./p-DO9lqnbB.js";import{c as r}from"./p-DjjAx7PF.js";import{w as t}from"./p-DVJaoI_m.js";import{S as a}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import"./p-B6YPrwyC.js";import"./p-CYQvLgSs.js";import"./p-BRnBHsdq.js";import"./p-HXpYMWUU.js";import"./p-NZS8uCtH.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D8GTwl9v.js";const p=class{constructor(i){s(this,i)}async componentWillLoad(){await t(),r(),this.analytics=new o(this)}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}async getValues(){var s,i;return null!==(i=null===(s=this.bankAccountBillingFormSimpleRef)||void 0===s?void 0:s.getValues())&&void 0!==i?i:{}}async validate(){var s,i;return null!==(i=null===(s=this.bankAccountBillingFormSimpleRef)||void 0===s?void 0:s.validate())&&void 0!==i?i:{isValid:!1,errors:{}}}render(){return i(a,{key:"1ed5d8cfc7f594e00f01fc765c3e04acd80b90a9"},i("bank-account-billing-form-simple",{key:"2058a974df2f57da2c731d2d5a78799ac5de0e41",legend:this.legend,ref:s=>this.bankAccountBillingFormSimpleRef=s}))}};export{p as justifi_bank_account_billing_form_simple}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{A as e}from"./p-CYQvLgSs.js";import{C as r,e as o}from"./p-NZS8uCtH.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as a,a as n}from"./p-Cm9f5fyh.js";import{J as c}from"./p-DO9lqnbB.js";import{c as l}from"./p-DjjAx7PF.js";import{c as h}from"./p-BArmtmkq.js";import{p as d,f as p,r as u,j as v}from"./p-BRnBHsdq.js";import{v as m,i as y,a as f,H as j}from"./p-D-zwk1J3.js";import{t as _,z as g}from"./p-CPKMvyV_.js";import{S as w}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as C}from"./p-uZ5KAseb.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-B6YPrwyC.js";import"./p-DkoufM1t.js";import"./p-HXpYMWUU.js";const b=e();class k{async fetchQuote(s,t){return b.post({endpoint:"insurance/quotes",body:t,authToken:s})}async toggleCoverage(s,t,i){return b.post({endpoint:`insurance/quotes/${t}/toggle`,body:i,authToken:s})}}const q=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(C,{width:"35%",height:"30px"})),s("div",{class:"col-12"},s(C,{width:"70%"})),s("div",{class:"col-12"},s(C,{width:"40%"})),s("div",{class:"col-12"},s(C,{width:"40%"})),s("div",{class:"col-12"},s(C,{width:"100%"})),s("div",{class:"col-12"},s(C,{width:"80%"}))),T=class{constructor(s){t(this,s),this.insuranceUpdated=i(this,"insurance-updated",7),this.errorEvent=i(this,"error-event",7),this.isLoading=!0}async validate(){return m()}processHTMLContent(s){return d(s,[s=>u(s,"style"),s=>v(s,"a","part",_),s=>v(s,"p","part",_)])}componentWillLoad(){l(),this.analytics=new c(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeServiceMethods(){const s=this.authToken||h.authToken;if(!s)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:r.ERROR});const t={authToken:s,service:new k};this.getQuote=(({authToken:s,service:t})=>async({payload:i,onSuccess:e,onError:o})=>{var c;try{const l=await t.fetchQuote(s,i);if(l.error)return o({error:n(l.error),code:a(null===(c=l.error)||void 0===c?void 0:c.code),severity:r.ERROR});e({quote:l.data})}catch(s){const t=a(null==s?void 0:s.code);return o({error:s.message||s,code:t,severity:r.ERROR})}})(t),this.toggleCoverage=(({authToken:s,service:t})=>async({quoteId:i,payload:e,onSuccess:o,onError:c})=>{var l;try{const h=await t.toggleCoverage(s,i,e);if(h.error)return c({error:n(h.error),code:a(null===(l=h.error)||void 0===l?void 0:l.code),severity:r.ERROR});o({quote:h.data})}catch(s){const t=a(null==s?void 0:s.code);return c({error:s.message||s,code:t,severity:r.ERROR})}})(t)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||h.checkoutId,policy_type:"season_interruption",primary_identity:{state:this.primaryIdentityState,email:this.primaryIdentityEmailAddress,first_name:this.primaryIdentityFirstName,last_name:this.primaryIdentityLastName,postal_code:this.primaryIdentityPostalCode,country:this.primaryIdentityCountry},policy_attributes:{insurable_amount:this.policyAttributesInsurableAmount,start_date:this.policyAttributesStartDate,end_date:this.policyAttributesEndDate,covered_identity:{first_name:this.coveredIdentityFirstName,last_name:this.coveredIdentityLastName}}},onSuccess:({quote:s})=>{this.quote=s,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),y[s.policy_type]=s.accepted,this.isLoading=!1},onError:({error:s,code:t,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}onChangeHandler(s,t){this.accepted=t,f[this.quote.policy_type]=!1,this.toggleCoverage({quoteId:this.quote.id,payload:{accepted:this.accepted},onSuccess:()=>{this.insuranceUpdated.emit(),y[this.quote.policy_type]=this.accepted},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}get error(){var s;return f[null===(s=this.quote)||void 0===s?void 0:s.policy_type]}render(){var t,i,e,r;return h&&!1===h.insuranceEnabled?(console.warn("[justifi-season-interruption-insurance] Insurance is disabled for this checkout (payment_settings.insurance_payments=false)."),null):s(w,null,this.isLoading?s(q,null):s("div",null,s(j,{text:null===(t=this.quote)||void 0===t?void 0:t.product.title,class:"fs-5 fw-bold pb-3"}),s("small",{part:_,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),s("form-control-radio",{label:`Accept coverage for ${p(null===(e=this.quote)||void 0===e?void 0:e.total_cents)}`,name:"opt-in",value:"true",checked:"true"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),s("form-control-radio",{label:"Decline coverage",name:"opt-in",value:"false",checked:"false"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),s("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:g},"Please select an option"),s("small",{part:_,innerHTML:null===(r=this.quote)||void 0===r?void 0:r.product.legal_disclaimer})))}};export{T as justifi_season_interruption_insurance}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-nb_LhbJq.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{b as i,C as r,e as o}from"./p-NZS8uCtH.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as h,a as p}from"./p-Cm9f5fyh.js";import{J as c}from"./p-
|
|
1
|
+
import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-nb_LhbJq.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{b as i,C as r,e as o}from"./p-NZS8uCtH.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as h,a as p}from"./p-Cm9f5fyh.js";import{J as c}from"./p-DO9lqnbB.js";import{c as d}from"./p-DjjAx7PF.js";import{S as m}from"./p-BqNNwq6C.js";import{T as f,a as l,b as u,c as y,d as b,e as g,f as v,g as j,h as C,i as _,j as k,k as w,l as T}from"./p-BICxxa69.js";import{T as P}from"./p-CZfYo5-1.js";import{M as D}from"./p-D1_eip6x.js";import{a as S}from"./p-BRnBHsdq.js";import{a6 as O,a7 as x}from"./p-CPKMvyV_.js";import{o as B,g as I}from"./p-Dm07nLGs.js";import"./p-CYQvLgSs.js";import"./p-D8GTwl9v.js";import"./p-B6YPrwyC.js";import"./p-CqiVXthx.js";import"./p-CHw7tICr.js";const A={created_at:()=>t("th",{part:O,scope:"col",title:"The date and time each payment was made"},"Date"),amount:()=>t("th",{part:O,scope:"col",title:"The dollar amount of each payment"},"Amount"),status:()=>t("th",{part:O,scope:"col",title:"The current status of each payment"},"Status"),payment_type:()=>t("th",{part:O,scope:"col",title:"The type of each payment"},"Type"),description:()=>t("th",{part:O,scope:"col",title:"The payment description, if you provided one"},"Description"),payers_name:()=>t("th",{part:O,scope:"col",title:"The name associated with the payment method"},"Account Holder"),last_four_digits:()=>t("th",{part:O,scope:"col",title:"The brand and last 4 digits of the payment method"},"Payment Method"),card_brand:()=>t("th",{part:O,scope:"col",title:"The brand of the payment method"},"Card Brand")},q={created_at:(e,a)=>t("td",{part:x(a)},t("div",{class:"fw-bold"},S(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.created_at,{showTime:!0}))),amount:(e,a)=>t("td",{part:x(a)},e.formattedPaymentAmount(e.amount)),status:(e,a)=>t("td",{part:x(a)},D(e.status)),payment_type:(e,a)=>t("td",{part:x(a)},e.payment_type),description:(e,a)=>t("td",{part:x(a)},e.description),payers_name:(e,a)=>t("td",{part:x(a)},e.payers_name),last_four_digits:(e,a)=>t("td",{part:x(a)},e.last_four_digits),card_brand:(e,a)=>{var s,i,r;return t("td",{part:x(a)},(r=(null===(s=e.payment_method.card)||void 0===s?void 0:s.brand)||(null===(i=e.payment_method.bank_account)||void 0===i?void 0:i.brand))?{visa:"VISA",mastercard:"Mastercard",american_express:"American Express",discover:"Discover",diners_club:"Diners Club",jcb:"JCB",china_unionpay:"China UnionPay",unknown:"Unknown"}[r.toLowerCase()]||r:"N/A")}},E=class{constructor(t){e(this,t),this.errorEvent=a(this,"error-event",7),this.clickEvent=a(this,"click-event",7),this.errorMessage=null,this.payments=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payment_type,description,payers_name,last_four_digits,card_brand",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.payments.find((t=>t.id===e));this.clickEvent.emit({name:P.row,data:a})}}componentWillLoad(){d(),this.analytics=new c(this),this.paymentsTable=new f(this.payments,this.columns,A,q),this.initializeGetPayments(),B("set",(()=>{this.pagingParams={},this.errorMessage=""})),B("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPayments()}updateOnPropChange(){this.fetchData()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:t,authToken:e,service:a})=>async({params:s,onSuccess:o,onError:n,final:c})=>{var d,m;try{const c=await a.fetchPayments(t,e,s);if(c.error)return n({error:p(c.error),code:h(null===(m=c.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},c.page_info);o({payments:(null===(d=c.data)||void 0===d?void 0:d.map((t=>new i(t))))||[],pagingInfo:t})}}catch(t){const e=h(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:r.ERROR})}finally{return c()}})({id:this.accountId,authToken:this.authToken,service:new s}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}fetchData(){this.getPayments&&(this.loading=!0,this.getPayments({params:this.paymentParams,onSuccess:({payments:t,pagingInfo:e})=>{this.payments=t,this.paging=e,this.paymentsTable.collectionData=this.payments},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:a})},final:()=>{this.loading=!1}}))}get paymentParams(){const t=I();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.payments.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.paymentsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(m,{key:"66f641cbde94ea4332bef30308047ecc98cf6476"},t(l,{key:"5d5d4190722ddf09e31de6d680b3df248b41325c"},t(u,{key:"b5ab4878004d4911129941cd48a85564cada1f87"},t(y,{key:"14aeb8df18cdde57c028d741f11a011060c0b1b4"},t(b,{key:"ba5a4643b5fff9c0f9975ae5d350f9db8cc5d7b2"},this.paymentsTable.columnData.map((t=>t)))),t(g,{key:"0b26316eb9193cab9001a31a7f268cd5156d13e3"},t(v,{key:"37c3545775d6e1586af72baf195f6a861fba0081",columnSpan:this.paymentsTable.columnData.length,isLoading:this.loading}),t(j,{key:"e3cde204ba86bab4813d6a06f948532c30271bb9",isEmpty:this.showEmptyState,columnSpan:this.paymentsTable.columnData.length}),t(C,{key:"202602af08813968a81743c8966ecb17e3a67043",columnSpan:this.paymentsTable.columnData.length,errorMessage:this.errorMessage}),this.showRowData&&this.paymentsTable.rowData.map(((e,a)=>t(_,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"b59fa3315491975cf7e5dd0ec26a4b1e0574438c"},t(w,{key:"e974cf1d3ec92fa89139982030791d69e6d02b10"},t(T,{key:"74405261ad2cae3dc6267aab06ec1dd81f4d4ba8",colSpan:this.paymentsTable.columnData.length},t("pagination-menu",{key:"cdcca8506afafb661d0c90ffe9a09f41f94a0862",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayments:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{E as justifi_payments_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={name:"@justifi/webcomponents",version:"6.12.5"};export{e as p}
|