@justifi/webcomponents 5.3.4-rc → 5.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Analytics-25d07997.js → Analytics-2fb20059.js} +1 -1
- package/dist/cjs/billing-form_3.cjs.entry.js +1 -1
- package/dist/cjs/{check-pkg-version-407ee257.js → check-pkg-version-f5a3d421.js} +1 -1
- package/dist/cjs/{get-payout-csv-78297c3a.js → get-payout-csv-13d68dab.js} +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +3 -3
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +3 -3
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payout-details.cjs.entry.js +7 -5
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-74690e82.js → package-e8aa0c51.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/payout-details/get-payout-csv.js +2 -2
- package/dist/collection/components/payout-details/payout-details.js +21 -1
- package/dist/docs.json +23 -1
- package/dist/esm/{Analytics-1051e87d.js → Analytics-759c7da5.js} +1 -1
- package/dist/esm/billing-form_3.entry.js +1 -1
- package/dist/esm/{check-pkg-version-cdc4a3de.js → check-pkg-version-1d6e48c8.js} +1 -1
- package/dist/esm/{get-payout-csv-be3ee3f0.js → get-payout-csv-8450b60d.js} +2 -2
- package/dist/esm/justifi-business-details.entry.js +3 -3
- package/dist/esm/justifi-business-form.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +3 -3
- package/dist/esm/justifi-checkouts-list.entry.js +3 -3
- package/dist/esm/justifi-dispute-management.entry.js +3 -3
- package/dist/esm/justifi-dispute-notification_3.entry.js +3 -3
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
- package/dist/esm/justifi-order-terminals.entry.js +3 -3
- package/dist/esm/justifi-payment-details.entry.js +3 -3
- package/dist/esm/justifi-payment-provisioning.entry.js +3 -3
- package/dist/esm/justifi-payments-list.entry.js +3 -3
- package/dist/esm/justifi-payout-details.entry.js +7 -5
- package/dist/esm/justifi-payouts-list.entry.js +4 -4
- package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +3 -3
- package/dist/esm/justifi-tokenize-payment-method.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-8bc1e068.js → package-49477570.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/get-payout-csv.js +2 -2
- package/dist/module/justifi-payout-details.js +4 -1
- package/dist/module/package.js +1 -1
- package/dist/types/api/services/payout.service.d.ts +1 -1
- package/dist/types/components/payout-details/get-payout-csv.d.ts +2 -1
- package/dist/types/components/payout-details/payout-details.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/webcomponents/{p-5d2d11be.entry.js → p-08a17c5c.entry.js} +1 -1
- package/dist/webcomponents/{p-f6aa31bc.entry.js → p-0f4d851d.entry.js} +1 -1
- package/dist/webcomponents/p-1aa22806.js +1 -0
- package/dist/webcomponents/p-29688e30.js +1 -0
- package/dist/webcomponents/p-39a63e0c.entry.js +1 -0
- package/dist/webcomponents/p-53b660a3.entry.js +1 -0
- package/dist/webcomponents/{p-2e1081d7.entry.js → p-56697a12.entry.js} +1 -1
- package/dist/webcomponents/{p-59918c9e.entry.js → p-670296bf.entry.js} +1 -1
- package/dist/webcomponents/p-75b7dfe7.entry.js +1 -0
- package/dist/webcomponents/{p-e8fdbc36.entry.js → p-7d2538d9.entry.js} +1 -1
- package/dist/webcomponents/{p-4b718a6c.entry.js → p-8548edd6.entry.js} +1 -1
- package/dist/webcomponents/{p-06d34949.entry.js → p-9055aa6e.entry.js} +1 -1
- package/dist/webcomponents/{p-93accc9a.entry.js → p-9cbbe9cb.entry.js} +1 -1
- package/dist/webcomponents/{p-2208ab4c.entry.js → p-a6b66c88.entry.js} +1 -1
- package/dist/webcomponents/{p-c3ada049.entry.js → p-acca56ec.entry.js} +1 -1
- package/dist/webcomponents/{p-58a3c5a6.entry.js → p-ae271c06.entry.js} +1 -1
- package/dist/webcomponents/p-bfe339d5.js +1 -0
- package/dist/webcomponents/{p-60948775.entry.js → p-c2196cb8.entry.js} +1 -1
- package/dist/webcomponents/{p-8b6a3249.entry.js → p-d279545a.entry.js} +1 -1
- package/dist/webcomponents/{p-5ab25e5d.js → p-df2559c7.js} +1 -1
- package/dist/webcomponents/{p-65880158.entry.js → p-fa843aad.entry.js} +1 -1
- package/dist/webcomponents/{p-ad0fffc5.entry.js → p-fc3d2a9e.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-13de2830.entry.js +0 -1
- package/dist/webcomponents/p-1f270bb9.entry.js +0 -1
- package/dist/webcomponents/p-39d421c9.entry.js +0 -1
- package/dist/webcomponents/p-7746acac.js +0 -1
- package/dist/webcomponents/p-82cbcce9.js +0 -1
- package/dist/webcomponents/p-f9ff808d.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-2783e363.js";import{a as s,C as o}from"./p-9dd8685c.js";import{g as r,a}from"./p-87f8c596.js";import{C as c}from"./p-ff1f2d65.js";import{J as h}from"./p-df2559c7.js";import{c as d}from"./p-1aa22806.js";import"./p-0e180654.js";import"./p-389e1eb7.js";import"./p-2ca5b5e4.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import"./p-29688e30.js";const n=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event",7),this.loadedEvent=i(this,"loaded",7),this.authToken=void 0,this.checkoutId=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.disableBnpl=void 0,this.disablePaymentMethodGroup=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin="https://components.justifi.ai/v2",this.getCheckout=void 0,this.complete=void 0,this.errorMessage=""}componentWillLoad(){d(),this.analytics=new h(this),this.initializeGetCheckout()}disconnectedCallback(){this.analytics.cleanup()}initializeGetCheckout(){this.authToken&&this.checkoutId?(this.getCheckout=(({authToken:t,checkoutId:i,service:e})=>async({onSuccess:o,onError:c})=>{var h;try{const d=await e.fetchCheckout(t,i);if(d.error)return c({error:r(d.error),code:a(null===(h=d.error)||void 0===h?void 0:h.code),severity:s.ERROR});o({checkout:d.data})}catch(t){const i=a(null==t?void 0:t.code);return c({error:t.message||t,code:i,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new c}),this.complete=(({authToken:t,checkoutId:i,service:e})=>async({payment:o,onSuccess:c,onError:h})=>{var d;try{const n=await e.complete(t,i,o);if(n.error)return h({error:r(n.error),code:a(null===(d=n.error)||void 0===d?void 0:d.code),severity:s.ERROR});c(n)}catch(t){const i=a(null==t?void 0:t.code);return h({error:t.message||t,code:i,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new c})):this.errorEvent.emit({message:"auth-token and checkout-id are required",errorCode:o.MISSING_PROPS,severity:s.ERROR})}propChanged(){this.initializeGetCheckout()}async fillBillingForm(t){this.checkoutCoreRef.fillBillingForm(t)}render(){return e("justifi-checkout-core",{key:"52aca1a3ce8016a382f428ef142abc8aee9da41d",getCheckout:this.getCheckout,authToken:this.authToken,complete:this.complete,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,disableBnpl:this.disableBnpl,disablePaymentMethodGroup:this.disablePaymentMethodGroup,hideCardBillingForm:this.hideCardBillingForm,iframeOrigin:this.iframeOrigin,ref:t=>{t&&(this.checkoutCoreRef=t)}},e("div",{key:"fabb53264f26320fff2aa0a603c664f47ca380d0",slot:"insurance"},e("slot",{key:"ce09504ef5a48d6b963f4ba39252d681f23d0168",name:"insurance"})))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"]}}};export{n as justifi_checkout}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as i,h as t,H as o}from"./p-2783e363.js";import{E as r}from"./p-8b16a20f.js";import{B as e}from"./p-b4ed5a2c.js";import{m as p}from"./p-f30cb232.js";import{C as a,a as h}from"./p-9dd8685c.js";import{J as m}from"./p-
|
|
1
|
+
import{r as s,c as i,h as t,H as o}from"./p-2783e363.js";import{E as r}from"./p-8b16a20f.js";import{B as e}from"./p-b4ed5a2c.js";import{m as p}from"./p-f30cb232.js";import{C as a,a as h}from"./p-9dd8685c.js";import{J as m}from"./p-df2559c7.js";import{c as d}from"./p-1aa22806.js";import"./p-e8cd9691.js";import"./p-0e180654.js";import"./p-5d1d2fd7.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-87f8c596.js";import"./p-29688e30.js";const n=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.businessId=void 0,this.authToken=void 0,this.errorMessage=void 0,this.getBusiness=void 0}componentWillLoad(){d(),this.analytics=new m(this),this.initializeGetBusiness()}disconnectedCallback(){this.analytics.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:this.errorMessage,severity:h.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new e})}render(){return t(o,null,this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness}))}};export{n as justifi_business_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./p-2783e363.js";import{a as e,C as o}from"./p-9dd8685c.js";import{J as
|
|
1
|
+
import{r as t,c as i,h as s}from"./p-2783e363.js";import{a as e,C as o}from"./p-9dd8685c.js";import{J as r}from"./p-df2559c7.js";import{c as a}from"./p-1aa22806.js";import{m as p,P as n}from"./p-bfe339d5.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{P as c}from"./p-42a48c59.js";import"./p-61f0a2ce.js";import{g as h,a as d}from"./p-87f8c596.js";import{m,S as l}from"./p-29fbbc93.js";import{S as u}from"./p-bfe9748b.js";import{d as b}from"./p-300a99ee.js";import"./p-29688e30.js";import"./p-0e180654.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-8a7266b4.js";import"./p-3b680e50.js";import"./p-e8cd9691.js";const f=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getPayouts=void 0,this.getPayoutCSV=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin="https://wc-proxy.justifi.ai",this.columns=b}componentWillLoad(){a(),this.analytics=new r(this),this.initializeGetData()}disconnectedCallback(){this.analytics.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 n,apiOrigin:this.apiOrigin};this.getPayouts=(({id:t,authToken:i,service:s,apiOrigin:o})=>async({params:r,onSuccess:a,onError:p})=>{var n,m;try{const l=await s.fetchPayouts(t,i,r,o);if(l.error)return p({error:h(l.error),code:d(null===(m=l.error)||void 0===m?void 0:m.code),severity:e.ERROR});{const t=Object.assign({},l.page_info);a({payouts:(null===(n=l.data)||void 0===n?void 0:n.map((t=>new c(t))))||[],pagingInfo:t})}}catch(t){const i=d(null==t?void 0:t.code);return p({error:t.message||t,code:i,severity:e.ERROR})}})(t),this.getPayoutCSV=p(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new l,apiOrigin:this.apiOrigin}))}render(){return s(u,{key:"259a62df9d161fc97d731ccc8488f556580f5378",exportedparts:"\ntable-head,table-head-row,table-head-cell,table-body,table-row,table-row-even,\ntable-row-odd,table-cell,loading-state-cell,loading-state-spinner,error-state,\nempty-state,pagination-bar,page-arrow,page-button,page-button-disabled,page-button-text\n"},s("payouts-list-core",{key:"9733d459d09173f4b9dec953d9c763910ac54e1d",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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as i,h as t}from"./p-2783e363.js";import{J as e}from"./p-df2559c7.js";import{C as o,a as r}from"./p-9dd8685c.js";import{m as n,a}from"./p-b84ee6d8.js";import{B as p}from"./p-b4ed5a2c.js";import{A as h}from"./p-0e180654.js";import{c as d}from"./p-1aa22806.js";import"./p-29688e30.js";import"./p-87f8c596.js";class c{async postProvisioning(s,i,t){const e={business_id:i,product_category:t};return h({authToken:s,apiOrigin:"https://wc-proxy.justifi.ai"}).post("entities/provisioning",e)}}const m=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.postProvisioning=void 0,this.getBusiness=void 0,this.businessId=void 0,this.authToken=void 0,this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){d(),this.analytics=new e(this),this.initializeApi()}disconnectedCallback(){this.analytics.cleanup()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new p}),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:o.MISSING_PROPS,severity:r.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"ca4b13afe923312bd51d477eae50099876991599",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{m as justifi_payment_provisioning}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,h as i}from"./p-2783e363.js";import{S as t}from"./p-bfe9748b.js";import{c as r}from"./p-
|
|
1
|
+
import{r as s,h as i}from"./p-2783e363.js";import{S as t}from"./p-bfe9748b.js";import{c as r}from"./p-1aa22806.js";import{d as e}from"./p-cbe05f11.js";import"./p-29688e30.js";import"./p-e8cd9691.js";const o=class{constructor(i){s(this,i),this.getTerminalOrders=void 0,this.errorMessage=null,this.businessId=void 0,this.authToken=void 0,this.apiOrigin="https://wc-proxy.justifi.ai",this.columns=e}componentWillLoad(){r(),this.initializeGetTerminalOrders()}initializeGetTerminalOrders(){this.businessId&&this.authToken?this.getTerminalOrders=()=>{console.log("getTerminalOrders")}:this.errorMessage="Business ID and Auth Token are required"}render(){return i(t,{key:"54ebb6b9b12b123caaa6d5190d0a1c6c2198d3e3"},i("terminal-orders-list-core",{key:"99376fd9a6b5657d8777a4873f16b98a4bcf03cf",getTerminalOrders:this.getTerminalOrders,columns:this.columns}))}};export{o as justifi_terminal_orders_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as s,h as t}from"./p-2783e363.js";import{B as e}from"./p-06f5b709.js";import{S as a}from"./p-bfe9748b.js";import{c as o}from"./p-
|
|
1
|
+
import{r as i,c as s,h as t}from"./p-2783e363.js";import{B as e}from"./p-06f5b709.js";import{S as a}from"./p-bfe9748b.js";import{c as o}from"./p-1aa22806.js";import{J as r}from"./p-df2559c7.js";import{a as d,C as c}from"./p-9dd8685c.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import"./p-e8cd9691.js";import"./p-29688e30.js";import"./p-0e180654.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";const h=class{constructor(t){i(this,t),this.errorEvent=s(this,"error-event",7),this.submitEvent=s(this,"submit-event",7),this.authToken=void 0,this.accountId=void 0,this.paymentMethodGroupId=void 0,this.submitButtonText=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.hideSubmitButton=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin="https://components.justifi.ai/v2",this.isLoading=!1}componentWillLoad(){o(),this.analytics=new r(this)}async tokenizePaymentMethod(i){let s;i&&i.preventDefault(),this.isLoading=!0;try{s=await this.paymentMethodOptionsRef.resolvePaymentMethod({isValid:!0}),s.error&&this.errorEvent.emit({errorCode:s.error.code,message:s.error.message,severity:d.ERROR})}catch(i){this.errorEvent.emit({errorCode:c.TOKENIZE_ERROR,message:i.message,severity:d.ERROR})}finally{return this.submitEvent.emit({response:s}),this.isLoading=!1,s}}async fillBillingForm(i){this.paymentMethodOptionsRef.fillBillingForm(i)}render(){return t(a,{key:"ac989aa84f6262ff1b72a88fc7c4ebb0e62175dc"},t("form",{key:"482ebf3ca3ac67738fdd0243de8d29ad66754313"},t("fieldset",{key:"e563783b34d570bafd1788949a486454ce70ab4a"},t("div",{key:"a42f5625f5d0860153f4260aa9c5f76f4afcad06",class:"row gy-3"},t("div",{key:"f64bb331c9922be711bfdd9a50d76530773867c0",class:"col-12"},t("justifi-payment-method-options",{key:"dc23821a9130ee6435c92e20574a0bf056e1c29c",ref:i=>this.paymentMethodOptionsRef=i,"show-card":!this.disableCreditCard,"show-ach":!this.disableBankAccount,"show-bnpl":!1,paymentMethodGroupId:this.paymentMethodGroupId,"show-saved-payment-methods":!1,hideCardBillingForm:this.hideCardBillingForm,authToken:this.authToken,"account-id":this.accountId,iframeOrigin:this.iframeOrigin})),t("div",{key:"29ec96487c4a5d54c4883c4cfe4a6ee4a309042f",class:"col-12"},t(e,{key:"fe116e392e79debf6a858c993ba11a21d417d998",variant:"primary",type:"submit",onClick:i=>this.tokenizePaymentMethod(i),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.hideSubmitButton},this.submitButtonText||"Submit"))))))}};export{h as justifi_tokenize_payment_method}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as s}from"./p-2783e363.js";import{f as i}from"./p-2ca5b5e4.js";import{t as a,B as r}from"./p-e8cd9691.js";import{B as d}from"./p-06f5b709.js";import{S as c}from"./p-bfe9748b.js";import{S as o}from"./p-e9e80a62.js";import{a as n,C as h}from"./p-9dd8685c.js";import{g as p,a as f}from"./p-87f8c596.js";import{D as l}from"./p-14f40baa.js";import{D as b}from"./p-667ebd79.js";import{c as u}from"./p-82cbcce9.js";import{J as y}from"./p-5ab25e5d.js";import"./p-0e180654.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import"./p-7746acac.js";const v=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},m=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7),this.dispute=void 0,this.authToken=void 0,this.isLoading=void 0}acceptDispute(){v({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:b.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"77119b1227200909f4742e24df0a45e1f631c65c"},this.isLoading&&s("div",{key:"f0766ff057fb2f4b75b34c7d4a386bde43e49652",style:{marginBottom:"8px"}},s(o,{key:"d7268194dea5ac2a3b87aea8e17573b4768e308f",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"f8863e45a917f56be302ca1b0b3d472119f6465c",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"c7b8c9c89d9488eea3be8ea0b4536f98a8151487",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"875fe7def317ce1c4547e04e83baf2b232209058",part:a},s("h1",{key:"09646afc2aac3bf4ef9737bc12442660bbafb2dd",class:"h4",part:r},"This payment is disputed"),s("p",{key:"14224cffb16726eaa589118be954e0f844ffaee8"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"415028b91872a2391796872fdffdbee837a2a511",class:"h5"},"Dispute details"),s("div",{key:"c2b8c6be3132f98eb8c686ab88a5a6a68f92a60e",class:"d-table gap-2"},s("div",{key:"d11bd8b3bc680183e8bee40281cc2c294aedbd5a",class:"d-table-row gap-2"},s("span",{key:"d77796c0d2764329c3b482ae49ceb8b4cac03d37",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"716d8af2a250c3237af6e23b43bf50e032e9f203",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"daba4379197533d2a4b246e81139d81cd15761c6",class:"d-table-row gap-2"},s("span",{key:"a039fbf47aff16445e3411c33a7b53716c42866d",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"19087aba5c516d0c71e9f84e8b3323a044ae532a",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"68ef78b15627df3b22bcde4b90f7c216466e7468",class:"d-table-row gap-2"},s("span",{key:"9463c281d76b5e201a55c2993253fc22d04168dc",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"5cffed27038f5571f37377c5023a88c8b7773a59",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"e856d924edac10116781425f6d7c4c8c6b26ced2",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"6d5278a91f79c2fe8fbdd9e391b109a6491b13b6",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"242b9076b482aae731ab6bedc1592a1a826e24c5",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"f3711546ce5bf8b6a4a8689f5db3fdbf58f45bf4"},s("h1",{key:"06e39be43cfacf667919adbd2f4f8c596702c340",class:"h4"},"This payment is disputed and under review"),s("p",{key:"b3bfef2d40e197f8dc9df6f71d9f13017a4b923d"},"The cardholder is disputing this payment. A counter dispute has been submitEvent and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"cb6185865417d70ab67734db37b880f67160ea62"},s("h1",{key:"96dfe178f6d5de97f190f0df6bb0bf19e7b04227",class:"h4"},"This payment was disputed"),s("p",{key:"4f6e8bdd940b69d34c1d84564b83f0a1f8c76059"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"3852f5221f59739d5079ad0e56b99409167678b0"},s("h1",{key:"f6052feaabc3b94c727465a8f02534805ba968c8",class:"h4"},"This payment was disputed"),s("p",{key:"b0c91b828828842bf7a706e794124d0a8404c25e"},"The cardholder disputed this payment and the card issuer has settled it their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.errorMessage=null,this.authToken=void 0,this.disputeId=void 0,this.disputeResponse=void 0,this.apiOrigin="https://wc-proxy.justifi.ai"}componentWillLoad(){u(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=v({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"4c0cd0b8a082d9f2f4428868d88cbb9bde2a3a5d"},s("justifi-dispute-response-core",{key:"58bbf7f5b2ce8efea0467efddfeffe3c752a3402","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url,this.isLoading=!1},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s}),this.isLoading=!1}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.onCancel=()=>{this.clickEvent.emit({name:b.cancelDispute})},this.handleSubmit=async(e,t,s)=>{this.isLoading=!0,t.length&&(this.documentList=t,await this.initializeMakePresignedURLs(),await this.initializeFileUploads()),await this.saveData(e,s),this.isLoading=!1},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:b.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:b.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:b.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.currentStep=0,this.currentStepComponentRef=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"a031de7ea80f4f31c6e841be4b4640a8b7db7dcd",class:"row gy-3"},s("div",{key:"cd7ef54b4643e1a74022ed7c2e075e75076c4c44",class:"col-12"},s("h1",{key:"705612783bc67e0d01f4d24e01c9c09d1b2a7362",class:"h4",part:r},"Counter dispute")),s("div",{key:"72c35e89dc87377fe4dbcbb9fe2e2c1b58767a21",class:"col-12"},this.currentStepComponent),s("div",{key:"37d85a8980293390f15b45271f8b2a8fa4cadb29",class:"col-12"},s("div",{key:"c3b281e02b19598b11acdb09a34212edf1745173",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{m as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}
|
|
1
|
+
import{r as e,c as t,h as s}from"./p-2783e363.js";import{f as i}from"./p-2ca5b5e4.js";import{t as a,B as r}from"./p-e8cd9691.js";import{B as d}from"./p-06f5b709.js";import{S as c}from"./p-bfe9748b.js";import{S as o}from"./p-e9e80a62.js";import{a as n,C as h}from"./p-9dd8685c.js";import{g as p,a as f}from"./p-87f8c596.js";import{D as l}from"./p-14f40baa.js";import{D as b}from"./p-667ebd79.js";import{c as u}from"./p-1aa22806.js";import{J as y}from"./p-df2559c7.js";import"./p-0e180654.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import"./p-29688e30.js";const v=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},m=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7),this.dispute=void 0,this.authToken=void 0,this.isLoading=void 0}acceptDispute(){v({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:b.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"77119b1227200909f4742e24df0a45e1f631c65c"},this.isLoading&&s("div",{key:"f0766ff057fb2f4b75b34c7d4a386bde43e49652",style:{marginBottom:"8px"}},s(o,{key:"d7268194dea5ac2a3b87aea8e17573b4768e308f",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"f8863e45a917f56be302ca1b0b3d472119f6465c",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"c7b8c9c89d9488eea3be8ea0b4536f98a8151487",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"875fe7def317ce1c4547e04e83baf2b232209058",part:a},s("h1",{key:"09646afc2aac3bf4ef9737bc12442660bbafb2dd",class:"h4",part:r},"This payment is disputed"),s("p",{key:"14224cffb16726eaa589118be954e0f844ffaee8"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"415028b91872a2391796872fdffdbee837a2a511",class:"h5"},"Dispute details"),s("div",{key:"c2b8c6be3132f98eb8c686ab88a5a6a68f92a60e",class:"d-table gap-2"},s("div",{key:"d11bd8b3bc680183e8bee40281cc2c294aedbd5a",class:"d-table-row gap-2"},s("span",{key:"d77796c0d2764329c3b482ae49ceb8b4cac03d37",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"716d8af2a250c3237af6e23b43bf50e032e9f203",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"daba4379197533d2a4b246e81139d81cd15761c6",class:"d-table-row gap-2"},s("span",{key:"a039fbf47aff16445e3411c33a7b53716c42866d",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"19087aba5c516d0c71e9f84e8b3323a044ae532a",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"68ef78b15627df3b22bcde4b90f7c216466e7468",class:"d-table-row gap-2"},s("span",{key:"9463c281d76b5e201a55c2993253fc22d04168dc",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"5cffed27038f5571f37377c5023a88c8b7773a59",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"e856d924edac10116781425f6d7c4c8c6b26ced2",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"6d5278a91f79c2fe8fbdd9e391b109a6491b13b6",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"242b9076b482aae731ab6bedc1592a1a826e24c5",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"f3711546ce5bf8b6a4a8689f5db3fdbf58f45bf4"},s("h1",{key:"06e39be43cfacf667919adbd2f4f8c596702c340",class:"h4"},"This payment is disputed and under review"),s("p",{key:"b3bfef2d40e197f8dc9df6f71d9f13017a4b923d"},"The cardholder is disputing this payment. A counter dispute has been submitEvent and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"cb6185865417d70ab67734db37b880f67160ea62"},s("h1",{key:"96dfe178f6d5de97f190f0df6bb0bf19e7b04227",class:"h4"},"This payment was disputed"),s("p",{key:"4f6e8bdd940b69d34c1d84564b83f0a1f8c76059"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"3852f5221f59739d5079ad0e56b99409167678b0"},s("h1",{key:"f6052feaabc3b94c727465a8f02534805ba968c8",class:"h4"},"This payment was disputed"),s("p",{key:"b0c91b828828842bf7a706e794124d0a8404c25e"},"The cardholder disputed this payment and the card issuer has settled it their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.errorMessage=null,this.authToken=void 0,this.disputeId=void 0,this.disputeResponse=void 0,this.apiOrigin="https://wc-proxy.justifi.ai"}componentWillLoad(){u(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=v({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"4c0cd0b8a082d9f2f4428868d88cbb9bde2a3a5d"},s("justifi-dispute-response-core",{key:"58bbf7f5b2ce8efea0467efddfeffe3c752a3402","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url,this.isLoading=!1},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s}),this.isLoading=!1}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.onCancel=()=>{this.clickEvent.emit({name:b.cancelDispute})},this.handleSubmit=async(e,t,s)=>{this.isLoading=!0,t.length&&(this.documentList=t,await this.initializeMakePresignedURLs(),await this.initializeFileUploads()),await this.saveData(e,s),this.isLoading=!1},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:b.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:b.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:b.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.currentStep=0,this.currentStepComponentRef=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"a031de7ea80f4f31c6e841be4b4640a8b7db7dcd",class:"row gy-3"},s("div",{key:"cd7ef54b4643e1a74022ed7c2e075e75076c4c44",class:"col-12"},s("h1",{key:"705612783bc67e0d01f4d24e01c9c09d1b2a7362",class:"h4",part:r},"Counter dispute")),s("div",{key:"72c35e89dc87377fe4dbcbb9fe2e2c1b58767a21",class:"col-12"},this.currentStepComponent),s("div",{key:"37d85a8980293390f15b45271f8b2a8fa4cadb29",class:"col-12"},s("div",{key:"c3b281e02b19598b11acdb09a34212edf1745173",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{m as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./p-2783e363.js";import{a as e,C as o}from"./p-9dd8685c.js";import{C as r}from"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import{g as a,a as c}from"./p-87f8c596.js";import{c as h}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s}from"./p-2783e363.js";import{a as e,C as o}from"./p-9dd8685c.js";import{C as r}from"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import{g as a,a as c}from"./p-87f8c596.js";import{c as h}from"./p-1aa22806.js";import{J as p}from"./p-df2559c7.js";import{C as n}from"./p-ff1f2d65.js";import{m,S as d}from"./p-29fbbc93.js";import{S as u}from"./p-bfe9748b.js";import{d as f}from"./p-906a6027.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-29688e30.js";import"./p-0e180654.js";import"./p-3b680e50.js";import"./p-e8cd9691.js";const j=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getCheckouts=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin="https://wc-proxy.justifi.ai",this.columns=f}componentWillLoad(){h(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:i,service:s,apiOrigin:o})=>async({params:h,onSuccess:p,onError:n})=>{var m,d;try{const u=await s.fetchCheckouts(t,i,h,o);if(u.error)return n({error:a(u.error),code:c(null===(d=u.error)||void 0===d?void 0:d.code),severity:e.ERROR});{const t=Object.assign({},u.page_info);p({checkouts:(null===(m=u.data)||void 0===m?void 0:m.map((t=>new r(t))))||[],pagingInfo:t})}}catch(t){const i=c(null==t?void 0:t.code);return n({error:t.message||t,code:i,severity:e.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new n,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new d,apiOrigin:this.apiOrigin}))}render(){return s(u,{key:"ae2a18885c69808bd589848ae1b33f4a4a3085e9"},s("checkouts-list-core",{key:"86201976540a348eb800ee07e9c50f68a1f1a1cf",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_checkouts_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-2783e363.js";import{P as e}from"./p-dfebd7a4.js";import{a as r,C as o}from"./p-9dd8685c.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import{g as p,a as
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-2783e363.js";import{P as e}from"./p-dfebd7a4.js";import{a as r,C as o}from"./p-9dd8685c.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-87f8c596.js";import{J as c}from"./p-df2559c7.js";import{c as d}from"./p-1aa22806.js";import{S as h}from"./p-bfe9748b.js";import{d as m}from"./p-1278dedf.js";import"./p-0e180654.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-29688e30.js";import"./p-09496255.js";import"./p-3b680e50.js";import"./p-e8cd9691.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getPayments=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin="https://wc-proxy.justifi.ai",this.columns=m}componentWillLoad(){d(),this.analytics=new c(this),this.initializeGetPayments()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPayments()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:t,authToken:s,service:i,apiOrigin:e})=>async({params:o,onSuccess:c,onError:d,final:h})=>{var m,f;try{const h=await i.fetchPayments(t,s,o,e);if(h.error)return d({error:p(h.error),code:n(null===(f=h.error)||void 0===f?void 0:f.code),severity:r.ERROR});{const t=Object.assign({},h.page_info);c({payments:(null===(m=h.data)||void 0===m?void 0:m.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const s=n(null==t?void 0:t.code);return d({error:t.message||t,code:s,severity:r.ERROR})}finally{return h()}})({id:this.accountId,authToken:this.authToken,service:new e,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}render(){return i(h,{key:"e03e05c3cb3c8dbaf0a5e982958345feccec1902"},i("payments-list-core",{key:"05f2b38a6a854e2e08bdd559e7e8dfab2d80f398",getPayments:this.getPayments,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_payments_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as t,h as r}from"./p-2783e363.js";import{A as i}from"./p-0e180654.js";import{a as o,C as e}from"./p-9dd8685c.js";import{g as a,a as
|
|
1
|
+
import{r as s,c as t,h as r}from"./p-2783e363.js";import{A as i}from"./p-0e180654.js";import{a as o,C as e}from"./p-9dd8685c.js";import{g as a,a as h}from"./p-87f8c596.js";import{E as n}from"./p-8b16a20f.js";import{J as c}from"./p-df2559c7.js";import{c as p}from"./p-1aa22806.js";import"./p-e8cd9691.js";import"./p-29688e30.js";class d{async fetchGrossVolumeChartData(s,t){return i({authToken:t,apiOrigin:"https://wc-proxy.justifi.ai"}).get(`account/${s}/reports/gross_volume`)}}const m=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)},this.accountId=void 0,this.authToken=void 0,this.getGrossPayment=void 0,this.errorMessage=null}componentWillLoad(){p(),this.analytics=new c(this),this.initializeGetGrossPayment()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:i,onError:e})=>{var n;try{const c=await r.fetchGrossVolumeChartData(s,t);c.error?e({error:a(c.error),code:h(null===(n=c.error)||void 0===n?void 0:n.code),severity:o.ERROR}):i(c.data)}catch(s){const t=h(null==s?void 0:s.code);e({error:a(s),code:t,severity:o.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new d}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:o.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{m as justifi_gross_payment_chart}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as n,H as t,c as i,g as o}from"./p-2783e363.js";import{c as a,F as r}from"./p-5844a0f0.js";import{u as s,l as c,k as d,m as f,n as l,q as u}from"./p-95e55bb1.js";import{S as h}from"./p-6078a370.js";import{n as m}from"./p-e3c22aa9.js";import{F as b}from"./p-2f9af679.js";import{p as w}from"./p-7746acac.js";import{a as p}from"./p-4cc3c7f9.js";import{i as g,b as y,a as v,c as k,l as x}from"./p-e8cd9691.js";import"./p-c9b78275.js";import"./p-5d1d2fd7.js";import"./p-1ff8810b.js";import"./p-61f0a2ce.js";import"./p-f20b6ce1.js";const j=a({name:s.required("Enter full name"),address_line1:c.required("Enter street address"),address_line2:d.nullable(),address_city:f.required("Enter city"),address_state:l.required("Select state"),address_postal_code:u.required("Enter postal code")}),I=a({address_postal_code:u.required("Enter postal code")}),z=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new r(j)}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 e=this.formController.getInitialValues();return n(t,{key:"2763b7ac25e51e9d206d6a0bc6ed28ec13f54cc3"},n("form",{key:"758b52530cc945e9c3ce5a2ee11838a3776abc6b"},n("fieldset",{key:"2ab7312e043d3cbc03993f11ac5692692319af4b"},this.legend&&n("legend",{key:"8e324a5bb2fabc975742e866341a3434e1950a3c"},this.legend),n("div",{key:"fafd0d9fa2784341dc80fea8c53d081d2c84af5d",class:"row gy-3"},n("div",{key:"3aa18a756f3ea6ff9dcfa061cd845c714cab3540",class:"col-12"},n("form-control-text",{key:"4b75c876eef667f3d353c802376774e7c1af1b84",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),n("div",{key:"dddc81024aef4757c18b31db84204fc9e70f9ab1",class:"col-12"},n("form-control-text",{key:"d9d63301e3d87885de9414164c820df2013cb6ae",name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),n("div",{key:"f96675211a63fc785b9e759aef44f4dd4b22e0a3",class:"col-12"},n("form-control-text",{key:"f2c6a24150d640f9efbfa1748f577e32550b3507",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),n("div",{key:"83cf74afae2c4e899151cc5461a06632fef3c756",class:"col-12"},n("form-control-text",{key:"cbbf7dfac17eb69b2c9e80534051822cd4f94afd",name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),n("div",{key:"9331b691855dc4f9a60b746089552228a5b12942",class:"col-12"},n("form-control-select",{key:"f0f726fe2633ab45754691726a0008c4e50f41ac",name:"address_state",label:"State",options:h,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),n("div",{key:"0d1d00ca86d09a370330cd9f3807783a8cd981a4",class:"col-12"},n("form-control-text",{key:"0e43cfe70ca05a3d795d82f554453d12562b2ec9",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:m}))))))}};var O,M={exports:{}};O=M,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,a=!1,r=7,s="[iFrameSizer]",c=s.length,d=null,f=window.requestAnimationFrame,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},h=null,m=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(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),b={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){C(t,e)})).end()}):k("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof e&&e.amd?e([],P):O.exports=P(),window.iFrameResize=window.iFrameResize||P()}function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function p(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function y(e){return u[e]?u[e].log:o}function v(e,n){j("log",e,n,y(e))}function k(e,n){j("info",e,n,y(e))}function x(e,n){j("warn",e,n,!0)}function j(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"),N((function(){H(_),S(W),m("onResized",_)}),_,"init")}function t(e){var n=Number(u[W]["max"+e]),t=Number(u[W]["min"+e]),i=e.toLowerCase(),o=Number(_[i]);v(W,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,v(W,"Set "+i+" to min value")),o>n&&(o=n,v(W,"Set "+i+" to max value")),_[i]=""+o}function i(e){return C.slice(C.indexOf(":")+r+e)}function o(e,n){var t,i;t=function(){var t,i;L("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=_.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)},b[i=n]||(b[i]=setTimeout((function(){b[i]=null,t()}),32))}function a(e){var n=e.getBoundingClientRect();return T(W),{x:Math.floor(Number(n.left)+Number(d.x)),y:Math.floor(Number(n.top)+Number(d.y))}}function f(e){var n=e?a(_.iframe):{x:0,y:0},t={x:Number(_.width)+n.x,y:Number(_.height)+n.y};v(W,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(d=t,l(),v(W,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):x(W,"Unable to scroll to requested position, window.parentIFrame not found")}function l(){!1===m("onScroll",d)?R():S(W)}function h(e){var n={};if(0===Number(_.width)&&0===Number(_.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:_.width,y:_.height};m(e,{iframe:_.iframe,screenX:Number(n.x),screenY:Number(n.y),type:_.type})}function m(e,n){return z(W,e,n)}var w,y,j,I,O,M,C=e.data,_={},W=null;"[iFrameResizerChild]Ready"===C?function(){for(var e in u)L("iFrame requested init",V(e),u[e].iframe,e)}():s===(""+C).slice(0,c)&&C.slice(c).split(":")[0]in u?(I=(j=C.slice(c).split(":"))[1]?parseInt(j[1],10):0,O=u[j[0]]&&u[j[0]].iframe,M=getComputedStyle(O),_={iframe:O,id:j[0],height:I+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(M)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(M),width:j[2],type:j[3]},u[W=_.id]&&(u[W].loaded=!0),(y=_.type in{true:1,false:1,undefined:1})&&v(W,"Ignoring init message from meta parent page"),!y&&function(e){var n=!0;return u[e]||(n=!1,x(_.type+" No settings for "+e+". Message was: "+C)),n}(W)&&(v(W,"Received: "+C),w=!0,null===_.iframe&&(x(W,"IFrame ("+_.id+") not found"),w=!1),w&&function(){var n,t=e.origin,i=u[W]&&u[W].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(v(W,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(v(W,"Checking connection is from: "+(n=u[W]&&u[W].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+_.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[W]&&u[W].firstRun&&u[W]&&(u[W].firstRun=!1),_.type){case"close":F(_.iframe);break;case"message":c=i(6),v(W,"onMessage passed: {iframe: "+_.iframe.id+", message: "+c+"}"),m("onMessage",{iframe:_.iframe,message:JSON.parse(c)}),v(W,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":u[W].autoResize=JSON.parse(i(9));break;case"scrollTo":f(!1);break;case"scrollToOffset":f(!0);break;case"pageInfo":o(u[W]&&u[W].iframe,W),function(){function e(e,i){function a(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){v(t,e+n+" listener for sendPageInfo"),i(window,n,a)}))}function n(){e("Remove ",g)}var t=W;e("Add ",p),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[W]&&u[W].stopPageInfo&&(u[W].stopPageInfo(),delete u[W].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",r=decodeURIComponent(t),(s=document.getElementById(r)||document.getElementsByName(r)[0])?(e=a(s),v(W,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),d={x:e.x,y:e.y},l(),v(W,"--")):window.top===window.self?v(W,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):v(W,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":E(_);break;case"init":n(),m("onInit",_.iframe);break;default:0===Number(_.width)&&0===Number(_.height)?x("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,r,s,c}())):k(W,"Ignored: "+C)}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 M(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==z(t,"onClose",t)){v(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}z(t,"onClosed",t),v(t,"--"),M(e),n&&(n.disconnect(),n=null)}else v(t,"Close iframe cancelled by onClose event")}function T(n){null===d&&v(n,"Get page position: "+(d={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+d.y)}function S(e){null!==d&&(window.scrollTo(d.x,d.y),v(e,"Set page position: "+d.x+","+d.y),R())}function R(){d=null}function E(e){v(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),T(e.id),N((function(){H(e),L("reset","reset",e.iframe,e.id)}),e,"reset")}function H(e){function n(n){a||"0"!==e[n]||(a=!0,v(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"))&&L("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){v("window","Mutation observed: "+n[0].target+" "+n[0].type),_(e,16)}var t,i=w();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",v(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):v("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 N(e,n,t){t!==n.type&&f&&!window.jasmine?(v(n.id,"Requesting animation frame"),f(e)):e()}function L(e,n,t,i,o){var a,r=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(v(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(a=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,a)):x(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||r||(r=!0,x(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 V(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 C(t,a){function r(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],x(d,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,c,d=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=a&&a.id||m.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(a||{}).log,v(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);d in u&&"iFrameResizer"in t?x(d,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[d]=Object.create(null),u[d].iframe=t,u[d].firstRun=!0,u[d].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(r,e),function(e){for(var n in m)Object.prototype.hasOwnProperty.call(m,n)&&(u[d][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:m[n])}(e),u[d]&&(u[d].targetOrigin=!0===u[d].checkOrigin?""===(n=u[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(a),function(){switch(v(d,"IFrame scrolling "+(u[d]&&u[d].scrolling?"enabled":"disabled")+" for "+d),t.style.overflow=!1===(u[d]&&u[d].scrolling)?"hidden":"auto",u[d]&&u[d].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[d]?u[d].scrolling:"no"}}(),function(){function e(e){var n=u[d][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,v(d,"Set "+e+" = "+t.style[e]))}function n(e){if(u[d]["min"+e]>u[d]["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[d]&&u[d].bodyMargin)&&"0"!==(u[d]&&u[d].bodyMargin)||(u[d].bodyMarginV1=u[d].bodyMargin,u[d].bodyMargin=u[d].bodyMargin+"px"),s=V(d),(c=w())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),p(t,"load",(function(){L("iFrame.onload",s,t,e,!0),(!u[d]||!u[d].firstRun)&&u[d]&&u[d].heightCalculationMethod in l&&E({iframe:t,height:0,width:0,type:"init"})})),L("init",s,t,e,!0),u[d]&&(u[d].iframe.iFrameResizer={close:F.bind(null,u[d].iframe),removeListeners:M.bind(null,u[d].iframe),resize:L.bind(null,"Window resize","resize",u[d].iframe),moveToAnchor:function(e){L("Move to anchor","moveToAnchor:"+e,u[d].iframe,d)},sendMessage:function(e){L("Send Message","message:"+(e=JSON.stringify(e)),u[d].iframe,d)}}))}function _(e,n){null===h&&(h=setTimeout((function(){h=null,e()}),n))}function W(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visibility change"),_((function(){A("Tab Visible","resize")}),16))}function A(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&L(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+">")}(),C(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!f;e+=1)f=window[n[e]+"RequestAnimationFrame"];f?f=f.bind(window):v("setup","RequestAnimationFrame not supported")}(),p(window,"message",I),p(window,"resize",(function(){v("window","Trigger event: resize"),_((function(){A("Window resize","resize")}),16)})),p(document,"visibilitychange",W),p(document,"-webkit-visibilitychange",W),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&x("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}}}();const F=M.exports;class T{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 S=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded",7),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))},this.isFocused=!1,this.isValid=!0,this.errorText=void 0,this.inputId=void 0,this.label=void 0,this.iframeOrigin=void 0}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:w.version})}initializeFrameCommunicationService(){var e;this.frameService=new T(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?g:this.isValid?this.isFocused?v:k:y}get style(){return this.isFocused?this.isValid?p.focused:p.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(p.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"871d71c6240e94e24f7ccc4c4ec8225b4123d865",class:"form-group d-flex flex-column"},n("div",{key:"0a1d98cba0960599d29db3c269bb8b458cdfddc8",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"bfd2e61b544db648cada7a52b45809bebf5722a8",class:"form-label",htmlFor:"",part:x},this.label||""),n("div",{key:"53e9f9a29e07edcdcbb00b023ba0f24d09d852ab",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:"2adc709c4094c44181dd83906763b4809b3f168b",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{F({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(b,{key:"c54bafd097b1e3e896901252d3520bfdfe5c71b6",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}},R=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new r(I)}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 e=this.formController.getInitialValues();return n(t,{key:"e798e67c159b53a995e4a60246c6f6d6e872f1ec"},n("form",{key:"24d6980de772a360c0218e9ab50550dcee5786d5"},n("fieldset",{key:"9e990836becccdf5d12a9e15e2eb7f4078f74b08"},this.legend&&n("legend",{key:"12d445b392cf03114dbd2a37391ecc1b87304868"},this.legend),n("div",{key:"2d2fed9cf30b3869633b80b39b7684dfde66f6b7",class:"row gy-3"},n("div",{key:"8ec042863e646d5daffeb3fbb5395336406adcde",class:"col-12"},n("form-control-text",{key:"82a2c18c2a7eef7ba7ac46e53dfc9c975c8d28b7",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:m}))))))}};export{z as billing_form,S as iframe_input,R as postal_form}
|
|
1
|
+
import{r as e,h as n,H as t,c as i,g as o}from"./p-2783e363.js";import{c as a,F as r}from"./p-5844a0f0.js";import{u as s,l as c,k as d,m as f,n as l,q as u}from"./p-95e55bb1.js";import{S as h}from"./p-6078a370.js";import{n as m}from"./p-e3c22aa9.js";import{F as b}from"./p-2f9af679.js";import{p as w}from"./p-29688e30.js";import{a as p}from"./p-4cc3c7f9.js";import{i as g,b as y,a as v,c as k,l as x}from"./p-e8cd9691.js";import"./p-c9b78275.js";import"./p-5d1d2fd7.js";import"./p-1ff8810b.js";import"./p-61f0a2ce.js";import"./p-f20b6ce1.js";const j=a({name:s.required("Enter full name"),address_line1:c.required("Enter street address"),address_line2:d.nullable(),address_city:f.required("Enter city"),address_state:l.required("Select state"),address_postal_code:u.required("Enter postal code")}),I=a({address_postal_code:u.required("Enter postal code")}),z=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new r(j)}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 e=this.formController.getInitialValues();return n(t,{key:"2763b7ac25e51e9d206d6a0bc6ed28ec13f54cc3"},n("form",{key:"758b52530cc945e9c3ce5a2ee11838a3776abc6b"},n("fieldset",{key:"2ab7312e043d3cbc03993f11ac5692692319af4b"},this.legend&&n("legend",{key:"8e324a5bb2fabc975742e866341a3434e1950a3c"},this.legend),n("div",{key:"fafd0d9fa2784341dc80fea8c53d081d2c84af5d",class:"row gy-3"},n("div",{key:"3aa18a756f3ea6ff9dcfa061cd845c714cab3540",class:"col-12"},n("form-control-text",{key:"4b75c876eef667f3d353c802376774e7c1af1b84",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),n("div",{key:"dddc81024aef4757c18b31db84204fc9e70f9ab1",class:"col-12"},n("form-control-text",{key:"d9d63301e3d87885de9414164c820df2013cb6ae",name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),n("div",{key:"f96675211a63fc785b9e759aef44f4dd4b22e0a3",class:"col-12"},n("form-control-text",{key:"f2c6a24150d640f9efbfa1748f577e32550b3507",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),n("div",{key:"83cf74afae2c4e899151cc5461a06632fef3c756",class:"col-12"},n("form-control-text",{key:"cbbf7dfac17eb69b2c9e80534051822cd4f94afd",name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),n("div",{key:"9331b691855dc4f9a60b746089552228a5b12942",class:"col-12"},n("form-control-select",{key:"f0f726fe2633ab45754691726a0008c4e50f41ac",name:"address_state",label:"State",options:h,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),n("div",{key:"0d1d00ca86d09a370330cd9f3807783a8cd981a4",class:"col-12"},n("form-control-text",{key:"0e43cfe70ca05a3d795d82f554453d12562b2ec9",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:m}))))))}};var O,M={exports:{}};O=M,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,a=!1,r=7,s="[iFrameSizer]",c=s.length,d=null,f=window.requestAnimationFrame,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},h=null,m=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(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),b={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){C(t,e)})).end()}):k("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof e&&e.amd?e([],P):O.exports=P(),window.iFrameResize=window.iFrameResize||P()}function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function p(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function y(e){return u[e]?u[e].log:o}function v(e,n){j("log",e,n,y(e))}function k(e,n){j("info",e,n,y(e))}function x(e,n){j("warn",e,n,!0)}function j(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"),N((function(){H(_),S(W),m("onResized",_)}),_,"init")}function t(e){var n=Number(u[W]["max"+e]),t=Number(u[W]["min"+e]),i=e.toLowerCase(),o=Number(_[i]);v(W,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,v(W,"Set "+i+" to min value")),o>n&&(o=n,v(W,"Set "+i+" to max value")),_[i]=""+o}function i(e){return C.slice(C.indexOf(":")+r+e)}function o(e,n){var t,i;t=function(){var t,i;L("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=_.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)},b[i=n]||(b[i]=setTimeout((function(){b[i]=null,t()}),32))}function a(e){var n=e.getBoundingClientRect();return T(W),{x:Math.floor(Number(n.left)+Number(d.x)),y:Math.floor(Number(n.top)+Number(d.y))}}function f(e){var n=e?a(_.iframe):{x:0,y:0},t={x:Number(_.width)+n.x,y:Number(_.height)+n.y};v(W,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(d=t,l(),v(W,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):x(W,"Unable to scroll to requested position, window.parentIFrame not found")}function l(){!1===m("onScroll",d)?R():S(W)}function h(e){var n={};if(0===Number(_.width)&&0===Number(_.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:_.width,y:_.height};m(e,{iframe:_.iframe,screenX:Number(n.x),screenY:Number(n.y),type:_.type})}function m(e,n){return z(W,e,n)}var w,y,j,I,O,M,C=e.data,_={},W=null;"[iFrameResizerChild]Ready"===C?function(){for(var e in u)L("iFrame requested init",V(e),u[e].iframe,e)}():s===(""+C).slice(0,c)&&C.slice(c).split(":")[0]in u?(I=(j=C.slice(c).split(":"))[1]?parseInt(j[1],10):0,O=u[j[0]]&&u[j[0]].iframe,M=getComputedStyle(O),_={iframe:O,id:j[0],height:I+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(M)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(M),width:j[2],type:j[3]},u[W=_.id]&&(u[W].loaded=!0),(y=_.type in{true:1,false:1,undefined:1})&&v(W,"Ignoring init message from meta parent page"),!y&&function(e){var n=!0;return u[e]||(n=!1,x(_.type+" No settings for "+e+". Message was: "+C)),n}(W)&&(v(W,"Received: "+C),w=!0,null===_.iframe&&(x(W,"IFrame ("+_.id+") not found"),w=!1),w&&function(){var n,t=e.origin,i=u[W]&&u[W].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(v(W,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(v(W,"Checking connection is from: "+(n=u[W]&&u[W].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+_.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[W]&&u[W].firstRun&&u[W]&&(u[W].firstRun=!1),_.type){case"close":F(_.iframe);break;case"message":c=i(6),v(W,"onMessage passed: {iframe: "+_.iframe.id+", message: "+c+"}"),m("onMessage",{iframe:_.iframe,message:JSON.parse(c)}),v(W,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":u[W].autoResize=JSON.parse(i(9));break;case"scrollTo":f(!1);break;case"scrollToOffset":f(!0);break;case"pageInfo":o(u[W]&&u[W].iframe,W),function(){function e(e,i){function a(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){v(t,e+n+" listener for sendPageInfo"),i(window,n,a)}))}function n(){e("Remove ",g)}var t=W;e("Add ",p),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[W]&&u[W].stopPageInfo&&(u[W].stopPageInfo(),delete u[W].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",r=decodeURIComponent(t),(s=document.getElementById(r)||document.getElementsByName(r)[0])?(e=a(s),v(W,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),d={x:e.x,y:e.y},l(),v(W,"--")):window.top===window.self?v(W,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):v(W,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":E(_);break;case"init":n(),m("onInit",_.iframe);break;default:0===Number(_.width)&&0===Number(_.height)?x("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,r,s,c}())):k(W,"Ignored: "+C)}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 M(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==z(t,"onClose",t)){v(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}z(t,"onClosed",t),v(t,"--"),M(e),n&&(n.disconnect(),n=null)}else v(t,"Close iframe cancelled by onClose event")}function T(n){null===d&&v(n,"Get page position: "+(d={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+d.y)}function S(e){null!==d&&(window.scrollTo(d.x,d.y),v(e,"Set page position: "+d.x+","+d.y),R())}function R(){d=null}function E(e){v(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),T(e.id),N((function(){H(e),L("reset","reset",e.iframe,e.id)}),e,"reset")}function H(e){function n(n){a||"0"!==e[n]||(a=!0,v(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"))&&L("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){v("window","Mutation observed: "+n[0].target+" "+n[0].type),_(e,16)}var t,i=w();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",v(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):v("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 N(e,n,t){t!==n.type&&f&&!window.jasmine?(v(n.id,"Requesting animation frame"),f(e)):e()}function L(e,n,t,i,o){var a,r=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(v(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(a=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,a)):x(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||r||(r=!0,x(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 V(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 C(t,a){function r(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],x(d,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,c,d=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=a&&a.id||m.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(a||{}).log,v(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);d in u&&"iFrameResizer"in t?x(d,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[d]=Object.create(null),u[d].iframe=t,u[d].firstRun=!0,u[d].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(r,e),function(e){for(var n in m)Object.prototype.hasOwnProperty.call(m,n)&&(u[d][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:m[n])}(e),u[d]&&(u[d].targetOrigin=!0===u[d].checkOrigin?""===(n=u[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(a),function(){switch(v(d,"IFrame scrolling "+(u[d]&&u[d].scrolling?"enabled":"disabled")+" for "+d),t.style.overflow=!1===(u[d]&&u[d].scrolling)?"hidden":"auto",u[d]&&u[d].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[d]?u[d].scrolling:"no"}}(),function(){function e(e){var n=u[d][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,v(d,"Set "+e+" = "+t.style[e]))}function n(e){if(u[d]["min"+e]>u[d]["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[d]&&u[d].bodyMargin)&&"0"!==(u[d]&&u[d].bodyMargin)||(u[d].bodyMarginV1=u[d].bodyMargin,u[d].bodyMargin=u[d].bodyMargin+"px"),s=V(d),(c=w())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),p(t,"load",(function(){L("iFrame.onload",s,t,e,!0),(!u[d]||!u[d].firstRun)&&u[d]&&u[d].heightCalculationMethod in l&&E({iframe:t,height:0,width:0,type:"init"})})),L("init",s,t,e,!0),u[d]&&(u[d].iframe.iFrameResizer={close:F.bind(null,u[d].iframe),removeListeners:M.bind(null,u[d].iframe),resize:L.bind(null,"Window resize","resize",u[d].iframe),moveToAnchor:function(e){L("Move to anchor","moveToAnchor:"+e,u[d].iframe,d)},sendMessage:function(e){L("Send Message","message:"+(e=JSON.stringify(e)),u[d].iframe,d)}}))}function _(e,n){null===h&&(h=setTimeout((function(){h=null,e()}),n))}function W(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visibility change"),_((function(){A("Tab Visible","resize")}),16))}function A(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&L(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+">")}(),C(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!f;e+=1)f=window[n[e]+"RequestAnimationFrame"];f?f=f.bind(window):v("setup","RequestAnimationFrame not supported")}(),p(window,"message",I),p(window,"resize",(function(){v("window","Trigger event: resize"),_((function(){A("Window resize","resize")}),16)})),p(document,"visibilitychange",W),p(document,"-webkit-visibilitychange",W),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&x("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}}}();const F=M.exports;class T{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 S=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded",7),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))},this.isFocused=!1,this.isValid=!0,this.errorText=void 0,this.inputId=void 0,this.label=void 0,this.iframeOrigin=void 0}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:w.version})}initializeFrameCommunicationService(){var e;this.frameService=new T(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?g:this.isValid?this.isFocused?v:k:y}get style(){return this.isFocused?this.isValid?p.focused:p.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(p.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"871d71c6240e94e24f7ccc4c4ec8225b4123d865",class:"form-group d-flex flex-column"},n("div",{key:"0a1d98cba0960599d29db3c269bb8b458cdfddc8",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"bfd2e61b544db648cada7a52b45809bebf5722a8",class:"form-label",htmlFor:"",part:x},this.label||""),n("div",{key:"53e9f9a29e07edcdcbb00b023ba0f24d09d852ab",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:"2adc709c4094c44181dd83906763b4809b3f168b",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{F({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(b,{key:"c54bafd097b1e3e896901252d3520bfdfe5c71b6",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}},R=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new r(I)}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 e=this.formController.getInitialValues();return n(t,{key:"e798e67c159b53a995e4a60246c6f6d6e872f1ec"},n("form",{key:"24d6980de772a360c0218e9ab50550dcee5786d5"},n("fieldset",{key:"9e990836becccdf5d12a9e15e2eb7f4078f74b08"},this.legend&&n("legend",{key:"12d445b392cf03114dbd2a37391ecc1b87304868"},this.legend),n("div",{key:"2d2fed9cf30b3869633b80b39b7684dfde66f6b7",class:"row gy-3"},n("div",{key:"8ec042863e646d5daffeb3fbb5395336406adcde",class:"col-12"},n("form-control-text",{key:"82a2c18c2a7eef7ba7ac46e53dfc9c975c8d28b7",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:m}))))))}};export{z as billing_form,S as iframe_input,R as postal_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as t}from"./p-0e180654.js";import{a}from"./p-9dd8685c.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import{g as r,a as o}from"./p-87f8c596.js";class s{async fetchPayouts(a,r,o,s="https://wc-proxy.justifi.ai"){return t({authToken:r,apiOrigin:s}).get(`account/${a}/payouts`,o)}async fetchPayout(a,r,o="https://wc-proxy.justifi.ai"){return t({authToken:r,apiOrigin:o}).get(`payouts/${a}`)}async fetchCSV(a,r,o="https://wc-proxy.justifi.ai"){return t({authToken:r,apiOrigin:o}).get(`reports/payouts/${a}`)}}const i=({authToken:t,service:s,apiOrigin:i})=>async({payoutId:p,onError:c})=>{try{const{data:a}=await s.fetchCSV(p,t,i),r=document.createElement("a");r.href=a.csv_url,r.click()}catch(t){c({error:r(t),code:o(null==t?void 0:t.code),severity:a.ERROR})}};export{s as P,i as m}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./p-2783e363.js";import{A as e}from"./p-0e180654.js";import{a as r,C as o}from"./p-9dd8685c.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import{g as a,a as n}from"./p-87f8c596.js";import{J as c}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s}from"./p-2783e363.js";import{A as e}from"./p-0e180654.js";import{a as r,C as o}from"./p-9dd8685c.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import{g as a,a as n}from"./p-87f8c596.js";import{J as c}from"./p-df2559c7.js";import{c as h}from"./p-1aa22806.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-29688e30.js";class d{async fetchQuote(t,i){return e({authToken:t,apiOrigin:"https://wc-proxy.justifi.ai"}).post("insurance/quotes",i)}async toggleCoverage(t,i,s){const r=`insurance/quotes/${i}/toggle`;return e({authToken:t,apiOrigin:"https://wc-proxy.justifi.ai"}).post(r,s)}}const p=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.authToken=void 0,this.checkoutId=void 0,this.primaryIdentityFirstName=void 0,this.primaryIdentityLastName=void 0,this.primaryIdentityState=void 0,this.primaryIdentityPostalCode=void 0,this.primaryIdentityCountry=void 0,this.primaryIdentityEmailAddress=void 0,this.policyAttributesInsurableAmount=void 0,this.policyAttributesStartDate=void 0,this.policyAttributesEndDate=void 0,this.coveredIdentityFirstName=void 0,this.coveredIdentityLastName=void 0,this.getQuote=void 0,this.toggleCoverage=void 0,this.quote=void 0}async validate(){return this.seasonInterruptionCoreRef.validate()}componentWillLoad(){h(),this.analytics=new c(this),this.initializeServiceMethods()}disconnectedCallback(){this.analytics&&this.analytics.cleanup()}initializeServiceMethods(){this.authToken?(this.getQuote=(({authToken:t,service:i})=>async({payload:s,onSuccess:e,onError:o})=>{var c;try{const h=await i.fetchQuote(t,s);if(h.error)return o({error:a(h.error),code:n(null===(c=h.error)||void 0===c?void 0:c.code),severity:r.ERROR});e({quote:h.data})}catch(t){const i=n(null==t?void 0:t.code);return o({error:t.message||t,code:i,severity:r.ERROR})}})({authToken:this.authToken,service:new d}),this.toggleCoverage=(({authToken:t,service:i})=>async({quoteId:s,payload:e,onSuccess:o,onError:c})=>{var h;try{const d=await i.toggleCoverage(t,s,e);if(d.error)return c({error:a(d.error),code:n(null===(h=d.error)||void 0===h?void 0:h.code),severity:r.ERROR});o({quote:d.data})}catch(t){const i=n(null==t?void 0:t.code);return c({error:t.message||t,code:i,severity:r.ERROR})}})({authToken:this.authToken,service:new d})):this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:r.ERROR})}render(){return s("justifi-season-interruption-insurance-core",{key:"09686ee78334afa3648039ef1f6edcc307017f02",ref:t=>this.seasonInterruptionCoreRef=t,"checkout-id":this.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{p as justifi_season_interruption_insurance}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./p-2783e363.js";import{a as e,C as r}from"./p-9dd8685c.js";import{J as o}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s}from"./p-2783e363.js";import{a as e,C as r}from"./p-9dd8685c.js";import{J as o}from"./p-df2559c7.js";import{c as a}from"./p-1aa22806.js";import{a as p}from"./p-abdbcd8e.js";import{g as n,a as c}from"./p-87f8c596.js";import{D as h}from"./p-14f40baa.js";import"./p-29688e30.js";import"./p-0e180654.js";import"./p-389e1eb7.js";import"./p-2ca5b5e4.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";const d=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.disputeId=void 0,this.authToken=void 0,this.apiOrigin="https://wc-proxy.justifi.ai",this.getDispute=void 0,this.errorMessage=null}componentWillLoad(){a(),this.analytics=new o(this),this.initializeGetDispute()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:i,service:s,apiOrigin:r})=>async({onSuccess:o,onError:a})=>{var h;try{const d=await s.fetchDispute(t,i,r);if(d.error)return a({error:n(d.error),code:c(null===(h=d.error)||void 0===h?void 0:h.code),severity:e.ERROR});{const t=Object.assign({},d.page_info);o({dispute:new p(d.data),pagingInfo:t})}}catch(t){const i=c(null==t?void 0:t.code);return a({error:t.message||t,code:i,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new h,apiOrigin:this.apiOrigin}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return s("justifi-dispute-management-core",{key:"ae0e4a208d6250c4da7033e1d8bf8c33ec041c36",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_dispute_management}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t}from"./p-
|
|
1
|
+
import{p as t}from"./p-29688e30.js";import{A as i}from"./p-0e180654.js";class s{async record(t){return i({apiOrigin:"https://wc-proxy.justifi.ai"}).post("analytics",t)}}class e{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("storybook")||(this.service=new s,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,(i=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:i.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.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}export{e as J}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s,r as i,c as t}from"./p-2783e363.js";import{c as o,F as e}from"./p-5844a0f0.js";import{b as r,a}from"./p-4acf8ca2.js";import{a as h,i as n}from"./p-d43a38a4.js";import{A as
|
|
1
|
+
import{h as s,r as i,c as t}from"./p-2783e363.js";import{c as o,F as e}from"./p-5844a0f0.js";import{b as r,a}from"./p-4acf8ca2.js";import{a as h,i as n}from"./p-d43a38a4.js";import{A as l}from"./p-0e180654.js";import"./p-9dd8685c.js";import"./p-389e1eb7.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-42a48c59.js";import"./p-61f0a2ce.js";import{B as p,a as c}from"./p-5d1d2fd7.js";import{J as m}from"./p-df2559c7.js";import{B as d}from"./p-06f5b709.js";import{S as f}from"./p-bfe9748b.js";import{H as j}from"./p-9edd6ad8.js";import{c as b}from"./p-1aa22806.js";import{S as u}from"./p-e9e80a62.js";import{B as v}from"./p-73f9be7c.js";import"./p-95e55bb1.js";import"./p-6078a370.js";import"./p-c9b78275.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-1ff8810b.js";import"./p-29688e30.js";import"./p-e8cd9691.js";const w=o(Object.assign(Object.assign({},r().fields),{legal_address:h(),additional_questions:a(),representative:n("representative")})),g=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(u,{width:"25%"})),s("div",{class:"col-12"},s(u,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(u,{width:"50%"}),s(u,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(u,{width:"65%"}),s(u,{width:"35%"}))),x=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(u,{width:"40%",height:"40px"})),s(g,null),s(g,null),s(g,null)),y=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event",7),this.clickEvent=t(this,"click-event",7),this.instantiateBusiness=s=>{const i=new p(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;try{const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new p(Object.assign(Object.assign({},i),s)).payload,o=await this.api.patch(this.businessEndpoint,t);this.handleReponse(o)}catch(s){this.errorMessage=c.patchData}finally{this.isSaving=!1}},this.fetchData=async()=>{this.isLoading=!0;try{const s=await this.api.get(this.businessEndpoint);this.instantiateBusiness(s.data)}catch(s){this.errorMessage=c.fetchData}finally{this.isLoading=!1}},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)},this.authToken=void 0,this.businessId=void 0,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.isLoading=!1,this.isSaving=!1,this.errorMessage=void 0}componentWillLoad(){b(),this.analytics=new m(this),this.authToken||console.error("Warning: Missing auth-token. The form will not be functional without it."),this.businessId||console.error("Warning: Missing business-id. The form requires an existing business-id to function."),this.formController=new e(w),this.api=l({authToken:this.authToken,apiOrigin:"https://wc-proxy.justifi.ai"}),this.fetchData()}disconnectedCallback(){this.analytics.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}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(x,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(j,{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(d,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:v.submit}),isLoading:this.isSaving},"Submit")))))}};export{y as justifi_business_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as s,c as i}from"./p-2783e363.js";import{t as a,B as t,C as
|
|
1
|
+
import{h as e,r as s,c as i}from"./p-2783e363.js";import{t as a,B as t,C as d,D as c}from"./p-e8cd9691.js";import{S as o}from"./p-bfe9748b.js";import{E as l}from"./p-8b16a20f.js";import{c as r}from"./p-1aa22806.js";import{J as f}from"./p-df2559c7.js";import{C as p,a as b}from"./p-9dd8685c.js";import{B as h}from"./p-b4ed5a2c.js";import{B as v}from"./p-5d1d2fd7.js";import{m}from"./p-f30cb232.js";import{S as n}from"./p-e9e80a62.js";import"./p-29688e30.js";import"./p-0e180654.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-87f8c596.js";const u=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(n,{width:"25%"})),e("div",{class:"col-12"},e(n,{width:"100%"})),e("div",{class:"col-12 d-flex gap-3"},e(n,{width:"50%"}),e(n,{width:"50%"})),e("div",{class:"col-12 d-flex gap-3"},e(n,{width:"65%"}),e(n,{width:"35%"}))),y=()=>e("div",{class:"row gap-5"},e("div",{class:"col-12"},e(n,{width:"40%",height:"40px"})),e(u,null),e(u,null),e(u,null)),k=class{constructor(e){s(this,e),this.errorEvent=i(this,"error-event",7),this.businessId=void 0,this.authToken=void 0,this.errorMessage=void 0,this.isLoading=!0,this.business=void 0}componentWillLoad(){r(),this.analytics=new f(this),this.initializeGetBusiness()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:b.ERROR});m({id:this.businessId,authToken:this.authToken,service:new h})({onSuccess:({business:e})=>{this.business=new v(e),this.isLoading=!1},onError:({error:e,code:s,severity:i})=>{this.errorMessage=e,this.errorEvent.emit({errorCode:s,message:e,severity:i}),this.isLoading=!1}})}render(){var s,i,r,f,p,b,h,v,m,n,u,k,g;return e(o,{key:"d5ac7406c2ec045832411cb7a7deecde13243a41"},this.isLoading&&e(y,{key:"ec71fe4b766244bbf2c04714bca66b69f367ece5"}),!this.isLoading&&this.errorMessage&&l(this.errorMessage),!this.isLoading&&!this.errorMessage&&this.business&&e("div",{key:"6492a8df913cb3360153715192bd30d656df4968",class:"row gap-5 pt-5",part:a},e("div",{key:"607b534001238efc4d226cb26d8f1c1288b5ac29",class:"row"},e("div",{key:"55e7bae0aad2ae9ec9a28961269cd532a2e00922",class:"col-12"},e("h2",{key:"c4e01bd6e3a9e46cb15d8b72093dc9de2d463feb",part:t},"Business Information:"),e("p",{key:"cd3c01f074c8d55b968e713ec4805a22f1ffc3ba"},"Business Name: ",this.business.legal_name))),e("div",{key:"20062e4aa0cad46f002821972fec7ec1fc8be01e",class:"row"},e("div",{key:"433a4a200edd564fa0d206378a706ad84aa2696e",class:"col-6"},e("h2",{key:"e4a4fc4c632ccb3b6b187ccb87fb5cce398e43ca",part:t},"Representative:"),e("ul",{key:"02449f299dddc9fee8544fed405acc436217a60b",class:"list-group",part:d},e("li",{key:"a1eff4e8974b8fe57c206fb9c6ce30e89c79d702",class:"list-group-item",part:c},"Name: ",null===(i=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===i?void 0:i.name),e("li",{key:"4e04f41d044b92560f401e6edbb1993b84fca7a6",class:"list-group-item",part:c},"Title: ",null===(f=null===(r=this.business)||void 0===r?void 0:r.representative)||void 0===f?void 0:f.title),e("li",{key:"b354a893098b9f26819ab34966a5e47226fd280b",class:"list-group-item",part:c},"Email: ",null===(b=null===(p=this.business)||void 0===p?void 0:p.representative)||void 0===b?void 0:b.email),e("li",{key:"d1d94089d4f7db78c64143820601b359a77ab09f",class:"list-group-item",part:c},"Phone: ",null===(v=null===(h=this.business)||void 0===h?void 0:h.representative)||void 0===v?void 0:v.phone))),e("div",{key:"91ee402f8f7886c1750b8050433992cfd9964b02",class:"col-6"},e("h2",{key:"143f76c17de7af724c325439767275efa7c8e903",part:t},"Shipping Address:"),e("ul",{key:"dae75ec772c3971a9e690648e4e28b2eec22c638",class:"list-group",part:d},e("li",{key:"0d83cea35521361eee13912f1cb107bf7496abcc",class:"list-group-item",part:c},"Street: ",null===(m=this.business.legal_address)||void 0===m?void 0:m.line1),e("li",{key:"be4d3d8a0c61645ac4f622235f7ecf2f3ac8e097",class:"list-group-item",part:c},null===(n=this.business.legal_address)||void 0===n?void 0:n.line2),e("li",{key:"2572604b85008e401a835abdbf6c291c3191a9c7",class:"list-group-item",part:c},"Postal Code: ",null===(u=this.business.legal_address)||void 0===u?void 0:u.postal_code),e("li",{key:"e5fd5aa1d9b1bf78c75ca667b058629575be06d3",class:"list-group-item",part:c},"City: ",null===(k=this.business.legal_address)||void 0===k?void 0:k.city),e("li",{key:"9acd18a7faed0ab283e110c616d9314410a93cee",class:"list-group-item",part:c},"State: ",null===(g=this.business.legal_address)||void 0===g?void 0:g.state))))))}};export{k as justifi_order_terminals}
|