@adyen/adyen-web 6.13.0 → 6.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs/index.d.cts +18 -74
  4. package/dist/es/components/Dropin/Dropin.js +1 -1
  5. package/dist/es/components/Dropin/Dropin.js.map +1 -1
  6. package/dist/es/components/Riverty/Riverty.js +1 -1
  7. package/dist/es/components/Riverty/Riverty.js.map +1 -1
  8. package/dist/es/components/components-name-map.js +1 -1
  9. package/dist/es/components/components-name-map.js.map +1 -1
  10. package/dist/es/components/index.js +1 -1
  11. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  12. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  13. package/dist/es/components/internal/Address/constants.js +1 -1
  14. package/dist/es/components/internal/Address/constants.js.map +1 -1
  15. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  16. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  17. package/dist/es/components/internal/OpenInvoice/utils.js.map +1 -1
  18. package/dist/es/components/tx-variants.js +1 -1
  19. package/dist/es/components/tx-variants.js.map +1 -1
  20. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  21. package/dist/es/core/core.js +1 -1
  22. package/dist/es/index.d.ts +18 -74
  23. package/dist/es/index.js +1 -1
  24. package/dist/es/utils/clipboard.js +1 -1
  25. package/dist/es/utils/clipboard.js.map +1 -1
  26. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  27. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  28. package/dist/es-legacy/components/Riverty/Riverty.js +1 -1
  29. package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
  30. package/dist/es-legacy/components/components-name-map.js +1 -1
  31. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  32. package/dist/es-legacy/components/index.js +1 -1
  33. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  34. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  35. package/dist/es-legacy/components/internal/Address/constants.js +1 -1
  36. package/dist/es-legacy/components/internal/Address/constants.js.map +1 -1
  37. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  38. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  39. package/dist/es-legacy/components/internal/OpenInvoice/utils.js.map +1 -1
  40. package/dist/es-legacy/components/tx-variants.js +1 -1
  41. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  42. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  43. package/dist/es-legacy/core/core.js +1 -1
  44. package/dist/es-legacy/index.js +1 -1
  45. package/dist/es-legacy/utils/clipboard.js +1 -1
  46. package/dist/es-legacy/utils/clipboard.js.map +1 -1
  47. package/package.json +18 -18
  48. package/dist/es/components/Riverty/config.js +0 -2
  49. package/dist/es/components/Riverty/config.js.map +0 -1
  50. package/dist/es-legacy/components/Riverty/config.js +0 -2
  51. package/dist/es-legacy/components/Riverty/config.js.map +0 -1
@@ -56,7 +56,7 @@ interface AddressSpecifications {
56
56
  };
57
57
  }
58
58
 
59
- declare const ADDRESS_SCHEMA: readonly ["street", "houseNumberOrName", "postalCode", "city", "stateOrProvince", "country", "firstName", "lastName"];
59
+ declare const ADDRESS_SCHEMA: readonly ["street", "houseNumberOrName", "postalCode", "city", "stateOrProvince", "country"];
60
60
 
