@justifi/webcomponents 5.7.6-rc-08 → 5.7.6-rc-10
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/{check-pkg-version-PeSbhLdJ.js → check-pkg-version-IzJ0mvZl.js} +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-apple-pay.cjs.entry.js +5 -3
- package/dist/cjs/justifi-bank-account-form_5.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-button_5.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +2 -2
- package/dist/cjs/{package-CRFlBTFJ.js → package-POr6jwdT.js} +1 -1
- package/dist/collection/api/services/apple-pay.service.js +1 -0
- package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +5 -4
- package/dist/docs.json +3 -3
- package/dist/esm/{check-pkg-version-C2I-noS-.js → check-pkg-version-BMqLB5Pf.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/justifi-apple-pay.entry.js +5 -3
- package/dist/esm/justifi-bank-account-form_5.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +2 -2
- package/dist/esm/justifi-button_5.entry.js +2 -2
- package/dist/esm/justifi-checkout.entry.js +2 -2
- package/dist/esm/justifi-checkouts-list.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +2 -2
- package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-order-terminals.entry.js +2 -2
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +2 -2
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-refund-payment.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
- package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +2 -2
- package/dist/esm/justifi-tokenize-payment-method.entry.js +2 -2
- package/dist/esm/{package-C3HuV_kf.js → package-Dm6cO_sz.js} +1 -1
- package/dist/module/justifi-apple-pay.js +5 -3
- package/dist/module/package.js +1 -1
- package/dist/types/components.d.ts +2 -2
- package/dist/webcomponents/{p-58395028.entry.js → p-03c23cfa.entry.js} +1 -1
- package/dist/webcomponents/{p-a5fa79cd.entry.js → p-07ffadd2.entry.js} +1 -1
- package/dist/webcomponents/{p-0307ecb2.entry.js → p-18579165.entry.js} +1 -1
- package/dist/webcomponents/{p-d2b3c6ee.entry.js → p-18ecd1f2.entry.js} +1 -1
- package/dist/webcomponents/{p-27d89548.entry.js → p-1c97fd0e.entry.js} +1 -1
- package/dist/webcomponents/{p-2b8dbdb0.entry.js → p-2ddd395b.entry.js} +1 -1
- package/dist/webcomponents/{p-9eeb7e9a.entry.js → p-47b483b1.entry.js} +1 -1
- package/dist/webcomponents/{p-aa189ce4.entry.js → p-4bdb9032.entry.js} +1 -1
- package/dist/webcomponents/{p-4e3a86c7.entry.js → p-4c3418cf.entry.js} +1 -1
- package/dist/webcomponents/p-50cfc8dc.entry.js +1 -0
- package/dist/webcomponents/{p-0218759e.entry.js → p-6eefb8e7.entry.js} +1 -1
- package/dist/webcomponents/{p-314d08be.entry.js → p-6f20e64c.entry.js} +1 -1
- package/dist/webcomponents/p-7bdc49bb.entry.js +1 -0
- package/dist/webcomponents/{p-d5d1d3b2.entry.js → p-7c91535d.entry.js} +1 -1
- package/dist/webcomponents/p-86c5e67a.entry.js +1 -0
- package/dist/webcomponents/{p-cc035e82.entry.js → p-8eca1602.entry.js} +1 -1
- package/dist/webcomponents/p-Dm6cO_sz.js +1 -0
- package/dist/webcomponents/{p-C1nBLmHv.js → p-VDUjfAoW.js} +1 -1
- package/dist/webcomponents/{p-56f5955a.entry.js → p-ac692297.entry.js} +1 -1
- package/dist/webcomponents/{p-1f97fb2d.entry.js → p-ba2e7384.entry.js} +1 -1
- package/dist/webcomponents/{p-e94800a2.entry.js → p-d13463ed.entry.js} +1 -1
- package/dist/webcomponents/{p-356f86cb.entry.js → p-d6a7b016.entry.js} +1 -1
- package/dist/webcomponents/{p-2131451b.entry.js → p-e3cdf53e.entry.js} +1 -1
- package/dist/webcomponents/{p-1306cc29.entry.js → p-e93a7c34.entry.js} +1 -1
- package/dist/webcomponents/{p-728012cb.entry.js → p-f1bc2d45.entry.js} +1 -1
- package/dist/webcomponents/{p-513c3232.entry.js → p-f5b700a1.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-11719182.entry.js +0 -1
- package/dist/webcomponents/p-C3HuV_kf.js +0 -1
- package/dist/webcomponents/p-bc94f43a.entry.js +0 -1
- package/dist/webcomponents/p-ffebee17.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as a}from"./p-kpoIU4v_.js";import{c as d,J as i}from"./p-
|
|
1
|
+
import{r as e,c as t,h as a}from"./p-kpoIU4v_.js";import{c as d,J as i}from"./p-VDUjfAoW.js";import{c as s}from"./p-BYakc1Om.js";import{d as c}from"./p-D3G5aVLy.js";import{P as o}from"./p-BDUTtU21.js";import{S as f}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import"./p-Dm6cO_sz.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-7MWRbTXI.js";const h={bankAccount:"New bank account",card:"New credit or debit card"},r=class{constructor(a){e(this,a),this.errorEvent=t(this,"error-event"),this.loadedEvent=t(this,"loaded"),this.submitEvent=t(this,"submit-event"),this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.paymentMethodOptions=[],this.savePaymentMethod=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){d(),this.analytics=new i(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}savePaymentMethodChanged(e){this.savePaymentMethod=e.detail}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){this.isSubmitting=!1,console.error("checkout error",e.detail)}paymentMethodOptionSelected(e){s.selectedPaymentMethod=e.detail.id}async fillBillingForm(e){s.billingFormFields=e}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){s.checkoutId=this.checkoutId,s.authToken=this.authToken,s.disableCreditCard=this.disableCreditCard,s.disableBankAccount=this.disableBankAccount,s.disableBnpl=this.disableBnpl,s.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){this.isSubmitting=!0,this.modularCheckoutRef.submitCheckout(s.billingFormFields)}get canSavePaymentMethod(){return s.selectedPaymentMethod===o.card||s.selectedPaymentMethod===o.bankAccount}get showBillingForm(){return s.selectedPaymentMethod===o.card&&!this.hideCardBillingForm||s.selectedPaymentMethod===o.bankAccount&&!this.hideBankAccountBillingForm}get showBillingFormSection(){return s.selectedPaymentMethod===o.card||s.selectedPaymentMethod===o.bankAccount}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}get showPostalCodeForm(){return s.selectedPaymentMethod===o.card&&this.hideCardBillingForm}render(){return a(f,{key:"4fb1d82b065de6c1e4651a246a53f8e58451d6f6"},a("justifi-modular-checkout",{key:"232cf32890422f474cf929b7c7ed7246d7b39c75",ref:e=>this.modularCheckoutRef=e,authToken:this.authToken,checkoutId:this.checkoutId,savePaymentMethod:this.canSavePaymentMethod&&this.savePaymentMethod},a("div",{key:"677ad110b05520be3b729995657086f0f6cbf337",class:"row gy-3 jfi-checkout-core"},a("div",{key:"458c84541dd154dd8b4ad1d0f2320e2308cc1785",class:"col-12",part:c},a("justifi-header",{key:"440a7d1ad7b21da3db66e6c6f1f9afefb434a089",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),a("section",{key:"99bd431a8f70ce6e764cc04da3d0aaae6f0ebcbe"},a("justifi-checkout-summary",{key:"52da663e5bed35f0deb220800c7ede8835a3671b"}))),a("div",{key:"e95b1c6830d20c5af57c558badb04d07d3c48f23",class:"col-12 mt-4"},a("slot",{key:"527d58d4806d2e1bbcba499e97ab65f6c9c7efb9",name:"insurance"})),a("div",{key:"69d1319d1e05852de4f5566ad3be20bc9a6ee499",class:"col-12 mt-4"},a("justifi-header",{key:"1682f909f22172a44da54118aefe428f92908e91",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&a("justifi-header",{key:"7942a12143bea0235705969737e11d59bc5180e1",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),a("div",{key:"497664d455695693c4f9a1a4465c62ad4d5b6bdf",class:"d-flex flex-column"},a("section",{key:"d3da4c18b430e1b36f7b9ba20be517994e763b5e"},a("div",{key:"1cc0f0462a0f70d2acc4c9fdee25fbb2fe953c22"},a("justifi-saved-payment-methods",{key:"576da27df84d67bc69f2d95f00a6c440fa73f7ed"}),a("justifi-sezzle-payment-method",{key:"6544a3a250ee012870a9edce71dd763553d44554"}),!this.disableCreditCard&&a("div",{key:"79050f768d8d76c4d882bed667e85391c230a960"},a("payment-method-option",{key:"5a6c1dc583766707e6215203fdba176bd65b501d",paymentMethodOptionId:o.card,isSelected:s.selectedPaymentMethod===o.card,clickHandler:()=>{s.selectedPaymentMethod=o.card},radioButtonHidden:this.disableCreditCard,label:h[o.card]}),s.selectedPaymentMethod===o.card&&a("div",{key:"5e6f0b854191a9a5db8936b2e30518fba251e478",class:"mt-4 mb-4"},a("justifi-card-form",{key:"6c3f72f27dfe36924fe94ab4f7c79b6b9ff19b47"}))),!this.disableBankAccount&&a("div",{key:"f6a88103b2c30e4dd10e733b19aaa29a7a44430c"},a("payment-method-option",{key:"67ef047a8caad5bc389238d54bb3d7056ca4b9e6",paymentMethodOptionId:o.bankAccount,isSelected:s.selectedPaymentMethod===o.bankAccount,clickHandler:()=>{s.selectedPaymentMethod=o.bankAccount},radioButtonHidden:this.disableBankAccount,label:h[o.bankAccount]}),s.selectedPaymentMethod===o.bankAccount&&a("div",{key:"e67924184fc43811523081711f59865a01d7cf9f",class:"mt-4 mb-4"},a("justifi-bank-account-form",{key:"a01cdfe8be1bc98d4c0f75c2a9f2ca1cce519042"}))))))),this.showBillingFormSection&&a("div",{key:"a15f1202548c7d6c302c2b2827168a6a119f8634",class:"col-12 mt-4"},this.showBillingForm&&a("justifi-header",{key:"ee654c812cb097449937da4253e191de1ee669d5",text:"Billing Address",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPostalCodeForm&&a("justifi-postal-code-form",{key:"2a5736e6da3354f7a9d1a5b8870a2f61c09c2592"}),this.showBillingForm&&a("justifi-billing-information-form",{key:"7dd63931e75d7583b4f51a1f6bb2b1e84a46e078"})),a("div",{key:"54aeb0f07f574ee004ec02cd279265202cffa9bf",class:"col-12"},this.canSavePaymentMethod&&a("justifi-save-new-payment-method",{key:"2e010be22091cee1ebc4353d5dac3b49639175e7"})),a("div",{key:"71df812c8a922ae8b447d647f69675230c092db9",class:"mt-4"},a("justifi-button",{key:"057cd18c6235c73cc69ca85e9cb35a2a614a4d9a",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disableBnpl:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{r as justifi_checkout}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s,r as i,c as t}from"./p-kpoIU4v_.js";import{c as r,F as e}from"./p-CR9D6mKt.js";import{b as o,a}from"./p-DSP8qjHL.js";import{i as p,a as h}from"./p-PgEzcvI6.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{C as n,a as m}from"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import{B as l,b as c}from"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{c as d,J as j}from"./p-
|
|
1
|
+
import{h as s,r as i,c as t}from"./p-kpoIU4v_.js";import{c as r,F as e}from"./p-CR9D6mKt.js";import{b as o,a}from"./p-DSP8qjHL.js";import{i as p,a as h}from"./p-PgEzcvI6.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{C as n,a as m}from"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import{B as l,b as c}from"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{c as d,J as j}from"./p-VDUjfAoW.js";import{B as u}from"./p-Cm_ywVHL.js";import{S as f}from"./p-CRFzwZW6.js";import{H as v}from"./p-Cc27pPPQ.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-Bz8JT676.js";import{B as g}from"./p-XYgDHrVL.js";import{m as w,b as C}from"./p-5aA7gjr5.js";import{B as y}from"./p-DVPcHdzq.js";import"./p-BFTU3MAI.js";import"./p-CYBR4K2p.js";import"./p-BX8GieXu.js";import"./p-yH3TC3ZQ.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-Dm6cO_sz.js";import"./p-Dj1uo4J3.js";import"./p-D3G5aVLy.js";import"./p-D2muobcE.js";const B=r(Object.assign(Object.assign({},o().fields),{legal_address:h(),additional_questions:a(),representative:p("representative")})),D=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"25%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"50%"}),s(b,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"65%"}),s(b,{width:"35%"}))),S=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(b,{width:"40%",height:"40px"})),s(D,null),s(D,null),s(D,null)),k=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event"),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.isLoading=!1,this.isSaving=!1,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new l(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new l(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){d(),this.analytics=new j(this),this.formController=new e(B),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=w({authToken:this.authToken,businessId:this.businessId,service:new y}),this.patchBusiness=C({authToken:this.authToken,businessId:this.businessId,service:new y}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:m.MISSING_PROPS,severity:n.ERROR})}handleReponse(s){s.error&&(this.errorMessage=c.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(f,null,this.isLoading?s(S,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(v,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(u,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:g.submit}),isLoading:this.isSaving},"Submit")))))}};export{k as justifi_business_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,c as s,H as i,g as o}from"./p-kpoIU4v_.js";import{S as r}from"./p-CRFzwZW6.js";import{B as a}from"./p-Cm_ywVHL.js";import{z as c,r as d}from"./p-D3G5aVLy.js";import{f as h}from"./p-B7jE0g5_.js";import{c as n,o as l}from"./p-BYakc1Om.js";import"./p-CZfYo5-1.js";import{H as p}from"./p-Cc27pPPQ.js";import{H as u,b as m,i as y}from"./p-vHbP4g3Q.js";import{H as f}from"./p-CLjv4frq.js";import{J as v,c as b}from"./p-C1nBLmHv.js";import"./p-9y5MOK55.js";import{C as k,a as j,b as C}from"./p-Cjcsf8ku.js";import{I as g}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as P,a as _}from"./p-D2muobcE.js";import{C as w}from"./p-C0EFqY0W.js";import"./p-7WIgS5RM.js";import"./p-C3HuV_kf.js";import"./p-Dj1uo4J3.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const L=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return t(r,{key:"89057d5d72b67b613e4846165ea8d2bf5c79482d"},t(a,{key:"2bfa0c22898e703a36fb59b1060da35b362f6efa",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},A=class{constructor(t){e(this,t)}render(){return t(r,{key:"dbe9b02315fe34f0765b04d1f56758eeafbec247"},t("section",{key:"8d55dbe1ed13f4d565eac71600dc53c4d29f9d2f"},t("div",{key:"d3b27f48a23b448680abae596531905ea198b4b0"},t("div",{key:"1df204481e044414825de33640d3b13e73bd44a2",part:c},null==n?void 0:n.paymentDescription),t("div",{key:"7734088f6171a77e56cbf3434de7a892949812d4"},t("span",{key:"ed855b2d6f02d316dcdc5e8c6d3309b4919c560e",part:c},"Total")," ",t("span",{key:"c352cf6089c2c4d8b2fc57776acd45991880fe3f",part:c},h(+(null==n?void 0:n.totalAmount)))))))}},E=class{constructor(t){e(this,t),this.levels={h1:p,h2:u,h3:f},this.level="h1"}render(){return t(r,{key:"0ea6499e12267cc11baa3e88b24b06aae5add667"},t(this.levels[this.level],{key:"d2e1d462e946d129890187b320db0b8006f505f7",text:this.text,class:this.class}))}},M=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event"),this.submitEvent=s(this,"submit-event"),this.paymentMethodChangedEvent=s(this,"payment-method-changed"),this.savePaymentMethod=!1,this.handleApplePayCompleted=e=>{const{success:t,token:s,error:i}=e.detail;t&&s?(this.applePayToken=s,this.submitCheckoutWithApplePay()):(console.error("Apple Pay completed but failed:",i),this.errorEvent.emit({message:(null==i?void 0:i.message)||"Apple Pay payment failed",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR}))},this.handleApplePayError=e=>{const{error:t}=e.detail;console.error("Apple Pay error:",t),this.errorEvent.emit({message:t||"Apple Pay error occurred",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})},this.handleApplePayCancelled=()=>{console.log("Apple Pay cancelled by user"),this.applePayToken=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),n.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new w};this.getCheckout=(({authToken:e,checkoutId:t,service:s})=>async({onSuccess:i,onError:o})=>{var r;try{const a=await s.fetchCheckout(e,t);if(a.error)return o({error:_(a.error),code:P(null===(r=a.error)||void 0===r?void 0:r.code),severity:k.ERROR});i({checkout:a.data})}catch(e){const t=P(null==e?void 0:e.code);return o({error:e.message||e,code:t,severity:k.ERROR})}})(e),this.completeCheckout=(({authToken:e,checkoutId:t,service:s})=>async({payment:i,onSuccess:o,onError:r})=>{var a;try{const c=await s.complete(e,t,i);if(c.error)return r({error:_(c.error),code:P(null===(a=c.error)||void 0===a?void 0:a.code),severity:k.ERROR});o({checkout:c.data})}catch(e){const t=P(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:k.ERROR})}})(e),l("selectedPaymentMethod",(e=>{this.paymentMethodChangedEvent.emit(e)}))}componentWillLoad(){this.authToken&&this.checkoutId?(this.analytics=new v(this),b(),n.authToken=this.authToken,this.fetchCheckout(),m("set",(e=>{void 0!==y[e]&&this.fetchCheckout()}))):this.errorEvent.emit({message:C.NOT_AUTHENTICATED,errorCode:j.NOT_AUTHENTICATED,severity:k.ERROR})}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.getCheckout&&this.getCheckout({onSuccess:({checkout:e})=>{e.status!==g.completed?e.status!==g.expired?this.updateStore(e):this.errorEvent.emit({message:C.CHECKOUT_EXPIRED,errorCode:j.CHECKOUT_EXPIRED,severity:k.ERROR}):this.errorEvent.emit({message:C.CHECKOUT_ALREADY_COMPLETED,errorCode:j.CHECKOUT_ALREADY_COMPLETED,severity:k.ERROR})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.FETCH_ERROR,severity:k.ERROR})}})}updateStore(e){var t,s,i,o;n.accountId=e.account_id,n.paymentMethods=e.payment_methods,n.paymentMethodGroupId=e.payment_method_group_id,n.paymentDescription=e.payment_description,n.totalAmount=e.total_amount,n.paymentAmount=e.payment_amount,n.bnplEnabled=e.payment_settings.bnpl_payments,n.bnplProviderClientId=null===(t=null==e?void 0:e.bnpl)||void 0===t?void 0:t.provider_client_id,n.bnplProviderMode=null===(s=null==e?void 0:e.bnpl)||void 0===s?void 0:s.provider_mode,n.bnplProviderApiVersion=null===(i=null==e?void 0:e.bnpl)||void 0===i?void 0:i.provider_api_version,n.bnplProviderCheckoutUrl=null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.provider_checkout_url}queryFormRefs(){this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form"),this.billingInformationFormRef=this.hostEl.querySelector("justifi-billing-information-form, justifi-postal-code-form"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance"),this.sezzlePaymentMethodRef=this.hostEl.querySelector("justifi-sezzle-payment-method"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async submitCheckoutWithApplePay(){this.applePayToken?this.completeCheckout({payment:{payment_mode:"apple_pay",payment_token:this.applePayToken},onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Apple Pay checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}}):this.errorEvent.emit({message:"No Apple Pay token available",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})}async tokenizePaymentMethod(e){var t,s;const i=null!==(s=await(null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.getValues()))&&void 0!==s?s:{},o=Object.assign(Object.assign({},e),i),r=Object.assign({accountId:n.accountId,payment_method_group_id:void 0},o);return this.savePaymentMethod&&(r.payment_method_group_id=n.paymentMethodGroupId),this.paymentMethodFormRef.tokenize({clientId:this.authToken,paymentMethodMetadata:r,account:n.accountId})}async getPaymentMethod(e){if(this.applePayToken)return"apple_pay_token";if(!this.paymentMethodFormRef)return n.selectedPaymentMethod;const{error:t,id:s}=await this.tokenizePaymentMethod(e);if(!t)return s;this.errorEvent.emit({errorCode:t.code,message:t.message,severity:k.ERROR})}async validate(){var e,t;if(this.applePayToken)return!0;const s=[null===(e=this.paymentMethodFormRef)||void 0===e?void 0:e.validate(),null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.validate()];return this.insuranceFormRef&&s.push(this.insuranceFormRef.validate()),(await Promise.all(s)).every((e=>!1!==(null==e?void 0:e.isValid)))}async submitCheckout(e){var t;if(this.applePayToken)return void await this.submitCheckoutWithApplePay();if(!await this.validate())return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:j.VALIDATION_ERROR,severity:k.ERROR});let s;if("sezzle"===n.selectedPaymentMethod){const e=this.insuranceFormRef?await this.insuranceFormRef.validate():{isValid:!0},i=await this.sezzlePaymentMethodRef.resolvePaymentMethod(e);if(i.error)return void this.errorEvent.emit({message:i.error.message,errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});"success"===(null===(t=i.bnpl)||void 0===t?void 0:t.status)&&(s={payment_mode:"bnpl",payment_token:void 0})}else{const t=await this.getPaymentMethod(e);if(!t)return void this.errorEvent.emit({message:"Payment method tokenization failed.",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});s={payment_mode:"ecom",payment_token:t}}this.completeCheckout({payment:s,onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}})}async setSelectedPaymentMethod(e){n.selectedPaymentMethod=e}render(){return t(i,{key:"307608e8cd41e1c262dbca6cda7b0bfc8855dedf"})}get hostEl(){return o(this)}},H=class{constructor(t){e(this,t)}render(){return t(r,{key:"e9069cbe6668585daa972c3d226ef2a901a0b003",class:"payment-method"},t("div",{key:"9ec14865488d43f8007c481a8ba030b5415abf96",class:"radio-list-item p-3",part:d,onClick:this.clickHandler,hidden:this.radioButtonHidden},t("form-control-radio",{key:"146ee9bc2cfc57192db519643f18ed672ac12e77",name:"paymentMethodType",value:this.paymentMethodOptionId,checked:this.isSelected,label:this.label})))}};export{L as justifi_button,A as justifi_checkout_summary,E as justifi_header,M as justifi_modular_checkout,H as payment_method_option}
|
|
1
|
+
import{r as e,h as t,c as s,H as i,g as o}from"./p-kpoIU4v_.js";import{S as r}from"./p-CRFzwZW6.js";import{B as a}from"./p-Cm_ywVHL.js";import{z as c,r as d}from"./p-D3G5aVLy.js";import{f as h}from"./p-B7jE0g5_.js";import{c as n,o as l}from"./p-BYakc1Om.js";import"./p-CZfYo5-1.js";import{H as p}from"./p-Cc27pPPQ.js";import{H as u,b as m,i as y}from"./p-vHbP4g3Q.js";import{H as f}from"./p-CLjv4frq.js";import{J as v,c as b}from"./p-VDUjfAoW.js";import"./p-9y5MOK55.js";import{C as k,a as j,b as C}from"./p-Cjcsf8ku.js";import{I as g}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as P,a as _}from"./p-D2muobcE.js";import{C as w}from"./p-C0EFqY0W.js";import"./p-7WIgS5RM.js";import"./p-Dm6cO_sz.js";import"./p-Dj1uo4J3.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const A=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return t(r,{key:"89057d5d72b67b613e4846165ea8d2bf5c79482d"},t(a,{key:"2bfa0c22898e703a36fb59b1060da35b362f6efa",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},E=class{constructor(t){e(this,t)}render(){return t(r,{key:"dbe9b02315fe34f0765b04d1f56758eeafbec247"},t("section",{key:"8d55dbe1ed13f4d565eac71600dc53c4d29f9d2f"},t("div",{key:"d3b27f48a23b448680abae596531905ea198b4b0"},t("div",{key:"1df204481e044414825de33640d3b13e73bd44a2",part:c},null==n?void 0:n.paymentDescription),t("div",{key:"7734088f6171a77e56cbf3434de7a892949812d4"},t("span",{key:"ed855b2d6f02d316dcdc5e8c6d3309b4919c560e",part:c},"Total")," ",t("span",{key:"c352cf6089c2c4d8b2fc57776acd45991880fe3f",part:c},h(+(null==n?void 0:n.totalAmount)))))))}},L=class{constructor(t){e(this,t),this.levels={h1:p,h2:u,h3:f},this.level="h1"}render(){return t(r,{key:"0ea6499e12267cc11baa3e88b24b06aae5add667"},t(this.levels[this.level],{key:"d2e1d462e946d129890187b320db0b8006f505f7",text:this.text,class:this.class}))}},M=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event"),this.submitEvent=s(this,"submit-event"),this.paymentMethodChangedEvent=s(this,"payment-method-changed"),this.savePaymentMethod=!1,this.handleApplePayCompleted=e=>{const{success:t,token:s,error:i}=e.detail;t&&s?(this.applePayToken=s,this.submitCheckoutWithApplePay()):(console.error("Apple Pay completed but failed:",i),this.errorEvent.emit({message:(null==i?void 0:i.message)||"Apple Pay payment failed",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR}))},this.handleApplePayError=e=>{const{error:t}=e.detail;console.error("Apple Pay error:",t),this.errorEvent.emit({message:t||"Apple Pay error occurred",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})},this.handleApplePayCancelled=()=>{console.log("Apple Pay cancelled by user"),this.applePayToken=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),n.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new w};this.getCheckout=(({authToken:e,checkoutId:t,service:s})=>async({onSuccess:i,onError:o})=>{var r;try{const a=await s.fetchCheckout(e,t);if(a.error)return o({error:_(a.error),code:P(null===(r=a.error)||void 0===r?void 0:r.code),severity:k.ERROR});i({checkout:a.data})}catch(e){const t=P(null==e?void 0:e.code);return o({error:e.message||e,code:t,severity:k.ERROR})}})(e),this.completeCheckout=(({authToken:e,checkoutId:t,service:s})=>async({payment:i,onSuccess:o,onError:r})=>{var a;try{const c=await s.complete(e,t,i);if(c.error)return r({error:_(c.error),code:P(null===(a=c.error)||void 0===a?void 0:a.code),severity:k.ERROR});o({checkout:c.data})}catch(e){const t=P(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:k.ERROR})}})(e),l("selectedPaymentMethod",(e=>{this.paymentMethodChangedEvent.emit(e)}))}componentWillLoad(){this.authToken&&this.checkoutId?(this.analytics=new v(this),b(),n.authToken=this.authToken,this.fetchCheckout(),m("set",(e=>{void 0!==y[e]&&this.fetchCheckout()}))):this.errorEvent.emit({message:C.NOT_AUTHENTICATED,errorCode:j.NOT_AUTHENTICATED,severity:k.ERROR})}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.getCheckout&&this.getCheckout({onSuccess:({checkout:e})=>{e.status!==g.completed?e.status!==g.expired?this.updateStore(e):this.errorEvent.emit({message:C.CHECKOUT_EXPIRED,errorCode:j.CHECKOUT_EXPIRED,severity:k.ERROR}):this.errorEvent.emit({message:C.CHECKOUT_ALREADY_COMPLETED,errorCode:j.CHECKOUT_ALREADY_COMPLETED,severity:k.ERROR})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.FETCH_ERROR,severity:k.ERROR})}})}updateStore(e){var t,s,i,o;n.accountId=e.account_id,n.paymentMethods=e.payment_methods,n.paymentMethodGroupId=e.payment_method_group_id,n.paymentDescription=e.payment_description,n.totalAmount=e.total_amount,n.paymentAmount=e.payment_amount,n.bnplEnabled=e.payment_settings.bnpl_payments,n.bnplProviderClientId=null===(t=null==e?void 0:e.bnpl)||void 0===t?void 0:t.provider_client_id,n.bnplProviderMode=null===(s=null==e?void 0:e.bnpl)||void 0===s?void 0:s.provider_mode,n.bnplProviderApiVersion=null===(i=null==e?void 0:e.bnpl)||void 0===i?void 0:i.provider_api_version,n.bnplProviderCheckoutUrl=null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.provider_checkout_url}queryFormRefs(){this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form"),this.billingInformationFormRef=this.hostEl.querySelector("justifi-billing-information-form, justifi-postal-code-form"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance"),this.sezzlePaymentMethodRef=this.hostEl.querySelector("justifi-sezzle-payment-method"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async submitCheckoutWithApplePay(){this.applePayToken?this.completeCheckout({payment:{payment_mode:"apple_pay",payment_token:this.applePayToken},onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Apple Pay checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}}):this.errorEvent.emit({message:"No Apple Pay token available",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})}async tokenizePaymentMethod(e){var t,s;const i=null!==(s=await(null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.getValues()))&&void 0!==s?s:{},o=Object.assign(Object.assign({},e),i),r=Object.assign({accountId:n.accountId,payment_method_group_id:void 0},o);return this.savePaymentMethod&&(r.payment_method_group_id=n.paymentMethodGroupId),this.paymentMethodFormRef.tokenize({clientId:this.authToken,paymentMethodMetadata:r,account:n.accountId})}async getPaymentMethod(e){if(this.applePayToken)return"apple_pay_token";if(!this.paymentMethodFormRef)return n.selectedPaymentMethod;const{error:t,id:s}=await this.tokenizePaymentMethod(e);if(!t)return s;this.errorEvent.emit({errorCode:t.code,message:t.message,severity:k.ERROR})}async validate(){var e,t;if(this.applePayToken)return!0;const s=[null===(e=this.paymentMethodFormRef)||void 0===e?void 0:e.validate(),null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.validate()];return this.insuranceFormRef&&s.push(this.insuranceFormRef.validate()),(await Promise.all(s)).every((e=>!1!==(null==e?void 0:e.isValid)))}async submitCheckout(e){var t;if(this.applePayToken)return void await this.submitCheckoutWithApplePay();if(!await this.validate())return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:j.VALIDATION_ERROR,severity:k.ERROR});let s;if("sezzle"===n.selectedPaymentMethod){const e=this.insuranceFormRef?await this.insuranceFormRef.validate():{isValid:!0},i=await this.sezzlePaymentMethodRef.resolvePaymentMethod(e);if(i.error)return void this.errorEvent.emit({message:i.error.message,errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});"success"===(null===(t=i.bnpl)||void 0===t?void 0:t.status)&&(s={payment_mode:"bnpl",payment_token:void 0})}else{const t=await this.getPaymentMethod(e);if(!t)return void this.errorEvent.emit({message:"Payment method tokenization failed.",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});s={payment_mode:"ecom",payment_token:t}}this.completeCheckout({payment:s,onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}})}async setSelectedPaymentMethod(e){n.selectedPaymentMethod=e}render(){return t(i,{key:"307608e8cd41e1c262dbca6cda7b0bfc8855dedf"})}get hostEl(){return o(this)}},z=class{constructor(t){e(this,t)}render(){return t(r,{key:"e9069cbe6668585daa972c3d226ef2a901a0b003",class:"payment-method"},t("div",{key:"9ec14865488d43f8007c481a8ba030b5415abf96",class:"radio-list-item p-3",part:d,onClick:this.clickHandler,hidden:this.radioButtonHidden},t("form-control-radio",{key:"146ee9bc2cfc57192db519643f18ed672ac12e77",name:"paymentMethodType",value:this.paymentMethodOptionId,checked:this.isSelected,label:this.label})))}};export{A as justifi_button,E as justifi_checkout_summary,L as justifi_header,M as justifi_modular_checkout,z as payment_method_option}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as s,c as t,h as r}from"./p-kpoIU4v_.js";import{P as i}from"./p-ObR0KZw0.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{C as o,a as e}from"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import{a as p}from"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as a,a as n}from"./p-D2muobcE.js";import{c as m,J as c}from"./p-VDUjfAoW.js";import{S as h}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{d as j}from"./p-B2csvKrZ.js";import"./p-Dj1uo4J3.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-Dm6cO_sz.js";import"./p-BvyiDejp.js";import"./p-DCDU6JB3.js";import"./p-D3G5aVLy.js";const d=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.columns=j,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){m(),this.analytics=new c(this),this.initializeGetPayments()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetPayments()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:s,authToken:t,service:r})=>async({params:i,onSuccess:e,onError:m,final:c})=>{var h,j;try{const c=await r.fetchPayments(s,t,i);if(c.error)return m({error:n(c.error),code:a(null===(j=c.error)||void 0===j?void 0:j.code),severity:o.ERROR});{const s=Object.assign({},c.page_info);e({payments:(null===(h=c.data)||void 0===h?void 0:h.map((s=>new p(s))))||[],pagingInfo:s})}}catch(s){const t=a(null==s?void 0:s.code);return m({error:s.message||s,code:t,severity:o.ERROR})}finally{return c()}})({id:this.accountId,authToken:this.authToken,service:new i}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}render(){return r(h,{key:"346d4f307320d44c5103a3d259bef61e08b4779b"},r("payments-list-core",{key:"9e5283017a8d56fd274754b81942e293686d874b",getPayments:this.getPayments,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_payments_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,r as e,c as i}from"./p-kpoIU4v_.js";import{S as s}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{S as n}from"./p-Bz8JT676.js";import{c as a,o}from"./p-BYakc1Om.js";import"./p-D3G5aVLy.js";import"./p-7WIgS5RM.js";var r,c,p,l;!function(t){t.STATUS_SUCCESS="STATUS_SUCCESS",t.STATUS_FAILURE="STATUS_FAILURE"}(r||(r={})),function(t){t.PLAIN="plain",t.BUY="buy",t.SET_UP="set-up",t.DONATE="donate",t.CHECK_OUT="check-out",t.BOOK="book",t.SUBSCRIBE="subscribe"}(c||(c={})),function(t){t.BLACK="black",t.WHITE="white",t.WHITE_OUTLINE="white-outline"}(p||(p={})),function(t){t.SUPPORTS_3DS="supports3DS",t.SUPPORTS_EMV="supportsEMV",t.SUPPORTS_CREDIT="supportsCredit",t.SUPPORTS_DEBIT="supportsDebit"}(l||(l={}));class h{constructor(t){this.merchantIdentifier=t.merchantIdentifier,this.displayName=t.displayName,this.initiative=t.initiative,this.initiativeContext=t.initiativeContext,this.buttonType=t.buttonType||c.PLAIN,this.buttonStyle=t.buttonStyle||p.BLACK,this.buttonLocale=t.buttonLocale||"en-US"}get isValid(){return!!(this.merchantIdentifier&&this.displayName&&this.initiative&&this.initiativeContext)}}class d{constructor(t){this.countryCode=t.countryCode,this.currencyCode=t.currencyCode,this.merchantCapabilities=t.merchantCapabilities,this.supportedNetworks=t.supportedNetworks,this.total=t.total,this.lineItems=t.lineItems,this.shippingMethods=t.shippingMethods,this.applicationData=t.applicationData,this.supportedCountries=t.supportedCountries}get isValid(){var t,e,i,s;return!!(this.countryCode&&this.currencyCode&&(null===(t=this.merchantCapabilities)||void 0===t?void 0:t.length)&&(null===(e=this.supportedNetworks)||void 0===e?void 0:e.length)&&(null===(i=this.total)||void 0===i?void 0:i.label)&&(null===(s=this.total)||void 0===s?void 0:s.amount))}}class u{static isApplePaySupported(){var t;return"undefined"!=typeof window&&"ApplePaySession"in window&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.supportsVersion(3))}static canMakePayments(){var t;return this.isApplePaySupported()&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.canMakePayments())||!1}static async canMakePaymentsWithActiveCard(t){var e;if(!this.isApplePaySupported())return!1;try{return await(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePaymentsWithActiveCard(t))||!1}catch(t){return console.error("Error checking Apple Pay active card:",t),!1}}static formatAmount(t){return(t/100).toFixed(2)}static parseAmount(t){return Math.round(100*parseFloat(t))}static createLineItem(t,e,i="final"){return{label:t,amount:this.formatAmount(e),type:i}}static getDefaultSupportedNetworks(){return["amex","discover","masterCard","visa"]}static getDefaultMerchantCapabilities(){return[l.SUPPORTS_3DS,l.SUPPORTS_EMV,l.SUPPORTS_CREDIT,l.SUPPORTS_DEBIT]}}class y{constructor(){this.apiBaseUrl="https://api.justifi-staging.com"}setApiBaseUrl(t){this.apiBaseUrl=t}setAuthToken(t){this.authToken=t}setAccountId(t){this.accountId=t}initialize(t){if(this.applePayConfig=new h(t),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(t,e){const i=`${this.apiBaseUrl}/v1/apple_pay/merchant_session`,s=e,n=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${t}`,"Sub-Account":this.accountId},body:JSON.stringify(s)});if(!n.ok){const t=await n.text();console.error("Backend validation failed - Raw response:",t);try{const e=JSON.parse(t);console.error("Backend validation failed - Parsed error:",e)}catch(t){console.error("Could not parse error response as JSON:",t)}throw new Error(`Merchant validation failed: ${n.status}`)}return await n.json()}async processPayment(t,e){const i=`${this.apiBaseUrl}/apple_pay/process_token`,s=e,n=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${t}`,"Sub-Account":this.accountId},body:JSON.stringify(s)}),a=await n.json();return{success:n.ok&&"success"===a.status,data:a}}isAvailable(){return u.isApplePaySupported()&&u.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await u.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(t){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");if(!this.isAvailable())throw new Error("Apple Pay is not available on this device/browser");const e=new d(t);if(!e.isValid)throw new Error("Invalid payment request provided");return this.currentPaymentRequest=e,new Promise(((t,i)=>{try{this.currentSession=new window.ApplePaySession(3,e),this.setupSessionEventHandlers(t,i),this.currentSession.begin()}catch(t){i({success:!1,error:{code:"SESSION_ERROR",message:t instanceof Error?t.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(t,e){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest&&(this.currentSession.onvalidatemerchant=async t=>{try{const i={validation_url:t.validationURL};if(!this.authToken)throw new Error("Authentication token not set. Call setAuthToken() first.");const s=await this.validateMerchant(this.authToken,i);if(s&&(t=>{const e=["merchantSessionIdentifier","nonce","merchantIdentifier","epochTimestamp","expiresAt"].filter((e=>!t[e]));if(e.length>0)return console.error("Missing required fields in merchant session:",e),console.error("Available fields:",Object.keys(t)),!1;const i=Date.now();return!(t.expiresAt&&t.expiresAt<i&&(console.error("Merchant session is expired:",{expiresAt:t.expiresAt,currentTime:i,expired:t.expiresAt<i}),1))})(s))try{this.currentSession.completeMerchantValidation(s)}catch(t){throw console.error("Error calling completeMerchantValidation:",t),t}else this.currentSession.abort(),e({success:!1,error:{code:"MERCHANT_VALIDATION_ERROR",message:"Merchant validation failed"}})}catch(t){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",t),console.error("Error stack:",t.stack),this.currentSession.abort(),e({success:!1,error:{code:"MERCHANT_VALIDATION_ERROR",message:t instanceof Error?t.message:"Merchant validation failed"}})}},this.currentSession.onpaymentauthorized=async i=>{try{const s=i.payment,n=Object.assign(Object.assign({},s.token),{product_details:{name:this.currentPaymentRequest.total.label,price:u.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}});if(!this.authToken)throw new Error("Authentication token not set. Call setAuthToken() first.");const a=await this.processPayment(this.authToken,n);a.success?(this.currentSession.completePayment({status:r.STATUS_SUCCESS}),t({success:!0,token:s.token})):(console.error("PSP reported payment failure:",a.data),this.currentSession.completePayment({status:r.STATUS_FAILURE}),e({success:!1,error:{code:"PAYMENT_PROCESSING_ERROR",message:"Payment processing failed"}}))}catch(t){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",t),console.error("Error stack:",t.stack),this.currentSession.completePayment({status:r.STATUS_FAILURE}),e({success:!1,error:{code:"PAYMENT_PROCESSING_ERROR",message:t instanceof Error?t.message:"Payment processing failed"}})}finally{this.currentSession=void 0,this.currentPaymentRequest=void 0}},this.currentSession.onpaymentmethodselected=()=>{const t={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(t)}catch(t){console.error("Error completing payment method selection:",t),this.currentSession.abort()}},this.currentSession.onshippingmethodselected=()=>{this.currentSession.completeShippingMethodSelection({status:r.STATUS_SUCCESS,newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]})},this.currentSession.oncancel=t=>{if(t.sessionError)switch(console.error(t.sessionError),t.sessionError.code){case"unknown":console.error("Unknown error - likely merchant validation issue"),console.error("This usually means:"),console.error("1. Merchant certificate is invalid or expired"),console.error("2. Merchant identifier mismatch"),console.error("3. Backend validation endpoint issues");break;case"invalidMerchantSession":console.error("Invalid merchant session provided"),console.error("Check that the merchant session from backend is valid");break;case"userCancel":console.error("User cancelled the payment");break;default:console.error("Other error code:",t.sessionError.code)}this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:"USER_CANCELLED",message:"User cancelled the Apple Pay session"}})},"onerror"in this.currentSession&&(this.currentSession.onerror=t=>{console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",t),this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:"SESSION_ERROR",message:"Apple Pay session error occurred"}})}))}static createPaymentRequest(t,e,i="US",s="USD"){return{countryCode:i,currencyCode:s,merchantCapabilities:u.getDefaultMerchantCapabilities(),supportedNetworks:u.getDefaultSupportedNetworks(),total:u.createLineItem(e,t)}}getApplePayConfig(){return this.applePayConfig}}const b=e=>{const{isReady:i}=e;return i?null:t("div",{class:"container-fluid p-0"},t("div",{class:"row mb-3"},t("div",{class:"col-12 align-content-center"},t(n,{height:"44px",width:"100%",styles:{borderRadius:"8px"}}))))},f=e=>t("div",{class:"apple-pay-button-container"},t("button",Object.assign({class:(()=>{let t="apple-pay-button";switch(e.buttonStyle){case p.WHITE:t+=" apple-pay-button-white";break;case p.WHITE_OUTLINE:t+=" apple-pay-button-white-outline";break;default:t+=" apple-pay-button-black"}switch(e.buttonType){case c.BUY:t+=" apple-pay-button-type-buy";break;case c.DONATE:t+=" apple-pay-button-type-donate";break;default:t+=" apple-pay-button-type-plain"}return(e.disabled||e.isProcessing||!e.isAvailable)&&(t+=" disabled"),t})(),style:{width:e.width||"200px",height:e.height||"48px"},onClick:()=>{!e.disabled&&!e.isProcessing&&e.isAvailable&&e.clickHandler&&e.clickHandler()},disabled:e.disabled||e.isProcessing||!e.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},e),e.isProcessing&&t("div",{class:"processing-overlay"},t("div",{class:"spinner"}),t("span",null,"Processing..."))),t("style",null,"\n .apple-pay-button-container {\n display: inline-block;\n position: relative;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),m=class{constructor(t){e(this,t),this.applePayStarted=i(this,"applePayStarted"),this.applePayCompleted=i(this,"applePayCompleted"),this.applePayCancelled=i(this,"applePayCancelled"),this.applePayError=i(this,"applePayError"),this.countryCode="US",this.merchantIdentifier="merchant.tech.justifi.checkout",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="checkout.justifi.tech",this.apiBaseUrl="https://api.justifi-staging.com",this.buttonType=c.PLAIN,this.buttonStyle=p.BLACK,this.disabled=!1,this.showSkeleton=!0,this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.error=null,this.handleApplePayClick=async()=>{var t;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit();const e={countryCode:this.countryCode,currencyCode:a.paymentCurrency,merchantCapabilities:u.getDefaultMerchantCapabilities(),supportedNetworks:u.getDefaultSupportedNetworks(),total:u.createLineItem(a.paymentDescription,a.paymentAmount)},i=await this.applePayService.startPaymentSession(e);i.success?this.applePayCompleted.emit({success:!0,token:i.token}):(this.applePayCompleted.emit({success:!1,error:i.error}),this.applePayError.emit({error:(null===(t=i.error)||void 0===t?void 0:t.message)||"Payment failed"}))}catch(t){console.error("Apple Pay payment error:",t);const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.applePayError.emit({error:e}),this.applePayCompleted.emit({success:!1,error:e})}finally{this.isProcessing=!1}}}componentWillLoad(){this.applePayService=new y,this.applePayService.setApiBaseUrl(this.apiBaseUrl),this.applePayService.setAuthToken(a.authToken),this.applePayService.setAccountId(a.accountId),this.initializeApplePay()}componentDidLoad(){o("paymentAmount",(()=>{this.initializeApplePay()})),o("authToken",(()=>{this.applePayService&&this.applePayService.setAuthToken(a.authToken)}))}watchPropsChange(){this.applePayService&&(this.applePayService.setApiBaseUrl(this.apiBaseUrl),this.applePayService.setAuthToken(a.authToken)),this.initializeApplePay()}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,!a.paymentAmount)return this.error="Missing required Apple Pay configuration",void(this.isLoading=!1);if(this.isAvailable=u.isApplePaySupported(),this.canMakePayments=u.canMakePayments(),!this.isAvailable)return this.error="Apple Pay is not supported on this device",void(this.isLoading=!1);if(!this.canMakePayments)return this.error="Apple Pay is not available",void(this.isLoading=!1);const t={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};this.applePayService.setAccountId(a.accountId),this.applePayService.initialize(t),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(t){console.error("Apple Pay initialization error:",t),this.error=t instanceof Error?t.message:"Failed to initialize Apple Pay"}finally{this.isLoading=!1}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?u.getDefaultSupportedNetworks():[]}async abort(){this.applePayService.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){return t(s,{key:"5e747c3141a93af7e5ce86562987cabe47bfd0ff"},t("div",{key:"8a10a99889b0e44f94cc81968d1babf754019bcd",class:"apple-pay-container"},t(b,{key:"af37813184b5fe6a06df5190a589548055c68b63",isReady:!this.isLoading&&this.isAvailable&&this.canMakePayments&&!this.error}),!this.isLoading&&this.error&&t("div",{key:"a3303ce85c773e48f51c7d87eb73e791a792d4cf",class:"apple-pay-error",role:"alert"},t("span",{key:"bc5868171c635a90bcde0facda1073e102a26534",class:"error-icon"},"⚠️"),t("span",{key:"71fb049d486db3369a7397da32f9386c3a8ecc2a",class:"error-message"},this.error)),!this.isLoading&&!this.error&&!this.isAvailable&&t("div",{key:"29845f0ec1e7759c27af745e65b4025e75778130",class:"apple-pay-unavailable"},t("span",{key:"f8012d32ef39a0d34ea3e482f7f99f932f80557b",class:"unavailable-message"},"Apple Pay is not available on this device")),!this.isLoading&&!this.error&&this.isAvailable&&this.canMakePayments&&t(f,{key:"5d72ce29f6867afde19354966928569389a222b6",buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick})),t("style",{key:"c59c14736ef3832c9a0894b29c787e63f338cace"},"\n .apple-pay-container {\n width: 100%;\n }\n\n .apple-pay-error {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px;\n background: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 8px;\n color: #dc2626;\n font-size: 14px;\n }\n\n .apple-pay-unavailable {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px;\n background: #f9fafb;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n color: #6b7280;\n font-size: 14px;\n }\n\n .error-icon {\n font-size: 16px;\n }\n "))}static get watchers(){return{merchantIdentifier:["watchPropsChange"],apiBaseUrl:["watchPropsChange"],buttonType:["watchPropsChange"],buttonStyle:["watchPropsChange"],disabled:["watchPropsChange"]}}};export{m as justifi_apple_pay}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as n,H as t,c as i,g as o}from"./p-kpoIU4v_.js";import{c as r}from"./p-7WIgS5RM.js";import{i as s,b as a,a as c,c as d,l as u}from"./p-D3G5aVLy.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-D522G7Ja.js";import{p as h}from"./p-C3HuV_kf.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:g}=m,b=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}async componentDidLoad(){const e=await this.getBaseFontStyles();g("fontStyles",e);const n=await this.getFocusedStyles();g("focused",n);const t=await this.getFocusedAndInvalidStyles();g("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.hiddenInput.focus(),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.hiddenInput.focus(),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?s:this.errorText?a:this.isFocused?c:d}render(){return n(t,{key:"0ee80d3f6e70e496682e798ddfc57d9e8e8b0578"},n("input",{key:"6ec2b8825e4b2e9c2d130ce810bb76f67dc30940",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,s="[iFrameSizer]",a=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){W(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=P(),window.iFrameResize=window.iFrameResize||P()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,b(e))}function v(e,n){x("info",e,n,b(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),C((function(){R(A),T(H),l("onResized",A)}),A,"init")}function t(e){var n=Number(u[H]["max"+e]),t=Number(u[H]["min"+e]),i=e.toLowerCase(),o=Number(A[i]);p(H,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(H,"Set "+i+" to min value")),o>n&&(o=n,p(H,"Set "+i+" to max value")),A[i]=""+o}function i(e){return W.slice(W.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;E("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=A.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(H),{x:Math.floor(Number(n.left)+Number(a.x)),y:Math.floor(Number(n.top)+Number(a.y))}}function c(e){var n=e?r(A.iframe):{x:0,y:0},t={x:Number(A.width)+n.x,y:Number(A.height)+n.y};p(H,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(H,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(H,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",a)?j():T(H)}function f(e){var n={};if(0===Number(A.width)&&0===Number(A.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:A.width,y:A.height};l(e,{iframe:A.iframe,screenX:Number(n.x),screenY:Number(n.y),type:A.type})}function l(e,n){return z(H,e,n)}var m,b,y,x,I,F,W=e.data,A={},H=null;"[iFrameResizerChild]Ready"===W?function(){for(var e in u)E("iFrame requested init",N(e),u[e].iframe,e)}():s===(""+W).slice(0,13)&&W.slice(13).split(":")[0]in u?(x=(y=W.slice(13).split(":"))[1]?parseInt(y[1],10):0,I=u[y[0]]&&u[y[0]].iframe,F=getComputedStyle(I),A={iframe:I,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(F)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(F),width:y[2],type:y[3]},u[H=A.id]&&(u[H].loaded=!0),(b=A.type in{true:1,false:1,undefined:1})&&p(H,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,k(A.type+" No settings for "+e+". Message was: "+W)),n}(H)&&(p(H,"Received: "+W),m=!0,null===A.iframe&&(k(H,"IFrame ("+A.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[H]&&u[H].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(H,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(H,"Checking connection is from: "+(n=u[H]&&u[H].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+A.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[H]&&u[H].firstRun&&u[H]&&(u[H].firstRun=!1),A.type){case"close":S(A.iframe);break;case"message":m=i(6),p(H,"onMessage passed: {iframe: "+A.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:A.iframe,message:JSON.parse(m)}),p(H,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[H].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[H]&&u[H].iframe,H),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=H;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[H]&&u[H].stopPageInfo&&(u[H].stopPageInfo(),delete u[H].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(H,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(H,"--")):window.top===window.self?p(H,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(H,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(A);break;case"init":n(),l("onInit",A.iframe);break;default:0===Number(A.width)&&0===Number(A.height)?k("Unsupported message received ("+A.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,s,h,m}())):v(H,"Ignored: "+W)}function z(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function F(e){delete u[e.id]}function S(e){var t=e.id;if(!1!==z(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}z(t,"onClosed",t),p(t,"--"),F(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===a&&p(n,"Get page position: "+(a={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+a.y)}function T(e){null!==a&&(window.scrollTo(a.x,a.y),p(e,"Set page position: "+a.x+","+a.y),j())}function j(){a=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),C((function(){R(e),E("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&E("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),A(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function E(e,n,t,i,o){var r,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function N(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function W(t,r){function s(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(s,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),a=N(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&S(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){E("iFrame.onload",a,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),E("init",a,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:S.bind(null,u[f].iframe),removeListeners:F.bind(null,u[f].iframe),resize:E.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){E("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){E("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function A(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function H(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),A((function(){L("Tab Visible","resize")}),16))}function L(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&E(e,n,u[t].iframe,t)}))}function P(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),W(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",I),w(window,"resize",(function(){p("window","Trigger event: resize"),A((function(){L("Window resize","resize")}),16)})),w(document,"visibilitychange",H),w(document,"-webkit-visibilitychange",H),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded"),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?s:this.isValid?this.isFocused?c:d:a}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"476aa13501c575d34fc189186cb9cc087f1934c0",class:"form-group d-flex flex-column"},n("div",{key:"4479d3f3ca36738a4803a8296335df173cc60600",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"ab3ca944b088d966fb5e31248e72be90cd817596",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"e0590b5060c5f53ae009f463c7fd2013c718d29a",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"5c31e3628e9c1480702008c750b9023e27427c68",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"8dd8903b2de383fa145a11d45e32efe1b95e10fd",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{b as hidden_input,I as iframe_input}
|
|
1
|
+
import{r as e,h as n,H as t,c as i,g as o}from"./p-kpoIU4v_.js";import{c as r}from"./p-7WIgS5RM.js";import{i as s,b as a,a as c,c as d,l as u}from"./p-D3G5aVLy.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-D522G7Ja.js";import{p as h}from"./p-Dm6cO_sz.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:g}=m,b=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}async componentDidLoad(){const e=await this.getBaseFontStyles();g("fontStyles",e);const n=await this.getFocusedStyles();g("focused",n);const t=await this.getFocusedAndInvalidStyles();g("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.hiddenInput.focus(),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.hiddenInput.focus(),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?s:this.errorText?a:this.isFocused?c:d}render(){return n(t,{key:"0ee80d3f6e70e496682e798ddfc57d9e8e8b0578"},n("input",{key:"6ec2b8825e4b2e9c2d130ce810bb76f67dc30940",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,s="[iFrameSizer]",a=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){W(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=P(),window.iFrameResize=window.iFrameResize||P()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,b(e))}function v(e,n){x("info",e,n,b(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),C((function(){R(A),T(L),l("onResized",A)}),A,"init")}function t(e){var n=Number(u[L]["max"+e]),t=Number(u[L]["min"+e]),i=e.toLowerCase(),o=Number(A[i]);p(L,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(L,"Set "+i+" to min value")),o>n&&(o=n,p(L,"Set "+i+" to max value")),A[i]=""+o}function i(e){return W.slice(W.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;E("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=A.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(L),{x:Math.floor(Number(n.left)+Number(a.x)),y:Math.floor(Number(n.top)+Number(a.y))}}function c(e){var n=e?r(A.iframe):{x:0,y:0},t={x:Number(A.width)+n.x,y:Number(A.height)+n.y};p(L,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(L,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(L,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",a)?j():T(L)}function f(e){var n={};if(0===Number(A.width)&&0===Number(A.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:A.width,y:A.height};l(e,{iframe:A.iframe,screenX:Number(n.x),screenY:Number(n.y),type:A.type})}function l(e,n){return z(L,e,n)}var m,b,y,x,I,F,W=e.data,A={},L=null;"[iFrameResizerChild]Ready"===W?function(){for(var e in u)E("iFrame requested init",N(e),u[e].iframe,e)}():s===(""+W).slice(0,13)&&W.slice(13).split(":")[0]in u?(x=(y=W.slice(13).split(":"))[1]?parseInt(y[1],10):0,I=u[y[0]]&&u[y[0]].iframe,F=getComputedStyle(I),A={iframe:I,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(F)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(F),width:y[2],type:y[3]},u[L=A.id]&&(u[L].loaded=!0),(b=A.type in{true:1,false:1,undefined:1})&&p(L,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,k(A.type+" No settings for "+e+". Message was: "+W)),n}(L)&&(p(L,"Received: "+W),m=!0,null===A.iframe&&(k(L,"IFrame ("+A.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[L]&&u[L].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(L,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(L,"Checking connection is from: "+(n=u[L]&&u[L].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+A.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[L]&&u[L].firstRun&&u[L]&&(u[L].firstRun=!1),A.type){case"close":S(A.iframe);break;case"message":m=i(6),p(L,"onMessage passed: {iframe: "+A.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:A.iframe,message:JSON.parse(m)}),p(L,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[L].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[L]&&u[L].iframe,L),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=L;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[L]&&u[L].stopPageInfo&&(u[L].stopPageInfo(),delete u[L].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(L,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(L,"--")):window.top===window.self?p(L,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(L,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(A);break;case"init":n(),l("onInit",A.iframe);break;default:0===Number(A.width)&&0===Number(A.height)?k("Unsupported message received ("+A.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,s,h,m}())):v(L,"Ignored: "+W)}function z(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function F(e){delete u[e.id]}function S(e){var t=e.id;if(!1!==z(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}z(t,"onClosed",t),p(t,"--"),F(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===a&&p(n,"Get page position: "+(a={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+a.y)}function T(e){null!==a&&(window.scrollTo(a.x,a.y),p(e,"Set page position: "+a.x+","+a.y),j())}function j(){a=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),C((function(){R(e),E("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&E("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),A(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function E(e,n,t,i,o){var r,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function N(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function W(t,r){function s(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(s,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),a=N(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&S(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){E("iFrame.onload",a,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),E("init",a,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:S.bind(null,u[f].iframe),removeListeners:F.bind(null,u[f].iframe),resize:E.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){E("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){E("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function A(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function L(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),A((function(){H("Tab Visible","resize")}),16))}function H(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&E(e,n,u[t].iframe,t)}))}function P(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),W(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",I),w(window,"resize",(function(){p("window","Trigger event: resize"),A((function(){H("Window resize","resize")}),16)})),w(document,"visibilitychange",L),w(document,"-webkit-visibilitychange",L),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded"),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?s:this.isValid?this.isFocused?c:d:a}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"476aa13501c575d34fc189186cb9cc087f1934c0",class:"form-group d-flex flex-column"},n("div",{key:"4479d3f3ca36738a4803a8296335df173cc60600",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"ab3ca944b088d966fb5e31248e72be90cd817596",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"e0590b5060c5f53ae009f463c7fd2013c718d29a",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"5c31e3628e9c1480702008c750b9023e27427c68",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"8dd8903b2de383fa145a11d45e32efe1b95e10fd",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{b as hidden_input,I as iframe_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as s,h as t}from"./p-kpoIU4v_.js";import{S as i}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{c as o,J as e}from"./p-
|
|
1
|
+
import{r,c as s,h as t}from"./p-kpoIU4v_.js";import{S as i}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{c as o,J as e}from"./p-VDUjfAoW.js";import{d as a}from"./p-DSekXpCa.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{C as n,a as p}from"./p-Cjcsf8ku.js";import{g as m}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as c,a as d}from"./p-D2muobcE.js";import{A as h}from"./p-Dj1uo4J3.js";import"./p-Dm6cO_sz.js";import"./p-D3G5aVLy.js";import"./p-DCDU6JB3.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const l=h();class j{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const u=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=a,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){o(),this.analytics=new e(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:o,onError:e,final:a})=>{var p,h;try{const a=await t.fetchTerminalOrders(r,s,i);if(a.error)return e({error:d(a.error),code:c(null===(h=a.error)||void 0===h?void 0:h.code),severity:n.ERROR});{const r=Object.assign({},a.page_info);o({terminalOrders:(null===(p=a.data)||void 0===p?void 0:p.map((r=>new m(r))))||[],pagingInfo:r})}}catch(r){const s=c(null==r?void 0:r.code);return e({error:r.message||r,code:s,severity:n.ERROR})}finally{return a()}})({id:this.accountId,authToken:this.authToken,service:new j}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return t(i,{key:"2c853865fea3d5d1cbb531474e6caefdeb26bf75"},t("terminal-orders-list-core",{key:"15591658366c6e127bb449c261dd980406025203",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{u as justifi_terminal_orders_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s,r as i,c as t}from"./p-kpoIU4v_.js";import{ap as e,am as r,ae as o,z as l}from"./p-D3G5aVLy.js";import{S as d}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{c as n,J as a}from"./p-VDUjfAoW.js";import{C as h,a as c}from"./p-Cjcsf8ku.js";import{B as u}from"./p-DVPcHdzq.js";import{B as v}from"./p-BlJnA265.js";import{m as p}from"./p-DH8F0bsw.js";import{S as m}from"./p-Bz8JT676.js";import"./p-9y5MOK55.js";import{k as f}from"./p-B7jE0g5_.js";import{h as b,g as w,b as j}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import{g,a as y}from"./p-D2muobcE.js";import{T as x}from"./p-DtsIovbb.js";import"./p-Dm6cO_sz.js";import"./p-Dj1uo4J3.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-7WIgS5RM.js";const k=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(m,{width:"25%"})),s("div",{class:"col-12"},s(m,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(m,{width:"50%"}),s(m,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(m,{width:"65%"}),s(m,{width:"35%"}))),S=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(m,{width:"40%",height:"40px"})),s(k,null)),B=()=>s("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},s("div",{class:"d-flex align-items-center gap-3"},s(m,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),s("div",{class:"flex-grow-1"},s("div",{class:"d-flex row flex-row"},s("div",{class:"col-6 flex-column"},s(m,null),s(m,{width:"60%"})),s("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},s(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),s(m,{width:"80px",height:"32px"}),s(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),s("div",{class:"mt-4"},s("div",{class:"d-flex flex-column gap-2"},s(m,null),s(m,null)))))),D=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event"),this.submitted=t(this,"submit-event"),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new w({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?j.boardingShipping:j.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}handleError(s,i,t){this.error={message:s,code:i,severity:t},this.errorEvent.emit({errorCode:i,message:s,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",c.MISSING_PROPS,h.ERROR)}initializeGetBusiness(){p({id:this.businessId,authToken:this.authToken,service:new u})({onSuccess:({business:s})=>{this.business=new v(s),this.loading.business=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.loading.business=!1}})}initializeGetTerminalModels(){(({id:s,authToken:i,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(s,i);if(a.error)return r({error:y(a.error),code:g(null===(n=a.error)||void 0===n?void 0:n.code),severity:h.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((s=>new b(s))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(s){const i=g(null==s?void 0:s.code);return r({error:s.message||s,code:i,severity:h.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new x})({onSuccess:({terminals:s,orderLimit:i})=>{this.terminalModels=s,this.orderLimit=i,this.loading.terminals=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.loading.terminals=!1}})}submitOrder(){const s=(({authToken:s,service:i,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await i.orderTerminals(s,e,t);if(d.error)return o({error:y(d.error),code:g(null===(l=d.error)||void 0===l?void 0:l.code),severity:h.ERROR});{const{data:s}=d;r({data:s})}}catch(s){const i=g(null==s?void 0:s.code);return o({error:s.message||s,code:i,severity:h.ERROR})}})({authToken:this.authToken,service:new x});this.submitting=!0,s({terminalOrder:this.order.payload,onSuccess:({data:s})=>{this.submitted.emit(s),this.submitting=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.submitting=!1}})}onSelectedQuantityChange(s){this.order.updateTerminal(s.detail.modelName,s.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return s("div",null,this.loading.business&&s(S,null),this.loading.terminals&&s("div",{class:"mt-5"},s(B,null),s(B,null),s(B,null)))}renderBusinessDetails(){var i,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return s("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},s("div",{class:"row"},s("div",{class:"col-12"},s("h2",{part:r},this.business.legal_name))),s("div",{class:"row"},s("div",{class:"col-6"},s("h5",{part:e},"Representative:"),s("div",null,s("div",null,null===(t=null===(i=this.business)||void 0===i?void 0:i.representative)||void 0===t?void 0:t.name),s("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),s("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),s("div",null,f(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),s("div",{class:"col-6"},s("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),s("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",s("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 s("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((i=>s("terminal-quantity-selector",{modelName:i.model_name,description:i.description,imageUrl:i.image_url,helpUrl:i.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return s("div",{class:"mt-3"},s("div",{class:"text-end"},"Order limit: ",this.orderLimit),s("div",{class:"d-flex justify-content-end mt-3"},s("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 s(d,{key:"0fcd2ba507d4d8cf04b0cc811416a3a374e36fb6"},s("div",{key:"f4b87bbf9d14bafcf817d9686173d2edbb6b8dcb",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{D as justifi_order_terminals}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as i,h as t}from"./p-kpoIU4v_.js";import{c as o,J as r}from"./p-
|
|
1
|
+
import{r as s,c as i,h as t}from"./p-kpoIU4v_.js";import{c as o,J as r}from"./p-VDUjfAoW.js";import{C as e,a as p}from"./p-Cjcsf8ku.js";import{m as n,a}from"./p-5aA7gjr5.js";import{B as h}from"./p-DVPcHdzq.js";import{A as m}from"./p-Dj1uo4J3.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import"./p-Dm6cO_sz.js";import"./p-D2muobcE.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const u=m();class c{async postProvisioning(s,i,t){return u.post({endpoint:"entities/provisioning",body:{business_id:i,product_category:t},authToken:s})}}const j=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){o(),this.analytics=new r(this),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new h}),this.postProvisioning=a({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new c})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:p.MISSING_PROPS,severity:e.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"11871305b4b4974787a9278195ea0b314be250b0",businessId:this.businessId,authToken:this.authToken,allowOptionalFields:this.allowOptionalFields,formTitle:this.formTitle,getBusiness:this.getBusiness,postProvisioning:this.postProvisioning})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{j as justifi_payment_provisioning}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as t,h as r}from"./p-kpoIU4v_.js";import{A as o}from"./p-Dj1uo4J3.js";import{C as i,a as e}from"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as a,a as p}from"./p-D2muobcE.js";import{E as n}from"./p-CEYGUVns.js";import{c,J as h}from"./p-VDUjfAoW.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D3G5aVLy.js";import"./p-Dm6cO_sz.js";const m=o();class u{async fetchGrossVolumeChartData(s,t){return m.get({endpoint:`account/${s}/reports/gross_volume`,authToken:t})}}const j=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){c(),this.analytics=new h(this),this.initializeGetGrossPayment()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:e})=>{var n;try{const c=await r.fetchGrossVolumeChartData(s,t);c.error?e({error:p(c.error),code:a(null===(n=c.error)||void 0===n?void 0:n.code),severity:i.ERROR}):o(c.data)}catch(s){const t=a(null==s?void 0:s.code);e({error:p(s),code:t,severity:i.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new u}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_gross_payment_chart}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as c,a}from"./p-D2muobcE.js";import{c as p,J as n}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as c,a}from"./p-D2muobcE.js";import{c as p,J as n}from"./p-VDUjfAoW.js";import{C as h}from"./p-C0EFqY0W.js";import{m,S as u}from"./p-Dv7YEshZ.js";import{S as j}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{d}from"./p-DX_mixvZ.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-Dm6cO_sz.js";import"./p-Dj1uo4J3.js";import"./p-DCDU6JB3.js";import"./p-D3G5aVLy.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=d,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){p(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i})=>async({params:r,onSuccess:p,onError:n})=>{var h,m;try{const u=await i.fetchCheckouts(t,s,r);if(u.error)return n({error:a(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);p({checkouts:(null===(h=u.data)||void 0===h?void 0:h.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:o.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new h}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u}))}render(){return i(j,{key:"41bf633467138b6af13b1c02ccf1e1016ec54bfe"},i("checkouts-list-core",{key:"cd3ca431258ad73e701fe74612ecdf2c0f2a1bda",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_checkouts_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={name:"@justifi/webcomponents",version:"5.7.6-rc-10"};export{e as p}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t}from"./p-
|
|
1
|
+
import{p as t}from"./p-Dm6cO_sz.js";import{A as s}from"./p-Dj1uo4J3.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class o{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("storybook")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters&&this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{const s=t.version,i=t.name,e=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(i),o=e.replace(/-rc.*/,""),n=s.split("."),r=e.split(".");n[0]!==r[0]&&console.warn(`The package ${i} is out of date. The latest version is ${o}. Please update.`)};export{o as J,n as c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-kpoIU4v_.js";import{A as r}from"./p-Dj1uo4J3.js";import{C as s,a as o}from"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as n,a}from"./p-D2muobcE.js";import{c,J as p}from"./p-
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-kpoIU4v_.js";import{A as r}from"./p-Dj1uo4J3.js";import{C as s,a as o}from"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as n,a}from"./p-D2muobcE.js";import{c,J as p}from"./p-VDUjfAoW.js";import{c as u}from"./p-BYakc1Om.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-Dm6cO_sz.js";const d=r();class m{async fetchQuote(t,i){return d.post({endpoint:"insurance/quotes",body:i,authToken:t})}async toggleCoverage(t,i,e){return d.post({endpoint:`insurance/quotes/${i}/toggle`,body:e,authToken:t})}}const h=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event")}async validate(){return this.seasonInterruptionCoreRef.validate()}componentWillLoad(){c(),this.analytics=new p(this),this.initializeServiceMethods()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}initializeServiceMethods(){const t=this.authToken||u.authToken;if(!t)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:s.ERROR});const i={authToken:t,service:new m};this.getQuote=(({authToken:t,service:i})=>async({payload:e,onSuccess:r,onError:o})=>{var c;try{const p=await i.fetchQuote(t,e);if(p.error)return o({error:a(p.error),code:n(null===(c=p.error)||void 0===c?void 0:c.code),severity:s.ERROR});r({quote:p.data})}catch(t){const i=n(null==t?void 0:t.code);return o({error:t.message||t,code:i,severity:s.ERROR})}})(i),this.toggleCoverage=(({authToken:t,service:i})=>async({quoteId:e,payload:r,onSuccess:o,onError:c})=>{var p;try{const u=await i.toggleCoverage(t,e,r);if(u.error)return c({error:a(u.error),code:n(null===(p=u.error)||void 0===p?void 0:p.code),severity:s.ERROR});o({quote:u.data})}catch(t){const i=n(null==t?void 0:t.code);return c({error:t.message||t,code:i,severity:s.ERROR})}})(i)}render(){return e("justifi-season-interruption-insurance-core",{key:"a563c1f6daf665c6ae06442c18dd25400b420f39",ref:t=>this.seasonInterruptionCoreRef=t,"checkout-id":this.checkoutId||u.checkoutId,getQuote:this.getQuote,toggleCoverage:this.toggleCoverage,"primary-identity-first-name":this.primaryIdentityFirstName,"primary-identity-last-name":this.primaryIdentityLastName,"primary-identity-state":this.primaryIdentityState,"primary-identity-postal-code":this.primaryIdentityPostalCode,"primary-identity-country":this.primaryIdentityCountry,"primary-identity-email-address":this.primaryIdentityEmailAddress,"policy-attributes-insurable-amount":this.policyAttributesInsurableAmount,"policy-attributes-start-date":this.policyAttributesStartDate,"policy-attributes-end-date":this.policyAttributesEndDate,"covered-identity-first-name":this.coveredIdentityFirstName,"covered-identity-last-name":this.coveredIdentityLastName})}};export{h as justifi_season_interruption_insurance}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-VDUjfAoW.js";import{a}from"./p-7MWRbTXI.js";import{g as n,a as h}from"./p-D2muobcE.js";import{D as c}from"./p-DiWKhLRS.js";import"./p-Dm6cO_sz.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new p(this),this.initializeGetDispute()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:o})=>{var p;try{const c=await i.fetchDispute(t,s);if(c.error)return o({error:h(c.error),code:n(null===(p=c.error)||void 0===p?void 0:p.code),severity:e.ERROR});{const t=Object.assign({},c.page_info);r({dispute:new a(c.data),pagingInfo:t})}}catch(t){const s=n(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new c}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return i("justifi-dispute-management-core",{key:"4087eb105a046a3cc194d9f25c80fa11298fa0a2",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_dispute_management}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-VDUjfAoW.js";import{P as p}from"./p-Sz-UKsNL.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{P as n}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as j}from"./p-Dv7YEshZ.js";import{S as d}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-B9GgcQ-7.js";import"./p-Dm6cO_sz.js";import"./p-Dj1uo4J3.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-BFL-wXPM.js";import"./p-DCDU6JB3.js";import"./p-D3G5aVLy.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=l,this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new p};this.getPayouts=(({id:t,authToken:s,service:i})=>async({params:r,onSuccess:e,onError:a})=>{var p,m;try{const u=await i.fetchPayouts(t,s,r);if(u.error)return a({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);e({payouts:(null===(p=u.data)||void 0===p?void 0:p.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return a({error:t.message||t,code:s,severity:o.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new j}))}render(){return i(d,{key:"d794ffd782737a60ee1473f9259dc6b482a88ab7"},i("payouts-list-core",{key:"35a6aab5504fb978b9ecd22c0e805f8e7c806dba",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_payouts_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as a}from"./p-kpoIU4v_.js";import{S as i}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{S as s}from"./p-Bz8JT676.js";import{c,J as d}from"./p-C1nBLmHv.js";import{w as n,c as r}from"./p-9y5MOK55.js";import{c as o,F as l}from"./p-CR9D6mKt.js";import{k as f,l as b,m as h,n as p,q as m,y as u}from"./p-CYBR4K2p.js";import{ag as y}from"./p-D3G5aVLy.js";import{n as k}from"./p-BnjCmwMr.js";import{S as v}from"./p-BX8GieXu.js";import{o as g}from"./p-BYakc1Om.js";import"./p-C3HuV_kf.js";import"./p-Dj1uo4J3.js";import"./p-B7jE0g5_.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-7WIgS5RM.js";import"./p-BFTU3MAI.js";import"./p-yH3TC3ZQ.js";const j=t=>{const{isReady:a}=t;return a?null:e("div",{class:"container-fluid p-0"},e("div",{class:"row mb-3"},e("div",{class:"col-12 align-content-end"},e(s,{height:"18px",width:"120px"}),e(s,{height:"36px"}))),e("div",{class:"row"},e("div",{class:"col-12 align-content-end"},e(s,{height:"18px",width:"110px"}),e(s,{height:"36px"}))))},x=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await n(),this.iframeOrigin=r.iframeOrigin,c(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.accountNumberIframeElement.validate(),t=await this.routingNumberIframeElement.validate();return e&&t}async tokenize({clientId:e,paymentMethodMetadata:t,account:a}){return this.accountNumberIframeElement.tokenize(e,t,a)}render(){return e(i,{key:"1cf811a60b481271f29c151aff5ab8c132d65d4b"},e(j,{key:"3b81c1b9456f2be69fb89f0abac6c0bb95d5f2d3",isReady:this.isReady}),e("hidden-input",{key:"d1d02debee100c4a851f7eb5aa9196587e58e54d"}),e("div",{key:"49ced4f6c7c3b9b42fc2b08fd14161ed9a21fdfa",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},e("div",{key:"5d44c0b231532e4b98ff6a777db820c41ce5ce0b",class:"row mb-3"},e("iframe-input",{key:"1628067e98f44f9e7e0f404b1df9e61d756e9d50",inputId:"accountNumber",ref:e=>this.accountNumberIframeElement=e,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),e("div",{key:"513aa503c8df3f79d340bf9f4bec9cdee2679a69",class:"row"},e("iframe-input",{key:"fdbaf1f56b3d0fbc5d1395293240f3b27c134bdd",inputId:"routingNumber",ref:e=>this.routingNumberIframeElement=e,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},_=e=>{const t=o({name:u.required("Enter full name"),address_line1:m.required("Enter street address"),address_line2:p.nullable(),address_city:h.required("Enter city"),address_state:b.required("Select state"),address_postal_code:f.required("Enter postal code")}),a=o({name:u.nullable(),address_line1:m.nullable(),address_line2:p.nullable(),address_city:h.nullable(),address_state:b.nullable(),address_postal_code:f.required("Enter postal code")});return e?a:t},w=class{constructor(e){t(this,e),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}connectedCallback(){this.unsubscribe=g("billingFormFields",(e=>{this.formController.setInitialValues(e)}))}disconnectedCallback(){var e;null===(e=this.unsubscribe)||void 0===e||e.call(this)}componentWillLoad(){this.formController=new l(_())}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async validate(){return{isValid:await this.formController.validate()}}render(){const t=this.formController.getInitialValues();return e(i,{key:"abaa29c5d463c95801ebeadb254a2b87fe116dd0"},e("div",{key:"f3327594ec80d1365e23cebc523d18581093ed70",part:y},e("form",{key:"2aa614c338af201f648cb03f7865238bb82aa2e4"},e("fieldset",{key:"a00e9457818d996eee924e996464146a741a5468"},e("div",{key:"a7d18b979c2505ea8e0ba8b8427f0191060da3c0",class:"row gy-3"},e("div",{key:"a3ee71f96aafa50cf65e54a1e259d59b44de7494",class:"col-12"},e("form-control-text",{key:"d9bd8c2db3ed0b7d6062a8ca454f1c33caf84471",name:"name",label:"Full Name",defaultValue:t.name,errorText:this.errors.name,inputHandler:this.inputHandler})),e("div",{key:"539f0e9ec635487c6118ec40b1bcf683efa5b64d",class:"col-12"},e("form-control-text",{key:"10ae18b859dffb202ba014fb303917c58b95953b",name:"address_line1",label:"Street Address",defaultValue:t.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),e("div",{key:"bc6aba1d85cef27587e07bcf15073c766936ca8f",class:"col-12"},e("form-control-text",{key:"073673edb594797a2158a1d5b04022b407b9ed0c",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:t.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),e("div",{key:"50062f42ee4da8238ffcc42b2f6850bbad309ffd",class:"col-12"},e("form-control-text",{key:"4bf1c47edb3faca18aec278bef52d078d59f60ed",name:"address_city",label:"City",defaultValue:t.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),e("div",{key:"d2b8c326762474d38b5271f89d682be763fb0f44",class:"col-12"},e("form-control-select",{key:"506286fed3c031d72cae737c4631ec4f91428ceb",name:"address_state",label:"State",options:v,defaultValue:t.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),e("div",{key:"f70fd74b32594b43a524cb305c79854bcb5ea2ba",class:"col-12"},e("form-control-text",{key:"8f24531c98865727c2b585feef088f9f2c9c7e96",name:"address_postal_code",label:"ZIP",defaultValue:t.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:k})))))))}},C=t=>{const{isReady:a}=t;return a?null:e("div",{class:"container-fluid p-0"},e("div",{class:"mb-3"},e(s,{height:"18px",width:"100px"}),e(s,{height:"36px"})),e("div",{class:"row"},e("div",{class:"col-4 align-content-end"},e(s,{height:"18px",width:"80px"}),e(s,{height:"36px"})),e("div",{class:"col-4 align-content-end"},e(s,{height:"36px"})),e("div",{class:"col-4 align-content-end"},e(s,{height:"18px",width:"30px"}),e(s,{height:"36px"}))))},V=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await n(),this.iframeOrigin=r.iframeOrigin,c(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.cardNumberIframeElement.validate(),t=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),i=await this.cvvIframeElement.validate();return e&&t&&a&&i}async tokenize({clientId:e,paymentMethodMetadata:t,account:a}){return this.cardNumberIframeElement.tokenize(e,t,a)}render(){return e(i,{key:"7cb0c0a08ef0572fa1604e17edbf19478ea3f36b"},e(C,{key:"5314b766fd972e03dbb7632776c97617132a861d",isReady:this.isReady}),e("hidden-input",{key:"479b8a68d10eb9e7e0358e165345020290ed6690"}),e("div",{key:"a71bc32cfbef8b37d47c56662094dc6e292ff1f3",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},e("div",{key:"64c8b172e9786cf1cdefaea11bcb27d665015ecf",class:"mb-3"},e("iframe-input",{key:"c31ef9a392acbe9b2aabcacb0a37d4999853bbfc",inputId:"cardNumber",ref:e=>this.cardNumberIframeElement=e,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),e("div",{key:"7c60c66b4212423fa08a902c6550c2ca757198b8",class:"row"},e("div",{key:"712d7b397299596d4b9dfd91ebdce84e028ec925",class:"col-4 align-content-end"},e("iframe-input",{key:"2caf6a11018a30dbac0b973387e23fd0d00f96bd",inputId:"expirationMonth",ref:e=>this.expirationMonthIframeElement=e,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),e("div",{key:"41122ae04a8b6c568157213874df4a7d483cba41",class:"col-4 align-content-end"},e("iframe-input",{key:"abd6e99b75446663e428094dd3588e02f849fb85",inputId:"expirationYear",ref:e=>this.expirationYearIframeElement=e,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),e("div",{key:"c974afa273e7f150cb365704401e49408074faac",class:"col-4 align-content-end"},e("iframe-input",{key:"c3998a85c9043a08d60b667c86e20bee5e5f007c",inputId:"CVV",ref:e=>this.cvvIframeElement=e,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},O=class{constructor(e){t(this,e),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}connectedCallback(){this.unsubscribe=g("billingFormFields",(e=>{this.formController.setInitialValues(e)}))}disconnectedCallback(){var e;null===(e=this.unsubscribe)||void 0===e||e.call(this)}componentWillLoad(){this.formController=new l(_(!0))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const t=this.formController.getInitialValues();return e(i,{key:"be5335622cb907795f13522a0b12e70e9854b2b6"},e("form",{key:"9fd26fb2568030bf000d5501e5063b79a98ab02e"},e("form-control-text",{key:"aed14596c15442d99705dd75f5349186b60a8a89",name:"address_postal_code",label:"ZIP",defaultValue:t.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:k})))}},H=class{constructor(e){t(this,e),this.checkboxChanged=a(this,"checkboxChanged"),this.isChecked=!1}handleCheckboxChange(e,t){this.isChecked=t,this.checkboxChanged.emit(this.isChecked)}render(){return e(i,{key:"114f1887f2aebee2440d5c0b187fe1f361137230"},e("div",{key:"8a967beb89065a8b3ee501f0589b6617764c641e",class:"mt-4 form-check"},e("form-control-checkbox",{key:"b22ca881a5fcda9dc044dfd1175e9ae06fd9f504",label:"Save new payment method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange.bind(this)})))}};export{x as justifi_bank_account_form,w as justifi_billing_information_form,V as justifi_card_form,O as justifi_postal_code_form,H as justifi_save_new_payment_method}
|
|
1
|
+
import{h as e,r as t,c as a}from"./p-kpoIU4v_.js";import{S as i}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{S as s}from"./p-Bz8JT676.js";import{c,J as d}from"./p-VDUjfAoW.js";import{w as n,c as r}from"./p-9y5MOK55.js";import{c as o,F as l}from"./p-CR9D6mKt.js";import{k as f,l as b,m as h,n as p,q as m,y as u}from"./p-CYBR4K2p.js";import{ag as y}from"./p-D3G5aVLy.js";import{n as k}from"./p-BnjCmwMr.js";import{S as v}from"./p-BX8GieXu.js";import{o as g}from"./p-BYakc1Om.js";import"./p-Dm6cO_sz.js";import"./p-Dj1uo4J3.js";import"./p-B7jE0g5_.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-7WIgS5RM.js";import"./p-BFTU3MAI.js";import"./p-yH3TC3ZQ.js";const j=t=>{const{isReady:a}=t;return a?null:e("div",{class:"container-fluid p-0"},e("div",{class:"row mb-3"},e("div",{class:"col-12 align-content-end"},e(s,{height:"18px",width:"120px"}),e(s,{height:"36px"}))),e("div",{class:"row"},e("div",{class:"col-12 align-content-end"},e(s,{height:"18px",width:"110px"}),e(s,{height:"36px"}))))},x=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await n(),this.iframeOrigin=r.iframeOrigin,c(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.accountNumberIframeElement.validate(),t=await this.routingNumberIframeElement.validate();return e&&t}async tokenize({clientId:e,paymentMethodMetadata:t,account:a}){return this.accountNumberIframeElement.tokenize(e,t,a)}render(){return e(i,{key:"1cf811a60b481271f29c151aff5ab8c132d65d4b"},e(j,{key:"3b81c1b9456f2be69fb89f0abac6c0bb95d5f2d3",isReady:this.isReady}),e("hidden-input",{key:"d1d02debee100c4a851f7eb5aa9196587e58e54d"}),e("div",{key:"49ced4f6c7c3b9b42fc2b08fd14161ed9a21fdfa",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},e("div",{key:"5d44c0b231532e4b98ff6a777db820c41ce5ce0b",class:"row mb-3"},e("iframe-input",{key:"1628067e98f44f9e7e0f404b1df9e61d756e9d50",inputId:"accountNumber",ref:e=>this.accountNumberIframeElement=e,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),e("div",{key:"513aa503c8df3f79d340bf9f4bec9cdee2679a69",class:"row"},e("iframe-input",{key:"fdbaf1f56b3d0fbc5d1395293240f3b27c134bdd",inputId:"routingNumber",ref:e=>this.routingNumberIframeElement=e,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},_=e=>{const t=o({name:u.required("Enter full name"),address_line1:m.required("Enter street address"),address_line2:p.nullable(),address_city:h.required("Enter city"),address_state:b.required("Select state"),address_postal_code:f.required("Enter postal code")}),a=o({name:u.nullable(),address_line1:m.nullable(),address_line2:p.nullable(),address_city:h.nullable(),address_state:b.nullable(),address_postal_code:f.required("Enter postal code")});return e?a:t},w=class{constructor(e){t(this,e),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}connectedCallback(){this.unsubscribe=g("billingFormFields",(e=>{this.formController.setInitialValues(e)}))}disconnectedCallback(){var e;null===(e=this.unsubscribe)||void 0===e||e.call(this)}componentWillLoad(){this.formController=new l(_())}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async validate(){return{isValid:await this.formController.validate()}}render(){const t=this.formController.getInitialValues();return e(i,{key:"abaa29c5d463c95801ebeadb254a2b87fe116dd0"},e("div",{key:"f3327594ec80d1365e23cebc523d18581093ed70",part:y},e("form",{key:"2aa614c338af201f648cb03f7865238bb82aa2e4"},e("fieldset",{key:"a00e9457818d996eee924e996464146a741a5468"},e("div",{key:"a7d18b979c2505ea8e0ba8b8427f0191060da3c0",class:"row gy-3"},e("div",{key:"a3ee71f96aafa50cf65e54a1e259d59b44de7494",class:"col-12"},e("form-control-text",{key:"d9bd8c2db3ed0b7d6062a8ca454f1c33caf84471",name:"name",label:"Full Name",defaultValue:t.name,errorText:this.errors.name,inputHandler:this.inputHandler})),e("div",{key:"539f0e9ec635487c6118ec40b1bcf683efa5b64d",class:"col-12"},e("form-control-text",{key:"10ae18b859dffb202ba014fb303917c58b95953b",name:"address_line1",label:"Street Address",defaultValue:t.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),e("div",{key:"bc6aba1d85cef27587e07bcf15073c766936ca8f",class:"col-12"},e("form-control-text",{key:"073673edb594797a2158a1d5b04022b407b9ed0c",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:t.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),e("div",{key:"50062f42ee4da8238ffcc42b2f6850bbad309ffd",class:"col-12"},e("form-control-text",{key:"4bf1c47edb3faca18aec278bef52d078d59f60ed",name:"address_city",label:"City",defaultValue:t.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),e("div",{key:"d2b8c326762474d38b5271f89d682be763fb0f44",class:"col-12"},e("form-control-select",{key:"506286fed3c031d72cae737c4631ec4f91428ceb",name:"address_state",label:"State",options:v,defaultValue:t.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),e("div",{key:"f70fd74b32594b43a524cb305c79854bcb5ea2ba",class:"col-12"},e("form-control-text",{key:"8f24531c98865727c2b585feef088f9f2c9c7e96",name:"address_postal_code",label:"ZIP",defaultValue:t.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:k})))))))}},C=t=>{const{isReady:a}=t;return a?null:e("div",{class:"container-fluid p-0"},e("div",{class:"mb-3"},e(s,{height:"18px",width:"100px"}),e(s,{height:"36px"})),e("div",{class:"row"},e("div",{class:"col-4 align-content-end"},e(s,{height:"18px",width:"80px"}),e(s,{height:"36px"})),e("div",{class:"col-4 align-content-end"},e(s,{height:"36px"})),e("div",{class:"col-4 align-content-end"},e(s,{height:"18px",width:"30px"}),e(s,{height:"36px"}))))},V=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await n(),this.iframeOrigin=r.iframeOrigin,c(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.cardNumberIframeElement.validate(),t=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),i=await this.cvvIframeElement.validate();return e&&t&&a&&i}async tokenize({clientId:e,paymentMethodMetadata:t,account:a}){return this.cardNumberIframeElement.tokenize(e,t,a)}render(){return e(i,{key:"7cb0c0a08ef0572fa1604e17edbf19478ea3f36b"},e(C,{key:"5314b766fd972e03dbb7632776c97617132a861d",isReady:this.isReady}),e("hidden-input",{key:"479b8a68d10eb9e7e0358e165345020290ed6690"}),e("div",{key:"a71bc32cfbef8b37d47c56662094dc6e292ff1f3",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},e("div",{key:"64c8b172e9786cf1cdefaea11bcb27d665015ecf",class:"mb-3"},e("iframe-input",{key:"c31ef9a392acbe9b2aabcacb0a37d4999853bbfc",inputId:"cardNumber",ref:e=>this.cardNumberIframeElement=e,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),e("div",{key:"7c60c66b4212423fa08a902c6550c2ca757198b8",class:"row"},e("div",{key:"712d7b397299596d4b9dfd91ebdce84e028ec925",class:"col-4 align-content-end"},e("iframe-input",{key:"2caf6a11018a30dbac0b973387e23fd0d00f96bd",inputId:"expirationMonth",ref:e=>this.expirationMonthIframeElement=e,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),e("div",{key:"41122ae04a8b6c568157213874df4a7d483cba41",class:"col-4 align-content-end"},e("iframe-input",{key:"abd6e99b75446663e428094dd3588e02f849fb85",inputId:"expirationYear",ref:e=>this.expirationYearIframeElement=e,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),e("div",{key:"c974afa273e7f150cb365704401e49408074faac",class:"col-4 align-content-end"},e("iframe-input",{key:"c3998a85c9043a08d60b667c86e20bee5e5f007c",inputId:"CVV",ref:e=>this.cvvIframeElement=e,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},O=class{constructor(e){t(this,e),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}connectedCallback(){this.unsubscribe=g("billingFormFields",(e=>{this.formController.setInitialValues(e)}))}disconnectedCallback(){var e;null===(e=this.unsubscribe)||void 0===e||e.call(this)}componentWillLoad(){this.formController=new l(_(!0))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const t=this.formController.getInitialValues();return e(i,{key:"be5335622cb907795f13522a0b12e70e9854b2b6"},e("form",{key:"9fd26fb2568030bf000d5501e5063b79a98ab02e"},e("form-control-text",{key:"aed14596c15442d99705dd75f5349186b60a8a89",name:"address_postal_code",label:"ZIP",defaultValue:t.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:k})))}},I=class{constructor(e){t(this,e),this.checkboxChanged=a(this,"checkboxChanged"),this.isChecked=!1}handleCheckboxChange(e,t){this.isChecked=t,this.checkboxChanged.emit(this.isChecked)}render(){return e(i,{key:"114f1887f2aebee2440d5c0b187fe1f361137230"},e("div",{key:"8a967beb89065a8b3ee501f0589b6617764c641e",class:"mt-4 form-check"},e("form-control-checkbox",{key:"b22ca881a5fcda9dc044dfd1175e9ae06fd9f504",label:"Save new payment method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange.bind(this)})))}};export{x as justifi_bank_account_form,w as justifi_billing_information_form,V as justifi_card_form,O as justifi_postal_code_form,I as justifi_save_new_payment_method}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as i,h as t}from"./p-kpoIU4v_.js";import{E as
|
|
1
|
+
import{r as s,c as i,h as t}from"./p-kpoIU4v_.js";import{E as o}from"./p-CEYGUVns.js";import{B as r}from"./p-DVPcHdzq.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as n,J as h}from"./p-VDUjfAoW.js";import"./p-D3G5aVLy.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-Dm6cO_sz.js";const j=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){n(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new r})}render(){return this.errorMessage?o(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{j as justifi_business_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as s,c as e}from"./p-kpoIU4v_.js";import{c as r,a as i,F as o}from"./p-CR9D6mKt.js";import{f as n}from"./p-B7jE0g5_.js";import"./p-9y5MOK55.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,i as m}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{B as h}from"./p-Cm_ywVHL.js";import{S as p}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-ObR0KZw0.js";import{m as d}from"./p-DSfL8jLw.js";import{c as f,J as j}from"./p-
|
|
1
|
+
import{h as t,r as s,c as e}from"./p-kpoIU4v_.js";import{c as r,a as i,F as o}from"./p-CR9D6mKt.js";import{f as n}from"./p-B7jE0g5_.js";import"./p-9y5MOK55.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,i as m}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{B as h}from"./p-Cm_ywVHL.js";import{S as p}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-ObR0KZw0.js";import{m as d}from"./p-DSfL8jLw.js";import{c as f,J as j}from"./p-VDUjfAoW.js";import{g as v,a as y}from"./p-D2muobcE.js";import{A as b}from"./p-Dj1uo4J3.js";import{S as w}from"./p-Bz8JT676.js";import"./p-BFTU3MAI.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D3G5aVLy.js";import"./p-Dm6cO_sz.js";const g=t=>{const s=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${n(s)}`,(function(t){return+t<=+s})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},R=t=>{if(t)return r({amount:g(t),description:i().optional(),reason:i().optional().oneOf([l.customerRequest,l.duplicate,l.fraudulent],"Select a reason")})},C=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],T=b();class A{async postRefund(t,s,e,r){return T.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":s},body:r,authToken:e})}}const B=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),x=()=>t(p,null,t("div",{class:"row gap-5"},t(B,null),t(B,null),t(B,null))),D=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,s)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:s}))}}componentWillLoad(){f(),this.analytics=new j(this),this.initializeApi(),this.formController=new o(R())}handleError(t,s,e){this.errorEvent.emit({errorCode:t,message:s,severity:e})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(u.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",a.ERROR)}initializeFormController(){const t=this.refundPayload.amount,s=t?t.toString():"0";this.formController=new o(R(s)),this.formController.setInitialValues({amount:s}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?d({id:this.paymentId,authToken:this.authToken,service:new c})({onSuccess:({payment:t})=>{this.refundPayload=new m({amount:t.amount_refundable})},onError:({error:t,code:s,severity:e})=>{this.handleError(s,t,e)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(u.MISSING_PROPS,"Payment ID and Auth Token are required",a.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const s=(({authToken:t,accountId:s,paymentId:e,service:r})=>async({refundBody:i,onSuccess:o,onError:n,final:u})=>{var l;try{const u=await r.postRefund(e,s,t,i);if(u.error)return n({error:y(u.error),code:v(null===(l=u.error)||void 0===l?void 0:l.code),severity:a.ERROR});o(u)}catch(t){const s=v(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:a.ERROR})}finally{return u()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new A}),e=this.formController.values.getValue();return this.refundLoading=!0,new Promise((t=>{let r;s({refundBody:e,onSuccess:t=>{r=t},onError:({error:t,code:s,severity:e})=>{r=t,this.handleError(t,s,e)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,t(r.data)}})}))}render(){if(this.paymentLoading)return t(x,null);const s=this.formController.getInitialValues(),e=this.refundPayload.amount;return t(p,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:s.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:s.reason,inputHandler:this.inputHandler,options:C,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:s.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(h,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${n(+e)}`))))))}};export{D as justifi_refund_payment}
|