61
61
  type CustomTranslations = {
62
62
  [locale: string]: Translations;
@@ -1479,7 +1479,6 @@ declare enum TxVariants {
1479
1479
  facilypay_12x = "facilypay_12x",
1480
1480
  ratepay = "ratepay",
1481
1481
  ratepay_directdebit = "ratepay_directdebit",
1482
- riverty = "riverty",
1483
1482
  /** Open Invoice */
1484
1483
  /** Wallets */
1485
1484
  amazonpay = "amazonpay",
@@ -1550,6 +1549,7 @@ declare enum TxVariants {
1550
1549
  vipps = "vipps",
1551
1550
  trustly = "trustly",
1552
1551
  paybybank_AIS_DD = "paybybank_AIS_DD",
1552
+ riverty = "riverty",
1553
1553
  /** Redirect */
1554
1554
  /** Klarna */
1555
1555
  klarna = "klarna",
@@ -5129,80 +5129,18 @@ declare class TrustlyElement extends RedirectElement {
5129
5129
  render(): h.JSX.Element;
5130
5130
  }
5131
5131
 
5132
- declare class Riverty extends OpenInvoiceContainer {
5132
+ declare class Riverty extends RedirectElement {
5133
5133
  static readonly type = TxVariants.riverty;
5134
- protected static defaultProps: {
5135
- consentCheckboxLabel?: h.JSX.Element;
5136
- billingAddressRequiredFields?: string[];
5137
- billingAddressSpecification?: AddressSpecifications;
5138
- allowedCountries?: string[];
5139
- countryCode?: string;
5140
- data?: {
5141
- companyDetails?: CompanyDetailsSchema;
5142
- personalDetails?: PersonalDetailsSchema;
5143
- billingAddress?: AddressData;
5144
- deliveryAddress?: AddressData;
5145
- bankAccount?: BankDetailsSchema;
5146
- };
5147
- onChange?: (state: any, element?: UIElement) => void;
5148
- payButton?: any;
5149
- visibility?: OpenInvoiceVisibility;
5150
- personalDetailsRequiredFields: string[];
5151
- deliveryAddressRequiredFields?: string[];
5152
- deliveryAddressSpecification: AddressSpecifications;
5153
- setComponentRef?: (ref: any) => void;
5154
- order?: Order;
5155
- modules?: {
5156
- srPanel?: SRPanel;
5157
- analytics?: AnalyticsModule;
5158
- resources?: Resources;
5159
- risk?: RiskElement;
5134
+ static readonly defaultProps: {
5135
+ type: TxVariants;
5136
+ };
5137
+ formatData(): {
5138
+ paymentMethod: {
5139
+ type: string;
5140
+ subtype: string;
5160
5141
  };
5161
- isDropin?: boolean;
5162
- onPaymentCompleted?: (data: PaymentCompletedData, component?: UIElement) => void;
5163
- onPaymentFailed?: (data?: PaymentFailedData, component?: UIElement) => void;
5164
- beforeRedirect?: (resolve: () => void, reject: () => void, redirectData: {
5165
- url: string;
5166
- method: string;
5167
- data?: any;
5168
- }) => void;
5169
- beforeSubmit?: (state: PaymentData, component: UIElement, actions: BeforeSubmitActions) => void;
5170
- onSubmit?: (state: SubmitData, component: UIElement, actions: SubmitActions) => void;
5171
- onActionHandled?: (actionHandled: ActionHandledReturnObject) => void;
5172
- onAdditionalDetails?: (state: AdditionalDetailsData, component: UIElement, actions: AdditionalDetailsActions) => void;
5173
- onEnterKeyPressed?: (activeElement: Element, component: UIElement) => void;
5174
- onError?: (error: AdyenCheckoutError, component?: UIElement) => void;
5175
- onOrderUpdated?: (data: {
5176
- order: Order;
5177
- }) => void;
5178
- onPaymentMethodsRequest?: (data: PaymentMethodsRequestData, actions: {
5179
- resolve: (response: PaymentMethodsResponse) => void;
5180
- reject: () => void;
5181
- }) => void;
5182
- environment?: string;
5183
- session?: Session;
5184
- onComplete?: (state: any, element: UIElement) => void;
5185
- isInstantPayment?: boolean;
5186
- isStoredPaymentMethod?: boolean;
5187
- oneClick?: boolean;
5188
- storedPaymentMethodId?: string;
5189
- statusType?: StatusFromAction;
5190
- type?: string;
5191
- name?: string;
5192
- icon?: string;
5193
- amount?: PaymentAmount;
5194
- secondaryAmount?: PaymentAmountExtended;
5195
- showPayButton?: boolean;
5196
- loadingContext?: string;
5197
- createFromAction?: (action: PaymentAction, props: object) => UIElement;
5198
- clientKey?: string;
5199
- elementRef?: any;
5200
- i18n?: Language;
5201
- label?: string;
5202
- paymentMethodType?: string;
5203
- originalAction?: PaymentAction;
5142
+ browserInfo: BrowserInfo;
5204
5143
  };
5205
- formatProps(props: OpenInvoiceConfiguration): any;
5206
5144
  }
5207
5145
 
5208
5146
  declare class PayByBankUS extends RedirectElement {
@@ -5328,7 +5266,6 @@ declare const ComponentsMap: {
5328
5266
  facilypay_12x: typeof FacilyPay12x;
5329
5267
  ratepay: typeof RatePay;
5330
5268
  ratepay_directdebit: typeof RatePayDirectDebit;
5331
- riverty: typeof Riverty;
5332
5269
  /** Open Invoice */
5333
5270
  /** Wallets */
5334
5271
  amazonpay: typeof AmazonPayElement;
@@ -5397,6 +5334,7 @@ declare const ComponentsMap: {
5397
5334
  vipps: typeof VippsElement;
5398
5335
  trustly: typeof TrustlyElement;
5399
5336
  paybybank_AIS_DD: typeof PayByBankUS;
5337
+ riverty: typeof Riverty;
5400
5338
  /** Redirect */
5401
5339
  /** Klarna */
5402
5340
  klarna: typeof KlarnaPayments;
@@ -5512,6 +5450,11 @@ interface DropinConfiguration extends UIElementProps {
5512
5450
  * Callback triggered once the Drop-in is ready to be used
5513
5451
  */
5514
5452
  onReady?(): void;
5453
+ /**
5454
+ * Callback triggered before Drop-in creates the stored payment method UIElements.
5455
+ * This callback lets you choose which saved payment methods appear in the Drop-in.
5456
+ */
5457
+ filterStoredPaymentMethods?(storedPaymentMethods: StoredPaymentMethod[]): StoredPaymentMethod[];
5515
5458
  /**
5516
5459
  * Callback triggered once the shopper selects a different payment method in the Drop-in
5517
5460
  */
@@ -6608,6 +6551,7 @@ declare class DropinElement extends UIElement<DropinConfiguration> implements ID
6608
6551
  openFirstStoredPaymentMethod?: boolean;
6609
6552
  openFirstPaymentMethod?: boolean;
6610
6553
  onReady?(): void;
6554
+ filterStoredPaymentMethods?(storedPaymentMethods: StoredPaymentMethod[]): StoredPaymentMethod[];
6611
6555
  onSelect?(paymentMethod: UIElement): void;
6612
6556
  showRemovePaymentMethodButton?: boolean;
6613
6557
  showRadioButton?: boolean;
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import o from"./defaultProps.js";import{DropinComponent as n}from"./components/DropinComponent.js";import{CoreProvider as i}from"../../core/Context/CoreProvider.js";import{getCommonProps as s}from"./components/utils.js";import r from"./elements/createElements.js";import a from"./elements/createStoredElements.js";import h from"./elements/createInstantPaymentElements.js";import{hasOwnProperty as d}from"../../utils/hasOwnProperty.js";import m from"../../core/Errors/SRPanelProvider.js";import p from"./elements/splitPaymentMethods.js";import{TxVariants as l}from"../tx-variants.js";function c(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}const y=["paywithgoogle","googlepay","applepay"];class f extends e{storeElementRefOnCore(){this.core.storeElementReference(this)}formatProps(t){return{type:"dropin",...super.formatProps(t),instantPaymentTypes:Array.from(new Set(t.instantPaymentTypes)).filter((t=>y.includes(t)))}}get isValid(){return!!this.dropinRef&&!!this.dropinRef.state.activePaymentMethod&&!!this.dropinRef.state.activePaymentMethod.isValid}showValidation(){return this.dropinRef.state.activePaymentMethod&&this.dropinRef.state.activePaymentMethod.showValidation(),this}setStatus(t,e={}){return this.dropinRef?.setStatus(t,e),this}get activePaymentMethod(){return this.dropinRef?.state||this.dropinRef?.state.activePaymentMethod?this.dropinRef.state.activePaymentMethod:null}get data(){return this.activePaymentMethod?this.dropinRef.state.activePaymentMethod.data:null}displayFinalAnimation(t){this.props.disableFinalAnimation||this.dropinRef.setStatus(t)}submit(){if(!this.activePaymentMethod)throw new Error("No active payment method.");this.activePaymentMethod.isValid||this.activePaymentMethod.showValidation(),this.activePaymentMethod.isInstantPayment&&this.closeActivePaymentMethod(),this.activePaymentMethod.submit()}handleAction(t,e={}){if(!t||!t.type){if(d(t,"action")&&d(t,"resultCode"))throw new Error('handleAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('handleAction::Invalid Action - the passed action object does not have a "type" property')}if("redirect"!==t.type&&this.activePaymentMethod?.updateWithAction)return this.activePaymentMethod.updateWithAction(t);this.elementRef instanceof f&&(e={...this.elementRef.activePaymentMethod?.props,...e});const o=this.core.createFromAction(t,{...e,elementRef:this.elementRef,onAdditionalDetails:this.handleAdditionalDetails,isDropin:!0});return o?(this.setStatus(o.props.statusType,{component:o}),this.componentFromAction=o,this):null}closeActivePaymentMethod(){this.dropinRef.closeActivePaymentMethod()}handleKeyPress(t){if("Enter"===t.key||"Enter"===t.code){if("radio"===document?.activeElement?.getAttribute("role"))return;super.handleKeyPress(t)}}onEnterKeyPressed(t,e){const o=this.activePaymentMethod??e;this.activePaymentMethod?.onEnterKeyPressed(t,o)}render(){return t(i,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(m,{srPanel:this.props.modules.srPanel},t(n,{...this.props,core:this.core,elementRef:this.elementRef,onCreateElements:this.handleCreate,ref:t=>{this.dropinRef=t}})))}constructor(t,e){super(t,e),c(this,"dropinRef",null),c(this,"paymentMethodsConfiguration",void 0),c(this,"componentFromAction",void 0),c(this,"handleCreate",(()=>{const{paymentMethodsConfiguration:t,showStoredPaymentMethods:e,showPaymentMethods:o,instantPaymentTypes:n}=this.props,{paymentMethods:i,storedPaymentMethods:d,instantPaymentMethods:m,fastlanePaymentMethod:l}=p(this.core.paymentMethodsResponse,n),c=s({...this.props,elementRef:this.elementRef}),y=o?r(i,t,c,this.core):[],f=h(m,t,c,this.core);return[e?a(d,t,c,this.core):[],y,f,l?r([l],t,c,this.core):[]]})),c(this,"handleOrder",(({order:t})=>{this.updateParent({order:t})})),this.submit=this.submit.bind(this),this.handleAction=this.handleAction.bind(this),this.props.paymentMethodComponents.forEach((t=>this.core.register(t))),this.paymentMethodsConfiguration=this.props.paymentMethodsConfiguration||{}}}c(f,"type",l.dropin),c(f,"defaultProps",o);export{f as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import o from"./defaultProps.js";import{DropinComponent as i}from"./components/DropinComponent.js";import{CoreProvider as n}from"../../core/Context/CoreProvider.js";import{getCommonProps as s}from"./components/utils.js";import r from"./elements/createElements.js";import a from"./elements/createStoredElements.js";import h from"./elements/createInstantPaymentElements.js";import{hasOwnProperty as d}from"../../utils/hasOwnProperty.js";import m from"../../core/Errors/SRPanelProvider.js";import p from"./elements/splitPaymentMethods.js";import{TxVariants as l}from"../tx-variants.js";function c(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}const y=["paywithgoogle","googlepay","applepay"];class f extends e{storeElementRefOnCore(){this.core.storeElementReference(this)}formatProps(t){return{type:"dropin",...super.formatProps(t),instantPaymentTypes:Array.from(new Set(t.instantPaymentTypes)).filter((t=>y.includes(t)))}}get isValid(){return!!this.dropinRef&&!!this.dropinRef.state.activePaymentMethod&&!!this.dropinRef.state.activePaymentMethod.isValid}showValidation(){return this.dropinRef.state.activePaymentMethod&&this.dropinRef.state.activePaymentMethod.showValidation(),this}setStatus(t,e={}){return this.dropinRef?.setStatus(t,e),this}get activePaymentMethod(){return this.dropinRef?.state||this.dropinRef?.state.activePaymentMethod?this.dropinRef.state.activePaymentMethod:null}get data(){return this.activePaymentMethod?this.dropinRef.state.activePaymentMethod.data:null}displayFinalAnimation(t){this.props.disableFinalAnimation||this.dropinRef.setStatus(t)}submit(){if(!this.activePaymentMethod)throw new Error("No active payment method.");this.activePaymentMethod.isValid||this.activePaymentMethod.showValidation(),this.activePaymentMethod.isInstantPayment&&this.closeActivePaymentMethod(),this.activePaymentMethod.submit()}handleAction(t,e={}){if(!t||!t.type){if(d(t,"action")&&d(t,"resultCode"))throw new Error('handleAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('handleAction::Invalid Action - the passed action object does not have a "type" property')}if("redirect"!==t.type&&this.activePaymentMethod?.updateWithAction)return this.activePaymentMethod.updateWithAction(t);this.elementRef instanceof f&&(e={...this.elementRef.activePaymentMethod?.props,...e});const o=this.core.createFromAction(t,{...e,elementRef:this.elementRef,onAdditionalDetails:this.handleAdditionalDetails,isDropin:!0});return o?(this.setStatus(o.props.statusType,{component:o}),this.componentFromAction=o,this):null}closeActivePaymentMethod(){this.dropinRef.closeActivePaymentMethod()}handleKeyPress(t){if("Enter"===t.key||"Enter"===t.code){if("radio"===document?.activeElement?.getAttribute("role"))return;super.handleKeyPress(t)}}onEnterKeyPressed(t,e){const o=this.activePaymentMethod??e;this.activePaymentMethod?.onEnterKeyPressed(t,o)}render(){return t(n,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(m,{srPanel:this.props.modules.srPanel},t(i,{...this.props,core:this.core,elementRef:this.elementRef,onCreateElements:this.handleCreate,ref:t=>{this.dropinRef=t}})))}constructor(t,e){super(t,e),c(this,"dropinRef",null),c(this,"paymentMethodsConfiguration",void 0),c(this,"componentFromAction",void 0),c(this,"handleCreate",(()=>{const{paymentMethodsConfiguration:t,showStoredPaymentMethods:e,showPaymentMethods:o,instantPaymentTypes:i}=this.props,{paymentMethods:n,storedPaymentMethods:d,instantPaymentMethods:m,fastlanePaymentMethod:l}=p(this.core.paymentMethodsResponse,i),c=s({...this.props,elementRef:this.elementRef}),y=o?r(n,t,c,this.core):[],f=h(m,t,c,this.core);return[e?a(this.props.filterStoredPaymentMethods?.(d)??d,t,c,this.core):[],y,f,l?r([l],t,c,this.core):[]]})),c(this,"handleOrder",(({order:t})=>{this.updateParent({order:t})})),this.submit=this.submit.bind(this),this.handleAction=this.handleAction.bind(this),this.props.paymentMethodComponents.forEach((t=>this.core.register(t))),this.paymentMethodsConfiguration=this.props.paymentMethodsConfiguration||{}}}c(f,"type",l.dropin),c(f,"defaultProps",o);export{f as default};
2
2
  //# sourceMappingURL=Dropin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dropin.js","sources":["../../../../src/components/Dropin/Dropin.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport defaultProps from './defaultProps';\nimport DropinComponent from '../../components/Dropin/components/DropinComponent';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { getCommonProps } from './components/utils';\nimport { createElements, createStoredElements } from './elements';\nimport createInstantPaymentElements from './elements/createInstantPaymentElements';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport splitPaymentMethods from './elements/splitPaymentMethods';\nimport { TxVariants } from '../tx-variants';\n\nimport type { DropinConfiguration, InstantPaymentTypes, PaymentMethodsConfiguration } from './types';\nimport type { PaymentAction, PaymentResponseData } from '../../types/global-types';\nimport type { ICore } from '../../core/types';\nimport type { IDropin } from './types';\n\nconst SUPPORTED_INSTANT_PAYMENTS = ['paywithgoogle', 'googlepay', 'applepay'];\n\nclass DropinElement extends UIElement<DropinConfiguration> implements IDropin {\n public static type = TxVariants.dropin;\n\n protected static defaultProps = defaultProps;\n\n public dropinRef = null;\n\n private paymentMethodsConfiguration: PaymentMethodsConfiguration;\n /**\n * Reference to the component created from `handleAction` (Ex.: ThreeDS2Challenge)\n */\n public componentFromAction?: UIElement;\n\n constructor(checkout: ICore, props?: DropinConfiguration) {\n super(checkout, props);\n this.submit = this.submit.bind(this);\n this.handleAction = this.handleAction.bind(this);\n\n this.props.paymentMethodComponents.forEach(PaymentMethod => this.core.register(PaymentMethod));\n this.paymentMethodsConfiguration = this.props.paymentMethodsConfiguration || {};\n }\n\n protected override storeElementRefOnCore() {\n this.core.storeElementReference(this);\n }\n\n formatProps(props) {\n return {\n type: 'dropin', // for analytics\n ...super.formatProps(props),\n instantPaymentTypes: Array.from<InstantPaymentTypes>(new Set(props.instantPaymentTypes)).filter(value =>\n SUPPORTED_INSTANT_PAYMENTS.includes(value)\n )\n };\n }\n\n get isValid() {\n return !!this.dropinRef && !!this.dropinRef.state.activePaymentMethod && !!this.dropinRef.state.activePaymentMethod.isValid;\n }\n\n showValidation() {\n if (this.dropinRef.state.activePaymentMethod) {\n this.dropinRef.state.activePaymentMethod.showValidation();\n }\n\n return this;\n }\n\n public setStatus(status, props = {}): this {\n this.dropinRef?.setStatus(status, props);\n return this;\n }\n\n get activePaymentMethod() {\n if (!this.dropinRef?.state && !this.dropinRef?.state.activePaymentMethod) {\n return null;\n }\n\n return this.dropinRef.state.activePaymentMethod;\n }\n\n get data() {\n if (!this.activePaymentMethod) {\n return null;\n }\n\n return this.dropinRef.state.activePaymentMethod.data;\n }\n\n public displayFinalAnimation(type: 'success' | 'error') {\n if (this.props.disableFinalAnimation) return;\n\n this.dropinRef.setStatus(type);\n }\n\n /**\n * Calls the onSubmit event with the state of the activePaymentMethod\n */\n public override submit(): void {\n if (!this.activePaymentMethod) {\n throw new Error('No active payment method.');\n }\n\n if (!this.activePaymentMethod.isValid) {\n this.activePaymentMethod.showValidation();\n }\n\n if (this.activePaymentMethod.isInstantPayment) {\n this.closeActivePaymentMethod();\n }\n\n this.activePaymentMethod.submit();\n }\n\n /**\n * Creates the Drop-in elements\n */\n private handleCreate = () => {\n const { paymentMethodsConfiguration, showStoredPaymentMethods, showPaymentMethods, instantPaymentTypes } = this.props;\n\n const { paymentMethods, storedPaymentMethods, instantPaymentMethods, fastlanePaymentMethod } = splitPaymentMethods(\n this.core.paymentMethodsResponse,\n instantPaymentTypes\n );\n\n const commonProps = getCommonProps({ ...this.props, elementRef: this.elementRef });\n\n const elements = showPaymentMethods ? createElements(paymentMethods, paymentMethodsConfiguration, commonProps, this.core) : [];\n const instantPaymentElements = createInstantPaymentElements(instantPaymentMethods, paymentMethodsConfiguration, commonProps, this.core);\n const storedElements = showStoredPaymentMethods\n ? createStoredElements(storedPaymentMethods, paymentMethodsConfiguration, commonProps, this.core)\n : [];\n const fastlanePaymentElement = fastlanePaymentMethod\n ? createElements([fastlanePaymentMethod], paymentMethodsConfiguration, commonProps, this.core)\n : [];\n\n return [storedElements, elements, instantPaymentElements, fastlanePaymentElement];\n };\n\n public handleAction(action: PaymentAction, props = {}): this | null {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'handleAction::Invalid Action - the passed action object itself has an \"action\" property and ' +\n 'a \"resultCode\": have you passed in the whole response object by mistake?'\n );\n }\n throw new Error('handleAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n if (action.type !== 'redirect' && this.activePaymentMethod?.updateWithAction) {\n return this.activePaymentMethod.updateWithAction(action);\n }\n\n if (this.elementRef instanceof DropinElement) {\n props = {\n ...this.elementRef.activePaymentMethod?.props,\n ...props\n };\n }\n\n const paymentAction: UIElement = this.core.createFromAction(action, {\n ...props,\n elementRef: this.elementRef, // maintain elementRef for 3DS2 flow\n onAdditionalDetails: this.handleAdditionalDetails,\n isDropin: true\n });\n\n if (paymentAction) {\n this.setStatus(paymentAction.props.statusType, { component: paymentAction });\n this.componentFromAction = paymentAction;\n return this;\n }\n\n return null;\n }\n\n /**\n * handleOrder is implemented so we don't trigger a callback like in the components\n * @param response - PaymentResponse\n */\n protected handleOrder = ({ order }: PaymentResponseData): void => {\n void this.updateParent({ order });\n };\n\n closeActivePaymentMethod() {\n this.dropinRef.closeActivePaymentMethod();\n }\n\n protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement> | KeyboardEvent) {\n if (e.key === 'Enter' || e.code === 'Enter') {\n // If the active element has role=\"radio\", we're on a header in the PMList, in which case we don't want to validate the form, or, prevent the default behaviour\n const isPMHeader = document?.activeElement?.getAttribute('role') === 'radio';\n if (isPMHeader) {\n return;\n }\n super.handleKeyPress(e);\n }\n }\n\n protected onEnterKeyPressed(activeElement: Element, component: UIElement) {\n // We want to have a ref to the activePM, if we can; not a ref to the Dropin\n const pmComponent = this.activePaymentMethod ?? component;\n this.activePaymentMethod?.onEnterKeyPressed(activeElement, pmComponent);\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <DropinComponent\n {...this.props}\n core={this.core}\n elementRef={this.elementRef}\n onCreateElements={this.handleCreate}\n ref={dropinRef => {\n this.dropinRef = dropinRef;\n }}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default DropinElement;\n"],"names":["SUPPORTED_INSTANT_PAYMENTS","DropinElement","UIElement","storeElementRefOnCore","this","core","storeElementReference","formatProps","props","type","super","instantPaymentTypes","Array","from","Set","filter","value","includes","isValid","dropinRef","state","activePaymentMethod","showValidation","setStatus","status","data","displayFinalAnimation","disableFinalAnimation","submit","Error","isInstantPayment","closeActivePaymentMethod","handleAction","action","hasOwnProperty","updateWithAction","elementRef","paymentAction","createFromAction","onAdditionalDetails","handleAdditionalDetails","isDropin","statusType","component","componentFromAction","handleKeyPress","e","key","code","document","activeElement","getAttribute","onEnterKeyPressed","pmComponent","render","h","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","DropinComponent","onCreateElements","handleCreate","ref","constructor","checkout","_define_property","paymentMethodsConfiguration","showStoredPaymentMethods","showPaymentMethods","paymentMethods","storedPaymentMethods","instantPaymentMethods","fastlanePaymentMethod","splitPaymentMethods","paymentMethodsResponse","commonProps","getCommonProps","elements","createElements","instantPaymentElements","createInstantPaymentElements","createStoredElements","handleOrder","order","updateParent","bind","paymentMethodComponents","forEach","PaymentMethod","register","TxVariants","dropin","defaultProps"],"mappings":"m0BAkBA,MAAMA,EAA6B,CAAC,gBAAiB,YAAa,YAElE,MAAMC,UAAsBC,EAsBLC,qBAAAA,GACfC,KAAKC,KAAKC,sBAAsBF,KACpC,CAEAG,WAAAA,CAAYC,GACR,MAAO,CACHC,KAAM,YACHC,MAAMH,YAAYC,GACrBG,oBAAqBC,MAAMC,KAA0B,IAAIC,IAAIN,EAAMG,sBAAsBI,QAAOC,GAC5FhB,EAA2BiB,SAASD,KAGhD,CAEA,WAAIE,GACA,QAASd,KAAKe,aAAef,KAAKe,UAAUC,MAAMC,uBAAyBjB,KAAKe,UAAUC,MAAMC,oBAAoBH,OACxH,CAEAI,cAAAA,GAKI,OAJIlB,KAAKe,UAAUC,MAAMC,qBACrBjB,KAAKe,UAAUC,MAAMC,oBAAoBC,iBAGtClB,IACX,CAEOmB,SAAAA,CAAUC,EAAQhB,EAAQ,IAE7B,OADAJ,KAAKe,WAAWI,UAAUC,EAAQhB,GAC3BJ,IACX,CAEA,uBAAIiB,GACA,OAAKjB,KAAKe,WAAWC,OAAUhB,KAAKe,WAAWC,MAAMC,oBAI9CjB,KAAKe,UAAUC,MAAMC,oBAHjB,IAIf,CAEA,QAAII,GACA,OAAKr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SAAM,IAnJ/BnF,KAAKwB,OAASxB,KAAKwB,OAAO6D,KAAKrF,MAC/BA,KAAK4B,aAAe5B,KAAK4B,aAAayD,KAAKrF,MAE3CA,KAAKI,MAAMkF,wBAAwBC,SAAQC,GAAiBxF,KAAKC,KAAKwF,SAASD,KAC/ExF,KAAKkE,4BAA8BlE,KAAKI,MAAM8D,6BAA+B,CAAC,CAClF,EAnBAD,EADEpE,EACYQ,OAAOqF,EAAWC,QAEhC1B,EAHEpE,EAGe+F,eAAeA"}
1
+ {"version":3,"file":"Dropin.js","sources":["../../../../src/components/Dropin/Dropin.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport defaultProps from './defaultProps';\nimport DropinComponent from '../../components/Dropin/components/DropinComponent';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { getCommonProps } from './components/utils';\nimport { createElements, createStoredElements } from './elements';\nimport createInstantPaymentElements from './elements/createInstantPaymentElements';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport splitPaymentMethods from './elements/splitPaymentMethods';\nimport { TxVariants } from '../tx-variants';\n\nimport type { DropinConfiguration, InstantPaymentTypes, PaymentMethodsConfiguration } from './types';\nimport type { PaymentAction, PaymentResponseData } from '../../types/global-types';\nimport type { ICore } from '../../core/types';\nimport type { IDropin } from './types';\n\nconst SUPPORTED_INSTANT_PAYMENTS = ['paywithgoogle', 'googlepay', 'applepay'];\n\nclass DropinElement extends UIElement<DropinConfiguration> implements IDropin {\n public static type = TxVariants.dropin;\n\n protected static defaultProps = defaultProps;\n\n public dropinRef = null;\n\n private paymentMethodsConfiguration: PaymentMethodsConfiguration;\n /**\n * Reference to the component created from `handleAction` (Ex.: ThreeDS2Challenge)\n */\n public componentFromAction?: UIElement;\n\n constructor(checkout: ICore, props?: DropinConfiguration) {\n super(checkout, props);\n this.submit = this.submit.bind(this);\n this.handleAction = this.handleAction.bind(this);\n\n this.props.paymentMethodComponents.forEach(PaymentMethod => this.core.register(PaymentMethod));\n this.paymentMethodsConfiguration = this.props.paymentMethodsConfiguration || {};\n }\n\n protected override storeElementRefOnCore() {\n this.core.storeElementReference(this);\n }\n\n formatProps(props) {\n return {\n type: 'dropin', // for analytics\n ...super.formatProps(props),\n instantPaymentTypes: Array.from<InstantPaymentTypes>(new Set(props.instantPaymentTypes)).filter(value =>\n SUPPORTED_INSTANT_PAYMENTS.includes(value)\n )\n };\n }\n\n get isValid() {\n return !!this.dropinRef && !!this.dropinRef.state.activePaymentMethod && !!this.dropinRef.state.activePaymentMethod.isValid;\n }\n\n showValidation() {\n if (this.dropinRef.state.activePaymentMethod) {\n this.dropinRef.state.activePaymentMethod.showValidation();\n }\n\n return this;\n }\n\n public setStatus(status, props = {}): this {\n this.dropinRef?.setStatus(status, props);\n return this;\n }\n\n get activePaymentMethod() {\n if (!this.dropinRef?.state && !this.dropinRef?.state.activePaymentMethod) {\n return null;\n }\n\n return this.dropinRef.state.activePaymentMethod;\n }\n\n get data() {\n if (!this.activePaymentMethod) {\n return null;\n }\n\n return this.dropinRef.state.activePaymentMethod.data;\n }\n\n public displayFinalAnimation(type: 'success' | 'error') {\n if (this.props.disableFinalAnimation) return;\n\n this.dropinRef.setStatus(type);\n }\n\n /**\n * Calls the onSubmit event with the state of the activePaymentMethod\n */\n public override submit(): void {\n if (!this.activePaymentMethod) {\n throw new Error('No active payment method.');\n }\n\n if (!this.activePaymentMethod.isValid) {\n this.activePaymentMethod.showValidation();\n }\n\n if (this.activePaymentMethod.isInstantPayment) {\n this.closeActivePaymentMethod();\n }\n\n this.activePaymentMethod.submit();\n }\n\n /**\n * Creates the Drop-in elements\n */\n private handleCreate = () => {\n const { paymentMethodsConfiguration, showStoredPaymentMethods, showPaymentMethods, instantPaymentTypes } = this.props;\n\n const { paymentMethods, storedPaymentMethods, instantPaymentMethods, fastlanePaymentMethod } = splitPaymentMethods(\n this.core.paymentMethodsResponse,\n instantPaymentTypes\n );\n\n const commonProps = getCommonProps({ ...this.props, elementRef: this.elementRef });\n\n const elements = showPaymentMethods ? createElements(paymentMethods, paymentMethodsConfiguration, commonProps, this.core) : [];\n const instantPaymentElements = createInstantPaymentElements(instantPaymentMethods, paymentMethodsConfiguration, commonProps, this.core);\n const storedElements = showStoredPaymentMethods\n ? createStoredElements(\n this.props.filterStoredPaymentMethods?.(storedPaymentMethods) ?? storedPaymentMethods,\n paymentMethodsConfiguration,\n commonProps,\n this.core\n )\n : [];\n const fastlanePaymentElement = fastlanePaymentMethod\n ? createElements([fastlanePaymentMethod], paymentMethodsConfiguration, commonProps, this.core)\n : [];\n\n return [storedElements, elements, instantPaymentElements, fastlanePaymentElement];\n };\n\n public handleAction(action: PaymentAction, props = {}): this | null {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'handleAction::Invalid Action - the passed action object itself has an \"action\" property and ' +\n 'a \"resultCode\": have you passed in the whole response object by mistake?'\n );\n }\n throw new Error('handleAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n if (action.type !== 'redirect' && this.activePaymentMethod?.updateWithAction) {\n return this.activePaymentMethod.updateWithAction(action);\n }\n\n if (this.elementRef instanceof DropinElement) {\n props = {\n ...this.elementRef.activePaymentMethod?.props,\n ...props\n };\n }\n\n const paymentAction: UIElement = this.core.createFromAction(action, {\n ...props,\n elementRef: this.elementRef, // maintain elementRef for 3DS2 flow\n onAdditionalDetails: this.handleAdditionalDetails,\n isDropin: true\n });\n\n if (paymentAction) {\n this.setStatus(paymentAction.props.statusType, { component: paymentAction });\n this.componentFromAction = paymentAction;\n return this;\n }\n\n return null;\n }\n\n /**\n * handleOrder is implemented so we don't trigger a callback like in the components\n * @param response - PaymentResponse\n */\n protected handleOrder = ({ order }: PaymentResponseData): void => {\n void this.updateParent({ order });\n };\n\n closeActivePaymentMethod() {\n this.dropinRef.closeActivePaymentMethod();\n }\n\n protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement> | KeyboardEvent) {\n if (e.key === 'Enter' || e.code === 'Enter') {\n // If the active element has role=\"radio\", we're on a header in the PMList, in which case we don't want to validate the form, or, prevent the default behaviour\n const isPMHeader = document?.activeElement?.getAttribute('role') === 'radio';\n if (isPMHeader) {\n return;\n }\n super.handleKeyPress(e);\n }\n }\n\n protected onEnterKeyPressed(activeElement: Element, component: UIElement) {\n // We want to have a ref to the activePM, if we can; not a ref to the Dropin\n const pmComponent = this.activePaymentMethod ?? component;\n this.activePaymentMethod?.onEnterKeyPressed(activeElement, pmComponent);\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <DropinComponent\n {...this.props}\n core={this.core}\n elementRef={this.elementRef}\n onCreateElements={this.handleCreate}\n ref={dropinRef => {\n this.dropinRef = dropinRef;\n }}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default DropinElement;\n"],"names":["SUPPORTED_INSTANT_PAYMENTS","DropinElement","UIElement","storeElementRefOnCore","this","core","storeElementReference","formatProps","props","type","super","instantPaymentTypes","Array","from","Set","filter","value","includes","isValid","dropinRef","state","activePaymentMethod","showValidation","setStatus","status","data","displayFinalAnimation","disableFinalAnimation","submit","Error","isInstantPayment","closeActivePaymentMethod","handleAction","action","hasOwnProperty","updateWithAction","elementRef","paymentAction","createFromAction","onAdditionalDetails","handleAdditionalDetails","isDropin","statusType","component","componentFromAction","handleKeyPress","e","key","code","document","activeElement","getAttribute","onEnterKeyPressed","pmComponent","render","h","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","DropinComponent","onCreateElements","handleCreate","ref","constructor","checkout","_define_property","paymentMethodsConfiguration","showStoredPaymentMethods","showPaymentMethods","paymentMethods","storedPaymentMethods","instantPaymentMethods","fastlanePaymentMethod","splitPaymentMethods","paymentMethodsResponse","commonProps","getCommonProps","elements","createElements","instantPaymentElements","createInstantPaymentElements","createStoredElements","filterStoredPaymentMethods","handleOrder","order","updateParent","bind","paymentMethodComponents","forEach","PaymentMethod","register","TxVariants","dropin","defaultProps"],"mappings":"m0BAkBA,MAAMA,EAA6B,CAAC,gBAAiB,YAAa,YAElE,MAAMC,UAAsBC,EAsBLC,qBAAAA,GACfC,KAAKC,KAAKC,sBAAsBF,KACpC,CAEAG,WAAAA,CAAYC,GACR,MAAO,CACHC,KAAM,YACHC,MAAMH,YAAYC,GACrBG,oBAAqBC,MAAMC,KAA0B,IAAIC,IAAIN,EAAMG,sBAAsBI,QAAOC,GAC5FhB,EAA2BiB,SAASD,KAGhD,CAEA,WAAIE,GACA,QAASd,KAAKe,aAAef,KAAKe,UAAUC,MAAMC,uBAAyBjB,KAAKe,UAAUC,MAAMC,oBAAoBH,OACxH,CAEAI,cAAAA,GAKI,OAJIlB,KAAKe,UAAUC,MAAMC,qBACrBjB,KAAKe,UAAUC,MAAMC,oBAAoBC,iBAGtClB,IACX,CAEOmB,SAAAA,CAAUC,EAAQhB,EAAQ,IAE7B,OADAJ,KAAKe,WAAWI,UAAUC,EAAQhB,GAC3BJ,IACX,CAEA,uBAAIiB,GACA,OAAKjB,KAAKe,WAAWC,OAAUhB,KAAKe,WAAWC,MAAMC,oBAI9CjB,KAAKe,UAAUC,MAAMC,oBAHjB,IAIf,CAEA,QAAII,GACA,OAAKrB,KAAKiB,oBAIHjB,KAAKe,UAAUC,MAAMC,oBAAoBI,KAHrC,IAIf,CAEOC,qBAAAA,CAAsBjB,GACrBL,KAAKI,MAAMmB,uBAEfvB,KAAKe,UAAUI,UAAUd,EAC7B,CAKA,MAAAmB,GACI,IAAKxB,KAAKiB,oBACN,MAAM,IAAIQ,MAAM,6BAGfzB,KAAKiB,oBAAoBH,SAC1Bd,KAAKiB,oBAAoBC,iBAGzBlB,KAAKiB,oBAAoBS,kBACzB1B,KAAK2B,2BAGT3B,KAAKiB,oBAAoBO,QAC7B,CAgCOI,YAA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
1
- import{createElement as e}from"../../external/preact/dist/preact.js";import r from"../helpers/OpenInvoiceContainer/OpenInvoiceContainer.js";import{termsAndConditionsUrlMap as i,privacyPolicyUrlMap as o,allowedDeliveryCountries as t,allowedBillingCountries as s,DISCLAIMER_MESSAGE_TRANSLATION_KEY as n,deliveryAddressSpecification as a,personalDetailsRequiredFields as l}from"./config.js";import{getConsentUrl as c}from"../../utils/getConsentUrl.js";import{LabelOnlyDisclaimerMessage as d}from"../internal/DisclaimerMessage/DisclaimerMessage.js";import{TxVariants as p}from"../tx-variants.js";function f(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}class m extends r{formatProps(r){const a=c(r.countryCode,r.i18n?.locale,i),l=c(r.countryCode,r.i18n?.locale,o);return{...super.formatProps(r),billingAddressSpecification:{...r.billingAddressSpecification,allowedCountries:r.countryCode?[r.countryCode]:s},deliveryAddressSpecification:{...r.deliveryAddressSpecification,allowedCountries:t},consentCheckboxLabel:e(d,{message:r.i18n.get(n),urls:[a,l]})}}}f(m,"type",p.riverty),f(m,"defaultProps",{personalDetailsRequiredFields:l,deliveryAddressSpecification:a,...r.defaultProps});export{m as default};
1
+ import{TxVariants as e}from"../tx-variants.js";import t from"../Redirect/Redirect.js";function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends t{formatData(){return{paymentMethod:{type:this.type,subtype:"redirect"},browserInfo:this.browserInfo}}}r(i,"type",e.riverty),r(i,"defaultProps",{type:e.riverty});export{i as default};
2
2
  //# sourceMappingURL=Riverty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Riverty.js","sources":["../../../../src/components/Riverty/Riverty.tsx"],"sourcesContent":["import { h } from 'preact';\nimport OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport {\n DISCLAIMER_MESSAGE_TRANSLATION_KEY,\n allowedBillingCountries,\n allowedDeliveryCountries,\n deliveryAddressSpecification,\n personalDetailsRequiredFields,\n termsAndConditionsUrlMap,\n privacyPolicyUrlMap\n} from './config';\nimport { getConsentUrl } from '../../utils/getConsentUrl';\nimport { LabelOnlyDisclaimerMessage } from '../internal/DisclaimerMessage/DisclaimerMessage';\nimport type { OpenInvoiceConfiguration } from '../helpers/OpenInvoiceContainer/types';\nimport { TxVariants } from '../tx-variants';\n\nexport default class Riverty extends OpenInvoiceContainer {\n public static readonly type = TxVariants.riverty;\n\n protected static defaultProps = {\n personalDetailsRequiredFields,\n deliveryAddressSpecification,\n ...OpenInvoiceContainer.defaultProps\n };\n\n formatProps(props: OpenInvoiceConfiguration) {\n const tocURL = getConsentUrl(props.countryCode, props.i18n?.locale, termsAndConditionsUrlMap);\n const privacyURL = getConsentUrl(props.countryCode, props.i18n?.locale, privacyPolicyUrlMap);\n\n return {\n ...super.formatProps(props),\n billingAddressSpecification: {\n ...props.billingAddressSpecification,\n allowedCountries: props.countryCode ? [props.countryCode] : allowedBillingCountries\n },\n deliveryAddressSpecification: {\n ...props.deliveryAddressSpecification,\n allowedCountries: allowedDeliveryCountries\n },\n consentCheckboxLabel: (\n <LabelOnlyDisclaimerMessage message={props.i18n.get(DISCLAIMER_MESSAGE_TRANSLATION_KEY)} urls={[tocURL, privacyURL]} />\n )\n };\n }\n}\n"],"names":["Riverty","OpenInvoiceContainer","formatProps","props","tocURL","getConsentUrl","countryCode","i18n","locale","termsAndConditionsUrlMap","privacyURL","privacyPolicyUrlMap","super","billingAddressSpecification","allowedCountries","allowedBillingCountries","deliveryAddressSpecification","allowedDeliveryCountries","consentCheckboxLabel","h","LabelOnlyDisclaimerMessage","message","get","DISCLAIMER_MESSAGE_TRANSLATION_KEY","urls","_define_property","type","TxVariants","riverty","defaultProps","personalDetailsRequiredFields"],"mappings":"wsBAgBe,MAAMA,UAAgBC,EASjCC,WAAAA,CAAYC,GACR,MAAMC,EAASC,EAAcF,EAAMG,YAAaH,EAAMI,MAAMC,OAAQC,GAC9DC,EAAaL,EAAcF,EAAMG,YAAaH,EAAMI,MAAMC,OAAQG,GAExE,MAAO,IACAC,MAAMV,YAAYC,GACrBU,4BAA6B,IACtBV,EAAMU,4BACTC,iBAAkBX,EAAMG,YAAc,CAACH,EAAMG,aAAeS,GAEhEC,6BAA8B,IACvBb,EAAMa,6BACTF,iBAAkBG,GAEtBC,qBACIC,EAACC,EAAAA,CAA2BC,QAASlB,EAAMI,KAAKe,IAAIC,GAAqCC,KAAM,CAACpB,EAAQM,KAGpH,EA1BAe,EADiBzB,EACM0B,OAAOC,EAAWC,SAEzCH,EAHiBzB,EAGA6B,eAAe,CAC5BC,gCACAd,kCACGf,EAAqB4B"}
1
+ {"version":3,"file":"Riverty.js","sources":["../../../../src/components/Riverty/Riverty.tsx"],"sourcesContent":["import { TxVariants } from '../tx-variants';\nimport RedirectElement from '../Redirect';\n\nclass Riverty extends RedirectElement {\n public static readonly type = TxVariants.riverty;\n\n public static override readonly defaultProps = {\n type: TxVariants.riverty\n };\n\n public override formatData() {\n return {\n paymentMethod: {\n type: this.type,\n subtype: 'redirect'\n },\n browserInfo: this.browserInfo\n };\n }\n}\n\nexport default Riverty;\n"],"names":["Riverty","RedirectElement","formatData","paymentMethod","type","this","subtype","browserInfo","_define_property","TxVariants","riverty","defaultProps"],"mappings":"8MAGA,MAAMA,UAAgBC,EAOFC,UAAAA,GACZ,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKD,KACXE,QAAS,YAEbC,YAAaF,KAAKE,YAE1B,EAdAC,EADER,EACqBI,OAAOK,EAAWC,SAEzCF,EAHER,EAG8BW,eAAe,CAC3CP,KAAMK,EAAWC"}
@@ -1,2 +1,2 @@
1
- import{TxVariants as a}from"./tx-variants.js";const o={[a.address]:"Address",[a.bankTransfer_IBAN]:"BankTransfer",[a.donation]:"Donation",[a.personal_details]:"PersonalDetails",[a.bcmc]:"Bancontact",[a.card]:"Card",[a.scheme]:"Card",[a.storedCard]:"Card",[a.customCard]:"CustomCard",[a.ach]:"Ach",[a.directdebit_GB]:"BacsDirectDebit",[a.sepadirectdebit]:"SepaDirectDebit",[a.affirm]:"Affirm",[a.afterpay]:"AfterPay",[a.afterpay_default]:"AfterPay",[a.afterpay_b2b]:"AfterPayB2B",[a.atome]:"Atome",[a.facilypay_3x]:"FacilyPay3x",[a.facilypay_4x]:"FacilyPay4x",[a.facilypay_6x]:"FacilyPay6x",[a.facilypay_10x]:"FacilyPay10x",[a.facilypay_12x]:"FacilyPay12x",[a.ratepay]:"RatePay",[a.ratepay_directdebit]:"RatePayDirectDebit",[a.riverty]:"Riverty",[a.amazonpay]:"AmazonPay",[a.applepay]:"ApplePay",[a.cashapp]:"CashAppPay",[a.clicktopay]:"ClickToPay",[a.googlepay]:"GooglePay",[a.paypal]:"PayPal",[a.fastlane]:"Fastlane",[a.paywithgoogle]:"GooglePay",[a.boletobancario]:"Boleto",[a.boletobancario_itau]:"Boleto",[a.boletobancario_santander]:"Boleto",[a.doku]:"Doku",[a.doku_alfamart]:"Doku",[a.doku_permata_lite_atm]:"Doku",[a.doku_indomaret]:"Doku",[a.doku_atm_mandiri_va]:"Doku",[a.doku_sinarmas_va]:"Doku",[a.doku_mandiri_va]:"Doku",[a.doku_cimb_va]:"Doku",[a.doku_danamon_va]:"Doku",[a.doku_bri_va]:"Doku",[a.doku_bni_va]:"Doku",[a.doku_bca_va]:"Doku",[a.doku_wallet]:"Doku",[a.oxxo]:"Oxxo",[a.primeiropay_boleto]:"Boleto",[a.billdesk_online]:"BillDeskOnline",[a.billdesk_wallet]:"BillDeskWallet",[a.dotpay]:"Dotpay",[a.eps]:"Eps",[a.molpay_ebanking_fpx_MY]:"MolPayEBankingMY",[a.molpay_ebanking_TH]:"MolPayEBankingTH",[a.molpay_ebanking_VN]:"MolPayEBankingVN",[a.onlineBanking_CZ]:"OnlineBankingCZ",[a.onlinebanking_IN]:"OnlineBankingIN",[a.onlineBanking_PL]:"OnlineBankingPL",[a.onlineBanking_SK]:"OnlineBankingSK",[a.paybybank]:"PayByBank",[a.payu_IN_cashcard]:"PayuCashcard",[a.payu_IN_nb]:"PayuNetBanking",[a.wallet_IN]:"WalletINElement",[a.dragonpay_ebanking]:"Dragonpay",[a.dragonpay_otc_banking]:"Dragonpay",[a.dragonpay_otc_non_banking]:"Dragonpay",[a.dragonpay_otc_philippines]:"Dragonpay",[a.econtext_atm]:"Econtext",[a.econtext_online]:"Econtext",[a.econtext_seven_eleven]:"Econtext",[a.econtext_stores]:"Econtext",[a.giropay]:"Giropay",[a.multibanco]:"Multibanco",[a.redirect]:"Redirect",[a.twint]:"Twint",[a.vipps]:"Vipps",[a.trustly]:"Trustly",[a.paybybank_AIS_DD]:"PayByBankUS",[a.klarna]:"Klarna",[a.klarna_account]:"Klarna",[a.klarna_paynow]:"Klarna",[a.klarna_b2b]:"Klarna",[a.bcmc_mobile]:"BcmcMobile",[a.bcmc_mobile_QR]:"BcmcMobile",[a.pix]:"Pix",[a.swish]:"Swish",[a.wechatpay]:"WeChat",[a.wechatpayQR]:"WeChat",[a.promptpay]:"PromptPay",[a.paynow]:"PayNow",[a.duitnow]:"DuitNow",[a.blik]:"Blik",[a.mbway]:"MBWay",[a.ancv]:"ANCV",[a.payto]:"PayTo",[a.upi]:"UPI",[a.upi_qr]:"UPI",[a.upi_collect]:"UPI",[a.upi_intent]:"UPI",[a.giftcard]:"Giftcard",[a.mealVoucher_FR_natixis]:"MealVoucherFR",[a.mealVoucher_FR_sodexo]:"MealVoucherFR",[a.mealVoucher_FR_groupeup]:"MealVoucherFR"};function e(a){return o[a]}export{e as default};
1
+ import{TxVariants as a}from"./tx-variants.js";const o={[a.address]:"Address",[a.bankTransfer_IBAN]:"BankTransfer",[a.donation]:"Donation",[a.personal_details]:"PersonalDetails",[a.bcmc]:"Bancontact",[a.card]:"Card",[a.scheme]:"Card",[a.storedCard]:"Card",[a.customCard]:"CustomCard",[a.ach]:"Ach",[a.directdebit_GB]:"BacsDirectDebit",[a.sepadirectdebit]:"SepaDirectDebit",[a.affirm]:"Affirm",[a.afterpay]:"AfterPay",[a.afterpay_default]:"AfterPay",[a.afterpay_b2b]:"AfterPayB2B",[a.atome]:"Atome",[a.facilypay_3x]:"FacilyPay3x",[a.facilypay_4x]:"FacilyPay4x",[a.facilypay_6x]:"FacilyPay6x",[a.facilypay_10x]:"FacilyPay10x",[a.facilypay_12x]:"FacilyPay12x",[a.ratepay]:"RatePay",[a.ratepay_directdebit]:"RatePayDirectDebit",[a.amazonpay]:"AmazonPay",[a.applepay]:"ApplePay",[a.cashapp]:"CashAppPay",[a.clicktopay]:"ClickToPay",[a.googlepay]:"GooglePay",[a.paypal]:"PayPal",[a.fastlane]:"Fastlane",[a.paywithgoogle]:"GooglePay",[a.boletobancario]:"Boleto",[a.boletobancario_itau]:"Boleto",[a.boletobancario_santander]:"Boleto",[a.doku]:"Doku",[a.doku_alfamart]:"Doku",[a.doku_permata_lite_atm]:"Doku",[a.doku_indomaret]:"Doku",[a.doku_atm_mandiri_va]:"Doku",[a.doku_sinarmas_va]:"Doku",[a.doku_mandiri_va]:"Doku",[a.doku_cimb_va]:"Doku",[a.doku_danamon_va]:"Doku",[a.doku_bri_va]:"Doku",[a.doku_bni_va]:"Doku",[a.doku_bca_va]:"Doku",[a.doku_wallet]:"Doku",[a.oxxo]:"Oxxo",[a.primeiropay_boleto]:"Boleto",[a.billdesk_online]:"BillDeskOnline",[a.billdesk_wallet]:"BillDeskWallet",[a.dotpay]:"Dotpay",[a.eps]:"Eps",[a.molpay_ebanking_fpx_MY]:"MolPayEBankingMY",[a.molpay_ebanking_TH]:"MolPayEBankingTH",[a.molpay_ebanking_VN]:"MolPayEBankingVN",[a.onlineBanking_CZ]:"OnlineBankingCZ",[a.onlinebanking_IN]:"OnlineBankingIN",[a.onlineBanking_PL]:"OnlineBankingPL",[a.onlineBanking_SK]:"OnlineBankingSK",[a.paybybank]:"PayByBank",[a.payu_IN_cashcard]:"PayuCashcard",[a.payu_IN_nb]:"PayuNetBanking",[a.wallet_IN]:"WalletINElement",[a.dragonpay_ebanking]:"Dragonpay",[a.dragonpay_otc_banking]:"Dragonpay",[a.dragonpay_otc_non_banking]:"Dragonpay",[a.dragonpay_otc_philippines]:"Dragonpay",[a.econtext_atm]:"Econtext",[a.econtext_online]:"Econtext",[a.econtext_seven_eleven]:"Econtext",[a.econtext_stores]:"Econtext",[a.giropay]:"Giropay",[a.multibanco]:"Multibanco",[a.redirect]:"Redirect",[a.twint]:"Twint",[a.vipps]:"Vipps",[a.trustly]:"Trustly",[a.paybybank_AIS_DD]:"PayByBankUS",[a.riverty]:"Riverty",[a.klarna]:"Klarna",[a.klarna_account]:"Klarna",[a.klarna_paynow]:"Klarna",[a.klarna_b2b]:"Klarna",[a.bcmc_mobile]:"BcmcMobile",[a.bcmc_mobile_QR]:"BcmcMobile",[a.pix]:"Pix",[a.swish]:"Swish",[a.wechatpay]:"WeChat",[a.wechatpayQR]:"WeChat",[a.promptpay]:"PromptPay",[a.paynow]:"PayNow",[a.duitnow]:"DuitNow",[a.blik]:"Blik",[a.mbway]:"MBWay",[a.ancv]:"ANCV",[a.payto]:"PayTo",[a.upi]:"UPI",[a.upi_qr]:"UPI",[a.upi_collect]:"UPI",[a.upi_intent]:"UPI",[a.giftcard]:"Giftcard",[a.mealVoucher_FR_natixis]:"MealVoucherFR",[a.mealVoucher_FR_sodexo]:"MealVoucherFR",[a.mealVoucher_FR_groupeup]:"MealVoucherFR"};function e(a){return o[a]}export{e as default};
2
2
  //# sourceMappingURL=components-name-map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components-name-map.js","sources":["../../../src/components/components-name-map.ts"],"sourcesContent":["import { TxVariants } from './tx-variants';\n\n/**\n * Maps each payment type with the string name of its Component element.\n *\n * It is used to give nicer error messages when creating components using Drop-in.\n * Example: paymentMethods response contains blik, but Blik component is not configured. So it warns that 'Blik' must be imported and added to the Drop-in configuration.\n */\nconst ComponentsNameMap = {\n /** internal */\n [TxVariants.address]: 'Address',\n [TxVariants.bankTransfer_IBAN]: 'BankTransfer',\n [TxVariants.donation]: 'Donation',\n [TxVariants.personal_details]: 'PersonalDetails',\n /** internal */\n\n /** Card */\n [TxVariants.bcmc]: 'Bancontact',\n [TxVariants.card]: 'Card',\n [TxVariants.scheme]: 'Card',\n [TxVariants.storedCard]: 'Card',\n [TxVariants.customCard]: 'CustomCard',\n /** Card */\n\n /** Direct debit */\n [TxVariants.ach]: 'Ach',\n [TxVariants.directdebit_GB]: 'BacsDirectDebit',\n [TxVariants.sepadirectdebit]: 'SepaDirectDebit',\n /** Direct debit */\n\n /** Open Invoice */\n [TxVariants.affirm]: 'Affirm',\n [TxVariants.afterpay]: 'AfterPay',\n [TxVariants.afterpay_default]: 'AfterPay',\n [TxVariants.afterpay_b2b]: 'AfterPayB2B',\n [TxVariants.atome]: 'Atome',\n [TxVariants.facilypay_3x]: 'FacilyPay3x',\n [TxVariants.facilypay_4x]: 'FacilyPay4x',\n [TxVariants.facilypay_6x]: 'FacilyPay6x',\n [TxVariants.facilypay_10x]: 'FacilyPay10x',\n [TxVariants.facilypay_12x]: 'FacilyPay12x',\n [TxVariants.ratepay]: 'RatePay',\n [TxVariants.ratepay_directdebit]: 'RatePayDirectDebit',\n [TxVariants.riverty]: 'Riverty',\n /** Open Invoice */\n\n /** Wallets */\n [TxVariants.amazonpay]: 'AmazonPay',\n [TxVariants.applepay]: 'ApplePay',\n [TxVariants.cashapp]: 'CashAppPay',\n [TxVariants.clicktopay]: 'ClickToPay',\n [TxVariants.googlepay]: 'GooglePay',\n [TxVariants.paypal]: 'PayPal',\n [TxVariants.fastlane]: 'Fastlane',\n [TxVariants.paywithgoogle]: 'GooglePay',\n /** Wallets */\n\n /** Voucher */\n [TxVariants.boletobancario]: 'Boleto',\n [TxVariants.boletobancario_itau]: 'Boleto',\n [TxVariants.boletobancario_santander]: 'Boleto',\n [TxVariants.doku]: 'Doku',\n [TxVariants.doku_alfamart]: 'Doku',\n [TxVariants.doku_permata_lite_atm]: 'Doku',\n [TxVariants.doku_indomaret]: 'Doku',\n [TxVariants.doku_atm_mandiri_va]: 'Doku',\n [TxVariants.doku_sinarmas_va]: 'Doku',\n [TxVariants.doku_mandiri_va]: 'Doku',\n [TxVariants.doku_cimb_va]: 'Doku',\n [TxVariants.doku_danamon_va]: 'Doku',\n [TxVariants.doku_bri_va]: 'Doku',\n [TxVariants.doku_bni_va]: 'Doku',\n [TxVariants.doku_bca_va]: 'Doku',\n [TxVariants.doku_wallet]: 'Doku',\n [TxVariants.oxxo]: 'Oxxo',\n [TxVariants.primeiropay_boleto]: 'Boleto',\n /** Voucher */\n\n /** issuerList */\n [TxVariants.billdesk_online]: 'BillDeskOnline',\n [TxVariants.billdesk_wallet]: 'BillDeskWallet',\n [TxVariants.dotpay]: 'Dotpay',\n [TxVariants.eps]: 'Eps',\n [TxVariants.molpay_ebanking_fpx_MY]: 'MolPayEBankingMY',\n [TxVariants.molpay_ebanking_TH]: 'MolPayEBankingTH',\n [TxVariants.molpay_ebanking_VN]: 'MolPayEBankingVN',\n [TxVariants.onlineBanking_CZ]: 'OnlineBankingCZ',\n [TxVariants.onlinebanking_IN]: 'OnlineBankingIN', // NOTE: the txVariant does have a lowercase \"b\"\n [TxVariants.onlineBanking_PL]: 'OnlineBankingPL',\n [TxVariants.onlineBanking_SK]: 'OnlineBankingSK',\n [TxVariants.paybybank]: 'PayByBank',\n [TxVariants.payu_IN_cashcard]: 'PayuCashcard',\n [TxVariants.payu_IN_nb]: 'PayuNetBanking',\n [TxVariants.wallet_IN]: 'WalletINElement',\n /** issuerList */\n\n /** Dragonpay */\n [TxVariants.dragonpay_ebanking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_non_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_philippines]: 'Dragonpay',\n /** Dragonpay */\n\n /** Econtext */\n [TxVariants.econtext_atm]: 'Econtext',\n [TxVariants.econtext_online]: 'Econtext',\n [TxVariants.econtext_seven_eleven]: 'Econtext',\n [TxVariants.econtext_stores]: 'Econtext',\n /** Econtext */\n\n /** Redirect */\n [TxVariants.giropay]: 'Giropay',\n [TxVariants.multibanco]: 'Multibanco',\n [TxVariants.redirect]: 'Redirect',\n [TxVariants.twint]: 'Twint',\n [TxVariants.vipps]: 'Vipps',\n [TxVariants.trustly]: 'Trustly',\n [TxVariants.paybybank_AIS_DD]: 'PayByBankUS',\n /** Redirect */\n\n /** Klarna */\n [TxVariants.klarna]: 'Klarna',\n [TxVariants.klarna_account]: 'Klarna',\n [TxVariants.klarna_paynow]: 'Klarna',\n [TxVariants.klarna_b2b]: 'Klarna',\n /** Klarna */\n\n /** QRLoader */\n [TxVariants.bcmc_mobile]: 'BcmcMobile',\n [TxVariants.bcmc_mobile_QR]: 'BcmcMobile',\n [TxVariants.pix]: 'Pix',\n [TxVariants.swish]: 'Swish',\n [TxVariants.wechatpay]: 'WeChat',\n [TxVariants.wechatpayQR]: 'WeChat',\n [TxVariants.promptpay]: 'PromptPay',\n [TxVariants.paynow]: 'PayNow',\n [TxVariants.duitnow]: 'DuitNow',\n /** QRLoader */\n\n /** Await */\n [TxVariants.blik]: 'Blik',\n [TxVariants.mbway]: 'MBWay',\n [TxVariants.ancv]: 'ANCV',\n [TxVariants.payto]: 'PayTo',\n [TxVariants.upi]: 'UPI', // also QR\n [TxVariants.upi_qr]: 'UPI', // also QR\n [TxVariants.upi_collect]: 'UPI', // also QR\n [TxVariants.upi_intent]: 'UPI',\n /** Await */\n\n /** Giftcard */\n [TxVariants.giftcard]: 'Giftcard',\n [TxVariants.mealVoucher_FR_natixis]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_sodexo]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_groupeup]: 'MealVoucherFR'\n /** Giftcard */\n};\n\n/**\n * Returns the Component name based on the payment type\n * @param paymentType\n */\nfunction getComponentNameOfPaymentType(paymentType: string): string {\n return ComponentsNameMap[paymentType];\n}\n\nexport default getComponentNameOfPaymentType;\n"],"names":["ComponentsNameMap","TxVariants","address","bankTransfer_IBAN","donation","personal_details","bcmc","card","scheme","storedCard","customCard","ach","directdebit_GB","sepadirectdebit","affirm","afterpay","afterpay_default","afterpay_b2b","atome","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","ratepay","ratepay_directdebit","riverty","amazonpay","applepay","cashapp","clicktopay","googlepay","paypal","fastlane","paywithgoogle","boletobancario","boletobancario_itau","boletobancario_santander","doku","doku_alfamart","doku_permata_lite_atm","doku_indomaret","doku_atm_mandiri_va","doku_sinarmas_va","doku_mandiri_va","doku_cimb_va","doku_danamon_va","doku_bri_va","doku_bni_va","doku_bca_va","doku_wallet","oxxo","primeiropay_boleto","billdesk_online","billdesk_wallet","dotpay","eps","molpay_ebanking_fpx_MY","molpay_ebanking_TH","molpay_ebanking_VN","onlineBanking_CZ","onlinebanking_IN","onlineBanking_PL","onlineBanking_SK","paybybank","payu_IN_cashcard","payu_IN_nb","wallet_IN","dragonpay_ebanking","dragonpay_otc_banking","dragonpay_otc_non_banking","dragonpay_otc_philippines","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","giropay","multibanco","redirect","twint","vipps","trustly","paybybank_AIS_DD","klarna","klarna_account","klarna_paynow","klarna_b2b","bcmc_mobile","bcmc_mobile_QR","pix","swish","wechatpay","wechatpayQR","promptpay","paynow","duitnow","blik","mbway","ancv","payto","upi","upi_qr","upi_collect","upi_intent","giftcard","mealVoucher_FR_natixis","mealVoucher_FR_sodexo","mealVoucher_FR_groupeup","getComponentNameOfPaymentType","paymentType"],"mappings":"8CAQA,MAAMA,EAAoB,CAEtB,CAACC,EAAWC,SAAU,UACtB,CAACD,EAAWE,mBAAoB,eAChC,CAACF,EAAWG,UAAW,WACvB,CAACH,EAAWI,kBAAmB,kBAI/B,CAACJ,EAAWK,MAAO,aACnB,CAACL,EAAWM,MAAO,OACnB,CAACN,EAAWO,QAAS,OACrB,CAACP,EAAWQ,YAAa,OACzB,CAACR,EAAWS,YAAa,aAIzB,CAACT,EAAWU,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5F,EAAW6F,QAAS,SACrB,CAAC7F,EAAW8F,SAAU,UAItB,CAAC9F,EAAW+F,MAAO,OACnB,CAAC/F,EAAWgG,OAAQ,QACpB,CAAChG,EAAWiG,MAAO,OACnB,CAACjG,EAAWkG,OAAQ,QACpB,CAAClG,EAAWmG,KAAM,MAClB,CAACnG,EAAWoG,QAAS,MACrB,CAACpG,EAAWqG,aAAc,MAC1B,CAACrG,EAAWsG,YAAa,MAIzB,CAACtG,EAAWuG,UAAW,WACvB,CAACvG,EAAWwG,wBAAyB,gBACrC,CAACxG,EAAWyG,uBAAwB,gBACpC,CAACzG,EAAW0G,yBAA0B,iBAQ1C,SAASC,EAA8BC,GACnC,OAAO7G,EAAkB6G,EAC7B"}
1
+ {"version":3,"file":"components-name-map.js","sources":["../../../src/components/components-name-map.ts"],"sourcesContent":["import { TxVariants } from './tx-variants';\n\n/**\n * Maps each payment type with the string name of its Component element.\n *\n * It is used to give nicer error messages when creating components using Drop-in.\n * Example: paymentMethods response contains blik, but Blik component is not configured. So it warns that 'Blik' must be imported and added to the Drop-in configuration.\n */\nconst ComponentsNameMap = {\n /** internal */\n [TxVariants.address]: 'Address',\n [TxVariants.bankTransfer_IBAN]: 'BankTransfer',\n [TxVariants.donation]: 'Donation',\n [TxVariants.personal_details]: 'PersonalDetails',\n /** internal */\n\n /** Card */\n [TxVariants.bcmc]: 'Bancontact',\n [TxVariants.card]: 'Card',\n [TxVariants.scheme]: 'Card',\n [TxVariants.storedCard]: 'Card',\n [TxVariants.customCard]: 'CustomCard',\n /** Card */\n\n /** Direct debit */\n [TxVariants.ach]: 'Ach',\n [TxVariants.directdebit_GB]: 'BacsDirectDebit',\n [TxVariants.sepadirectdebit]: 'SepaDirectDebit',\n /** Direct debit */\n\n /** Open Invoice */\n [TxVariants.affirm]: 'Affirm',\n [TxVariants.afterpay]: 'AfterPay',\n [TxVariants.afterpay_default]: 'AfterPay',\n [TxVariants.afterpay_b2b]: 'AfterPayB2B',\n [TxVariants.atome]: 'Atome',\n [TxVariants.facilypay_3x]: 'FacilyPay3x',\n [TxVariants.facilypay_4x]: 'FacilyPay4x',\n [TxVariants.facilypay_6x]: 'FacilyPay6x',\n [TxVariants.facilypay_10x]: 'FacilyPay10x',\n [TxVariants.facilypay_12x]: 'FacilyPay12x',\n [TxVariants.ratepay]: 'RatePay',\n [TxVariants.ratepay_directdebit]: 'RatePayDirectDebit',\n /** Open Invoice */\n\n /** Wallets */\n [TxVariants.amazonpay]: 'AmazonPay',\n [TxVariants.applepay]: 'ApplePay',\n [TxVariants.cashapp]: 'CashAppPay',\n [TxVariants.clicktopay]: 'ClickToPay',\n [TxVariants.googlepay]: 'GooglePay',\n [TxVariants.paypal]: 'PayPal',\n [TxVariants.fastlane]: 'Fastlane',\n [TxVariants.paywithgoogle]: 'GooglePay',\n /** Wallets */\n\n /** Voucher */\n [TxVariants.boletobancario]: 'Boleto',\n [TxVariants.boletobancario_itau]: 'Boleto',\n [TxVariants.boletobancario_santander]: 'Boleto',\n [TxVariants.doku]: 'Doku',\n [TxVariants.doku_alfamart]: 'Doku',\n [TxVariants.doku_permata_lite_atm]: 'Doku',\n [TxVariants.doku_indomaret]: 'Doku',\n [TxVariants.doku_atm_mandiri_va]: 'Doku',\n [TxVariants.doku_sinarmas_va]: 'Doku',\n [TxVariants.doku_mandiri_va]: 'Doku',\n [TxVariants.doku_cimb_va]: 'Doku',\n [TxVariants.doku_danamon_va]: 'Doku',\n [TxVariants.doku_bri_va]: 'Doku',\n [TxVariants.doku_bni_va]: 'Doku',\n [TxVariants.doku_bca_va]: 'Doku',\n [TxVariants.doku_wallet]: 'Doku',\n [TxVariants.oxxo]: 'Oxxo',\n [TxVariants.primeiropay_boleto]: 'Boleto',\n /** Voucher */\n\n /** issuerList */\n [TxVariants.billdesk_online]: 'BillDeskOnline',\n [TxVariants.billdesk_wallet]: 'BillDeskWallet',\n [TxVariants.dotpay]: 'Dotpay',\n [TxVariants.eps]: 'Eps',\n [TxVariants.molpay_ebanking_fpx_MY]: 'MolPayEBankingMY',\n [TxVariants.molpay_ebanking_TH]: 'MolPayEBankingTH',\n [TxVariants.molpay_ebanking_VN]: 'MolPayEBankingVN',\n [TxVariants.onlineBanking_CZ]: 'OnlineBankingCZ',\n [TxVariants.onlinebanking_IN]: 'OnlineBankingIN', // NOTE: the txVariant does have a lowercase \"b\"\n [TxVariants.onlineBanking_PL]: 'OnlineBankingPL',\n [TxVariants.onlineBanking_SK]: 'OnlineBankingSK',\n [TxVariants.paybybank]: 'PayByBank',\n [TxVariants.payu_IN_cashcard]: 'PayuCashcard',\n [TxVariants.payu_IN_nb]: 'PayuNetBanking',\n [TxVariants.wallet_IN]: 'WalletINElement',\n /** issuerList */\n\n /** Dragonpay */\n [TxVariants.dragonpay_ebanking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_non_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_philippines]: 'Dragonpay',\n /** Dragonpay */\n\n /** Econtext */\n [TxVariants.econtext_atm]: 'Econtext',\n [TxVariants.econtext_online]: 'Econtext',\n [TxVariants.econtext_seven_eleven]: 'Econtext',\n [TxVariants.econtext_stores]: 'Econtext',\n /** Econtext */\n\n /** Redirect */\n [TxVariants.giropay]: 'Giropay',\n [TxVariants.multibanco]: 'Multibanco',\n [TxVariants.redirect]: 'Redirect',\n [TxVariants.twint]: 'Twint',\n [TxVariants.vipps]: 'Vipps',\n [TxVariants.trustly]: 'Trustly',\n [TxVariants.paybybank_AIS_DD]: 'PayByBankUS',\n [TxVariants.riverty]: 'Riverty',\n /** Redirect */\n\n /** Klarna */\n [TxVariants.klarna]: 'Klarna',\n [TxVariants.klarna_account]: 'Klarna',\n [TxVariants.klarna_paynow]: 'Klarna',\n [TxVariants.klarna_b2b]: 'Klarna',\n /** Klarna */\n\n /** QRLoader */\n [TxVariants.bcmc_mobile]: 'BcmcMobile',\n [TxVariants.bcmc_mobile_QR]: 'BcmcMobile',\n [TxVariants.pix]: 'Pix',\n [TxVariants.swish]: 'Swish',\n [TxVariants.wechatpay]: 'WeChat',\n [TxVariants.wechatpayQR]: 'WeChat',\n [TxVariants.promptpay]: 'PromptPay',\n [TxVariants.paynow]: 'PayNow',\n [TxVariants.duitnow]: 'DuitNow',\n /** QRLoader */\n\n /** Await */\n [TxVariants.blik]: 'Blik',\n [TxVariants.mbway]: 'MBWay',\n [TxVariants.ancv]: 'ANCV',\n [TxVariants.payto]: 'PayTo',\n [TxVariants.upi]: 'UPI', // also QR\n [TxVariants.upi_qr]: 'UPI', // also QR\n [TxVariants.upi_collect]: 'UPI', // also QR\n [TxVariants.upi_intent]: 'UPI',\n /** Await */\n\n /** Giftcard */\n [TxVariants.giftcard]: 'Giftcard',\n [TxVariants.mealVoucher_FR_natixis]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_sodexo]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_groupeup]: 'MealVoucherFR'\n /** Giftcard */\n};\n\n/**\n * Returns the Component name based on the payment type\n * @param paymentType\n */\nfunction getComponentNameOfPaymentType(paymentType: string): string {\n return ComponentsNameMap[paymentType];\n}\n\nexport default getComponentNameOfPaymentType;\n"],"names":["ComponentsNameMap","TxVariants","address","bankTransfer_IBAN","donation","personal_details","bcmc","card","scheme","storedCard","customCard","ach","directdebit_GB","sepadirectdebit","affirm","afterpay","afterpay_default","afterpay_b2b","atome","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","ratepay","ratepay_directdebit","amazonpay","applepay","cashapp","clicktopay","googlepay","paypal","fastlane","paywithgoogle","boletobancario","boletobancario_itau","boletobancario_santander","doku","doku_alfamart","doku_permata_lite_atm","doku_indomaret","doku_atm_mandiri_va","doku_sinarmas_va","doku_mandiri_va","doku_cimb_va","doku_danamon_va","doku_bri_va","doku_bni_va","doku_bca_va","doku_wallet","oxxo","primeiropay_boleto","billdesk_online","billdesk_wallet","dotpay","eps","molpay_ebanking_fpx_MY","molpay_ebanking_TH","molpay_ebanking_VN","onlineBanking_CZ","onlinebanking_IN","onlineBanking_PL","onlineBanking_SK","paybybank","payu_IN_cashcard","payu_IN_nb","wallet_IN","dragonpay_ebanking","dragonpay_otc_banking","dragonpay_otc_non_banking","dragonpay_otc_philippines","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","giropay","multibanco","redirect","twint","vipps","trustly","paybybank_AIS_DD","riverty","klarna","klarna_account","klarna_paynow","klarna_b2b","bcmc_mobile","bcmc_mobile_QR","pix","swish","wechatpay","wechatpayQR","promptpay","paynow","duitnow","blik","mbway","ancv","payto","upi","upi_qr","upi_collect","upi_intent","giftcard","mealVoucher_FR_natixis","mealVoucher_FR_sodexo","mealVoucher_FR_groupeup","getComponentNameOfPaymentType","paymentType"],"mappings":"8CAQA,MAAMA,EAAoB,CAEtB,CAACC,EAAWC,SAAU,UACtB,CAACD,EAAWE,mBAAoB,eAChC,CAACF,EAAWG,UAAW,WACvB,CAACH,EAAWI,kBAAmB,kBAI/B,CAACJ,EAAWK,MAAO,aACnB,CAACL,EAAWM,MAAO,OACnB,CAACN,EAAWO,QAAS,OACrB,CAACP,EAAWQ,YAAa,OACzB,CAACR,EAAWS,YAAa,aAIzB,CAACT,EAAWU,KAAM,MAClB,CAACV,EAAWW,gBAAiB,kBAC7B,CAACX,EAAWY,iBAAkB,kBAI9B,CAACZ,EAAWa,QAAS,SACrB,CAACb,EAAWc,UAAW,WACvB,CAACd,EAAWe,kBAAmB,WAC/B,CAACf,EAAWgB,cAAe,cAC3B,CAAChB,EAAWiB,OAAQ,QACpB,CAACjB,EAAWkB,cAAe,cAC3B,CAAClB,EAAWmB,cAAe,cAC3B,CAACnB,EAAWoB,cAAe,cAC3B,CAACpB,EAAWqB,eAAgB,eAC5B,CAACrB,EAAWsB,eAAgB,eAC5B,CAACtB,EAAWuB,SAAU,UACtB,CAACvB,EAAWwB,qBAAsB,qBAIlC,CAACxB,EAAWyB,WAAY,YACxB,CAACzB,EAAW0B,UAAW,WACvB,CA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1
- export{CardElement as Card}from"./Card/Card.js";export{default as Bancontact}from"./Card/Bancontact.js";export{CustomCard}from"./CustomCard/CustomCard.js";export{default as ThreeDS2Challenge}from"./ThreeDS2/ThreeDS2Challenge.js";export{default as ThreeDS2DeviceFingerprint}from"./ThreeDS2/ThreeDS2DeviceFingerprint.js";export{AchElement as Ach}from"./Ach/Ach.js";export{default as BacsDirectDebit}from"./BacsDD/BacsDD.js";export{default as SepaDirectDebit}from"./Sepa/Sepa.js";export{default as Affirm}from"./Affirm/Affirm.js";export{default as AfterPay}from"./AfterPay/AfterPay.js";export{default as AfterPayB2B}from"./AfterPay/AfterPayB2B.js";export{default as Atome}from"./Atome/Atome.js";export{default as FacilPay3x}from"./FacilyPay/FacilyPay3x.js";export{default as FacilPay4x}from"./FacilyPay/FacilyPay4x.js";export{default as FacilPay6x}from"./FacilyPay/FacilyPay6x.js";export{default as FacilPay10x}from"./FacilyPay/FacilyPay10x.js";export{default as FacilPay12x}from"./FacilyPay/FacilyPay12x.js";export{default as RatePay}from"./RatePay/RatePay.js";export{default as RatePayDirectDebit}from"./RatePay/RatePayDirectDebit.js";export{default as Riverty}from"./Riverty/Riverty.js";export{AmazonPayElement as AmazonPay}from"./AmazonPay/AmazonPay.js";export{default as ApplePay}from"./ApplePay/ApplePay.js";export{CashAppPay}from"./CashAppPay/CashAppPay.js";export{ClickToPayElement as ClickToPay}from"./ClickToPay/ClickToPay.js";export{default as GooglePay}from"./GooglePay/GooglePay.js";export{default as PayPal}from"./PayPal/Paypal.js";export{default as Fastlane}from"./PayPalFastlane/Fastlane.js";export{BoletoElement as Boleto}from"./Boleto/Boleto.js";export{DokuElement as Doku}from"./Doku/Doku.js";export{OxxoElement as Oxxo}from"./Oxxo/Oxxo.js";export{default as BillDeskOnline}from"./BillDesk/BillDeskOnline.js";export{default as BillDeskWallet}from"./BillDesk/BillDeskWallet.js";export{default as Dotpay}from"./Dotpay/index.js";export{default as EPS}from"./EPS/index.js";export{default as MolPayEBankingMY}from"./MolPayEBanking/MolPayEBankingMY.js";export{default as MolPayEBankingTH}from"./MolPayEBanking/MolPayEBankingTH.js";export{default as MolPayEBankingVN}from"./MolPayEBanking/MolPayEBankingVN.js";export{default as OnlineBankingCZ}from"./OnlineBankingCZ/index.js";export{default as OnlineBankingIN}from"./OnlineBankingIN/index.js";export{default as OnlineBankingPL}from"./OnlineBankingPL/OnlineBankingPL.js";export{default as OnlineBankingSK}from"./OnlineBankingSK/index.js";export{default as OnlineBankingFI}from"./OnlineBankingFI/OnlineBankingFI.js";export{default as PayByBank}from"./PayByBank/PayByBank.js";export{default as PayuCashcard}from"./PayU/PayuCashcard.js";export{default as PayuNetBanking}from"./PayU/PayuNetBanking.js";export{default as WalletIN}from"./WalletIN/index.js";export{DragonpayElement as Dragonpay}from"./Dragonpay/Dragonpay.js";export{EcontextElement as Econtext}from"./Econtext/Econtext.js";export{default as Giropay}from"./Giropay/Giropay.js";export{MultibancoElement as Multibanco}from"./Multibanco/Multibanco.js";export{default as Redirect}from"./Redirect/Redirect.js";export{default as Twint}from"./Twint/Twint.js";export{default as Vipps}from"./Vipps/Vipps.js";export{default as Trustly}from"./Trustly/Trustly.js";export{default as PayByBankUS}from"./PayByBankUS/PayByBankUS.js";export{default as Klarna}from"./Klarna/KlarnaPayments.js";export{default as BcmcMobile}from"./BcmcMobile/BcmcMobile.js";export{default as Pix}from"./Pix/Pix.js";export{default as Swish}from"./Swish/Swish.js";export{default as WeChat}from"./WeChat/WeChat.js";export{default as PromptPay}from"./PromptPay/PromptPay.js";export{default as PayNow}from"./PayNow/PayNow.js";export{default as DuitNow}from"./DuitNow/DuitNow.js";export{default as PayMe}from"./PayMe/PayMe.js";export{default as Blik}from"./Blik/Blik.js";export{MBWayElement as MBWay}from"./MBWay/MBWay.js";export{default as UPI}from"./UPI/UPI.js";export{ANCVElement as ANCV}from"./ANCV/ANCV.js";export{PayToElement as PayTo}from"./PayTo/PayTo.js";export{GiftcardElement as Giftcard}from"./Giftcard/Giftcard.js";export{MealVoucherFRElement as MealVoucherFR}from"./MealVoucherFR/MealVoucherFR.js";export{AddressElement as Address}from"./Address/Address.js";export{BankTransferElement as BankTransfer}from"./BankTransfer/BankTransfer.js";export{default as Donation}from"./Donation/Donation.js";export{default as Dropin}from"./Dropin/Dropin.js";export{PersonalDetailsElement as PersonalDetails}from"./PersonalDetails/PersonalDetails.js";
1
+ export{CardElement as Card}from"./Card/Card.js";export{default as Bancontact}from"./Card/Bancontact.js";export{CustomCard}from"./CustomCard/CustomCard.js";export{default as ThreeDS2Challenge}from"./ThreeDS2/ThreeDS2Challenge.js";export{default as ThreeDS2DeviceFingerprint}from"./ThreeDS2/ThreeDS2DeviceFingerprint.js";export{AchElement as Ach}from"./Ach/Ach.js";export{default as BacsDirectDebit}from"./BacsDD/BacsDD.js";export{default as SepaDirectDebit}from"./Sepa/Sepa.js";export{default as Affirm}from"./Affirm/Affirm.js";export{default as AfterPay}from"./AfterPay/AfterPay.js";export{default as AfterPayB2B}from"./AfterPay/AfterPayB2B.js";export{default as Atome}from"./Atome/Atome.js";export{default as FacilPay3x}from"./FacilyPay/FacilyPay3x.js";export{default as FacilPay4x}from"./FacilyPay/FacilyPay4x.js";export{default as FacilPay6x}from"./FacilyPay/FacilyPay6x.js";export{default as FacilPay10x}from"./FacilyPay/FacilyPay10x.js";export{default as FacilPay12x}from"./FacilyPay/FacilyPay12x.js";export{default as RatePay}from"./RatePay/RatePay.js";export{default as RatePayDirectDebit}from"./RatePay/RatePayDirectDebit.js";export{AmazonPayElement as AmazonPay}from"./AmazonPay/AmazonPay.js";export{default as ApplePay}from"./ApplePay/ApplePay.js";export{CashAppPay}from"./CashAppPay/CashAppPay.js";export{ClickToPayElement as ClickToPay}from"./ClickToPay/ClickToPay.js";export{default as GooglePay}from"./GooglePay/GooglePay.js";export{default as PayPal}from"./PayPal/Paypal.js";export{default as Fastlane}from"./PayPalFastlane/Fastlane.js";export{BoletoElement as Boleto}from"./Boleto/Boleto.js";export{DokuElement as Doku}from"./Doku/Doku.js";export{OxxoElement as Oxxo}from"./Oxxo/Oxxo.js";export{default as BillDeskOnline}from"./BillDesk/BillDeskOnline.js";export{default as BillDeskWallet}from"./BillDesk/BillDeskWallet.js";export{default as Dotpay}from"./Dotpay/index.js";export{default as EPS}from"./EPS/index.js";export{default as MolPayEBankingMY}from"./MolPayEBanking/MolPayEBankingMY.js";export{default as MolPayEBankingTH}from"./MolPayEBanking/MolPayEBankingTH.js";export{default as MolPayEBankingVN}from"./MolPayEBanking/MolPayEBankingVN.js";export{default as OnlineBankingCZ}from"./OnlineBankingCZ/index.js";export{default as OnlineBankingIN}from"./OnlineBankingIN/index.js";export{default as OnlineBankingPL}from"./OnlineBankingPL/OnlineBankingPL.js";export{default as OnlineBankingSK}from"./OnlineBankingSK/index.js";export{default as OnlineBankingFI}from"./OnlineBankingFI/OnlineBankingFI.js";export{default as PayByBank}from"./PayByBank/PayByBank.js";export{default as PayuCashcard}from"./PayU/PayuCashcard.js";export{default as PayuNetBanking}from"./PayU/PayuNetBanking.js";export{default as WalletIN}from"./WalletIN/index.js";export{DragonpayElement as Dragonpay}from"./Dragonpay/Dragonpay.js";export{EcontextElement as Econtext}from"./Econtext/Econtext.js";export{default as Giropay}from"./Giropay/Giropay.js";export{MultibancoElement as Multibanco}from"./Multibanco/Multibanco.js";export{default as Redirect}from"./Redirect/Redirect.js";export{default as Twint}from"./Twint/Twint.js";export{default as Vipps}from"./Vipps/Vipps.js";export{default as Trustly}from"./Trustly/Trustly.js";export{default as PayByBankUS}from"./PayByBankUS/PayByBankUS.js";export{default as Riverty}from"./Riverty/Riverty.js";export{default as Klarna}from"./Klarna/KlarnaPayments.js";export{default as BcmcMobile}from"./BcmcMobile/BcmcMobile.js";export{default as Pix}from"./Pix/Pix.js";export{default as Swish}from"./Swish/Swish.js";export{default as WeChat}from"./WeChat/WeChat.js";export{default as PromptPay}from"./PromptPay/PromptPay.js";export{default as PayNow}from"./PayNow/PayNow.js";export{default as DuitNow}from"./DuitNow/DuitNow.js";export{default as PayMe}from"./PayMe/PayMe.js";export{default as Blik}from"./Blik/Blik.js";export{MBWayElement as MBWay}from"./MBWay/MBWay.js";export{default as UPI}from"./UPI/UPI.js";export{ANCVElement as ANCV}from"./ANCV/ANCV.js";export{PayToElement as PayTo}from"./PayTo/PayTo.js";export{GiftcardElement as Giftcard}from"./Giftcard/Giftcard.js";export{MealVoucherFRElement as MealVoucherFR}from"./MealVoucherFR/MealVoucherFR.js";export{AddressElement as Address}from"./Address/Address.js";export{BankTransferElement as BankTransfer}from"./BankTransfer/BankTransfer.js";export{default as Donation}from"./Donation/Donation.js";export{default as Dropin}from"./Dropin/Dropin.js";export{PersonalDetailsElement as PersonalDetails}from"./PersonalDetails/PersonalDetails.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{createElement as e,Fragment as t}from"../../../../external/preact/dist/preact.js";import a from"../../FormFields/Fieldset/Fieldset.js";import{FALLBACK_VALUE as r}from"../constants.js";const s=({firstName:a,lastName:r})=>e(t,null,a&&`${a} `,r&&`${r}`,e("br",null)),l=({data:l,label:m})=>{const{street:o,houseNumberOrName:n,city:i,postalCode:c,stateOrProvince:d,country:u,firstName:N,lastName:f}=l;return e(a,{classNameModifiers:[m],label:m,readonly:!0},e(t,null,(N||f)&&e(s,{firstName:N,lastName:f}),!!o&&o,n&&`, ${n},`,e("br",null),c&&`${c}`,i&&`, ${i}`,d&&d!==r&&`, ${d}`,u&&`, ${u} `))};export{l as default};
1
+ import{createElement as e,Fragment as t}from"../../../../external/preact/dist/preact.js";import r from"../../FormFields/Fieldset/Fieldset.js";import{FALLBACK_VALUE as s}from"../constants.js";const a=({data:a,label:o})=>{const{street:l,houseNumberOrName:n,city:m,postalCode:i,stateOrProvince:c,country:d}=a;return e(r,{classNameModifiers:[o],label:o,readonly:!0},e(t,null,!!l&&l,n&&`, ${n},`,e("br",null),i&&`${i}`,m&&`, ${m}`,c&&c!==s&&`, ${c}`,d&&`, ${d} `))};export{a as default};
2
2
  //# sourceMappingURL=ReadOnlyAddress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReadOnlyAddress.js","sources":["../../../../../../src/components/internal/Address/components/ReadOnlyAddress.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport Fieldset from '../../FormFields/Fieldset';\nimport { ReadOnlyAddressProps } from '../types';\nimport { FALLBACK_VALUE } from '../constants';\n\nconst FullName = ({ firstName, lastName }) => {\n return (\n <Fragment>\n {firstName && `${firstName} `}\n {lastName && `${lastName}`}\n <br />\n </Fragment>\n );\n};\n\nconst ReadOnlyAddress = ({ data, label }: ReadOnlyAddressProps) => {\n const { street, houseNumberOrName, city, postalCode, stateOrProvince, country, firstName, lastName } = data;\n const hasName = firstName || lastName;\n\n return (\n <Fieldset classNameModifiers={[label]} label={label} readonly>\n <Fragment>\n {hasName && <FullName firstName={firstName} lastName={lastName}></FullName>}\n {!!street && street}\n {houseNumberOrName && `, ${houseNumberOrName},`}\n <br />\n {postalCode && `${postalCode}`}\n {city && `, ${city}`}\n {stateOrProvince && stateOrProvince !== FALLBACK_VALUE && `, ${stateOrProvince}`}\n {country && `, ${country} `}\n </Fragment>\n </Fieldset>\n );\n};\n\nexport default ReadOnlyAddress;\n"],"names":["FullName","firstName","lastName","h","Fragment","br","ReadOnlyAddress","data","label","street","houseNumberOrName","city","postalCode","stateOrProvince","country","Fieldset","classNameModifiers","readonly","FALLBACK_VALUE"],"mappings":"+LAKA,MAAMA,EAAW,EAAGC,YAAWC,cAEvBC,EAACC,EAAAA,KACIH,GAAa,GAAGA,KAChBC,GAAY,GAAGA,IAChBC,EAACE,KAAAA,OAKPC,EAAkB,EAAGC,OAAMC,YAC7B,MAAMC,OAAEA,EAAMC,kBAAEA,EAAiBC,KAAEA,EAAIC,WAAEA,EAAUC,gBAAEA,EAAeC,QAAEA,EAAOb,UAAEA,EAASC,SAAEA,GAAaK,EAGvG,OACIJ,EAACY,EAAAA,CAASC,mBAAoB,CAACR,GAAQA,MAAOA,EAAOS,UAAAA,GACjDd,EAACC,EAAAA,MAJOH,GAAaC,IAKLC,EAACH,EAAAA,CAASC,UAAWA,EAAWC,SAAUA,MACnDO,GAAUA,EACZC,GAAqB,KAAKA,KAC3BP,EAACE,KAAAA,MACAO,GAAc,GAAGA,IACjBD,GAAQ,KAAKA,IACbE,GAAmBA,IAAoBK,GAAkB,KAAKL,IAC9DC,GAAW,KAAKA,MAAU"}
1
+ {"version":3,"file":"ReadOnlyAddress.js","sources":["../../../../../../src/components/internal/Address/components/ReadOnlyAddress.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport Fieldset from '../../FormFields/Fieldset';\nimport { ReadOnlyAddressProps } from '../types';\nimport { FALLBACK_VALUE } from '../constants';\n\nconst ReadOnlyAddress = ({ data, label }: ReadOnlyAddressProps) => {\n const { street, houseNumberOrName, city, postalCode, stateOrProvince, country } = data;\n\n return (\n <Fieldset classNameModifiers={[label]} label={label} readonly>\n <Fragment>\n {!!street && street}\n {houseNumberOrName && `, ${houseNumberOrName},`}\n <br />\n {postalCode && `${postalCode}`}\n {city && `, ${city}`}\n {stateOrProvince && stateOrProvince !== FALLBACK_VALUE && `, ${stateOrProvince}`}\n {country && `, ${country} `}\n </Fragment>\n </Fieldset>\n );\n};\n\nexport default ReadOnlyAddress;\n"],"names":["ReadOnlyAddress","data","label","street","houseNumberOrName","city","postalCode","stateOrProvince","country","h","Fieldset","classNameModifiers","readonly","Fragment","br","FALLBACK_VALUE"],"mappings":"+LAKA,MAAMA,EAAkB,EAAGC,OAAMC,YAC7B,MAAMC,OAAEA,EAAMC,kBAAEA,EAAiBC,KAAEA,EAAIC,WAAEA,EAAUC,gBAAEA,EAAeC,QAAEA,GAAYP,EAElF,OACIQ,EAACC,EAAAA,CAASC,mBAAoB,CAACT,GAAQA,MAAOA,EAAOU,UAAAA,GACjDH,EAACI,SACMV,GAAUA,EACZC,GAAqB,KAAKA,KAC3BK,EAACK,KACAR,MAAAA,GAAc,GAAGA,IACjBD,GAAQ,KAAKA,IACbE,GAAmBA,IAAoBQ,GAAkB,KAAKR,IAC9DC,GAAW,KAAKA,MAAU"}
@@ -1,2 +1,2 @@
1
- const e="N/A",a=["street","houseNumberOrName","postalCode","city","stateOrProvince","country","firstName","lastName"],[t,s,l,r,o,c,i,d]=a,p={AU:{hasDataset:!0,labels:{[s]:"apartmentSuite",[o]:"state",[t]:"address"},optionalFields:[s],placeholders:{[o]:"select.state"},schema:[c,t,s,r,[[o,50],[l,50]]]},BR:{hasDataset:!0,labels:{[o]:"state"},placeholders:{[o]:"select.state"}},CA:{hasDataset:!0,labels:{[s]:"apartmentSuite",[o]:"provinceOrTerritory",[t]:"address"},optionalFields:[s],schema:[c,t,s,[[r,70],[l,30]],o]},GB:{labels:{[r]:"cityTown"},schema:[c,[[s,30],[t,70]],[[r,70],[l,30]],o]},US:{hasDataset:!0,labels:{[l]:"zipCode",[s]:"apartmentSuite",[o]:"state",[t]:"address"},optionalFields:[s],placeholders:{[o]:"select.state"},schema:[c,t,s,r,[[o,50],[l,50]]]},default:{optionalFields:[],placeholders:{[o]:"select.provinceOrTerritory"},schema:[c,[[t,70],[s,30]],[[l,30],[r,70]],o]}},h={default:{labels:{[l]:"zipCode"},schema:[l]}},m=Object.keys(p);export{a as ADDRESS_SCHEMA,p as ADDRESS_SPECIFICATIONS,r as CITY,m as COUNTRIES_WITH_CUSTOM_SPECIFICATION,c as COUNTRY,e as FALLBACK_VALUE,i as FIRST_NAME,s as HOUSE_NUMBER_OR_NAME,d as LAST_NAME,h as PARTIAL_ADDRESS_SCHEMA,l as POSTAL_CODE,o as STATE_OR_PROVINCE,t as STREET};
1
+ const e="N/A",a=["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],[t,s,l,r,o,c]=a,i={AU:{hasDataset:!0,labels:{[s]:"apartmentSuite",[o]:"state",[t]:"address"},optionalFields:[s],placeholders:{[o]:"select.state"},schema:[c,t,s,r,[[o,50],[l,50]]]},BR:{hasDataset:!0,labels:{[o]:"state"},placeholders:{[o]:"select.state"}},CA:{hasDataset:!0,labels:{[s]:"apartmentSuite",[o]:"provinceOrTerritory",[t]:"address"},optionalFields:[s],schema:[c,t,s,[[r,70],[l,30]],o]},GB:{labels:{[r]:"cityTown"},schema:[c,[[s,30],[t,70]],[[r,70],[l,30]],o]},US:{hasDataset:!0,labels:{[l]:"zipCode",[s]:"apartmentSuite",[o]:"state",[t]:"address"},optionalFields:[s],placeholders:{[o]:"select.state"},schema:[c,t,s,r,[[o,50],[l,50]]]},default:{optionalFields:[],placeholders:{[o]:"select.provinceOrTerritory"},schema:[c,[[t,70],[s,30]],[[l,30],[r,70]],o]}},d={default:{labels:{[l]:"zipCode"},schema:[l]}},p=Object.keys(i);export{a as ADDRESS_SCHEMA,i as ADDRESS_SPECIFICATIONS,r as CITY,p as COUNTRIES_WITH_CUSTOM_SPECIFICATION,c as COUNTRY,e as FALLBACK_VALUE,s as HOUSE_NUMBER_OR_NAME,d as PARTIAL_ADDRESS_SCHEMA,l as POSTAL_CODE,o as STATE_OR_PROVINCE,t as STREET};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/components/internal/Address/constants.ts"],"sourcesContent":["import { AddressSpecifications } from './types';\n\nexport const FALLBACK_VALUE = 'N/A';\nexport const ADDRESS_SCHEMA = ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country', 'firstName', 'lastName'] as const;\nexport const [STREET, HOUSE_NUMBER_OR_NAME, POSTAL_CODE, CITY, STATE_OR_PROVINCE, COUNTRY, FIRST_NAME, LAST_NAME] = ADDRESS_SCHEMA;\n// prettier-ignore\nexport const ADDRESS_SPECIFICATIONS: AddressSpecifications = {\n AU: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n BR: {\n hasDataset: true,\n labels: {\n [STATE_OR_PROVINCE]: 'state'\n },\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n },\n CA: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'provinceOrTerritory',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n GB: {\n labels: {\n [CITY]: 'cityTown'\n },\n schema: [COUNTRY, [[HOUSE_NUMBER_OR_NAME, 30], [STREET, 70]], [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n US: {\n hasDataset: true,\n labels: {\n [POSTAL_CODE]: 'zipCode',\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n default: {\n optionalFields: [],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.provinceOrTerritory'\n },\n schema: [COUNTRY, [[STREET, 70], [HOUSE_NUMBER_OR_NAME, 30]], [[POSTAL_CODE, 30], [CITY, 70]], STATE_OR_PROVINCE],\n }\n};\n\nexport const PARTIAL_ADDRESS_SCHEMA: AddressSpecifications = {\n default: {\n labels: {\n [POSTAL_CODE]: 'zipCode'\n },\n schema: [POSTAL_CODE]\n }\n};\n\nexport const COUNTRIES_WITH_CUSTOM_SPECIFICATION = Object.keys(ADDRESS_SPECIFICATIONS);\n"],"names":["FALLBACK_VALUE","ADDRESS_SCHEMA","STREET","HOUSE_NUMBER_OR_NAME","POSTAL_CODE","CITY","STATE_OR_PROVINCE","COUNTRY","FIRST_NAME","LAST_NAME","ADDRESS_SPECIFICATIONS","AU","hasDataset","labels","optionalFields","placeholders","schema","BR","CA","GB","US","default","PARTIAL_ADDRESS_SCHEMA","COUNTRIES_WITH_CUSTOM_SPECIFICATION","Object","keys"],"mappings":"AAEO,MAAMA,EAAiB,MACjBC,EAAiB,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,UAAW,YAAa,aACjHC,EAAQC,EAAsBC,EAAaC,EAAMC,EAAmBC,EAASC,EAAYC,GAAaR,EAEvGS,EAAgD,CACzDC,GAAI,CACAC,YAAY,EACZC,OAAQ,CACJV,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,QACrBJ,CAACA,GAAS,WAEdY,eAAgB,CAACX,GACjBY,aAAc,CACVT,CAACA,GAAoB,gBAEzBU,OAAQ,CAACT,EAASL,EAAQC,EAAsBE,EAAM,CAAC,CAACC,EAAmB,IAAK,CAACF,EAAa,OAElGa,GAAI,CACAL,YAAY,EACZC,OAAQ,CACJP,CAACA,GAAoB,SAEzBS,aAAc,CACVT,CAACA,GAAoB,iBAG7BY,GAAI,CACAN,YAAY,EACZC,OAAQ,CACJV,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,sBACrBJ,CAACA,GAAS,WAEdY,eAAgB,CAACX,GACjBa,OAAQ,CAACT,EAASL,EAAQC,EAAsB,CAAC,CAACE,EAAM,IAAK,CAACD,EAAa,KAAME,IAErFa,GAAI,CACAN,OAAQ,CACJR,CAACA,GAAO,YAEZW,OAAQ,CAACT,EAAS,CAAC,CAACJ,EAAsB,IAAK,CAACD,EAAQ,KAAM,CAAC,CAACG,EAAM,IAAK,CAACD,EAAa,KAAME,IAEnGc,GAAI,CACAR,YAAY,EACZC,OAAQ,CACJT,CAACA,GAAc,UACfD,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,QACrBJ,CAACA,GAAS,WAEdY,eAAgB,CAACX,GACjBY,aAAc,CACVT,CAACA,GAAoB,gBAEzBU,OAAQ,CAACT,EAASL,EAAQC,EAAsBE,EAAM,CAAC,CAACC,EAAmB,IAAK,CAACF,EAAa,OAElGiB,QAAS,CACLP,eAAgB,GAChBC,aAAc,CACVT,CAACA,GAAoB,8BAEzBU,OAAQ,CAACT,EAAS,CAAC,CAACL,EAAQ,IAAK,CAACC,EAAsB,KAAM,CAAC,CAACC,EAAa,IAAK,CAACC,EAAM,KAAMC,KAI1FgB,EAAgD,CACzDD,QAAS,CACLR,OAAQ,CACJT,CAACA,GAAc,WAEnBY,OAAQ,CAACZ,KAIJmB,EAAsCC,OAAOC,KAAKf"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/components/internal/Address/constants.ts"],"sourcesContent":["import { AddressSpecifications } from './types';\n\nexport const FALLBACK_VALUE = 'N/A';\nexport const ADDRESS_SCHEMA = ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'] as const;\nexport const [STREET, HOUSE_NUMBER_OR_NAME, POSTAL_CODE, CITY, STATE_OR_PROVINCE, COUNTRY] = ADDRESS_SCHEMA;\n// prettier-ignore\nexport const ADDRESS_SPECIFICATIONS: AddressSpecifications = {\n AU: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n BR: {\n hasDataset: true,\n labels: {\n [STATE_OR_PROVINCE]: 'state'\n },\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n },\n CA: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'provinceOrTerritory',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n GB: {\n labels: {\n [CITY]: 'cityTown'\n },\n schema: [COUNTRY, [[HOUSE_NUMBER_OR_NAME, 30], [STREET, 70]], [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n US: {\n hasDataset: true,\n labels: {\n [POSTAL_CODE]: 'zipCode',\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n default: {\n optionalFields: [],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.provinceOrTerritory'\n },\n schema: [COUNTRY, [[STREET, 70], [HOUSE_NUMBER_OR_NAME, 30]], [[POSTAL_CODE, 30], [CITY, 70]], STATE_OR_PROVINCE],\n }\n};\n\nexport const PARTIAL_ADDRESS_SCHEMA: AddressSpecifications = {\n default: {\n labels: {\n [POSTAL_CODE]: 'zipCode'\n },\n schema: [POSTAL_CODE]\n }\n};\n\nexport const COUNTRIES_WITH_CUSTOM_SPECIFICATION = Object.keys(ADDRESS_SPECIFICATIONS);\n"],"names":["FALLBACK_VALUE","ADDRESS_SCHEMA","STREET","HOUSE_NUMBER_OR_NAME","POSTAL_CODE","CITY","STATE_OR_PROVINCE","COUNTRY","ADDRESS_SPECIFICATIONS","AU","hasDataset","labels","optionalFields","placeholders","schema","BR","CA","GB","US","default","PARTIAL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8BAEzBQ,OAAQ,CAACP,EAAS,CAAC,CAACL,EAAQ,IAAK,CAACC,EAAsB,KAAM,CAAC,CAACC,EAAa,IAAK,CAACC,EAAM,KAAMC,KAI1Fc,EAAgD,CACzDD,QAAS,CACLR,OAAQ,CACJP,CAACA,GAAc,WAEnBU,OAAQ,CAACV,KAIJiB,EAAsCC,OAAOC,KAAKf"}
@@ -1,2 +1,2 @@
1
- import{render as t}from"../../../external/preact/dist/preact.js";import e from"../../../utils/getProp.js";import s from"../../../utils/uuid.js";import r from"../../../core/Errors/AdyenCheckoutError.js";import{NO_CHECKOUT_ATTEMPT_ID as o,ANALYTICS_RENDERED_STR as i}from"../../../core/Analytics/constants.js";import{on as n,off as a}from"../../../utils/listenerUtils.js";function h(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class p{buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}setUpAnalytics(t){return null}submitAnalytics(t){return null}handleKeyPress(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=e(this.props,"modules.risk.data"),s=e(this.props,"modules.analytics.getCheckoutAttemptId")?.()??o,r=this.state.order||this.props.order,i=this.formatData();if(i.paymentMethod&&s&&(i.paymentMethod.checkoutAttemptId=s),"riverty"!==this.props.type&&i.billingAddress){const{firstName:t,lastName:e,...s}=i.billingAddress;i.billingAddress={...s}}return{...t&&{riskData:{clientData:t}},...r&&{order:{orderData:r.orderData,pspReference:r.pspReference}},...i,clientStateDataIndicator:!0}}activate(){}render(){throw new Error("Payment method cannot be rendered.")}mount(e){const s="string"==typeof e?document.querySelector(e):e;if(!s)throw new Error("Component could not mount. Root node was not found.");const r=!this._node;return this._node&&this.unmount(),this._node=s,n(this._node,"keypress",this.handleKeyPress,!1),this._component=this.render(),t(this._component,s),r&&this.props.modules&&this.props.modules.analytics&&this.setUpAnalytics({containerWidth:s&&s.offsetWidth,component:this.props.isDropin?"dropin":this.constructor.analyticsType??this.constructor.type,flavor:this.props.isDropin?"dropin":"components"}).then((()=>{this.props.isDropin||this.submitAnalytics({type:i})})),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return a(this._node,"keypress",this.handleKeyPress),this._node&&t(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}constructor(t,e){h(this,"_id",`${this.constructor.type}-${s()}`),h(this,"core",void 0),h(this,"props",void 0),h(this,"state",{}),h(this,"_component",void 0),h(this,"_node",null);const o=function(t){return!!t&&("function"==typeof t.initialize&&"function"==typeof t.createFromAction)}(t);if(!o)throw new r("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(e),this.handleKeyPress=this.handleKeyPress.bind(this)}}h(p,"defaultProps",{});export{p as default};
1
+ import{render as t}from"../../../external/preact/dist/preact.js";import e from"../../../utils/getProp.js";import s from"../../../utils/uuid.js";import o from"../../../core/Errors/AdyenCheckoutError.js";import{NO_CHECKOUT_ATTEMPT_ID as r,ANALYTICS_RENDERED_STR as n}from"../../../core/Analytics/constants.js";import{on as i,off as a}from"../../../utils/listenerUtils.js";function h(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class p{buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}setUpAnalytics(t){return null}submitAnalytics(t){return null}handleKeyPress(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=e(this.props,"modules.risk.data"),s=e(this.props,"modules.analytics.getCheckoutAttemptId")?.()??r,o=this.state.order||this.props.order,n=this.formatData();return n.paymentMethod&&s&&(n.paymentMethod.checkoutAttemptId=s),{...t&&{riskData:{clientData:t}},...o&&{order:{orderData:o.orderData,pspReference:o.pspReference}},...n,clientStateDataIndicator:!0}}activate(){}render(){throw new Error("Payment method cannot be rendered.")}mount(e){const s="string"==typeof e?document.querySelector(e):e;if(!s)throw new Error("Component could not mount. Root node was not found.");const o=!this._node;return this._node&&this.unmount(),this._node=s,i(this._node,"keypress",this.handleKeyPress,!1),this._component=this.render(),t(this._component,s),o&&this.props.modules&&this.props.modules.analytics&&this.setUpAnalytics({containerWidth:s&&s.offsetWidth,component:this.props.isDropin?"dropin":this.constructor.analyticsType??this.constructor.type,flavor:this.props.isDropin?"dropin":"components"}).then((()=>{this.props.isDropin||this.submitAnalytics({type:n})})),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return a(this._node,"keypress",this.handleKeyPress),this._node&&t(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}constructor(t,e){h(this,"_id",`${this.constructor.type}-${s()}`),h(this,"core",void 0),h(this,"props",void 0),h(this,"state",{}),h(this,"_component",void 0),h(this,"_node",null);const r=function(t){return!!t&&("function"==typeof t.initialize&&"function"==typeof t.createFromAction)}(t);if(!r)throw new o("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(e),this.handleKeyPress=this.handleKeyPress.bind(this)}}h(p,"defaultProps",{});export{p as default};
2
2
  //# sourceMappingURL=BaseElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseElement.js","sources":["../../../../../src/components/internal/BaseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, h, render } from 'preact';\nimport getProp from '../../../utils/getProp';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { ANALYTICS_RENDERED_STR, NO_CHECKOUT_ATTEMPT_ID } from '../../../core/Analytics/constants';\n\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport type { AnalyticsInitialEvent, SendAnalyticsObject } from '../../../core/Analytics/types';\nimport { off, on } from '../../../utils/listenerUtils';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nabstract class BaseElement<P extends BaseElementProps> implements IBaseElement {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public readonly core: ICore;\n\n public props: P;\n public state: any = {};\n public _component;\n\n protected _node: HTMLElement = null;\n\n protected static defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n\n this.handleKeyPress = this.handleKeyPress.bind(this);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n */\n protected formatData(): any {\n return {};\n }\n\n /* eslint-disable-next-line */\n protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj?: SendAnalyticsObject) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) {\n return null;\n }\n\n protected setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n const clientData = getProp(this.props, 'modules.risk.data');\n const checkoutAttemptId = getProp(this.props, 'modules.analytics.getCheckoutAttemptId')?.() ?? NO_CHECKOUT_ATTEMPT_ID; // NOTE: we never expect to see this \"failed\" value, but, just in case...\n const order = this.state.order || this.props.order;\n const componentData = this.formatData();\n\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n // Workaround, to be fixed properly\n // Remove the firstName & lastName in the billingAddress for non Riverty components\n // @ts-ignore type exists\n if (this.props.type !== 'riverty' && componentData.billingAddress) {\n const { firstName, lastName, ...rest } = componentData.billingAddress;\n componentData.billingAddress = { ...rest };\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n /**\n * Method used to make the payment method active\n * (Useful when there are different payment methods available and activating one PM must trigger a specific task)\n */\n public activate(): void {\n return;\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n const setupAnalytics = !this._node;\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n // Add listener for key press events, notably 'Enter' key presses\n on(this._node, 'keypress', this.handleKeyPress, false);\n\n this._component = this.render();\n\n render(this._component, node);\n\n // Set up analytics (once, since this._node is currently undefined) now that we have mounted and rendered\n if (setupAnalytics) {\n if (this.props.modules && this.props.modules.analytics) {\n this.setUpAnalytics({\n containerWidth: node && node.offsetWidth,\n component: !this.props.isDropin ? (this.constructor['analyticsType'] ?? this.constructor['type']) : 'dropin',\n flavor: !this.props.isDropin ? 'components' : 'dropin'\n }).then(() => {\n // Once the initial analytics set up call has been made...\n // ...create an analytics event declaring that the component has been rendered\n // (The dropin will do this itself from DropinComponent once the PM list has rendered)\n if (!this.props.isDropin) {\n this.submitAnalytics({ type: ANALYTICS_RENDERED_STR });\n }\n });\n }\n }\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {};\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n // Remove listener\n off(this._node, 'keypress', this.handleKeyPress);\n\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["BaseElement","buildElementProps","componentProps","this","props","formatProps","constructor","formatData","setUpAnalytics","setUpAnalyticsObj","submitAnalytics","analyticsObj","handleKeyPress","e","setState","newState","state","data","clientData","getProp","checkoutAttemptId","NO_CHECKOUT_ATTEMPT_ID","order","componentData","paymentMethod","type","billingAddress","firstName","lastName","rest","riskData","orderData","pspReference","clientStateDataIndicator","activate","render","Error","mount","domNode","node","document","querySelector","setupAnalytics","_node","unmount","on","_component","modules","analytics","containerWidth","offsetWidth","component","isDropin","flavor","then","ANALYTICS_RENDERED_STR","update","off","remove","core","checkout","_define_property","_id","uuid","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","bind","defaultProps"],"mappings":"0eAuBA,MAAeA,EA4BDC,iBAAAA,CAAkBC,GACxBC,KAAKC,MAAQD,KAAKE,YAAY,IAAKF,KAAKG,YAA2B,gBAAKJ,GAC5E,CAMUG,WAAAA,CAAYD,GAClB,OAAOA,CACX,CAMA,UAAAG,GACI,MAAO,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aseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, h, render } from 'preact';\nimport getProp from '../../../utils/getProp';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { ANALYTICS_RENDERED_STR, NO_CHECKOUT_ATTEMPT_ID } from '../../../core/Analytics/constants';\n\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport type { AnalyticsInitialEvent, SendAnalyticsObject } from '../../../core/Analytics/types';\nimport { off, on } from '../../../utils/listenerUtils';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nabstract class BaseElement<P extends BaseElementProps> implements IBaseElement {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public readonly core: ICore;\n\n public props: P;\n public state: any = {};\n public _component;\n\n protected _node: HTMLElement = null;\n\n protected static defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n\n this.handleKeyPress = this.handleKeyPress.bind(this);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n */\n protected formatData(): any {\n return {};\n }\n\n /* eslint-disable-next-line */\n protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj?: SendAnalyticsObject) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) {\n return null;\n }\n\n protected setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n const clientData = getProp(this.props, 'modules.risk.data');\n const checkoutAttemptId = getProp(this.props, 'modules.analytics.getCheckoutAttemptId')?.() ?? NO_CHECKOUT_ATTEMPT_ID; // NOTE: we never expect to see this \"failed\" value, but, just in case...\n const order = this.state.order || this.props.order;\n const componentData = this.formatData();\n\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n /**\n * Method used to make the payment method active\n * (Useful when there are different payment methods available and activating one PM must trigger a specific task)\n */\n public activate(): void {\n return;\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n const setupAnalytics = !this._node;\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n // Add listener for key press events, notably 'Enter' key presses\n on(this._node, 'keypress', this.handleKeyPress, false);\n\n this._component = this.render();\n\n render(this._component, node);\n\n // Set up analytics (once, since this._node is currently undefined) now that we have mounted and rendered\n if (setupAnalytics) {\n if (this.props.modules && this.props.modules.analytics) {\n this.setUpAnalytics({\n containerWidth: node && node.offsetWidth,\n component: !this.props.isDropin ? (this.constructor['analyticsType'] ?? this.constructor['type']) : 'dropin',\n flavor: !this.props.isDropin ? 'components' : 'dropin'\n }).then(() => {\n // Once the initial analytics set up call has been made...\n // ...create an analytics event declaring that the component has been rendered\n // (The dropin will do this itself from DropinComponent once the PM list has rendered)\n if (!this.props.isDropin) {\n this.submitAnalytics({ type: ANALYTICS_RENDERED_STR });\n }\n });\n }\n }\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {};\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n // Remove listener\n off(this._node, 'keypress', this.handleKeyPress);\n\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["BaseElement","buildElementProps","componentProps","this","props","formatProps","constructor","formatData","setUpAnalytics","setUpAnalyticsObj","submitAnalytics","analyticsObj","handleKeyPress","e","setState","newState","state","data","clientData","getProp","checkoutAttemptId","NO_CHECKOUT_ATTEMPT_ID","order","componentData","paymentMethod","riskData","orderData","pspReference","clientStateDataIndicator","activate","render","Error","mount","domNode","node","document","querySelector","setupAnalytics","_node","unmount","on","_component","modules","analytics","containerWidth","offsetWidth","component","isDropin","flavor","then","type","ANALYTICS_RENDERED_STR","update","off","remove","core","checkout","_define_property","_id","uuid","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","bind","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"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../src/components/internal/OpenInvoice/utils.ts"],"sourcesContent":["import { OpenInvoiceActiveFieldsets, OpenInvoiceStateData, OpenInvoiceVisibility } from './types';\nimport Language from '../../../language';\nimport { mapFieldKey as mapFieldKeyAddress } from '../Address/utils';\nimport { StringObject } from '../Address/types';\n\nexport const fieldsetsSchema: Array<keyof OpenInvoiceStateData> = [\n 'companyDetails',\n 'personalDetails',\n 'billingAddress',\n 'deliveryAddress',\n 'bankAccount'\n];\n\nconst isPrefilled = (fieldsetData: object = {}): boolean => Object.keys(fieldsetData).length > 1;\n\nexport const getActiveFieldsData = (activeFieldsets: OpenInvoiceActiveFieldsets, data: OpenInvoiceStateData): OpenInvoiceStateData =>\n Object.keys(data)\n .filter(fieldset => activeFieldsets[fieldset])\n .reduce((acc, cur) => {\n acc[cur] = data[cur];\n return acc;\n }, {});\n\nexport const getInitialActiveFieldsets = (visibility: OpenInvoiceVisibility, data: OpenInvoiceStateData = {}): OpenInvoiceActiveFieldsets =>\n fieldsetsSchema.reduce((acc, fieldset) => {\n const isVisible = visibility[fieldset] !== 'hidden';\n const isDeliveryAddress = fieldset === 'deliveryAddress';\n const billingAddressIsHidden = visibility?.billingAddress === 'hidden';\n\n // The delivery address will be active not only when set as visible\n // but also when the billing address is hidden or when it has prefilled data\n acc[fieldset] = isVisible && (!isDeliveryAddress || billingAddressIsHidden || isPrefilled(data[fieldset]));\n return acc;\n }, {} as OpenInvoiceActiveFieldsets);\n\n/**\n * Used by the SRPanel sorting function to tell it whether we need to add the field type to the SR panel message, and, if so, we retrieve the correct translation for the field type.\n * (Whether we need to add the field type depends on whether we know that the error message correctly reflects the label of the field. Ultimately all error messages should do this\n * and this mapping fn will become redundant)\n */\nexport const mapFieldKey = (key: string, i18n: Language, countrySpecificLabels: StringObject): string => {\n let refKey = key;\n let label;\n\n // Differentiate between address types (billing and delivery)\n const splitKey = refKey.split(':');\n const hasSplitKey = splitKey.length > 1;\n if (hasSplitKey) {\n label = splitKey[0];\n refKey = splitKey[1];\n }\n\n const addressKey = mapFieldKeyAddress(refKey, i18n, countrySpecificLabels);\n // Also use the presence of a label to know that we are dealing with address related fields. (This matters now that addresses can contain first & last name fields.)\n if (addressKey && label) return hasSplitKey ? `${i18n.get(label)} ${addressKey}` : addressKey;\n\n switch (refKey) {\n case 'dateOfBirth':\n case 'shopperEmail':\n case 'telephoneNumber':\n return i18n.get(refKey);\n default:\n break;\n }\n\n // We know that the translated error messages do contain a reference to the field they refer to, so we won't need to map them\n return null;\n};\n"],"names":["fieldsetsSchema","getActiveFieldsData","activeFieldsets","data","Object","keys","filter","fieldset","reduce","acc","cur","getInitialActiveFieldsets","visibility","isVisible","isDeliveryAddress","billingAddressIsHidden","billingAddress","fieldsetData","length","isPrefilled","mapFieldKey","key","i18n","countrySpecificLabels","label","refKey","splitKey","split","hasSplitKey","addressKey","mapFieldKeyAddress","get"],"mappings":"wDAKaA,EAAqD,CAC9D,iBACA,kBACA,iBACA,kBACA,eAKSC,EAAsB,CAACC,EAA6CC,IAC7EC,OAAOC,KAAKF,GACPG,QAAOC,GAAYL,EAAgBK,KACnCC,QAAO,CAACC,EAAKC,KACVD,EAAIC,GAAOP,EAAKO,GACTD,IACR,CAAI,GAEFE,EAA4B,CAACC,EAAmCT,EAA6B,CAAA,IACtGH,EAAgBQ,QAAO,CAACC,EAAKF,KACzB,MAAMM,EAAqC,WAAzBD,EAAWL,GACvBO,EAAiC,oBAAbP,EACpBQ,EAAwD,WAA/BH,GAAYI,eAK3C,OADAP,EAAIF,GAAYM,KAAeC,GAAqBC,GAlBxC,EAACE,EAAuB,KAAgBb,OAAOC,KAAKY,GAAcC,OAAS,EAkBTC,CAAYhB,EAAKI,KACxFE,CAAAA,GACR,CAAkC,GAO5BW,EAAc,CAACC,EAAaC,EAAgBC,KACrD,IACIC,EADAC,EAASJ,EAIb,MAAMK,EAAWD,EAAOE,MAAM,KACxBC,EAAcF,EAASR,OAAS,EAClCU,IACAJ,EAAQE,EAAS,GACjBD,EAASC,EAAS,IAGtB,MAAMG,EAAaC,EAAmBL,EAAQH,EAAMC,GAEpD,GAAIM,GAAcL,EAAO,OAAOI,EAAc,GAAGN,EAAKS,IAAIP,MAAUK,IAAeA,EAEnF,OAAQJ,GACJ,IAAK,cACL,IAAK,eACL,IAAK,kBACD,OAAOH,EAAKS,IAAIN,GAMxB,OAAO,IAAA"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../src/components/internal/OpenInvoice/utils.ts"],"sourcesContent":["import { OpenInvoiceActiveFieldsets, OpenInvoiceStateData, OpenInvoiceVisibility } from './types';\nimport Language from '../../../language';\nimport { mapFieldKey as mapFieldKeyAddress } from '../Address/utils';\nimport { StringObject } from '../Address/types';\n\nexport const fieldsetsSchema: Array<keyof OpenInvoiceStateData> = [\n 'companyDetails',\n 'personalDetails',\n 'billingAddress',\n 'deliveryAddress',\n 'bankAccount'\n];\n\nconst isPrefilled = (fieldsetData: object = {}): boolean => Object.keys(fieldsetData).length > 1;\n\nexport const getActiveFieldsData = (activeFieldsets: OpenInvoiceActiveFieldsets, data: OpenInvoiceStateData): OpenInvoiceStateData =>\n Object.keys(data)\n .filter(fieldset => activeFieldsets[fieldset])\n .reduce((acc, cur) => {\n acc[cur] = data[cur];\n return acc;\n }, {});\n\nexport const getInitialActiveFieldsets = (visibility: OpenInvoiceVisibility, data: OpenInvoiceStateData = {}): OpenInvoiceActiveFieldsets =>\n fieldsetsSchema.reduce((acc, fieldset) => {\n const isVisible = visibility[fieldset] !== 'hidden';\n const isDeliveryAddress = fieldset === 'deliveryAddress';\n const billingAddressIsHidden = visibility?.billingAddress === 'hidden';\n\n // The delivery address will be active not only when set as visible\n // but also when the billing address is hidden or when it has prefilled data\n acc[fieldset] = isVisible && (!isDeliveryAddress || billingAddressIsHidden || isPrefilled(data[fieldset]));\n return acc;\n }, {} as OpenInvoiceActiveFieldsets);\n\n/**\n * Used by the SRPanel sorting function to tell it whether we need to add the field type to the SR panel message, and, if so, we retrieve the correct translation for the field type.\n * (Whether we need to add the field type depends on whether we know that the error message correctly reflects the label of the field. Ultimately all error messages should do this\n * and this mapping fn will become redundant)\n */\nexport const mapFieldKey = (key: string, i18n: Language, countrySpecificLabels: StringObject): string => {\n let refKey = key;\n let label;\n\n // Differentiate between address types (billing and delivery)\n const splitKey = refKey.split(':');\n const hasSplitKey = splitKey.length > 1;\n\n if (hasSplitKey) {\n label = splitKey[0];\n refKey = splitKey[1];\n }\n\n const addressKey = mapFieldKeyAddress(refKey, i18n, countrySpecificLabels);\n // Also use the presence of a label to know that we are dealing with address related fields. (This matters now that addresses can contain first & last name fields.)\n if (addressKey && label) return hasSplitKey ? `${i18n.get(label)} ${addressKey}` : addressKey;\n\n switch (refKey) {\n case 'dateOfBirth':\n case 'shopperEmail':\n case 'telephoneNumber':\n return i18n.get(refKey);\n default:\n break;\n }\n\n // We know that the translated error messages do contain a reference to the field they refer to, so we won't need to map them\n return null;\n};\n"],"names":["fieldsetsSchema","getActiveFieldsData","activeFieldsets","data","Object","keys","filter","fieldset","reduce","acc","cur","getInitialActiveFieldsets","visibility","isVisible","isDeliveryAddress","billingAddressIsHidden","billingAddress","fieldsetData","length","isPrefilled","mapFieldKey","key","i18n","countrySpecificLabels","label","refKey","splitKey","split","hasSplitKey","addressKey","mapFieldKeyAddress","get"],"mappings":"wDAKaA,EAAqD,CAC9D,iBACA,kBACA,iBACA,kBACA,eAKSC,EAAsB,CAACC,EAA6CC,IAC7EC,OAAOC,KAAKF,GACPG,QAAOC,GAAYL,EAAgBK,KACnCC,QAAO,CAACC,EAAKC,KACVD,EAAIC,GAAOP,EAAKO,GACTD,IACR,CAAI,GAEFE,EAA4B,CAACC,EAAmCT,EAA6B,CAAA,IACtGH,EAAgBQ,QAAO,CAACC,EAAKF,KACzB,MAAMM,EAAqC,WAAzBD,EAAWL,GACvBO,EAAiC,oBAAbP,EACpBQ,EAAwD,WAA/BH,GAAYI,eAK3C,OADAP,EAAIF,GAAYM,KAAeC,GAAqBC,GAlBxC,EAACE,EAAuB,KAAgBb,OAAOC,KAAKY,GAAcC,OAAS,EAkBTC,CAAYhB,EAAKI,KACxFE,CAAAA,GACR,CAAkC,GAO5BW,EAAc,CAACC,EAAaC,EAAgBC,KACrD,IACIC,EADAC,EAASJ,EAIb,MAAMK,EAAWD,EAAOE,MAAM,KACxBC,EAAcF,EAASR,OAAS,EAElCU,IACAJ,EAAQE,EAAS,GACjBD,EAASC,EAAS,IAGtB,MAAMG,EAAaC,EAAmBL,EAAQH,EAAMC,GAEpD,GAAIM,GAAcL,EAAO,OAAOI,EAAc,GAAGN,EAAKS,IAAIP,MAAUK,IAAeA,EAEnF,OAAQJ,GACJ,IAAK,cACL,IAAK,eACL,IAAK,kBACD,OAAOH,EAAKS,IAAIN,GAMxB,OAAO,IAAA"}
@@ -1,2 +1,2 @@
1
- var a=function(a){return a.address="address",a.bankTransfer_IBAN="bankTransfer_IBAN",a.donation="donation",a.personal_details="personal_details",a.dropin="dropin",a.bcmc="bcmc",a.card="card",a.scheme="scheme",a.storedCard="storedCard",a.customCard="customcard",a.threeDS2Challenge="threeDS2Challenge",a.threeDS2Fingerprint="threeDS2Fingerprint",a.threeDS2DeviceFingerprint="threeDS2DeviceFingerprint",a.ach="ach",a.directdebit_GB="directdebit_GB",a.sepadirectdebit="sepadirectdebit",a.affirm="affirm",a.afterpay="afterpay",a.afterpay_default="afterpay_default",a.afterpay_b2b="afterpay_b2b",a.atome="atome",a.facilypay_3x="facilypay_3x",a.facilypay_4x="facilypay_4x",a.facilypay_6x="facilypay_6x",a.facilypay_10x="facilypay_10x",a.facilypay_12x="facilypay_12x",a.ratepay="ratepay",a.ratepay_directdebit="ratepay_directdebit",a.riverty="riverty",a.amazonpay="amazonpay",a.applepay="applepay",a.cashapp="cashapp",a.clicktopay="clicktopay",a.googlepay="googlepay",a.paypal="paypal",a.fastlane="fastlane",a.paywithgoogle="paywithgoogle",a.boletobancario="boletobancario",a.boletobancario_itau="boletobancario_itau",a.boletobancario_santander="boletobancario_santander",a.primeiropay_boleto="primeiropay_boleto",a.doku="doku",a.doku_alfamart="doku_alfamart",a.doku_permata_lite_atm="doku_permata_lite_atm",a.doku_indomaret="doku_indomaret",a.doku_atm_mandiri_va="doku_atm_mandiri_va",a.doku_sinarmas_va="doku_sinarmas_va",a.doku_mandiri_va="doku_mandiri_va",a.doku_cimb_va="doku_cimb_va",a.doku_danamon_va="doku_danamon_va",a.doku_bri_va="doku_bri_va",a.doku_bni_va="doku_bni_va",a.doku_bca_va="doku_bca_va",a.doku_wallet="doku_wallet",a.oxxo="oxxo",a.billdesk_online="billdesk_online",a.billdesk_wallet="billdesk_wallet",a.dotpay="dotpay",a.eps="eps",a.molpay_ebanking_fpx_MY="molpay_ebanking_fpx_MY",a.molpay_ebanking_TH="molpay_ebanking_TH",a.molpay_ebanking_VN="molpay_ebanking_VN",a.onlineBanking_CZ="onlineBanking_CZ",a.onlinebanking_IN="onlinebanking_IN",a.onlineBanking_PL="onlineBanking_PL",a.onlineBanking_SK="onlineBanking_SK",a.paybybank="paybybank",a.payu_IN_cashcard="payu_IN_cashcard",a.payu_IN_nb="payu_IN_nb",a.wallet_IN="wallet_IN",a.dragonpay="dragonpay",a.dragonpay_ebanking="dragonpay_ebanking",a.dragonpay_otc_banking="dragonpay_otc_banking",a.dragonpay_otc_non_banking="dragonpay_otc_non_banking",a.dragonpay_otc_philippines="dragonpay_otc_philippines",a.econtext="econtext",a.econtext_atm="econtext_atm",a.econtext_online="econtext_online",a.econtext_seven_eleven="econtext_seven_eleven",a.econtext_stores="econtext_stores",a.giropay="giropay",a.multibanco="multibanco",a.redirect="redirect",a.twint="twint",a.vipps="vipps",a.trustly="trustly",a.paybybank_AIS_DD="paybybank_AIS_DD",a.klarna="klarna",a.klarna_account="klarna_account",a.klarna_paynow="klarna_paynow",a.klarna_b2b="klarna_b2b",a.bcmc_mobile="bcmc_mobile",a.bcmc_mobile_QR="bcmc_mobile_QR",a.pix="pix",a.swish="swish",a.wechatpay="wechatpay",a.wechatpayQR="wechatpayQR",a.promptpay="promptpay",a.paynow="paynow",a.duitnow="duitnow",a.blik="blik",a.mbway="mbway",a.ancv="ancv",a.payto="payto",a.upi="upi",a.upi_qr="upi_qr",a.upi_collect="upi_collect",a.upi_intent="upi_intent",a.giftcard="giftcard",a.mealVoucher_FR="mealVoucher_FR",a.mealVoucher_FR_natixis="mealVoucher_FR_natixis",a.mealVoucher_FR_sodexo="mealVoucher_FR_sodexo",a.mealVoucher_FR_groupeup="mealVoucher_FR_groupeup",a}({});export{a as TxVariants};
1
+ var a=function(a){return a.address="address",a.bankTransfer_IBAN="bankTransfer_IBAN",a.donation="donation",a.personal_details="personal_details",a.dropin="dropin",a.bcmc="bcmc",a.card="card",a.scheme="scheme",a.storedCard="storedCard",a.customCard="customcard",a.threeDS2Challenge="threeDS2Challenge",a.threeDS2Fingerprint="threeDS2Fingerprint",a.threeDS2DeviceFingerprint="threeDS2DeviceFingerprint",a.ach="ach",a.directdebit_GB="directdebit_GB",a.sepadirectdebit="sepadirectdebit",a.affirm="affirm",a.afterpay="afterpay",a.afterpay_default="afterpay_default",a.afterpay_b2b="afterpay_b2b",a.atome="atome",a.facilypay_3x="facilypay_3x",a.facilypay_4x="facilypay_4x",a.facilypay_6x="facilypay_6x",a.facilypay_10x="facilypay_10x",a.facilypay_12x="facilypay_12x",a.ratepay="ratepay",a.ratepay_directdebit="ratepay_directdebit",a.amazonpay="amazonpay",a.applepay="applepay",a.cashapp="cashapp",a.clicktopay="clicktopay",a.googlepay="googlepay",a.paypal="paypal",a.fastlane="fastlane",a.paywithgoogle="paywithgoogle",a.boletobancario="boletobancario",a.boletobancario_itau="boletobancario_itau",a.boletobancario_santander="boletobancario_santander",a.primeiropay_boleto="primeiropay_boleto",a.doku="doku",a.doku_alfamart="doku_alfamart",a.doku_permata_lite_atm="doku_permata_lite_atm",a.doku_indomaret="doku_indomaret",a.doku_atm_mandiri_va="doku_atm_mandiri_va",a.doku_sinarmas_va="doku_sinarmas_va",a.doku_mandiri_va="doku_mandiri_va",a.doku_cimb_va="doku_cimb_va",a.doku_danamon_va="doku_danamon_va",a.doku_bri_va="doku_bri_va",a.doku_bni_va="doku_bni_va",a.doku_bca_va="doku_bca_va",a.doku_wallet="doku_wallet",a.oxxo="oxxo",a.billdesk_online="billdesk_online",a.billdesk_wallet="billdesk_wallet",a.dotpay="dotpay",a.eps="eps",a.molpay_ebanking_fpx_MY="molpay_ebanking_fpx_MY",a.molpay_ebanking_TH="molpay_ebanking_TH",a.molpay_ebanking_VN="molpay_ebanking_VN",a.onlineBanking_CZ="onlineBanking_CZ",a.onlinebanking_IN="onlinebanking_IN",a.onlineBanking_PL="onlineBanking_PL",a.onlineBanking_SK="onlineBanking_SK",a.paybybank="paybybank",a.payu_IN_cashcard="payu_IN_cashcard",a.payu_IN_nb="payu_IN_nb",a.wallet_IN="wallet_IN",a.dragonpay="dragonpay",a.dragonpay_ebanking="dragonpay_ebanking",a.dragonpay_otc_banking="dragonpay_otc_banking",a.dragonpay_otc_non_banking="dragonpay_otc_non_banking",a.dragonpay_otc_philippines="dragonpay_otc_philippines",a.econtext="econtext",a.econtext_atm="econtext_atm",a.econtext_online="econtext_online",a.econtext_seven_eleven="econtext_seven_eleven",a.econtext_stores="econtext_stores",a.giropay="giropay",a.multibanco="multibanco",a.redirect="redirect",a.twint="twint",a.vipps="vipps",a.trustly="trustly",a.paybybank_AIS_DD="paybybank_AIS_DD",a.riverty="riverty",a.klarna="klarna",a.klarna_account="klarna_account",a.klarna_paynow="klarna_paynow",a.klarna_b2b="klarna_b2b",a.bcmc_mobile="bcmc_mobile",a.bcmc_mobile_QR="bcmc_mobile_QR",a.pix="pix",a.swish="swish",a.wechatpay="wechatpay",a.wechatpayQR="wechatpayQR",a.promptpay="promptpay",a.paynow="paynow",a.duitnow="duitnow",a.blik="blik",a.mbway="mbway",a.ancv="ancv",a.payto="payto",a.upi="upi",a.upi_qr="upi_qr",a.upi_collect="upi_collect",a.upi_intent="upi_intent",a.giftcard="giftcard",a.mealVoucher_FR="mealVoucher_FR",a.mealVoucher_FR_natixis="mealVoucher_FR_natixis",a.mealVoucher_FR_sodexo="mealVoucher_FR_sodexo",a.mealVoucher_FR_groupeup="mealVoucher_FR_groupeup",a}({});export{a as TxVariants};
2
2
  //# sourceMappingURL=tx-variants.js.map