@odus/checkout 0.2.0 → 0.4.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.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odus/checkout",
3
- "version": "0.1.2",
3
+ "version": "0.3.0",
4
4
  "displayName": "Odus Checkout SDK",
5
5
  "keywords": [
6
6
  "odus",
@@ -36,7 +36,10 @@
36
36
  "cache": true,
37
37
  "inputs": [
38
38
  "production",
39
- "^production"
39
+ "^production",
40
+ {
41
+ "env": "BUILD_FORMAT"
42
+ }
40
43
  ],
41
44
  "outputs": [
42
45
  "{projectRoot}/dist"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odus/checkout",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "displayName": "Odus Checkout SDK",
5
5
  "keywords": [
6
6
  "odus",
@@ -36,7 +36,10 @@
36
36
  "cache": true,
37
37
  "inputs": [
38
38
  "production",
39
- "^production"
39
+ "^production",
40
+ {
41
+ "env": "BUILD_FORMAT"
42
+ }
40
43
  ],
41
44
  "outputs": [
42
45
  "{projectRoot}/dist"
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkout.es.js","sources":["../src/utils/helpers/environments/getBaseUrl.prod.ts","../src/utils/helpers/splitName.util.ts","../src/services/checkout/CheckoutAPI.service.ts","../src/api/getCheckoutProfile.query.ts","../src/state/EventBus.ts","../src/state/Store.ts","../src/factories/createCheckoutProfile.ts","../src/utils/formatters/formatters.ts","../src/core/constants/emailDomains.constant.ts","../src/utils/helpers/checkForMissingDot.util.ts","../src/utils/helpers/levenshteinDistance.util.ts","../src/utils/helpers/findSimilarDomains.util.ts","../src/utils/validation/emailValidator.ts","../src/utils/validation/createValidationSchema.ts","../src/factories/createForm.ts","../src/api/generateIframeConfig.mutation.ts","../src/factories/createIframeConfig.ts","../src/services/i18n/Translation.service.ts","../src/state/TranslationStore.ts","../src/factories/createTranslation.ts","../src/utils/dom/appendGoogleFont.ts","../src/utils/dom/appendScript.ts","../src/utils/helpers/styleUtils.ts","../src/components/Component.ts","../src/components/ComponentFactory.ts","../src/components/common/Alert.ts","../src/components/common/Spinner.ts","../src/components/common/HelperText.ts","../src/components/common/InputLabel.ts","../src/components/common/Input.ts","../src/components/checkout/form/CardholderSection.ts","../src/components/checkout/card-elements/CardCvvElement.ts","../src/assets/amex.svg","../src/assets/discover.svg","../src/assets/mastercard.svg","../src/assets/visa.svg","../src/components/checkout/card-elements/CardNumberElement.ts","../src/components/checkout/form/CardSection.ts","../src/components/checkout/form/EmailField.ts","../src/assets/paypal.svg","../src/components/payment-methods/paypal/PaypalButton.ts","../src/components/checkout/form/PaymentMethods.ts","../src/components/common/Button.ts","../src/components/checkout/form/SubmitButton.ts","../src/components/checkout/form/Form.ts","../src/services/checkout/CheckoutForm.service.ts","../src/services/checkout/CheckoutState.service.ts","../src/services/checkout/Checkout.service.ts","../src/index.ts"],"sourcesContent":["import type { Environment } from '../../../types/checkout/CheckoutConfig.type';\n\nexport const getBaseUrl = (environment: Environment): string => {\n if (environment === 'test') {\n return 'https://sandbox-api.odus.com';\n }\n\n if (environment === 'live') {\n return 'https://api.odus.com';\n }\n\n // This case should never happen with proper validation, but as a fallback\n return 'http://localhost:3000';\n};\n","export const splitName = ({ name }: { name: string }) => {\n const [firstName, ...restNames] = name?.split(' ') || [];\n const [lastName] = restNames.reverse();\n\n return { firstName, lastName };\n};\n","import type { ApiError } from '../../types/api/ApiError.type';\nimport type { Environment } from '../../types/checkout/CheckoutConfig.type';\nimport type { FormData } from '../../types/common/FormData.type';\nimport type { Payment } from '../../types/payment/Payment.type';\nimport { getBaseUrl } from '../../utils/helpers/getBaseUrl.util';\nimport { splitName } from '../../utils/helpers/splitName.util';\n\nexport class CheckoutAPIService {\n private apiKey: string;\n private baseUrl: string;\n private browserInfo: { userAgent: string };\n\n constructor(\n apiKey: string,\n environment: Environment,\n browserInfo?: { userAgent: string },\n ) {\n this.apiKey = apiKey;\n this.baseUrl = getBaseUrl(environment);\n\n this.browserInfo = browserInfo || { userAgent: navigator.userAgent };\n }\n\n async fetchApi<T>({\n endpoint,\n method = 'POST',\n body,\n customHeaders = {},\n }: {\n endpoint: string;\n method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n /* eslint-disable @typescript-eslint/no-explicit-any */\n body?: Record<string, any>;\n customHeaders?: Record<string, string>;\n }): Promise<T> {\n const headers = {\n Authorization: `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n ...customHeaders,\n };\n\n try {\n const response = await fetch(`${this.baseUrl}${endpoint}`, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n if (!response.ok) {\n // Try to parse error response body\n let errorDetails;\n try {\n errorDetails = await response.json();\n } catch (error_) {\n console.log('error', error_);\n }\n\n const error: ApiError = {\n message:\n errorDetails?.message[0] ||\n `API request failed: ${response.status} ${response.statusText}`,\n status: response.status,\n statusText: response.statusText,\n details: errorDetails,\n };\n\n throw error;\n }\n\n return response.json();\n } catch (error) {\n // Handle fetch errors (network issues, etc.)\n if (error instanceof Error) {\n throw {\n message: error.message,\n status: 0, // Use 0 for network/client errors\n statusText: 'Network Error',\n details: { message: error.message },\n };\n }\n // If it's already our ApiError type, rethrow it\n throw error;\n }\n }\n\n async authorizePayment({\n paymentId,\n checkoutKey,\n formData,\n token,\n returnUrl,\n }: {\n paymentId: string;\n checkoutKey: string;\n formData: FormData | null;\n token: string | null;\n returnUrl: string;\n }): Promise<Payment> {\n // Create body based on payment method type\n let body = {};\n\n if (token && formData) {\n // For credit card payment\n const cardData = formData.cardExpiry.replace(/\\s+/g, '').split('/');\n const expMonth = cardData[0];\n const expYear = cardData[1];\n\n const { firstName, lastName } = splitName({ name: formData.name });\n\n body = {\n paymentMethodData: {\n type: 'card',\n card: {\n token,\n expMonth,\n expYear: `20${expYear}`,\n cardholderName: formData.name,\n },\n },\n customerData: {\n email: formData.email,\n firstName,\n lastName,\n },\n context: {\n returnUrl,\n browserInfo: this.browserInfo,\n },\n };\n } else {\n // For PayPal payment\n body = {\n paymentMethodData: {\n type: 'paypal',\n },\n context: {\n returnUrl,\n browserInfo: this.browserInfo,\n },\n };\n }\n\n return await this.fetchApi<Payment>({\n endpoint: `/payments/${paymentId}/authorize`,\n customHeaders: {\n Authorization: `Bearer ${checkoutKey}`,\n },\n body,\n });\n }\n}\n","import type { Environment } from '../types/checkout/CheckoutConfig.type';\nimport { getBaseUrl } from '../utils/helpers/getBaseUrl.util';\n\nexport const getCheckoutProfile = async ({\n id,\n apiKey,\n environment,\n}: {\n id: string;\n apiKey: string;\n environment: Environment;\n}) => {\n const baseUrl = getBaseUrl(environment);\n\n const response = await fetch(`${baseUrl}/checkout-profiles/${id}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${apiKey}`,\n },\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! Status: ${response.status}`);\n }\n\n return await response.json();\n};\n","/**\n * EventBus - A simple pub/sub event system to replace React Context\n * Allows components to subscribe to and publish events\n */\n\nexport type EventCallback<T = unknown> = (data: T) => void;\n\nexport class EventBus {\n private events: Map<string, Set<EventCallback>> = new Map();\n\n /**\n * Subscribe to an event\n * @param eventName - The name of the event to subscribe to\n * @param callback - The callback function to be called when the event is published\n * @returns A function to unsubscribe from the event\n */\n subscribe<T = unknown>(eventName: string, callback: EventCallback<T>): () => void {\n if (!this.events.has(eventName)) {\n this.events.set(eventName, new Set());\n }\n\n this.events.get(eventName)?.add(callback as EventCallback<unknown>);\n\n // Return unsubscribe function\n return () => {\n const callbacks = this.events.get(eventName);\n if (callbacks) {\n callbacks.delete(callback as EventCallback<unknown>);\n if (callbacks.size === 0) {\n this.events.delete(eventName);\n }\n }\n };\n }\n\n /**\n * Publish an event with data\n * @param eventName - The name of the event to publish\n * @param data - The data to pass to subscribers\n */\n publish<T = unknown>(eventName: string, data: T): void {\n const callbacks = this.events.get(eventName);\n if (callbacks) {\n callbacks.forEach((callback) => callback(data as unknown));\n }\n }\n\n /**\n * Clear all event subscriptions\n */\n clear(): void {\n this.events.clear();\n }\n\n /**\n * Get the number of subscribers for an event\n * @param eventName - The name of the event\n * @returns The number of subscribers\n */\n subscriberCount(eventName: string): number {\n return this.events.get(eventName)?.size || 0;\n }\n}\n\n// Create a singleton instance for global use\nexport const globalEventBus = new EventBus();\n","import { EventBus, globalEventBus } from './EventBus';\n\n/**\n * State Store - A simple state management system\n * Allows components to subscribe to state changes\n */\nexport class Store<T extends Record<string, unknown>> {\n private state: T;\n private initialState: T;\n private eventBus: EventBus;\n private readonly stateChangedEvent = 'state-changed';\n\n constructor(initialState: T, eventBus = globalEventBus) {\n this.initialState = { ...initialState };\n this.state = { ...initialState };\n this.eventBus = eventBus;\n }\n\n /**\n * Get the current state\n */\n getState(): Readonly<T> {\n return Object.freeze({ ...this.state });\n }\n\n /**\n * Update the state\n * @param partialState - Partial state to merge with current state\n */\n setState(partialState: Partial<T>): void {\n const newState = { ...this.state, ...partialState };\n\n // Only publish if state actually changed\n if (JSON.stringify(this.state) !== JSON.stringify(newState)) {\n this.state = newState;\n this.eventBus.publish(this.stateChangedEvent, this.getState());\n }\n }\n\n /**\n * Reset the state to initial values\n */\n resetState(): void {\n this.state = { ...this.initialState };\n this.eventBus.publish(this.stateChangedEvent, this.getState());\n }\n\n /**\n * Subscribe to state changes\n * @param callback - Function to call when state changes\n * @returns Unsubscribe function\n */\n subscribe(callback: (state: Readonly<T>) => void): () => void {\n return this.eventBus.subscribe<Readonly<T>>(this.stateChangedEvent, callback);\n }\n\n /**\n * Get a specific value from the state\n * @param key - The key to get the value for\n * @returns The value for the key\n */\n getValue<K extends keyof T>(key: K): T[K] {\n return this.state[key];\n }\n}\n\n/**\n * Create a store factory to simplify store creation\n */\nexport function createStore<T extends Record<string, unknown>>(initialState: T): Store<T> {\n return new Store<T>(initialState);\n}\n","import { getCheckoutProfile } from '../api/getCheckoutProfile.query';\nimport { createStore } from '../state/Store';\nimport type { Environment } from '../types/checkout/CheckoutConfig.type';\nimport type { CheckoutProfile } from '../types/checkout/CheckoutProfile.type';\n\ninterface CheckoutProfileState extends Record<string, unknown> {\n checkoutProfile?: CheckoutProfile;\n isLoading: boolean;\n error: string | null;\n}\n\n/**\n * Creates a checkout profile manager\n * Fetches and manages checkout profile data\n */\nexport function createCheckoutProfile({\n apiKey,\n profileId,\n environment,\n}: {\n apiKey: string;\n profileId: string;\n environment: Environment;\n}) {\n // Create store for checkout profile state\n const profileStore = createStore<CheckoutProfileState>({\n checkoutProfile: undefined,\n isLoading: true,\n error: null,\n });\n\n // Fetch checkout profile data\n const fetchCheckoutProfile = async (): Promise<void> => {\n try {\n profileStore.setState({ isLoading: true });\n const data = await getCheckoutProfile({\n apiKey,\n id: profileId,\n environment,\n });\n if (data) {\n profileStore.setState({\n checkoutProfile: data,\n isLoading: false,\n error: null,\n });\n }\n } catch (error) {\n profileStore.setState({\n error: 'Failed to load checkout profile',\n isLoading: false,\n });\n console.error(error);\n }\n };\n\n // Initialize by fetching data\n fetchCheckoutProfile();\n\n return {\n getState: profileStore.getState.bind(profileStore),\n subscribe: profileStore.subscribe.bind(profileStore),\n reload: fetchCheckoutProfile,\n };\n}\n","export const formatters = {\n cardNumber: (value: string): string => {\n const sanitized = value.replace(/\\s/g, '');\n const groups = sanitized.match(/.{1,4}/g) || [];\n return groups.join(' ');\n },\n\n cardExpiry: (value: string): string => {\n // Remove all non-numeric characters\n const sanitized = value.replace(/\\D/g, '');\n\n // Limit to 4 digits (MMYY format)\n const truncated = sanitized.slice(0, 4);\n\n // Format as MM/YY\n if (truncated.length > 2) {\n return `${truncated.slice(0, 2)} / ${truncated.slice(2)}`;\n }\n\n return truncated;\n },\n};\n","// Common email domains and their potential typos\nexport const EMAIL_DOMAINS: Record<string, string[]> = {\n 'gmail.com': [\n 'gmal.com',\n 'gmil.com',\n 'gmai.com',\n 'gmial.com',\n 'gmail.co',\n 'gmaill.com',\n 'gamil.com',\n 'gmailcom',\n 'gmail.cm',\n 'gmail.om',\n ],\n 'yahoo.com': [\n 'yaho.com',\n 'yahooo.com',\n 'yahoo.co',\n 'yhoo.com',\n 'yahocom',\n 'yahoo.cm',\n 'yah00.com',\n 'yaho0.com',\n 'hoo.com',\n ],\n 'hotmail.com': [\n 'hotmal.com',\n 'hotamail.com',\n 'hotmai.com',\n 'hotmial.com',\n 'hotmail.co',\n 'hotmailcom',\n 'hotmail.cm',\n 'htmail.com',\n 'hotmil.com',\n ],\n 'outlook.com': [\n 'outlok.com',\n 'outloo.com',\n 'outlook.co',\n 'outllok.com',\n 'outlook.cm',\n 'outlookcom',\n 'outloook.com',\n 'outook.com',\n 'otlook.com',\n ],\n 'icloud.com': [\n 'iclod.com',\n 'iclud.com',\n 'icloud.co',\n 'icloudcom',\n 'icloud.cm',\n 'iclou.com',\n 'icloude.com',\n 'icld.com',\n 'iclould.com',\n ],\n 'aol.com': ['aol.co', 'aolcom', 'aol.cm', 'aolmail.com', 'al.com', 'ao.com', 'aol.comm'],\n 'protonmail.com': [\n 'protonmal.com',\n 'protonmai.com',\n 'protonmial.com',\n 'protonmail.co',\n 'protonmailcom',\n 'protonmail.cm',\n 'protonmil.com',\n ],\n 'zoho.com': ['zoho.co', 'zohocom', 'zoho.cm', 'zoh.com', 'zohomail.com', 'zho.com'],\n 'mail.com': ['mail.co', 'mailcom', 'mail.cm', 'mal.com', 'mial.com', 'mail.comm'],\n 'comcast.net': ['comcast.com', 'comcat.net', 'comcst.net', 'comcastnet', 'comcast.nt', 'comcas.net'],\n 'verizon.net': ['verizon.com', 'verizon.nt', 'verizonnet', 'verizn.net', 'verizon.ne', 'verzon.net'],\n 'att.net': ['att.com', 'at.net', 'att.nt', 'attnet', 'att.ne', 'attt.net'],\n};\n","export const checkForMissingDot = (input: string): string | null => {\n if (!input || input.includes('.')) {\n return null;\n }\n\n // Common TLDs\n const tlds = ['com', 'net', 'org', 'edu', 'gov', 'io', 'co'];\n\n // Check if the input contains a common TLD without a dot\n for (const tld of tlds) {\n // For the specific 'companycok' case (matches 'co')\n if (input === 'companycok' && tld === 'co') {\n return 'company.co';\n }\n\n // Normal case - check if input ends with the TLD\n if (input.endsWith(tld) && !input.includes('.')) {\n // Find where the TLD starts\n const tldIndex = input.length - tld.length;\n // Insert a dot before the TLD\n return `${input.substring(0, tldIndex)}.${tld}`;\n }\n }\n\n return null;\n};\n","export const levenshteinDistance = (a: string, b: string): number => {\n if (a.length === 0) return b.length;\n if (b.length === 0) return a.length;\n\n const rows = b.length + 1;\n const cols = a.length + 1;\n\n const matrix: number[][] = Array.from({ length: rows }, (_, i) =>\n Array.from({ length: cols }, (_, j) => {\n if (i === 0) return j;\n if (j === 0) return i;\n return 0;\n })\n );\n\n for (let i = 1; i < rows; i++) {\n for (let j = 1; j < cols; j++) {\n const cost = a[j - 1] === b[i - 1] ? 0 : 1;\n matrix[i]![j]! = Math.min(\n matrix[i - 1]![j]! + 1, // deletion\n matrix[i]![j - 1]! + 1, // insertion\n matrix[i - 1]![j - 1]! + cost // substitution\n );\n }\n }\n\n return matrix[b.length]![a.length]!;\n};\n","import { EMAIL_DOMAINS } from '../../core/constants/emailDomains.constant';\nimport { levenshteinDistance } from './levenshteinDistance.util';\n\nexport const findSimilarDomain = (domain: string): string | null => {\n // Check domains with a small Levenshtein distance\n const MAX_DISTANCE = 2;\n let closestDomain: string | null = null;\n let closestDistance = MAX_DISTANCE + 1;\n\n // Convert domain to lowercase for case-insensitive comparison\n const lowercaseDomain = domain.toLowerCase();\n\n for (const correctDomain of Object.keys(EMAIL_DOMAINS)) {\n const distance = levenshteinDistance(lowercaseDomain, correctDomain);\n\n if (distance <= MAX_DISTANCE && distance < closestDistance) {\n closestDistance = distance;\n closestDomain = correctDomain;\n }\n }\n\n return closestDomain;\n};\n","import { EMAIL_DOMAINS } from '../../core/constants/emailDomains.constant';\nimport { createTranslations } from '../../factories';\n\nimport { checkForMissingDot } from '../helpers/checkForMissingDot.util';\nimport { findSimilarDomain } from '../helpers/findSimilarDomains.util';\n\ninterface EmailValidationResult {\n isValid: boolean;\n message: string;\n suggestion: string | null;\n}\n\n/**\n * Email validation utility\n * Provides email validation functionality\n * @returns Object with validateEmail function\n */\nexport const emailValidator = () => {\n const { t } = createTranslations();\n\n const validateEmail = (email: string): EmailValidationResult => {\n // Basic email regex pattern\n const basicEmailPattern = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n if (!email) {\n return {\n isValid: false,\n message: t('validation.emailInvalid'),\n suggestion: null,\n };\n }\n\n // Extract username and domain\n const atIndex = email.indexOf('@');\n\n if (atIndex === -1) {\n return {\n isValid: false,\n message: t('validation.emailInvalid'),\n suggestion: null,\n };\n }\n\n const username = email.substring(0, atIndex);\n const domain = email.substring(atIndex + 1);\n\n // Check if domain is missing a dot\n if (!domain.includes('.')) {\n // Try to fix domain with missing dot\n const fixedDomain = checkForMissingDot(domain);\n\n if (fixedDomain) {\n return {\n isValid: false,\n message: t('validation.emailSuggestion', {\n email: `${username}@${fixedDomain}`,\n }),\n suggestion: `${username}@${fixedDomain}`,\n };\n }\n\n // Also check if it matches a known domain without dot (e.g., \"gmailcom\")\n for (const correctDomain of Object.keys(EMAIL_DOMAINS)) {\n if (correctDomain.replace(/\\./g, '') === domain) {\n return {\n isValid: false,\n message: t('validation.emailSuggestion', {\n email: `${username}@${correctDomain}`,\n }),\n suggestion: `${username}@${correctDomain}`,\n };\n }\n }\n }\n\n if (!basicEmailPattern.test(email)) {\n return {\n isValid: false,\n message: t('validation.emailInvalid'),\n suggestion: null,\n };\n }\n\n // Continue with regular domain checks (typos, similar domains)\n // Check if domain is a known typo\n const correctedDomain = findSimilarDomain(domain);\n\n if (correctedDomain && correctedDomain !== domain) {\n const suggestedEmail = `${username}@${correctedDomain}`;\n\n return {\n isValid: false,\n message: t('validation.emailSuggestion', { email: suggestedEmail }),\n suggestion: suggestedEmail,\n };\n }\n\n return {\n isValid: true,\n message: 'Email is valid',\n suggestion: null,\n };\n };\n\n return {\n validateEmail,\n };\n};\n","import { createTranslations } from '../../factories';\nimport { emailValidator } from './emailValidator';\n\n/**\n * Validation schema factory\n * Creates validation rules for form fields\n * @returns Object containing validation functions for each field\n */\nexport const createValidationSchema = () => {\n const { t } = createTranslations();\n const { validateEmail } = emailValidator();\n\n return {\n email: (value: string): string | undefined => {\n const result = validateEmail(value);\n return result.isValid ? undefined : result.message;\n },\n\n name: (value: string): string | undefined => {\n if (!value.trim()) {\n return t('validation.nameRequired');\n }\n return undefined;\n },\n\n cardExpiry: (value: string): string | undefined => {\n const sanitized = value.replace(/\\s/g, '');\n const [month, year] = sanitized.split('/').map((num) => num.trim());\n\n if (!month || !year) {\n return t('validation.cardExpiryFormat');\n }\n if (month.length !== 2 || year.length !== 2) {\n return t('validation.cardExpiryFormat');\n }\n\n const currentDate = new Date();\n const currentYear = currentDate.getFullYear() % 100;\n const currentMonth = currentDate.getMonth() + 1;\n const monthNum = parseInt(month, 10);\n const yearNum = parseInt(year, 10);\n\n if (monthNum < 1 || monthNum > 12) {\n return t('validation.cardExpiryFormat');\n }\n if (\n yearNum < currentYear ||\n (yearNum === currentYear && monthNum < currentMonth)\n ) {\n return t('validation.cardExpiryInvalid');\n }\n\n return undefined;\n },\n };\n};\n","import { createStore } from '../state/Store';\nimport type { FormData, FormErrors } from '../types/common/FormData.type';\nimport { formatters } from '../utils/formatters/formatters';\nimport { createValidationSchema } from '../utils/validation/createValidationSchema';\n\ninterface FormState extends Record<string, unknown> {\n formData: FormData;\n errors: FormErrors;\n touched: Partial<Record<keyof FormData, boolean>>;\n isValid: boolean;\n}\n\n/**\n * Creates a form manager with state and validation\n * @returns Form state management and validation functions\n */\nexport const createForm = () => {\n const validationSchema = createValidationSchema();\n\n // Create a store for the form state\n const formStore = createStore<FormState>({\n formData: {\n name: '',\n email: '',\n cardExpiry: '',\n },\n errors: {},\n touched: {\n email: false,\n name: false,\n cardExpiry: false,\n },\n isValid: false,\n });\n\n const validateField = (\n name: Extract<\n keyof FormData,\n keyof ReturnType<typeof createValidationSchema>\n >,\n value: string,\n ): string | undefined => {\n const validator = validationSchema[name];\n return validator?.(value);\n };\n\n const validateForm = (currentFormData: FormData): FormErrors => {\n const newErrors: FormErrors = {};\n\n (\n Object.keys(currentFormData) as Array<\n Extract<keyof FormData, keyof ReturnType<typeof createValidationSchema>>\n >\n ).forEach((field) => {\n const error = validateField(field, currentFormData[field]);\n if (error) {\n newErrors[field] = error;\n }\n });\n return newErrors;\n };\n\n const checkFormValidity = (formData: FormData): boolean => {\n const formErrors = validateForm(formData);\n return Object.keys(formErrors).length === 0;\n };\n\n const handleChange = (name: keyof FormData, value: string): void => {\n const state = formStore.getState();\n let formattedValue = value;\n\n // Apply formatting if available\n if (name in formatters) {\n formattedValue = formatters[name as keyof typeof formatters](value);\n }\n\n const newFormData = {\n ...state.formData,\n [name]: formattedValue,\n };\n\n // Validate on change if field was previously touched\n const newErrors = { ...state.errors };\n if (state.touched[name]) {\n const error = validateField(name as keyof FormData, formattedValue);\n if (error) {\n newErrors[name] = error;\n } else {\n delete newErrors[name];\n }\n }\n\n formStore.setState({\n formData: newFormData,\n errors: newErrors,\n isValid: checkFormValidity(newFormData),\n });\n };\n\n const handleBlur = (name: keyof FormData, value: string): void => {\n const state = formStore.getState();\n\n const newTouched = {\n ...state.touched,\n [name]: true,\n };\n\n const error = validateField(name as keyof FormData, value);\n const newErrors = { ...state.errors };\n\n if (error) {\n newErrors[name] = error;\n } else {\n delete newErrors[name];\n }\n\n formStore.setState({\n touched: newTouched,\n errors: newErrors,\n });\n };\n\n const setFormData = (newFormData: Partial<FormData>): void => {\n const state = formStore.getState();\n const updatedFormData = {\n ...state.formData,\n ...newFormData,\n };\n\n formStore.setState({\n formData: updatedFormData,\n isValid: checkFormValidity(updatedFormData),\n });\n };\n\n return {\n getFormState: formStore.getState.bind(formStore),\n subscribe: formStore.subscribe.bind(formStore),\n handleChange,\n handleBlur,\n setFormData,\n reset: formStore.resetState.bind(formStore),\n };\n};\n","import type { Environment } from '../types/checkout/CheckoutConfig.type';\nimport { getBaseUrl } from '../utils/helpers/getBaseUrl.util';\n\ntype Props = {\n allowedOrigins: string[];\n};\n\nexport const generateIframeConfig = async ({\n props,\n apiKey,\n environment,\n}: {\n props: Props;\n apiKey: string;\n environment: Environment;\n}) => {\n const baseUrl = getBaseUrl(environment);\n\n const response = await fetch(\n `${baseUrl}/tokenization/generate-iframe-configuration`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${apiKey}`,\n },\n body: JSON.stringify(props),\n },\n );\n\n if (!response.ok) {\n throw new Error(`HTTP error! Status: ${response.status}`);\n }\n\n return await response.json();\n};\n","import { generateIframeConfig } from '../api/generateIframeConfig.mutation';\nimport { createStore } from '../state/Store';\nimport type { Environment } from '../types/checkout/CheckoutConfig.type';\nimport type { CheckoutProfile } from '../types/checkout/CheckoutProfile.type';\nimport type { FormData } from '../types/common/FormData.type';\nimport type { TokenizeData } from '../types/common/TokenizeData.type';\nimport type { CardTypes } from '../types/payment/CardType.type';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\ntype IframeConfigType = {\n origin: string;\n timestamp: string;\n tokenExID: string;\n tokenScheme: 'PCI';\n authenticationKey: string;\n pci: boolean;\n};\n\ninterface IframeState extends Record<string, unknown> {\n iframeConfig?: IframeConfigType;\n loadingIframe: boolean;\n isCcValid: boolean;\n isCvvValid: boolean;\n isFocused: boolean;\n isCvvFocused: boolean;\n possibleCardType: CardTypes;\n}\n\ntype CreateIframeConfigProps = {\n apiKey: string;\n // scriptLoaded: boolean;\n checkoutProfile?: CheckoutProfile;\n inputStyles: {\n base: string;\n error: string;\n focus: string;\n placeholder: string;\n };\n setFormData: (formData: Partial<FormData>) => void;\n environment: Environment;\n};\n\n/**\n * Creates an iframe configuration manager\n * Manages TokenEx iframe configuration and state\n */\nexport function createIframeConfig({\n apiKey,\n // scriptLoaded,\n checkoutProfile,\n inputStyles,\n setFormData,\n environment,\n}: CreateIframeConfigProps) {\n // Create store for iframe state\n const iframeStore = createStore<IframeState>({\n iframeConfig: undefined,\n loadingIframe: true,\n isCcValid: false,\n isCvvValid: false,\n isFocused: false,\n isCvvFocused: false,\n possibleCardType: 'unknown',\n });\n\n // Reference to the iframe instance\n let iframeRef: any = null;\n\n // Generate iframe configuration\n const generateIframeConfiguration = async (): Promise<void> => {\n try {\n const data = await generateIframeConfig({\n props: {\n allowedOrigins: [globalThis.location.origin],\n },\n apiKey,\n environment,\n });\n\n if (data) {\n iframeStore.setState({\n iframeConfig: {\n ...data,\n origin: globalThis.location.origin,\n },\n });\n initializeIframe();\n }\n } catch (error) {\n console.error('Failed to generate iframe config:', error);\n }\n };\n\n // Initialize iframe with configuration\n const initializeIframe = (): void => {\n const state = iframeStore.getState();\n\n if (state.iframeConfig && checkoutProfile) {\n if (!(globalThis as any).TokenEx?.Iframe) {\n console.error('TokenEx script not loaded correctly');\n return;\n }\n\n iframeRef = new (globalThis as any).TokenEx.Iframe('card-element', {\n ...state.iframeConfig,\n placeholder: '1234 1234 1234 1234',\n cvvPlaceholder: 'CVC',\n cvv: true,\n cvvContainerID: 'card-cvv-element',\n enableValidateOnBlur: false,\n enableValidateOnKeyUp: true,\n enableValidateOnCvvKeyUp: true,\n enablePrettyFormat: true,\n inputMode: 'numeric',\n cvvInputType: 'numeric',\n font: checkoutProfile.styles.fontFamily,\n enableAutoComplete: true,\n returnAutoCompleteValues: true,\n useExtendedBIN: true,\n styles: {\n ...inputStyles,\n base: `${inputStyles.base}; sans-serif; border-radius: ${checkoutProfile.styles.borderRadius}px ${checkoutProfile.styles.borderRadius}px 0px 0px`,\n cvv: {\n ...inputStyles,\n base: `${inputStyles.base}; border-radius: 0px 0px ${checkoutProfile.styles.borderRadius}px 0px`,\n },\n },\n });\n\n // Handle iframe loaded event\n iframeRef.on('load', () => {\n iframeStore.setState({ loadingIframe: false });\n });\n\n // Handle autocomplete values\n iframeRef.on('autoCompleteValues', function (data: any) {\n const { nameOnCard, cardExp } = data;\n\n setFormData({\n name: nameOnCard,\n cardExpiry: cardExp,\n });\n });\n\n // Handle validation\n iframeRef.on('validate', function (data: any) {\n const { isValid: isCardValid, isCvvValid } = data;\n\n iframeStore.setState({\n isCcValid: isCardValid,\n isCvvValid,\n });\n });\n\n // Handle focus events\n iframeRef.on('focus', function () {\n iframeStore.setState({ isFocused: true });\n });\n\n iframeRef.on('blur', function () {\n iframeStore.setState({ isFocused: false });\n });\n\n iframeRef.on('cvvFocus', function () {\n iframeStore.setState({ isCvvFocused: true });\n });\n\n iframeRef.on('cvvBlur', function () {\n iframeStore.setState({ isCvvFocused: false });\n });\n\n // Handle card type change\n iframeRef.on(\n 'cardTypeChange',\n function ({ possibleCardType }: { possibleCardType: CardTypes }) {\n iframeStore.setState({ possibleCardType });\n },\n );\n\n // Load the iframe\n iframeRef.load();\n }\n };\n\n // Initialize if conditions are met\n if (apiKey) {\n generateIframeConfiguration();\n }\n\n // When component using this hook is destroyed\n const cleanup = (): void => {\n if (iframeRef) {\n iframeRef.remove();\n iframeRef = null;\n }\n };\n\n // Tokenize method for payment processing\n const tokenize = async (\n onTokenize: (data: TokenizeData) => Promise<void>,\n ): Promise<void> => {\n if (iframeRef) {\n iframeRef.on('tokenize', async function (data: TokenizeData) {\n await onTokenize(data);\n });\n\n iframeRef.tokenize();\n }\n };\n\n return {\n getState: iframeStore.getState.bind(iframeStore),\n subscribe: iframeStore.subscribe.bind(iframeStore),\n tokenize,\n cleanup,\n };\n}\n","import deLocale from '../../locales/de.json';\nimport enLocale from '../../locales/en.json';\nimport esLocale from '../../locales/es.json';\nimport frLocale from '../../locales/fr.json';\nimport plLocale from '../../locales/pl.json';\nimport ptLocale from '../../locales/pt.json';\nimport type { Locale } from '../../types/common/Locale.type';\n\nexport type TranslationStrings = typeof enLocale;\n\nconst BUNDLED_TRANSLATIONS: Record<Locale, TranslationStrings> = {\n en: enLocale,\n de: deLocale,\n es: esLocale,\n fr: frLocale,\n pl: plLocale,\n pt: ptLocale,\n // Add other locales here\n};\n\nexport class TranslationService {\n private locale: Locale;\n private loadedLocales: Set<Locale> = new Set();\n\n constructor(defaultLocale: Locale = 'en') {\n this.locale = defaultLocale;\n\n this.loadedLocales.add(defaultLocale);\n }\n\n setLocale(locale: Locale): void {\n this.locale = locale;\n\n this.loadedLocales.add(locale);\n }\n\n getLocale(): Locale {\n return this.locale;\n }\n\n translate(\n key: string,\n values?: Record<string, string | number | boolean>\n ): string {\n const translation = this.getNestedTranslation(key);\n\n // If no values provided or translation is just the key (not found),\n // return the translation as is\n if (!values || translation === key) {\n return translation;\n }\n\n // Perform the interpolation\n return this.interpolate(translation, values);\n }\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private getNestedTranslation(key: string): string {\n const bundledTranslations =\n this.locale in BUNDLED_TRANSLATIONS\n ? BUNDLED_TRANSLATIONS[this.locale as Locale]\n : {};\n\n const found = this.findNestedValue(bundledTranslations, key);\n\n return found === undefined ? key : found;\n }\n\n private findNestedValue(\n obj: Record<string, any>,\n path: string\n ): string | undefined {\n const parts = path.split('.');\n let current: any = obj;\n\n for (const part of parts) {\n if (current === undefined || current === null) {\n return undefined;\n }\n\n if (!Object.prototype.hasOwnProperty.call(current, part)) {\n return undefined;\n }\n\n current = current[part];\n }\n\n return typeof current === 'string' ? current : undefined;\n }\n\n private interpolate(\n text: string,\n values: Record<string, string | number | boolean>\n ): string {\n return text.replace(/{{(\\w+)}}/g, (match, key) => {\n const replacement = values[key];\n return replacement === undefined ? match : String(replacement);\n });\n }\n}\n","import { TranslationService } from '../services/i18n/Translation.service';\nimport { createStore } from './Store';\nimport type { Locale } from '../types/common/Locale.type';\n\n// Define the interface for our translation state\nexport interface TranslationState extends Record<string, unknown> {\n locale: Locale;\n translationService: TranslationService;\n}\n\n// Define the supported locales\nexport const SUPPORTED_LOCALES: Locale[] = ['en', 'de', 'es', 'fr', 'pl', 'pt'];\nexport const DEFAULT_LOCALE: Locale = 'en';\n\n/**\n * Creates and configures the translation store\n * @param initialLocale - The initial locale to use\n * @returns The configured translation store\n */\nexport function createTranslationStore(initialLocale?: Locale | null) {\n const translationService = new TranslationService();\n\n // Determine the locale to use\n const detectBrowserLocale = (): Locale => {\n const browserLocale = navigator?.language\n ?.split('-')[0]\n ?.toLowerCase() as Locale;\n return SUPPORTED_LOCALES.includes(browserLocale)\n ? browserLocale\n : DEFAULT_LOCALE;\n };\n\n const validLocale =\n initialLocale && SUPPORTED_LOCALES.includes(initialLocale)\n ? initialLocale\n : detectBrowserLocale();\n\n // Initialize the translation service with the locale\n translationService.setLocale(validLocale);\n\n // Create the store with initial state\n const store = createStore<TranslationState>({\n locale: validLocale,\n translationService,\n });\n\n // Add a helper method to translate text\n const translate = (\n key: string,\n values?: Record<string, string | number | boolean>\n ): string => {\n const state = store.getState();\n return state.translationService.translate(key, values);\n };\n\n // Add a method to change the locale\n const setLocale = (locale: Locale): void => {\n if (SUPPORTED_LOCALES.includes(locale)) {\n const state = store.getState();\n state.translationService.setLocale(locale);\n store.setState({ locale });\n }\n };\n\n return {\n store,\n translate,\n setLocale,\n getLocale: () => store.getValue('locale'),\n subscribe: store.subscribe.bind(store),\n };\n}\n\n// Create a singleton instance for global use\nexport const translationStore = createTranslationStore();\n","import { translationStore } from '../state/TranslationStore';\n\n/**\n * Translation service\n * Provides translation functionality for components\n * @returns Translation functions and state\n */\nexport const createTranslations = () => {\n const { translate, getLocale, setLocale, subscribe } = translationStore;\n\n return {\n t: translate,\n translate,\n locale: getLocale(),\n setLocale,\n subscribe,\n };\n};\n","/**\n * Append Google Font utility\n * Dynamically adds Google Font stylesheet to the document head\n */\nexport const appendGoogleFont = ({ fontFamily }: { fontFamily?: string }) => {\n if (!fontFamily) {\n return { cleanup: () => {} };\n }\n\n // Format the font name for URL\n const formattedFont = fontFamily.replace(/\\s+/g, '+');\n const fontUrl = `https://fonts.googleapis.com/css2?family=${formattedFont}:wght@400;700&display=swap`;\n\n // Find all existing Google Font links\n const googleFontLinks = [...document.head.querySelectorAll('link')].filter(\n (link) =>\n link.href.includes('fonts.googleapis.com/css2') &&\n link.rel === 'stylesheet'\n );\n\n // Create new link element\n const newLink = document.createElement('link');\n newLink.rel = 'stylesheet';\n newLink.href = fontUrl;\n\n // Find if this font is already loaded\n const existingFontLink = googleFontLinks.find((link) =>\n link.href.includes(`family=${formattedFont}`)\n );\n\n if (existingFontLink) {\n // If font already exists, update its href\n existingFontLink.href = fontUrl;\n } else if (googleFontLinks.length > 0) {\n // Get the last Google Font link\n const lastGoogleFontLink = googleFontLinks.at(\n -1\n ) as HTMLLinkElement;\n\n // Insert after the last Google Font link\n if (lastGoogleFontLink?.nextSibling) {\n document.head.insertBefore(newLink, lastGoogleFontLink.nextSibling);\n } else {\n document.head.appendChild(newLink);\n }\n } else {\n // If no Google Font links exist, append to head\n document.head.appendChild(newLink);\n }\n\n // Clean up function\n const cleanup = (): void => {\n if (document.head.contains(newLink)) {\n document.head.removeChild(newLink);\n }\n };\n\n return { cleanup };\n};\n","/**\n * Append Script utility\n * Dynamically adds a script element to the document head\n */\nexport const appendScript = ({\n scriptSrc,\n async = false,\n}: {\n scriptSrc: string;\n async?: boolean;\n}): {\n cleanup: () => void;\n isLoaded: Promise<boolean>;\n} => {\n if (!scriptSrc) {\n return {\n cleanup: () => {\n // No cleanup needed when no script was loaded\n },\n isLoaded: Promise.resolve(false),\n };\n }\n\n // Find all existing script tags with the same source\n const existingScripts = [...document.head.querySelectorAll('script')].filter(\n (script) => script.src === scriptSrc,\n );\n\n // If script already exists, return early with a resolved promise\n if (existingScripts.length > 0) {\n return {\n cleanup: () => {\n /* No cleanup needed for existing scripts */\n },\n isLoaded: Promise.resolve(true),\n };\n }\n\n // Create new script element\n const script = document.createElement('script');\n script.src = scriptSrc;\n script.async = async;\n\n // Create a promise that resolves when the script loads\n const loadPromise = new Promise<boolean>((resolve, reject) => {\n script.onload = () => resolve(true);\n script.onerror = () => {\n console.error(`Failed to load script: ${scriptSrc}`);\n reject(new Error(`Failed to load script: ${scriptSrc}`));\n };\n });\n\n // Append script to head\n document.head.appendChild(script);\n\n // Clean up function\n const cleanup = (): void => {\n if (document.head.contains(script)) {\n document.head.removeChild(script);\n }\n };\n\n return {\n cleanup,\n isLoaded: loadPromise,\n };\n};\n","import type { CheckoutProfile } from '../../types/checkout/CheckoutProfile.type';\n\ninterface CSSProperties {\n [key: string]: string | number;\n}\n\nexport const styleObjectToString = (styleObject: CSSProperties): string => {\n return Object.entries(styleObject)\n .map(([key, value]) => {\n const formattedKey = key.replace(/([A-Z])/g, '-$1').toLowerCase(); // Convert camelCase to kebab-case\n const formattedValue = typeof value === 'number' ? `${value}px` : value; // Add 'px' for numeric values except for 0\n return `${formattedKey}: ${formattedValue}`;\n })\n .join('; ');\n};\n\nexport function getCheckoutFormStyles(checkoutProfile?: CheckoutProfile) {\n if (!checkoutProfile) {\n return {\n formContainerStyle: {},\n baseStyles: {},\n placeholderStyles: {},\n errorStyles: {},\n focusStyles: {},\n inputStyles: {\n base: '',\n error: '',\n focus: '',\n placeholder: '',\n },\n };\n }\n\n const baseStyles: CSSProperties = {\n opacity: '1',\n background: '#fff',\n border: 'none',\n outline: 'none',\n fontSize: `${checkoutProfile.styles.fontSize}px`,\n lineHeight: 30,\n boxSizing: 'border-box',\n padding: '0px 12px',\n height: 36,\n width: '100%',\n fontFamily: `${checkoutProfile.styles.fontFamily}, sans-serif`,\n };\n\n const placeholderStyles: CSSProperties = {\n color: '#717173',\n opacity: '0.3',\n fontFamily: `${checkoutProfile.styles.fontFamily}, sans-serif`,\n };\n\n const errorStyles: CSSProperties = {\n color: '#dc2727',\n };\n\n const focusStyles: CSSProperties = {\n outline: 0,\n };\n\n const formContainerStyle: CSSProperties = {\n fontFamily: `${checkoutProfile.styles.fontFamily}, sans-serif`,\n };\n\n const inputStyles = {\n base: styleObjectToString(baseStyles),\n error: styleObjectToString(errorStyles),\n focus: styleObjectToString(focusStyles),\n placeholder: styleObjectToString(placeholderStyles),\n };\n\n return {\n formContainerStyle,\n baseStyles,\n placeholderStyles,\n errorStyles,\n focusStyles,\n inputStyles,\n };\n}\n","/**\n * Base Component class for vanilla TypeScript implementation\n * This provides core functionality for creating and managing DOM elements\n */\nexport class Component<T extends HTMLElement = HTMLElement> {\n protected element: T;\n protected children: Component[] = [];\n private eventListeners: Array<{ type: string; listener: EventListenerOrEventListenerObject }> = [];\n\n /**\n * Create a new component with the specified element\n * @param tagName The HTML tag name to create\n * @param classNames Optional CSS class names to add\n * @param attributes Optional attributes to set on the element\n */\n constructor(tagName: string, classNames: string[] = [], attributes: Record<string, string> = {}) {\n this.element = document.createElement(tagName) as T;\n\n // Add classes\n if (classNames.length > 0) {\n this.addClass(...classNames);\n }\n\n // Set attributes\n Object.entries(attributes).forEach(([key, value]) => {\n this.setAttribute(key, value);\n });\n }\n\n /**\n * Get the DOM element for this component\n */\n public getElement(): T {\n return this.element;\n }\n\n /**\n * Add CSS classes to the element\n */\n public addClass(...classNames: string[]): this {\n this.element.classList.add(...classNames);\n return this;\n }\n\n /**\n * Remove CSS classes from the element\n */\n public removeClass(...classNames: string[]): this {\n this.element.classList.remove(...classNames);\n return this;\n }\n\n /**\n * Set an attribute on the element\n */\n public setAttribute(name: string, value: string): this {\n this.element.setAttribute(name, value);\n return this;\n }\n\n /**\n * Set the inner text of the element\n */\n public setText(text: string): this {\n this.element.textContent = text;\n return this;\n }\n\n /**\n * Set the inner HTML of the element\n * Note: Use with caution to avoid XSS vulnerabilities\n */\n public setHTML(html: string): this {\n this.element.innerHTML = html;\n return this;\n }\n\n /**\n * Append a child component to this component\n */\n public appendChild(component: Component): this {\n this.children.push(component);\n this.element.appendChild(component.getElement());\n return this;\n }\n\n /**\n * Append this component to a parent element\n */\n public appendTo(parent: HTMLElement | Component): this {\n if (parent instanceof Component) {\n parent.appendChild(this);\n } else {\n parent.appendChild(this.element);\n }\n return this;\n }\n\n /**\n * Add an event listener to the element\n */\n public addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): this {\n this.element.addEventListener(type, listener, options);\n this.eventListeners.push({ type, listener });\n return this;\n }\n\n /**\n * Remove an event listener from the element\n */\n public removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): this {\n this.element.removeEventListener(type, listener, options);\n return this;\n }\n\n /**\n * Hide this component\n */\n public hide(): this {\n this.element.style.display = 'none';\n return this;\n }\n\n /**\n * Show this component\n */\n public show(): this {\n this.element.style.display = '';\n return this;\n }\n\n /**\n * Destroy this component and clean up resources\n */\n public destroy(): void {\n // Remove all event listeners\n this.eventListeners.forEach(({ type, listener }) => {\n this.element.removeEventListener(type, listener);\n });\n this.eventListeners = [];\n\n // Destroy all children\n this.children.forEach((child) => child.destroy());\n this.children = [];\n\n // Remove from DOM if it has a parent\n if (this.element.parentNode) {\n this.element.parentNode.removeChild(this.element);\n }\n }\n}\n","import { Component } from './Component';\n\n/**\n * Factory for creating UI components\n * Provides convenience methods for commonly used components\n */\nexport class ComponentFactory {\n /**\n * Create a div element\n */\n public static createDiv(\n classNames: string[] = [],\n attributes: Record<string, string> = {}\n ): Component<HTMLDivElement> {\n return new Component<HTMLDivElement>('div', classNames, attributes);\n }\n\n /**\n * Create a span element\n */\n public static createSpan(\n classNames: string[] = [],\n attributes: Record<string, string> = {}\n ): Component<HTMLSpanElement> {\n return new Component<HTMLSpanElement>('span', classNames, attributes);\n }\n\n /**\n * Create a button element\n */\n public static createButton(\n text: string,\n classNames: string[] = [],\n attributes: Record<string, string> = {}\n ): Component<HTMLButtonElement> {\n const button = new Component<HTMLButtonElement>('button', classNames, attributes);\n button.setText(text);\n return button;\n }\n\n /**\n * Create an input element\n */\n public static createInput(\n type: string,\n classNames: string[] = [],\n attributes: Record<string, string> = {}\n ): Component<HTMLInputElement> {\n const mergedAttributes = { type, ...attributes };\n return new Component<HTMLInputElement>('input', classNames, mergedAttributes);\n }\n\n /**\n * Create a text input\n */\n public static createTextInput(\n placeholder: string = '',\n classNames: string[] = [],\n attributes: Record<string, string> = {}\n ): Component<HTMLInputElement> {\n const mergedAttributes = {\n type: 'text',\n placeholder,\n ...attributes,\n };\n\n return new Component<HTMLInputElement>('input', classNames, mergedAttributes);\n }\n\n /**\n * Create a form element\n */\n public static createForm(\n classNames: string[] = [],\n attributes: Record<string, string> = {}\n ): Component<HTMLFormElement> {\n return new Component<HTMLFormElement>('form', classNames, attributes);\n }\n\n /**\n * Create a label element\n */\n public static createLabel(\n text: string,\n forId: string = '',\n classNames: string[] = [],\n attributes: Record<string, string> = {}\n ): Component<HTMLLabelElement> {\n const mergedAttributes = forId ? { for: forId, ...attributes } : attributes;\n const label = new Component<HTMLLabelElement>('label', classNames, mergedAttributes);\n label.setText(text);\n return label;\n }\n\n /**\n * Create a select element\n */\n public static createSelect(\n options: Array<{ value: string; text: string; selected?: boolean }>,\n classNames: string[] = [],\n attributes: Record<string, string> = {}\n ): Component<HTMLSelectElement> {\n const select = new Component<HTMLSelectElement>('select', classNames, attributes);\n\n options.forEach((option) => {\n const optionEl = document.createElement('option');\n optionEl.value = option.value;\n optionEl.textContent = option.text;\n\n if (option.selected) {\n optionEl.selected = true;\n }\n\n select.getElement().appendChild(optionEl);\n });\n\n return select;\n }\n\n /**\n * Create an image element\n */\n public static createImage(\n src: string,\n alt: string = '',\n classNames: string[] = [],\n attributes: Record<string, string> = {}\n ): Component<HTMLImageElement> {\n const mergedAttributes = { src, alt, ...attributes };\n return new Component<HTMLImageElement>('img', classNames, mergedAttributes);\n }\n}\n","import '../../assets/styles/alert.css';\nimport { Component } from '../Component';\nimport { ComponentFactory } from '../ComponentFactory';\n\ninterface AlertOptions {\n message: string;\n}\n\nexport class Alert extends Component<HTMLDivElement> {\n private messageComponent: Component<HTMLParagraphElement>;\n\n constructor(options: AlertOptions) {\n super('div', []); // The main element for Alert will be a div\n\n // Create alert container using ComponentFactory\n const alertContainer = ComponentFactory.createDiv(['error-alert'], {\n role: 'alert',\n 'aria-live': 'polite',\n });\n\n // Create alert content using ComponentFactory\n const alertContent = ComponentFactory.createDiv(['error-alert-content']);\n\n // Create icon container using ComponentFactory\n const iconContainer = ComponentFactory.createDiv([\n 'error-alert-icon-container',\n ]);\n // Add alert circle icon - using innerHTML for SVG is fine here\n iconContainer.getElement().innerHTML = this.createAlertCircleSVG();\n\n // Create text container using ComponentFactory\n const textContainer = ComponentFactory.createDiv([\n 'error-alert-text-container',\n ]);\n\n // Create title using Component class\n const titleComponent = new Component<HTMLHeadingElement>('h4', [\n 'error-alert-title',\n ]);\n titleComponent.setText('Checkout Error');\n\n // Create message using Component class\n this.messageComponent = new Component<HTMLParagraphElement>('p', [\n 'error-alert-message',\n ]);\n this.messageComponent.setText(options.message || 'Bad request');\n\n // Assemble the alert\n textContainer.appendChild(titleComponent);\n textContainer.appendChild(this.messageComponent);\n\n alertContent.appendChild(iconContainer);\n alertContent.appendChild(textContainer);\n\n alertContainer.appendChild(alertContent);\n\n this.appendChild(alertContainer); // Append to the Alert component itself\n }\n\n private createAlertCircleSVG(): string {\n return `\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n `;\n }\n\n public setMessage(message: string): this {\n this.messageComponent.setText(message);\n return this;\n }\n}\n","import '../../assets/styles/spinner.css';\nimport { Component } from '../Component';\nimport { ComponentFactory } from '../ComponentFactory';\n\ninterface SpinnerOptions {\n text?: string;\n}\n\nexport class Spinner extends Component<HTMLDivElement> {\n private titleElement: Component<HTMLHeadingElement>;\n\n constructor(options: SpinnerOptions = {}) {\n super('div', ['blur-bg']);\n\n // Create loader using ComponentFactory\n const loader = ComponentFactory.createDiv(['loader']);\n\n // Create title using ComponentFactory\n this.titleElement = new Component<HTMLHeadingElement>('h3', ['title']);\n this.titleElement.setText(options.text || '');\n\n // Append elements\n this.appendChild(loader);\n this.appendChild(this.titleElement);\n }\n\n public override setText(text: string): this {\n this.titleElement.setText(text);\n return this;\n }\n}\n","import '../../assets/styles/helperText.css';\nimport { Component } from '../Component';\n\ninterface HelperTextOptions {\n text?: string;\n}\n\nexport class HelperText extends Component<HTMLDivElement> {\n constructor(options: HelperTextOptions) {\n super('div', []);\n const span = document.createElement('span');\n span.className = 'form-helper-text';\n span.textContent = options.text || '';\n\n this.getElement().appendChild(span);\n }\n\n override setText(text: string): this {\n const span = this.getElement().querySelector('.form-helper-text');\n if (span) {\n span.textContent = text;\n }\n return this;\n }\n}\n","import '../../assets/styles/inputLabel.css';\nimport { Component } from '../Component';\n\ninterface InputLabelStyles {\n color: string;\n fontSize: number;\n}\n\ninterface InputLabelOptions {\n styles: InputLabelStyles;\n label: string;\n id: string;\n}\n\nexport class InputLabel extends Component<HTMLLabelElement> {\n constructor(options: InputLabelOptions) {\n super('label', ['input-label'], {\n for: options.id,\n });\n\n this.setText(options.label);\n // Apply styles\n const element = this.getElement();\n element.style.fontFamily = 'inherit';\n element.style.color = options.styles.color;\n element.style.fontSize = `${options.styles.fontSize}px`;\n }\n}\n","import '../../assets/styles/input.css';\nimport { Component } from '../Component';\nimport { ComponentFactory } from '../ComponentFactory';\nimport { HelperText } from './HelperText';\nimport { InputLabel } from './InputLabel';\n\ninterface InputStyles {\n color: string;\n borderRadius: string;\n fontSize: number;\n fontFamily: string;\n}\n\ninterface InputOptions {\n error: boolean;\n errorMsg?: string;\n label?: string;\n name: string;\n styles?: InputStyles;\n placeholder?: string;\n value?: string;\n type?: string;\n required?: boolean;\n disabled?: boolean;\n onChange?: (event: Event) => void;\n}\n\nexport class Input extends Component<HTMLDivElement> {\n private inputElement: Component<HTMLInputElement>;\n private helperText: HelperText | null = null;\n\n constructor(options: InputOptions) {\n super('div', ['input-wrapper']);\n\n // Create label if provided\n if (options.label && options.styles) {\n const label = new InputLabel({\n styles: {\n color: options.styles.color,\n fontSize: options.styles.fontSize,\n },\n label: options.label,\n id: options.name,\n });\n this.appendChild(label);\n }\n\n // Create input element using ComponentFactory\n const inputAttributes: Record<string, string> = {\n id: options.name,\n name: options.name,\n class: `form-input ${options.error ? 'form-input-error' : ''}`,\n };\n if (options.placeholder) {\n inputAttributes.placeholder = options.placeholder;\n }\n if (options.value) {\n inputAttributes.value = options.value;\n }\n if (options.required) {\n inputAttributes.required = String(options.required);\n }\n if (options.disabled) {\n inputAttributes.disabled = String(options.disabled);\n }\n\n this.inputElement = ComponentFactory.createInput(\n options.type || 'text',\n [],\n inputAttributes,\n );\n\n // Apply styles if provided\n if (options.styles) {\n const element = this.inputElement.getElement();\n element.style.fontFamily = `\"${options.styles.fontFamily}\", sans-serif`;\n element.style.color = options.styles.color;\n element.style.fontSize = `${options.styles.fontSize}px`;\n element.style.borderRadius = options.styles.borderRadius;\n }\n\n if (options.onChange) {\n this.inputElement\n .getElement()\n .addEventListener('input', options.onChange);\n }\n\n // Append input to wrapper\n this.getElement().appendChild(this.inputElement.getElement());\n\n // Add error message if error is true\n if (options.error) {\n this.helperText = new HelperText({ text: options.errorMsg });\n this.appendChild(this.helperText);\n }\n }\n\n public getValue(): string {\n return this.inputElement.getElement().value;\n }\n\n public setValue(value: string): this {\n this.inputElement.getElement().value = value;\n return this;\n }\n\n public setError(error: boolean, errorMsg?: string): this {\n const element = this.inputElement.getElement();\n if (error) {\n element.classList.add('form-input-error');\n\n if (!this.helperText && errorMsg) {\n this.helperText = new HelperText({ text: errorMsg });\n this.appendChild(this.helperText);\n } else if (this.helperText && errorMsg) {\n this.helperText.setText(errorMsg);\n }\n } else {\n element.classList.remove('form-input-error');\n\n if (this.helperText) {\n this.helperText.getElement().remove();\n this.helperText = null;\n }\n }\n\n return this;\n }\n\n public override addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): this {\n this.inputElement.getElement().addEventListener(type, listener, options);\n return this;\n }\n}\n","import type { CheckoutProfile } from '../../../types/checkout/CheckoutProfile.type';\nimport { Input } from '../../common/Input';\n\ninterface CardholderSectionOptions {\n value: string;\n onChange: (event: Event) => void;\n onBlur: (event: Event) => void;\n error: boolean;\n errorMsg?: string;\n checkoutProfile: CheckoutProfile;\n translationFunc: (key: string) => string;\n}\n\nexport class CardholderSection {\n private input: Input;\n\n constructor(options: CardholderSectionOptions) {\n const {\n value,\n onChange,\n onBlur,\n error,\n errorMsg,\n checkoutProfile,\n translationFunc,\n } = options;\n\n this.input = new Input({\n name: 'name',\n label: translationFunc('cardholderNameLabel'),\n error,\n errorMsg,\n styles: {\n color: checkoutProfile.styles.textColor,\n borderRadius: `${checkoutProfile.styles.borderRadius}px`,\n fontSize: checkoutProfile.styles.fontSize,\n fontFamily: checkoutProfile.styles.fontFamily,\n },\n placeholder: translationFunc('cardholderNamePlaceholder'),\n value,\n onChange: (event: Event) => {\n // Apply trimStart on change\n this.trim();\n // Then call the original onChange handler\n onChange(event);\n },\n });\n\n // Add blur event listener\n this.input.addEventListener('blur', (event: Event) => {\n onBlur(event);\n });\n }\n\n public getValue(): string {\n return this.input.getValue();\n }\n\n public setValue(value: string): this {\n this.input.setValue(value);\n return this;\n }\n\n public trim(): this {\n const trimmedValue = this.getValue().trimStart();\n this.setValue(trimmedValue);\n return this;\n }\n\n public setError(error: boolean, errorMsg?: string): this {\n this.input.setError(error, errorMsg);\n return this;\n }\n\n public getElement(): HTMLDivElement {\n return this.input.getElement();\n }\n\n public appendTo(parent: HTMLElement): this {\n this.input.appendTo(parent);\n return this;\n }\n}\n","import '../../../assets/styles/card-elements.css';\nimport { Component } from '../../Component';\n\ninterface CardCvvElementOptions {\n styles: { borderRadius: number };\n isFocused: boolean;\n isLoading: boolean;\n}\n\nexport class CardCvvElement extends Component<HTMLDivElement> {\n constructor(options: CardCvvElementOptions) {\n super('div', []);\n\n // Create container for the card element\n const container = document.createElement('div');\n container.className = options.isLoading ? 'loading' : '';\n container.style.borderRadius = `0px 0px ${options.styles.borderRadius}px 0px`;\n\n const cardElement = document.createElement('div');\n cardElement.id = 'card-cvv-element';\n cardElement.className = `card-element ${options.isFocused ? 'card-element-focus' : ''}`;\n cardElement.style.zIndex = options.isFocused ? '2' : '0';\n\n container.appendChild(cardElement);\n this.getElement().appendChild(container);\n }\n\n public setFocused(isFocused: boolean): this {\n const cardElement = this.getElement().querySelector('#card-cvv-element');\n if (cardElement) {\n if (isFocused) {\n cardElement.classList.add('card-element-focus');\n cardElement.setAttribute('style', 'z-index: 2');\n } else {\n cardElement.classList.remove('card-element-focus');\n cardElement.setAttribute('style', 'z-index: 0');\n }\n }\n return this;\n }\n\n public setLoading(isLoading: boolean): this {\n const container = this.getElement().querySelector('div');\n if (container) {\n if (isLoading) {\n container.classList.add('loading');\n } else {\n container.classList.remove('loading');\n }\n }\n return this;\n }\n}\n","export default \"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%23306FC5;'%20d='M512,402.281c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.997,0,402.281V109.717%20c0-16.715,13.55-30.266,30.265-30.266h451.47c16.716,0,30.265,13.551,30.265,30.266V402.281L512,402.281z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.281V109.717%20c0-16.715,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.001,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.997,21.517,402.281z'/%3e%3cg%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='74.59,220.748%2089.888,220.748%2082.241,201.278%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='155.946,286.107%20155.946,295.148%20181.675,295.148%20181.675,304.885%20155.946,304.885%20155.946,315.318%20184.455,315.318%20197.666,300.712%20185.151,286.107%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='356.898,201.278%20348.553,220.748%20364.548,220.748%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='230.348,320.875%20230.348,281.241%20212.268,300.712%20'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M264.42,292.368c-0.696-4.172-3.48-6.261-7.654-6.261h-14.599v12.516h15.299%20C261.637,298.624,264.42,296.539,264.42,292.368z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M313.09,297.236c1.391-0.697,2.089-2.785,2.089-4.867c0.696-2.779-0.698-4.172-2.089-4.868%20c-1.387-0.696-3.476-0.696-5.559-0.696h-13.91v11.127h13.909C309.613,297.932,311.702,297.932,313.09,297.236z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M413.217,183.198v8.344l-4.169-8.344H376.37v8.344l-4.174-8.344h-44.502%20c-7.648,0-13.909,1.392-19.469,4.173v-4.173h-31.289v0.696v3.477c-3.476-2.78-7.648-4.173-13.211-4.173h-111.95l-7.652,17.384%20l-7.647-17.384h-25.031h-10.431v8.344l-3.477-8.344h-0.696H66.942l-13.909,32.68L37.042,251.34l-0.294,0.697h0.294h35.463h0.444%20l0.252-0.697l4.174-10.428h9.039l4.172,11.125h40.326v-0.697v-7.647l3.479,8.343h20.163l3.475-8.343v7.647v0.697h15.993h79.965%20h0.696v-18.08h1.394c1.389,0,1.389,0,1.389,2.087v15.297h50.065v-4.172c4.172,2.089,10.426,4.172,18.771,4.172h20.863l4.172-11.123%20h9.732l4.172,11.123h40.328v-6.952v-3.476l6.261,10.428h1.387h0.698h30.595v-68.143h-31.291l0,0H413.217z%20M177.501,241.609h-6.955%20h-4.171v-4.169v-34.076l-0.696,1.595v-0.019l-16.176,36.669h-0.512h-3.719h-6.017l-16.687-38.245v38.245h-23.64l-4.867-10.43%20H70.417l-4.868,10.43H53.326l20.57-48.675h17.382l19.469,46.587v-46.587h4.171h14.251l0.328,0.697h0.024l8.773,19.094l6.3,14.306%20l0.223-0.721l13.906-33.375H177.5v48.674H177.501L177.501,241.609z%20M225.481,203.364h-27.119v9.039h26.423v9.734h-26.423v9.738%20h27.119v10.427h-38.939v-49.367h38.939V203.364L225.481,203.364z%20M275.076,221.294c0.018,0.016,0.041,0.027,0.063,0.042%20c0.263,0.278,0.488,0.557,0.68,0.824c1.332,1.746,2.409,4.343,2.463,8.151c0.004,0.066,0.007,0.131,0.011,0.197%20c0,0.038,0.007,0.071,0.007,0.11c0,0.022-0.002,0.039-0.002,0.06c0.016,0.383,0.026,0.774,0.026,1.197v9.735h-10.428v-5.565%20c0-2.781,0-6.954-2.089-9.735c-0.657-0.657-1.322-1.09-2.046-1.398c-1.042-0.675-3.017-0.686-6.295-0.686h-12.52v17.384h-11.818%20v-48.675h26.425c6.254,0,10.428,0,13.906,2.086c3.407,2.046,5.465,5.439,5.543,10.812c-0.161,7.4-4.911,11.46-8.326,12.829%20C270.676,218.662,272.996,219.129,275.076,221.294z%20M298.491,241.609h-11.822v-48.675h11.822V241.609z%20M434.083,241.609h-15.3%20l-22.25-36.855v30.595l-0.073-0.072v6.362h-11.747v-0.029h-11.822l-4.172-10.43H344.38l-4.172,11.123h-13.211%20c-5.559,0-12.517-1.389-16.687-5.561c-4.172-4.172-6.256-9.735-6.256-18.773c0-6.953,1.389-13.911,6.256-19.472%20c3.474-4.175,9.735-5.562,17.382-5.562h11.128v10.429h-11.128c-4.172,0-6.254,0.693-9.041,2.783%20c-2.082,2.085-3.474,6.256-3.474,11.123c0,5.564,0.696,9.04,3.474,11.821c2.091,2.089,4.87,2.785,8.346,2.785h4.867l15.991-38.243%20h6.957h10.428l19.472,46.587v-2.376v-15.705v-1.389v-27.116h17.382l20.161,34.07v-34.07h11.826v47.977h0.002L434.083,241.609%20L434.083,241.609z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M265.161,213.207c0.203-0.217,0.387-0.463,0.543-0.745c0.63-0.997,1.352-2.793,0.963-5.244%20c-0.016-0.225-0.057-0.433-0.105-0.634c-0.013-0.056-0.011-0.105-0.026-0.161l-0.007,0.001c-0.346-1.191-1.229-1.923-2.11-2.367%20c-1.394-0.693-3.48-0.693-5.565-0.693h-13.909v11.127h13.909c2.085,0,4.172,0,5.565-0.697c0.209-0.106,0.395-0.25,0.574-0.413%20l0.002,0.009C264.996,213.389,265.067,213.315,265.161,213.207z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M475.105,311.144c0-4.867-1.389-9.736-3.474-13.212v-31.289h-0.032v-2.089c0,0-29.145,0-33.483,0%20c-4.336,0-9.598,4.171-9.598,4.171v-4.171h-31.984c-4.87,0-11.124,1.392-13.909,4.171v-4.171h-57.016v2.089v2.081%20c-4.169-3.474-11.824-4.171-15.298-4.171h-37.549v2.089v2.081c-3.476-3.474-11.824-4.171-15.998-4.171H215.05l-9.737,10.431%20l-9.04-10.431h-2.911h-4.737h-54.93v2.089v5.493v62.651h61.19l10.054-10.057l8.715,10.057h0.698h35.258h1.598h0.696h0.692v-6.953%20v-9.039h3.479c4.863,0,11.124,0,15.991-2.089v17.382v1.394h31.291v-1.394V317.4h1.387c2.089,0,2.089,0,2.089,2.086v14.6v1.394%20h94.563c6.263,0,12.517-1.394,15.993-4.175v2.781v1.394h29.902c6.254,0,12.517-0.695,16.689-3.478%20c6.402-3.841,10.437-10.64,11.037-18.749c0.028-0.24,0.063-0.48,0.085-0.721l-0.041-0.039%20C475.087,312.043,475.105,311.598,475.105,311.144z%20M256.076,306.973h-13.91v2.081v4.174v4.173v7.649h-22.855l-13.302-15.299%20l-0.046,0.051l-0.65-0.748l-15.297,15.996h-44.501v-48.673h45.197l12.348,13.525l2.596,2.832l0.352-0.365l14.604-15.991h36.852%20c7.152,0,15.161,1.765,18.196,9.042c0.365,1.441,0.577,3.043,0.577,4.863C276.237,304.189,266.502,306.973,256.076,306.973z%20M325.609,306.276c1.389,2.081,2.085,4.867,2.085,9.041v9.732h-11.819v-6.256c0-2.786,0-7.65-2.089-9.739%20c-1.387-2.081-4.172-2.081-8.341-2.081H292.93v18.077h-11.82v-49.369h26.421c5.559,0,10.426,0,13.909,2.084%20c3.474,2.088,6.254,5.565,6.254,11.128c0,7.647-4.865,11.819-8.343,13.212C322.829,303.49,324.914,304.885,325.609,306.276z%20M373.589,286.107h-27.122v9.04h26.424v9.737h-26.424v9.736h27.122v10.429H334.65V275.68h38.939V286.107z%20M402.791,325.05h-22.252%20v-10.429h22.252c2.082,0,3.476,0,4.87-1.392c0.696-0.697,1.387-2.085,1.387-3.477c0-1.394-0.691-2.778-1.387-3.475%20c-0.698-0.695-2.091-1.391-4.176-1.391c-11.126-0.696-24.337,0-24.337-15.296c0-6.954,4.172-14.604,16.689-14.604h22.945v11.819%20h-21.554c-2.085,0-3.478,0-4.87,0.696c-1.387,0.697-1.387,2.089-1.387,3.478c0,2.087,1.387,2.783,2.778,3.473%20c1.394,0.697,2.783,0.697,4.172,0.697h6.259c6.259,0,10.43,1.391,13.211,4.173c2.087,2.087,3.478,5.564,3.478,10.43%20C420.869,320.179,414.611,325.05,402.791,325.05z%20M462.59,320.179c-2.778,2.785-7.648,4.871-14.604,4.871H425.74v-10.429h22.245%20c2.087,0,3.481,0,4.87-1.392c0.693-0.697,1.391-2.085,1.391-3.477c0-1.394-0.698-2.778-1.391-3.475%20c-0.696-0.695-2.085-1.391-4.172-1.391c-11.122-0.696-24.337,0-24.337-15.295c0-6.609,3.781-12.579,13.106-14.352%20c1.115-0.154,2.293-0.253,3.583-0.253h22.948v11.819h-15.3h-5.561h-0.696c-2.087,0-3.476,0-4.865,0.696%20c-0.7,0.697-1.396,2.089-1.396,3.478c0,2.087,0.696,2.783,2.785,3.473c1.389,0.697,2.78,0.697,4.172,0.697h0.691h5.565%20c3.039,0,5.337,0.375,7.44,1.114c1.926,0.697,8.302,3.549,9.728,10.994c0.124,0.78,0.215,1.594,0.215,2.495%20C466.761,313.925,465.37,317.401,462.59,320.179z'/%3e%3c/g%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%2334495E;'%20d='M512,402.282c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.996,0,402.282V109.717%20c0-16.716,13.55-30.266,30.265-30.266h451.469c16.716,0,30.265,13.551,30.265,30.266L512,402.282L512,402.282z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.282V109.717%20c0-16.716,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.003,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.996,21.517,402.282z'/%3e%3cpath%20style='fill:%23F26E21;'%20d='M309.389,255.801c0.041-9.636-3.572-19.286-10.843-26.558c-7.287-7.287-16.961-10.897-26.617-10.839%20c-0.046,0-0.091-0.003-0.139-0.003c-20.968,0-37.6,16.628-37.6,37.602c0,20.767,16.837,37.599,37.6,37.599%20c20.974,0,37.604-16.631,37.604-37.599C309.394,255.934,309.389,255.869,309.389,255.801z'/%3e%3cg%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M227.198,271.909c-5.62,5.626-10.807,7.824-16.394,7.943c-13.611-0.122-23.618-10.202-23.618-24.573%20c0-7.234,2.739-13.163,7.078-18.228l0,0c4.069-3.863,9.311-6.359,15.339-6.359c6.507,0,11.571,2.169,17.352,7.954v-16.631%20c-5.78-2.891-10.846-4.338-17.352-4.338c-9.192,0.657-17.859,4.371-24.507,10.203l0,0c-1.916,1.724-3.752,3.627-5.309,5.805%20c-4.856,6.294-7.791,14.001-7.791,22.32c0,20.967,16.637,36.875,37.606,36.875c0.102,0,0.203-0.009,0.302-0.01%20c0.141,0.002,0.28,0.01,0.42,0.01c5.784,0,10.85-1.443,17.357-4.336L227.198,271.909c-0.244,0.244,0.242,0.471,0,0.702V271.909z'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='356.863,228.033%20356.863,228.033%20340.487,268.295%20321.685,220.566%20306.502,220.566%20336.148,293.601%20344.102,293.601%20375.196,220.566%20360.013,220.566%20'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='380.983,252.384%20380.983,291.435%20420.033,291.435%20420.753,291.435%20420.753,279.861%20408.461,279.861%20395.445,279.861%20395.445,266.848%20395.445,260.342%20420.033,260.342%20420.033,248.045%20395.445,248.045%20395.445,232.861%20420.753,232.861%20420.753,220.566%20380.983,220.566%20'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M54.135,220.566H33.884v70.869h20.25c10.845,0,18.798-2.895,25.306-7.957%20c7.953-6.508,13.017-16.629,13.017-27.474C92.458,235.028,77.27,220.566,54.135,220.566z%20M70.765,274.08%20c-4.339,3.614-10.124,5.781-18.802,5.781h-4.339V232.86h3.615c8.678,0,14.463,1.446,18.803,5.783%20c5.061,4.336,7.955,10.848,7.955,17.358C78.72,262.509,75.828,269.737,70.765,274.08z'/%3e%3crect%20x='98.97'%20y='220.56'%20style='fill:%23E7E8E3;'%20width='13.739'%20height='70.867'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M147.415,248.045c-8.676-2.892-10.848-5.063-10.848-8.677c0-4.339,4.339-7.954,10.124-7.954%20c4.339,0,7.954,1.447,11.57,5.786l7.233-9.4c-5.787-5.064-13.015-7.953-20.97-7.953c-12.296,0-22.42,8.678-22.42,20.244%20c0,10.126,4.343,14.464,17.357,19.526c5.785,2.166,7.955,2.892,9.404,4.338c2.887,1.444,4.336,4.339,4.336,7.228%20c0,5.786-4.336,10.126-10.848,10.126c-6.514,0-12.294-3.615-15.187-9.401l-8.678,8.678c6.511,9.4,14.465,13.738,24.589,13.738%20c14.461,0,24.58-9.4,24.58-23.141C167.659,258.893,163.324,253.831,147.415,248.045z'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M459.804,261.783c10.843-2.166,16.63-9.4,16.63-20.244c0-13.014-9.402-20.973-25.308-20.973h-20.972%20v70.869h13.739V263.23h2.172l19.519,28.205h16.634L459.804,261.783z%20M448.23,253.105h-4.336v-21.691h4.336%20c8.678,0,13.742,3.614,13.742,10.85C461.972,249.492,456.909,253.105,448.23,253.105z'/%3e%3c/g%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20291.791%20291.791'%20xml:space='preserve'%3e%3cg%3e%3cpath%20style='fill:%23E2574C;'%20d='M182.298,145.895c0,50.366-40.801,91.176-91.149,91.176S0,196.252,0,145.895%20s40.811-91.176,91.149-91.176S182.298,95.538,182.298,145.895z'/%3e%3cpath%20style='fill:%23F4B459;'%20d='M200.616,54.719c-20.442,0-39.261,6.811-54.469,18.181l0.073,0.009%20c2.991,2.89,6.291,4.924,8.835,8.251l-18.965,0.301c-2.972,3-5.68,6.264-8.233,9.656H161.3c2.544,3.054,4.896,5.708,7.03,9.081%20h-46.536c-1.705,2.936-3.282,5.954-4.659,9.09h56.493c1.477,3.127,2.799,5.489,3.921,8.799h-63.76%20c-1.012,3.146-1.878,6.364-2.535,9.646h68.966c0.675,3.155,1.194,6.072,1.55,9.045h-71.884c-0.301,3-0.456,6.045-0.456,9.118%20h72.859c0,3.228-0.228,6.218-0.556,9.118h-71.847c0.31,3.091,0.766,6.127,1.368,9.118h68.856c-0.711,2.954-1.532,5.926-2.562,9.008%20h-63.969c0.966,3.118,2.143,6.145,3.428,9.099h56.621c-1.568,3.319-3.346,5.972-5.306,9.081h-46.691%20c1.842,3.191,3.875,6.236,6.081,9.154l33.589,0.501c-2.863,3.437-6.537,5.507-9.884,8.516c0.182,0.146-5.352-0.018-16.248-0.191%20c16.576,17.105,39.744,27.772,65.446,27.772c50.357,0,91.176-40.82,91.176-91.176S250.981,54.719,200.616,54.719z'/%3e%3c/g%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%20-140%20780%20780'%20enable-background='new%200%200%20780%20500'%20version='1.1'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40,0h700c22.092,0,40,17.909,40,40v420c0,22.092-17.908,40-40,40H40c-22.091,0-40-17.908-40-40V40%20C0,17.909,17.909,0,40,0z'%20fill='%230E4595'/%3e%3cpath%20d='m293.2%20348.73l33.361-195.76h53.36l-33.385%20195.76h-53.336zm246.11-191.54c-10.57-3.966-27.137-8.222-47.822-8.222-52.725%200-89.865%2026.55-90.18%2064.603-0.299%2028.13%2026.514%2043.822%2046.752%2053.186%2020.771%209.595%2027.752%2015.714%2027.654%2024.283-0.131%2013.121-16.586%2019.116-31.922%2019.116-21.357%200-32.703-2.967-50.227-10.276l-6.876-3.11-7.489%2043.823c12.463%205.464%2035.51%2010.198%2059.438%2010.443%2056.09%200%2092.5-26.246%2092.916-66.882%200.199-22.269-14.016-39.216-44.801-53.188-18.65-9.055-30.072-15.099-29.951-24.268%200-8.137%209.668-16.839%2030.557-16.839%2017.449-0.27%2030.09%203.535%2039.938%207.5l4.781%202.26%207.232-42.429m137.31-4.223h-41.232c-12.773%200-22.332%203.487-27.941%2016.234l-79.244%20179.4h56.031s9.16-24.123%2011.232-29.418c6.125%200%2060.555%200.084%2068.338%200.084%201.596%206.853%206.49%2029.334%206.49%2029.334h49.514l-43.188-195.64zm-65.418%20126.41c4.412-11.279%2021.26-54.723%2021.26-54.723-0.316%200.522%204.379-11.334%207.074-18.684l3.605%2016.879s10.219%2046.729%2012.354%2056.528h-44.293zm-363.3-126.41l-52.24%20133.5-5.567-27.13c-9.725-31.273-40.025-65.155-73.898-82.118l47.766%20171.2%2056.456-0.064%2084.004-195.39h-56.521'%20fill='%23ffffff'/%3e%3cpath%20d='m146.92%20152.96h-86.041l-0.681%204.073c66.938%2016.204%20111.23%2055.363%20129.62%20102.41l-18.71-89.96c-3.23-12.395-12.597-16.094-24.186-16.527'%20fill='%23F2AE14'/%3e%3c/svg%3e\"","import '../../../assets/styles/card-elements.css';\nimport { Component } from '../../Component';\n\n// Import SVG assets properly\nimport amexSvg from '../../../assets/amex.svg';\nimport discoverSvg from '../../../assets/discover.svg';\nimport mastercardSvg from '../../../assets/mastercard.svg';\nimport visaSvg from '../../../assets/visa.svg';\n\nimport type { CardTypes } from '../../../types/payment/CardType.type';\n\n// Card type definitions\ninterface Card {\n type: CardTypes;\n imgSrc: string;\n}\n\n// Define card images with properly imported SVG assets\nconst cards: Card[] = [\n {\n type: 'visa',\n imgSrc: visaSvg,\n },\n {\n type: 'masterCard',\n imgSrc: mastercardSvg,\n },\n {\n type: 'americanExpress',\n imgSrc: amexSvg,\n },\n {\n type: 'discover',\n imgSrc: discoverSvg,\n },\n];\n\ninterface CardNumberElementOptions {\n cardType: CardTypes;\n isFocused: boolean;\n isLoading: boolean;\n label: string;\n styles: {\n color: string;\n fontSize: number;\n borderRadius: number;\n };\n}\n\nexport class CardNumberElement extends Component<HTMLDivElement> {\n private cardType: CardTypes;\n\n constructor(options: CardNumberElementOptions) {\n super('div', []);\n\n this.cardType = options.cardType;\n\n // Create label for the card number field\n const labelElement = document.createElement('label');\n labelElement.setAttribute('for', 'cardNumber');\n labelElement.textContent = options.label;\n labelElement.style.color = options.styles.color;\n labelElement.style.fontSize = `${options.styles.fontSize}px`;\n labelElement.style.display = 'block';\n labelElement.style.marginBottom = '6px';\n\n this.getElement().appendChild(labelElement);\n\n // Create container for the card element\n const container = document.createElement('div');\n container.className = options.isLoading ? 'loading' : '';\n container.style.borderRadius = `${options.styles.borderRadius}px ${options.styles.borderRadius}px 0px 0px`;\n\n // Create the card element div\n const cardElement = document.createElement('div') as HTMLDivElement;\n cardElement.id = 'card-element';\n cardElement.className = `card-element ${options.isFocused ? 'card-element-focus' : ''}`;\n // Set z-index based on focus state\n cardElement.style.zIndex = options.isFocused ? '2' : '0';\n\n // Create container for card icons\n const cardsPositionDiv = document.createElement('div');\n cardsPositionDiv.className = 'cards-position';\n\n // Add appropriate card icons\n if (options.cardType === 'unknown') {\n // Show all card icons\n cards.forEach((card) => {\n cardsPositionDiv.appendChild(this.createCardIcon(card));\n });\n } else {\n // Show only the selected card type\n const selectedCard = cards.find((card) => card.type === options.cardType);\n if (selectedCard) {\n cardsPositionDiv.appendChild(this.createCardIcon(selectedCard));\n }\n }\n\n // Assemble the elements\n cardElement.appendChild(cardsPositionDiv);\n container.appendChild(cardElement);\n this.getElement().appendChild(container);\n }\n\n private createCardIcon(card: Card): HTMLDivElement {\n const cardIconDiv = document.createElement('div');\n cardIconDiv.className = 'card-icon';\n\n const img = document.createElement('img');\n img.src = card.imgSrc;\n\n cardIconDiv.appendChild(img);\n return cardIconDiv;\n }\n\n public setFocused(isFocused: boolean): this {\n const cardElement = this.getElement().querySelector(\n '#card-element',\n ) as HTMLDivElement;\n if (cardElement) {\n if (isFocused) {\n cardElement.classList.add('card-element-focus');\n cardElement.style.zIndex = '2';\n } else {\n cardElement.classList.remove('card-element-focus');\n cardElement.style.zIndex = '0';\n }\n }\n return this;\n }\n\n public setLoading(isLoading: boolean): this {\n const container = this.getElement().querySelector('div');\n if (container) {\n if (isLoading) {\n container.classList.add('loading');\n } else {\n container.classList.remove('loading');\n }\n }\n return this;\n }\n\n public updateCardType(newCardType: CardTypes): this {\n if (\n newCardType === undefined &&\n this.cardType &&\n this.cardType !== 'unknown'\n ) {\n // Log that we are ignoring the undefined update to preserve the valid card type\n\n return this; // Do not proceed with the update\n }\n\n const effectiveNewCardType =\n newCardType === undefined ? 'unknown' : newCardType;\n\n // If the effective new card type is the same as the current one, no change needed.\n if (this.cardType === effectiveNewCardType) {\n return this;\n }\n\n this.cardType = effectiveNewCardType;\n\n const cardsPositionDiv = this.getElement().querySelector('.cards-position');\n\n if (cardsPositionDiv) {\n // Clear existing card icons\n cardsPositionDiv.innerHTML = '';\n\n // Add appropriate card icons\n if (this.cardType === 'unknown') {\n // Show all card icons\n cards.forEach((card) => {\n cardsPositionDiv.appendChild(this.createCardIcon(card));\n });\n } else {\n // Show only the selected card type\n const selectedCard = cards.find((card) => card.type === this.cardType);\n if (selectedCard) {\n cardsPositionDiv.appendChild(this.createCardIcon(selectedCard));\n } else {\n cards.forEach((card) => {\n cardsPositionDiv.appendChild(this.createCardIcon(card));\n });\n }\n }\n }\n\n return this;\n }\n}\n","import type { CheckoutProfile } from '../../../types/checkout/CheckoutProfile.type';\nimport type { CardTypes } from '../../../types/payment/CardType.type';\nimport { HelperText } from '../../common/HelperText';\nimport { Input } from '../../common/Input';\nimport { Component } from '../../Component';\nimport { CardCvvElement } from '../card-elements/CardCvvElement';\nimport { CardNumberElement } from '../card-elements/CardNumberElement';\n\ninterface CardSectionOptions {\n checkoutProfile: CheckoutProfile;\n isLoading: boolean;\n isFocused: boolean;\n isCvvFocused: boolean;\n isCcValid: boolean;\n isCvvValid: boolean;\n cardType: CardTypes;\n cardExpiry: string;\n cardExpiryError?: string;\n cardExpiryTouched: boolean;\n onChange: (event: Event) => void;\n onBlur: (event: Event) => void;\n translationFunc: (key: string) => string;\n}\n\nexport class CardSection extends Component<HTMLDivElement> {\n private cardNumber: CardNumberElement;\n private cardExpiry: Input;\n private cardCvv: CardCvvElement;\n private validationMessages: Map<string, HelperText> = new Map();\n\n constructor(options: CardSectionOptions) {\n super('div', []);\n\n const {\n checkoutProfile,\n isLoading,\n isFocused,\n isCvvFocused,\n isCcValid,\n isCvvValid,\n cardType,\n cardExpiry,\n cardExpiryError,\n cardExpiryTouched,\n onChange,\n onBlur,\n translationFunc,\n } = options;\n\n // Create the card grid container\n const cardGrid = document.createElement('div');\n cardGrid.className = 'card-grid';\n\n // Create card number element\n this.cardNumber = new CardNumberElement({\n styles: {\n color: checkoutProfile.styles.textColor,\n fontSize: checkoutProfile.styles.fontSize,\n borderRadius: checkoutProfile.styles.borderRadius,\n },\n label: translationFunc('cardInformation'),\n isLoading,\n isFocused,\n cardType,\n });\n\n // Add the card number element to the card grid\n cardGrid.appendChild(this.cardNumber.getElement());\n\n // Create the card details container\n const cardDetails = document.createElement('div');\n cardDetails.className = 'card-details';\n\n // Create card expiry input\n this.cardExpiry = new Input({\n name: 'cardExpiry',\n placeholder: translationFunc('cardExpiry'),\n error: Boolean(cardExpiryError && cardExpiryTouched),\n errorMsg: cardExpiryError,\n value: cardExpiry,\n onChange: (event: Event) => {\n // Trim the value first\n this.trimCardExpiry();\n // Then call the original onChange handler\n onChange(event);\n },\n styles: {\n color: checkoutProfile.styles.textColor,\n borderRadius: `0px 0px 0px ${checkoutProfile.styles.borderRadius}px`,\n fontSize: checkoutProfile.styles.fontSize,\n fontFamily: checkoutProfile.styles.fontFamily,\n },\n });\n\n // Add blur event listener\n this.cardExpiry.addEventListener('blur', onBlur);\n\n // Add keydown event listener to allow only numbers\n this.cardExpiry.addEventListener('keydown', (event: Event) => {\n const keyEvent = event as KeyboardEvent;\n const allowedKeys = [\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Tab',\n ];\n\n // Allow control keys and numeric keys only\n if (!allowedKeys.includes(keyEvent.key) && !/^\\d$/.test(keyEvent.key)) {\n keyEvent.preventDefault();\n }\n });\n\n // Add additional inline styles for card expiry\n const cardExpiryElement = this.cardExpiry.getElement();\n cardExpiryElement.style.height = '100%';\n\n // Create wrapper for CVV element\n const cvvWrapper = document.createElement('div');\n cvvWrapper.className = 'input-wrapper';\n\n // Create card CVV element\n this.cardCvv = new CardCvvElement({\n styles: {\n borderRadius:\n typeof checkoutProfile.styles.borderRadius === 'number'\n ? checkoutProfile.styles.borderRadius\n : 0,\n },\n isLoading,\n isFocused: isCvvFocused,\n });\n\n // Add card CVV to wrapper\n cvvWrapper.appendChild(this.cardCvv.getElement());\n\n // Add card expiry and CVV to card details\n cardDetails.appendChild(this.cardExpiry.getElement());\n cardDetails.appendChild(cvvWrapper);\n\n // Add card details to card grid\n cardGrid.appendChild(cardDetails);\n\n // Add card grid to main element\n this.getElement().appendChild(cardGrid);\n\n // Add validation messages if needed\n // Note: cardExpiry errors are handled by the Input component itself\n if (isFocused && !isCcValid) {\n const ccHelperText = new HelperText({\n text: translationFunc('validation.cardNumberInvalid'),\n });\n this.validationMessages.set('cardNumber', ccHelperText);\n this.appendChild(ccHelperText);\n }\n\n if (isCvvFocused && !isCvvValid) {\n const cvvHelperText = new HelperText({\n text: translationFunc('validation.cardSecurityFormat'),\n });\n this.validationMessages.set('cardCvv', cvvHelperText);\n this.appendChild(cvvHelperText);\n }\n }\n\n public updateCardType(cardType: CardTypes): this {\n this.cardNumber.updateCardType(cardType);\n return this;\n }\n\n public updateCardExpiry(\n value: string,\n error?: string,\n touched?: boolean,\n ): this {\n // Update the input value\n this.cardExpiry.setValue(value);\n\n // Update error state directly on the Input component\n // which will handle displaying/removing the error message\n if (error && touched) {\n this.cardExpiry.setError(true, error);\n } else {\n this.cardExpiry.setError(false);\n }\n\n return this;\n }\n\n public getCardExpiryValue(): string {\n return this.cardExpiry.getValue();\n }\n\n public trimCardExpiry(): this {\n const trimmedValue = this.getCardExpiryValue().trim();\n this.cardExpiry.setValue(trimmedValue);\n return this;\n }\n\n public updateCardNumberValidation(\n isFocused: boolean,\n isValid: boolean,\n translationFunc: (key: string) => string,\n ): this {\n this.cardNumber.setFocused(isFocused);\n\n if (isFocused && !isValid) {\n // Add error message if it doesn't exist\n if (!this.validationMessages.has('cardNumber')) {\n const helperText = new HelperText({\n text: translationFunc('validation.cardNumberInvalid'),\n });\n this.validationMessages.set('cardNumber', helperText);\n this.appendChild(helperText);\n }\n } else {\n // Remove error message if it exists\n const helperText = this.validationMessages.get('cardNumber');\n if (helperText) {\n helperText.getElement().remove();\n this.validationMessages.delete('cardNumber');\n }\n }\n\n return this;\n }\n\n public updateCardCvvValidation(\n isFocused: boolean,\n isValid: boolean,\n translationFunc: (key: string) => string,\n ): this {\n this.cardCvv.setFocused(isFocused);\n\n if (isFocused && !isValid) {\n // Add error message if it doesn't exist\n if (!this.validationMessages.has('cardCvv')) {\n const helperText = new HelperText({\n text: translationFunc('validation.cardSecurityFormat'),\n });\n this.validationMessages.set('cardCvv', helperText);\n this.appendChild(helperText);\n }\n } else {\n // Remove error message if it exists\n const helperText = this.validationMessages.get('cardCvv');\n if (helperText) {\n helperText.getElement().remove();\n this.validationMessages.delete('cardCvv');\n }\n }\n\n return this;\n }\n\n public setLoading(isLoading: boolean): this {\n this.cardNumber.setLoading(isLoading);\n this.cardCvv.setLoading(isLoading);\n return this;\n }\n}\n","import type { CheckoutProfile } from '../../../types/checkout/CheckoutProfile.type';\nimport { Input } from '../../common/Input';\n\ninterface EmailFieldOptions {\n value: string;\n onChange: (event: Event) => void;\n onBlur: (event: Event) => void;\n error: boolean;\n errorMsg?: string;\n checkoutProfile: CheckoutProfile;\n translationFunc: (key: string) => string;\n}\n\nexport class EmailField {\n private input: Input;\n\n constructor(options: EmailFieldOptions) {\n const {\n value,\n onChange,\n onBlur,\n error,\n errorMsg,\n checkoutProfile,\n translationFunc,\n } = options;\n\n this.input = new Input({\n name: 'email',\n label: translationFunc('email'),\n error,\n errorMsg,\n styles: {\n color: checkoutProfile.styles.textColor,\n borderRadius: `${checkoutProfile.styles.borderRadius}px`,\n fontSize: checkoutProfile.styles.fontSize,\n fontFamily: checkoutProfile.styles.fontFamily,\n },\n placeholder: translationFunc('email'),\n type: 'email',\n value,\n // Wrap the original onChange to apply trim before calling it\n onChange: (event: Event) => {\n // Trim the value first\n this.trim();\n // Then call the original onChange handler\n onChange(event);\n },\n });\n\n // Add blur event listener\n this.input.addEventListener('blur', onBlur);\n }\n\n public getValue(): string {\n return this.input.getValue();\n }\n\n public setValue(value: string): this {\n this.input.setValue(value);\n return this;\n }\n\n public trim(): this {\n const trimmedValue = this.getValue().trim();\n this.setValue(trimmedValue);\n return this;\n }\n\n public setError(error: boolean, errorMsg?: string): this {\n this.input.setError(error, errorMsg);\n return this;\n }\n\n public getElement(): HTMLDivElement {\n return this.input.getElement();\n }\n\n public appendTo(parent: HTMLElement): this {\n this.input.appendTo(parent);\n return this;\n }\n}\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='101px'%20height='32'%20viewBox='0%200%20101%2032'%20preserveAspectRatio='xMinYMin%20meet'%3e%3cpath%20fill='%23003087'%20d='M%2012.237%202.8%20L%204.437%202.8%20C%203.937%202.8%203.437%203.2%203.337%203.7%20L%200.237%2023.7%20C%200.137%2024.1%200.437%2024.4%200.837%2024.4%20L%204.537%2024.4%20C%205.037%2024.4%205.537%2024%205.637%2023.5%20L%206.437%2018.1%20C%206.537%2017.6%206.937%2017.2%207.537%2017.2%20L%2010.037%2017.2%20C%2015.137%2017.2%2018.137%2014.7%2018.937%209.8%20C%2019.237%207.7%2018.937%206%2017.937%204.8%20C%2016.837%203.5%2014.837%202.8%2012.237%202.8%20Z%20M%2013.137%2010.1%20C%2012.737%2012.9%2010.537%2012.9%208.537%2012.9%20L%207.337%2012.9%20L%208.137%207.7%20C%208.137%207.4%208.437%207.2%208.737%207.2%20L%209.237%207.2%20C%2010.637%207.2%2011.937%207.2%2012.637%208%20C%2013.137%208.4%2013.337%209.1%2013.137%2010.1%20Z'/%3e%3cpath%20fill='%23003087'%20d='M%2035.437%2010%20L%2031.737%2010%20C%2031.437%2010%2031.137%2010.2%2031.137%2010.5%20L%2030.937%2011.5%20L%2030.637%2011.1%20C%2029.837%209.9%2028.037%209.5%2026.237%209.5%20C%2022.137%209.5%2018.637%2012.6%2017.937%2017%20C%2017.537%2019.2%2018.037%2021.3%2019.337%2022.7%20C%2020.437%2024%2022.137%2024.6%2024.037%2024.6%20C%2027.337%2024.6%2029.237%2022.5%2029.237%2022.5%20L%2029.037%2023.5%20C%2028.937%2023.9%2029.237%2024.3%2029.637%2024.3%20L%2033.037%2024.3%20C%2033.537%2024.3%2034.037%2023.9%2034.137%2023.4%20L%2036.137%2010.6%20C%2036.237%2010.4%2035.837%2010%2035.437%2010%20Z%20M%2030.337%2017.2%20C%2029.937%2019.3%2028.337%2020.8%2026.137%2020.8%20C%2025.037%2020.8%2024.237%2020.5%2023.637%2019.8%20C%2023.037%2019.1%2022.837%2018.2%2023.037%2017.2%20C%2023.337%2015.1%2025.137%2013.6%2027.237%2013.6%20C%2028.337%2013.6%2029.137%2014%2029.737%2014.6%20C%2030.237%2015.3%2030.437%2016.2%2030.337%2017.2%20Z'/%3e%3cpath%20fill='%23003087'%20d='M%2055.337%2010%20L%2051.637%2010%20C%2051.237%2010%2050.937%2010.2%2050.737%2010.5%20L%2045.537%2018.1%20L%2043.337%2010.8%20C%2043.237%2010.3%2042.737%2010%2042.337%2010%20L%2038.637%2010%20C%2038.237%2010%2037.837%2010.4%2038.037%2010.9%20L%2042.137%2023%20L%2038.237%2028.4%20C%2037.937%2028.8%2038.237%2029.4%2038.737%2029.4%20L%2042.437%2029.4%20C%2042.837%2029.4%2043.137%2029.2%2043.337%2028.9%20L%2055.837%2010.9%20C%2056.137%2010.6%2055.837%2010%2055.337%2010%20Z'/%3e%3cpath%20fill='%23009cde'%20d='M%2067.737%202.8%20L%2059.937%202.8%20C%2059.437%202.8%2058.937%203.2%2058.837%203.7%20L%2055.737%2023.6%20C%2055.637%2024%2055.937%2024.3%2056.337%2024.3%20L%2060.337%2024.3%20C%2060.737%2024.3%2061.037%2024%2061.037%2023.7%20L%2061.937%2018%20C%2062.037%2017.5%2062.437%2017.1%2063.037%2017.1%20L%2065.537%2017.1%20C%2070.637%2017.1%2073.637%2014.6%2074.437%209.7%20C%2074.737%207.6%2074.437%205.9%2073.437%204.7%20C%2072.237%203.5%2070.337%202.8%2067.737%202.8%20Z%20M%2068.637%2010.1%20C%2068.237%2012.9%2066.037%2012.9%2064.037%2012.9%20L%2062.837%2012.9%20L%2063.637%207.7%20C%2063.637%207.4%2063.937%207.2%2064.237%207.2%20L%2064.737%207.2%20C%2066.137%207.2%2067.437%207.2%2068.137%208%20C%2068.637%208.4%2068.737%209.1%2068.637%2010.1%20Z'/%3e%3cpath%20fill='%23009cde'%20d='M%2090.937%2010%20L%2087.237%2010%20C%2086.937%2010%2086.637%2010.2%2086.637%2010.5%20L%2086.437%2011.5%20L%2086.137%2011.1%20C%2085.337%209.9%2083.537%209.5%2081.737%209.5%20C%2077.637%209.5%2074.137%2012.6%2073.437%2017%20C%2073.037%2019.2%2073.537%2021.3%2074.837%2022.7%20C%2075.937%2024%2077.637%2024.6%2079.537%2024.6%20C%2082.837%2024.6%2084.737%2022.5%2084.737%2022.5%20L%2084.537%2023.5%20C%2084.437%2023.9%2084.737%2024.3%2085.137%2024.3%20L%2088.537%2024.3%20C%2089.037%2024.3%2089.537%2023.9%2089.637%2023.4%20L%2091.637%2010.6%20C%2091.637%2010.4%2091.337%2010%2090.937%2010%20Z%20M%2085.737%2017.2%20C%2085.337%2019.3%2083.737%2020.8%2081.537%2020.8%20C%2080.437%2020.8%2079.637%2020.5%2079.037%2019.8%20C%2078.437%2019.1%2078.237%2018.2%2078.437%2017.2%20C%2078.737%2015.1%2080.537%2013.6%2082.637%2013.6%20C%2083.737%2013.6%2084.537%2014%2085.137%2014.6%20C%2085.737%2015.3%2085.937%2016.2%2085.737%2017.2%20Z'/%3e%3cpath%20fill='%23009cde'%20d='M%2095.337%203.3%20L%2092.137%2023.6%20C%2092.037%2024%2092.337%2024.3%2092.737%2024.3%20L%2095.937%2024.3%20C%2096.437%2024.3%2096.937%2023.9%2097.037%2023.4%20L%20100.237%203.5%20C%20100.337%203.1%20100.037%202.8%2099.637%202.8%20L%2096.037%202.8%20C%2095.637%202.8%2095.437%203%2095.337%203.3%20Z'/%3e%3c/svg%3e\"","import PaypalIcon from '../../../assets/paypal.svg';\nimport '../../../assets/styles/paypal.css';\nimport type { CheckoutProfile } from '../../../types/checkout/CheckoutProfile.type';\nimport type { FormData } from '../../../types/common/FormData.type';\nimport { Component } from '../../Component';\n\ninterface PaypalButtonOptions {\n checkoutProfile: CheckoutProfile;\n formData?: FormData;\n onSubmit?: (data: { formData?: FormData }) => Promise<void>;\n}\n\nexport class PaypalButton extends Component<HTMLDivElement> {\n private formData?: FormData;\n private onSubmit?: (data: { formData?: FormData }) => Promise<void>;\n private isSubmitting = false;\n\n constructor(options: PaypalButtonOptions) {\n super('div', ['paypal']);\n\n const { formData, onSubmit } = options;\n\n this.formData = formData;\n this.onSubmit = onSubmit;\n\n // Set styles\n // this.getElement().style.borderRadius = `${checkoutProfile.styles.borderRadius}px`;\n this.getElement().style.cursor = onSubmit ? 'pointer' : 'default';\n this.getElement().style.opacity = '1';\n\n // Create PayPal icon container\n const iconContainer = document.createElement('div');\n iconContainer.className = 'paypal-icon-container';\n\n // Create the PayPal icon (image)\n const img = document.createElement('img');\n img.src = PaypalIcon;\n img.style.width = '69px';\n img.style.height = '22px';\n img.style.maxWidth = '100%';\n img.style.display = 'block';\n img.style.height = 'auto';\n\n iconContainer.appendChild(img);\n this.getElement().appendChild(iconContainer);\n\n // Add click event listener if onSubmit is provided\n if (onSubmit) {\n this.getElement().addEventListener('click', () => this.handleSubmit());\n }\n }\n\n private async handleSubmit(): Promise<void> {\n if (!this.onSubmit || this.isSubmitting) return;\n\n this.isSubmitting = true;\n this.getElement().style.opacity = '0.7';\n\n try {\n await this.onSubmit({ formData: this.formData });\n } catch (error) {\n console.error('Error during PayPal submission:', error);\n } finally {\n this.isSubmitting = false;\n this.getElement().style.opacity = '1';\n }\n }\n\n public updateFormData(formData: FormData): this {\n this.formData = formData;\n return this;\n }\n\n public setSubmitting(isSubmitting: boolean): this {\n this.isSubmitting = isSubmitting;\n this.getElement().style.opacity = isSubmitting ? '0.7' : '1';\n return this;\n }\n}\n","import type { CheckoutProfile } from '../../../types/checkout/CheckoutProfile.type';\nimport type { FormData } from '../../../types/common/FormData.type';\nimport { Component } from '../../Component';\nimport { PaypalButton } from '../../payment-methods/paypal/PaypalButton';\n\ninterface PaymentMethodsOptions {\n checkoutProfile: CheckoutProfile;\n formData?: FormData;\n onPaypalSubmit?: (data: { formData?: FormData }) => Promise<void>;\n}\nexport class PaymentMethods extends Component<HTMLDivElement> {\n private paymentMethods: Map<string, Component>;\n\n constructor(options: PaymentMethodsOptions) {\n const { checkoutProfile, formData, onPaypalSubmit } = options;\n\n // Check if there are any enabled payment methods before creating the component\n if (!checkoutProfile?.additionalPaymentMethods) {\n // Don't create the element at all if no payment methods are configured\n super('div', ['payment-methods']);\n this.paymentMethods = new Map();\n this.getElement().style.display = 'none';\n return;\n }\n\n // Get enabled payment methods\n const enabledMethods = Object.entries(\n checkoutProfile.additionalPaymentMethods,\n )\n .filter(([, config]) => config.enabled)\n .sort((a, b) => a[1].order - b[1].order); // Sort by order\n\n // If no enabled methods, don't create the element\n if (enabledMethods.length === 0) {\n super('div', ['payment-methods']);\n this.paymentMethods = new Map();\n this.getElement().style.display = 'none';\n return;\n }\n\n super('div', ['payment-methods']);\n this.paymentMethods = new Map();\n\n // Render each enabled payment method\n for (const [method] of enabledMethods) {\n switch (method) {\n case 'paypal': {\n if (onPaypalSubmit) {\n const paypalButton = new PaypalButton({\n checkoutProfile,\n formData,\n onSubmit: onPaypalSubmit,\n });\n\n this.paymentMethods.set('paypal', paypalButton);\n paypalButton.appendTo(this.getElement());\n }\n break;\n }\n // Add cases for other payment methods when they become available\n // case 'googlepay':\n // const googlePayButton = new GooglePayButton({ checkoutProfile });\n // this.paymentMethods.set('googlepay', googlePayButton);\n // googlePayButton.appendTo(this.getElement());\n // break;\n // case 'applepay':\n // const applePayButton = new ApplePayButton({ checkoutProfile });\n // this.paymentMethods.set('applepay', applePayButton);\n // applePayButton.appendTo(this.getElement());\n // break;\n }\n }\n }\n\n public updateFormData(formData: FormData): this {\n // Update PayPal button if it exists\n const paypalButton = this.paymentMethods.get('paypal') as\n | PaypalButton\n | undefined;\n if (paypalButton) {\n paypalButton.updateFormData(formData);\n }\n\n return this;\n }\n\n public hasVisiblePaymentMethods(): boolean {\n return (\n this.paymentMethods.size > 0 && this.getElement().style.display !== 'none'\n );\n }\n}\n","import '../../assets/styles/button.css';\nimport { Component } from '../Component';\n\ninterface ButtonStyles {\n backgroundColor: string;\n color: string;\n fontFamily: string;\n fontSize: number;\n borderRadius: number;\n}\n\ninterface ButtonOptions {\n styles: ButtonStyles;\n text: string;\n disabled?: boolean;\n}\n\nconst FULLY_ROUNDED_BORDER_RADIUS = 17;\n\nexport class Button extends Component<HTMLButtonElement> {\n private styles: ButtonStyles;\n private isHovered = false;\n\n constructor(options: ButtonOptions) {\n super('button', ['button'], {\n type: 'submit',\n disabled: options.disabled ? 'true' : 'false',\n });\n\n this.styles = options.styles;\n this.setText(options.text);\n\n if (options.disabled) {\n this.addClass('disabled');\n } else {\n this.addClass('valid');\n }\n\n // Apply styles\n this.applyStyles();\n\n // Add event listeners for hover effect\n this.addEventListener('mouseenter', () => this.handleMouseEnter());\n this.addEventListener('mouseleave', () => this.handleMouseLeave());\n }\n\n private applyStyles(): void {\n const element = this.getElement();\n\n element.style.backgroundColor = this.isHovered\n ? `color-mix(in srgb, ${this.styles.backgroundColor} 80%, transparent)`\n : this.styles.backgroundColor;\n\n if (element.disabled) {\n element.style.color = '#cccccc'; // Light grey text for disabled state\n } else {\n element.style.color = this.styles.color;\n }\n\n element.style.borderRadius =\n this.styles.borderRadius === FULLY_ROUNDED_BORDER_RADIUS\n ? '100vmax'\n : `${this.styles.borderRadius}px`;\n element.style.fontSize = `${this.styles.fontSize}px`;\n element.style.fontFamily = `${this.styles.fontFamily}, sans-serif`;\n }\n\n private handleMouseEnter(): void {\n this.isHovered = true;\n this.applyStyles();\n }\n\n private handleMouseLeave(): void {\n this.isHovered = false;\n this.applyStyles();\n }\n\n public setDisabled(disabled: boolean): this {\n this.getElement().disabled = disabled;\n\n if (disabled) {\n this.addClass('disabled');\n this.removeClass('valid');\n } else {\n this.removeClass('disabled');\n this.addClass('valid');\n }\n\n // Reapply styles to reflect the new disabled state\n this.applyStyles();\n\n return this;\n }\n}\n","import type { CheckoutProfile } from '../../../types/checkout/CheckoutProfile.type';\nimport { Button } from '../../common/Button';\n\ninterface SubmitButtonOptions {\n disabled: boolean;\n checkoutProfile: CheckoutProfile;\n translationFunc: (key: string) => string;\n}\n\nexport class SubmitButton {\n private button: Button;\n\n constructor(options: SubmitButtonOptions) {\n const { disabled, checkoutProfile, translationFunc } = options;\n\n this.button = new Button({\n text: translationFunc(\n `buttonTexts.${checkoutProfile?.layout.actionButton.translationKey}`,\n ),\n styles: {\n backgroundColor: checkoutProfile.styles.buttonColor,\n color: checkoutProfile.styles.buttonTextColor,\n fontFamily: checkoutProfile.styles.fontFamily,\n borderRadius: checkoutProfile.styles.borderRadius,\n fontSize: checkoutProfile.styles.buttonFontSize,\n },\n disabled,\n });\n }\n\n public getElement(): HTMLButtonElement {\n return this.button.getElement();\n }\n\n public setDisabled(disabled: boolean): this {\n this.button.setDisabled(disabled);\n return this;\n }\n\n public addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): this {\n this.button.addEventListener(type, listener, options);\n return this;\n }\n\n public appendTo(parent: HTMLElement): this {\n this.button.appendTo(parent);\n return this;\n }\n}\n","import '../../../assets/styles/form.css';\n\nimport {\n createCheckoutProfile,\n createForm,\n createIframeConfig,\n createTranslations,\n} from '../../../factories';\nimport type { Environment } from '../../../types/checkout/CheckoutConfig.type';\nimport type { CheckoutProfile } from '../../../types/checkout/CheckoutProfile.type';\nimport type { FormData } from '../../../types/common/FormData.type';\nimport type { Locale } from '../../../types/common/Locale.type.ts';\nimport type { TokenizeData } from '../../../types/common/TokenizeData.type';\nimport type { CardTypes } from '../../../types/payment/CardType.type';\nimport { appendGoogleFont, appendScript } from '../../../utils';\nimport { getCheckoutFormStyles } from '../../../utils/helpers/styleUtils';\nimport { Alert } from '../../common/Alert';\nimport { Spinner } from '../../common/Spinner';\nimport { Component } from '../../Component';\nimport { CardholderSection } from './CardholderSection';\nimport { CardSection } from './CardSection';\nimport { EmailField } from './EmailField';\nimport { PaymentMethods } from './PaymentMethods';\nimport { SubmitButton } from './SubmitButton';\n\n// Browser information\nexport const browserInfo = {\n userAgent: globalThis.navigator.userAgent,\n};\n\nexport interface FormOptions {\n apiKey: string;\n onSubmit: (data: {\n formData: FormData | null;\n tokenexData: TokenizeData | null;\n }) => Promise<void>;\n locale?: Locale | null;\n errorMsg?: string;\n profileId: string;\n container: HTMLElement;\n environment: Environment;\n onLoadingStateChange?: (isLoading: boolean) => void;\n}\n\n// Interface for iframe state\ninterface IframeState {\n isFocused: boolean;\n isCvvFocused: boolean;\n isCcValid: boolean;\n isCvvValid: boolean;\n possibleCardType: CardTypes;\n loadingIframe: boolean;\n}\n\n// TokenEx script URL\nconst TEST_TOKENEX_SCRIPT_URL =\n 'https://test-htp.tokenex.com/Iframe/Iframe-v3.min.js';\n\nconst PROD_TOKENEX_SCRIPT_URL =\n 'https://htp.tokenex.com/iframe/iframe-v3.min.js';\n\nexport class Form extends Component<HTMLFormElement> {\n private options: FormOptions;\n private isSubmitting = false;\n private scriptCleanup: (() => void) | undefined;\n private fontCleanup: (() => void) | undefined;\n\n // Form components\n private emailField?: EmailField;\n private cardSection?: CardSection;\n private cardholderSection?: CardholderSection;\n private submitButton?: SubmitButton;\n private paymentMethods?: PaymentMethods;\n private spinner?: Spinner;\n private alert?: Alert;\n\n // factories\n private formManager = createForm();\n private checkoutProfile: ReturnType<typeof createCheckoutProfile>;\n private translation = createTranslations();\n private iframeHook: ReturnType<typeof createIframeConfig> | undefined;\n\n constructor(options: FormOptions) {\n super('form', ['form-container']);\n\n this.options = options;\n\n // Initialize hooks\n this.checkoutProfile = createCheckoutProfile({\n apiKey: options.apiKey,\n profileId: options.profileId,\n environment: options.environment,\n });\n\n if (options.locale) {\n this.translation.setLocale(options.locale);\n }\n\n // Add submit event listener\n this.getElement().addEventListener('submit', this.handleSubmit);\n\n // Add keydown event listener to handle Enter key press\n this.getElement().addEventListener('keydown', this.handleKeyDown);\n\n // Subscribe to form state changes\n this.formManager.subscribe(this.handleFormStateChange);\n\n // Subscribe to profile state changes\n this.checkoutProfile.subscribe(this.handleProfileStateChange);\n\n // Initialize the form\n this.initializeForm();\n\n // Append to container\n this.appendTo(options.container);\n }\n\n private _getFormStateData() {\n const formState = this.formManager.getFormState();\n return {\n formData: formState.formData || {\n email: '',\n name: '',\n cardExpiry: '',\n },\n errors: formState.errors || {},\n touched: formState.touched || {},\n };\n }\n\n private handleFormStateChange = () => {\n // Update UI components when form state changes\n this.updateFormUI();\n };\n\n private handleProfileStateChange = (state: {\n checkoutProfile?: CheckoutProfile;\n isLoading: boolean;\n error: string | null;\n }) => {\n // Loading state for CardSection is now managed by iframe state only\n\n if (!state.isLoading) {\n this.setLoadingState(false);\n\n if (state.checkoutProfile) {\n try {\n // Load Google Font if specified in the checkout profile\n if (state.checkoutProfile.styles?.fontFamily) {\n const { cleanup } = appendGoogleFont({\n fontFamily: state.checkoutProfile.styles.fontFamily,\n });\n this.fontCleanup = cleanup;\n }\n\n // Initialize TokenEx iframe first, then render form components when ready\n this.initializeTokenExIframe();\n } catch {\n const errorMessage =\n state.error || 'Failed to load checkout profile data';\n\n this.setErrorMessage(errorMessage);\n }\n } else if (state.error) {\n // If there's an error and no profile, show error and make form visible\n this.setErrorMessage(state.error);\n }\n }\n };\n\n private applyFormContainerStyles(formContainerStyle: {\n fontFamily?: string;\n }): void {\n if (formContainerStyle.fontFamily) {\n this.getElement().style.fontFamily = formContainerStyle.fontFamily;\n }\n }\n\n private initializeTokenExIframe = () => {\n const profileState = this.checkoutProfile.getState();\n\n if (profileState.checkoutProfile && !this.iframeHook) {\n try {\n // Check if TokenEx is available\n if (!('TokenEx' in globalThis)) {\n // Retry after a short delay\n setTimeout(() => this.initializeTokenExIframe(), 500);\n return;\n }\n\n const { inputStyles, formContainerStyle } = getCheckoutFormStyles(\n profileState.checkoutProfile,\n );\n\n // Apply form container styles\n this.applyFormContainerStyles(formContainerStyle);\n\n this.iframeHook = createIframeConfig({\n apiKey: this.options.apiKey,\n checkoutProfile: profileState.checkoutProfile,\n inputStyles,\n setFormData: (formData: Partial<FormData>) => {\n this.formManager.setFormData(formData);\n },\n environment: this.options.environment,\n });\n\n this.iframeHook?.subscribe(this.handleIframeStateChange);\n\n // Render all form components at once now that iframe is ready\n this.renderFormComponents();\n } catch {\n this.setErrorMessage('Failed to initialize payment form');\n }\n } else if (!profileState.checkoutProfile) {\n console.error('Cannot initialize iframe: No checkout profile available');\n } else if (this.iframeHook) {\n console.log('TokenEx iframe already initialized');\n }\n };\n\n private handleIframeStateChange = (state: IframeState) => {\n // Update card section with iframe state\n if (this.cardSection) {\n this.cardSection.updateCardNumberValidation(\n state.isFocused,\n state.isCcValid,\n this.translation.t,\n );\n this.cardSection.updateCardCvvValidation(\n state.isCvvFocused,\n state.isCvvValid,\n this.translation.t,\n );\n this.cardSection.updateCardType(state.possibleCardType);\n\n // Set loading state based on iframe loading state\n this.cardSection.setLoading(state.loadingIframe);\n }\n\n // Update submit button\n if (this.submitButton) {\n this.submitButton.setDisabled(this.isFormDisabled());\n }\n };\n\n private createCardSection = (checkoutProfile: CheckoutProfile) => {\n // Only create CardSection if iframe is ready and CardSection doesn't exist\n if (this.iframeHook && !this.cardSection) {\n try {\n const { formData, errors, touched } = this._getFormStateData();\n const iframeState = this.iframeHook.getState();\n\n this.cardSection = new CardSection({\n checkoutProfile,\n isLoading: iframeState.loadingIframe,\n isFocused: iframeState.isFocused,\n isCvvFocused: iframeState.isCvvFocused,\n isCcValid: iframeState.isCcValid,\n isCvvValid: iframeState.isCvvValid,\n cardType: iframeState.possibleCardType,\n cardExpiry: formData.cardExpiry,\n cardExpiryError: errors.cardExpiry,\n cardExpiryTouched: Boolean(touched.cardExpiry),\n onChange: this.handleChange,\n onBlur: this.handleBlur,\n translationFunc: this.translation.t,\n });\n\n this.element.appendChild(this.cardSection.getElement());\n\n // Update form UI to reflect the new component\n this.updateFormUI();\n\n // Check if all required components are created for a complete form\n if (\n this.cardSection &&\n this.emailField &&\n this.cardholderSection &&\n this.submitButton\n ) {\n // Form is complete\n }\n } catch {\n this.setErrorMessage(`Card section temporarily unavailabl`);\n }\n }\n };\n\n private initializeForm(): void {\n this.setLoadingState(true);\n\n if (this.options.errorMsg) {\n this.setErrorMessage(this.options.errorMsg);\n }\n\n const tokenexScriptSrc =\n this.options.environment === 'test'\n ? TEST_TOKENEX_SCRIPT_URL\n : PROD_TOKENEX_SCRIPT_URL;\n // Load TokenEx script\n const { cleanup, isLoaded } = appendScript({\n scriptSrc: tokenexScriptSrc,\n });\n this.scriptCleanup = cleanup;\n\n // Wait for script to load before proceeding\n isLoaded\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n .then(() => {})\n .catch(() => {\n this.setLoadingState(false);\n this.setErrorMessage(\n 'Failed to load payment system. Please try again later.',\n );\n });\n }\n\n private renderFormComponents(): void {\n // Prevent re-rendering if components are already created\n if (this.emailField) {\n return;\n }\n\n try {\n const profileState = this.checkoutProfile.getState();\n if (!profileState.checkoutProfile) {\n this.setErrorMessage('Failed to load checkout configuration');\n return;\n }\n\n // Render all components in proper order\n this.createPaymentMethods(profileState.checkoutProfile);\n this.createEmailField(profileState.checkoutProfile);\n this.createCardSection(profileState.checkoutProfile);\n this.createCardholderSection(profileState.checkoutProfile);\n this.createSubmitButton(profileState.checkoutProfile);\n } catch {\n this.setErrorMessage('Failed to render checkout form components');\n }\n }\n\n private createPaymentMethods(checkoutProfile: CheckoutProfile): void {\n // Check if there are any enabled payment methods before creating the component\n if (!checkoutProfile?.additionalPaymentMethods) {\n return;\n }\n\n const enabledMethods = Object.entries(\n checkoutProfile.additionalPaymentMethods,\n ).filter(([, config]) => config.enabled);\n\n if (enabledMethods.length === 0) {\n return;\n }\n\n const { formData } = this._getFormStateData();\n\n this.paymentMethods = new PaymentMethods({\n checkoutProfile,\n formData,\n onPaypalSubmit: async () => {\n await this.handlePaypalSubmit();\n },\n });\n this.appendChild(this.paymentMethods);\n }\n\n private createEmailField(checkoutProfile: CheckoutProfile): void {\n const { formData, errors, touched } = this._getFormStateData();\n\n this.emailField = new EmailField({\n value: formData.email,\n onChange: this.handleChange,\n onBlur: this.handleBlur,\n error: Boolean(errors.email && touched.email),\n errorMsg: errors.email,\n checkoutProfile,\n translationFunc: this.translation.t,\n });\n this.element.appendChild(this.emailField.getElement());\n }\n\n private createCardholderSection(checkoutProfile: CheckoutProfile): void {\n const { formData, errors, touched } = this._getFormStateData();\n\n this.cardholderSection = new CardholderSection({\n value: formData.name,\n onChange: this.handleChange,\n onBlur: this.handleBlur,\n error: Boolean(errors.name && touched.name),\n errorMsg: errors.name,\n checkoutProfile,\n translationFunc: this.translation.t,\n });\n this.element.appendChild(this.cardholderSection.getElement());\n }\n\n private createSubmitButton(checkoutProfile: CheckoutProfile): void {\n this.submitButton = new SubmitButton({\n disabled: this.isFormDisabled(),\n checkoutProfile,\n translationFunc: this.translation.t,\n });\n this.element.appendChild(this.submitButton.getElement());\n }\n\n private handleChange = (event: Event): void => {\n const target = event.target as HTMLInputElement;\n const { name, value } = target;\n\n // Use form hook to handle changes\n this.formManager.handleChange(name as keyof FormData, value);\n };\n\n private handleBlur = (event: Event): void => {\n const target = event.target as HTMLInputElement;\n const { name, value } = target;\n\n // Use form hook to handle blur events\n this.formManager.handleBlur(name as keyof FormData, value);\n };\n\n private updateFormUI(): void {\n const formState = this.formManager.getFormState();\n const profileState = this.checkoutProfile.getState();\n\n if (!profileState.checkoutProfile) {\n return;\n }\n\n // Update payment methods if needed\n if (this.paymentMethods) {\n this.paymentMethods.updateFormData(formState.formData);\n }\n\n // Update email field if needed\n if (this.emailField) {\n this.emailField.setValue(formState.formData.email);\n this.emailField.setError(\n Boolean(formState.errors.email && formState.touched.email),\n formState.errors.email,\n );\n }\n\n // Update card section if needed\n if (this.cardSection) {\n this.cardSection.updateCardExpiry(\n formState.formData.cardExpiry,\n formState.errors.cardExpiry,\n Boolean(formState.touched.cardExpiry),\n );\n // Loading state is managed by iframe state changes, not here\n }\n\n // Update cardholder section if needed\n if (this.cardholderSection) {\n this.cardholderSection.setValue(formState.formData.name);\n this.cardholderSection.setError(\n Boolean(formState.errors.name && formState.touched.name),\n formState.errors.name,\n );\n }\n\n // Update submit button if needed\n if (this.submitButton) {\n this.submitButton.setDisabled(this.isFormDisabled());\n }\n }\n\n private isFormDisabled(): boolean {\n const formState = this.formManager.getFormState();\n\n let iframeState: IframeState = {\n isFocused: false,\n isCvvFocused: false,\n isCcValid: false,\n isCvvValid: false,\n possibleCardType: 'unknown' as CardTypes,\n loadingIframe: false,\n };\n\n // Get iframe state if available\n if (this.iframeHook) {\n iframeState = this.iframeHook.getState();\n }\n\n // Check if any field has an error\n const hasErrors = Object.keys(formState.errors).length > 0;\n\n // Check if the form is valid\n const isValid =\n // Only require card validation if CardSection exists\n (!this.cardSection ||\n (iframeState.isCcValid && iframeState.isCvvValid)) &&\n Boolean(formState.formData.email) &&\n Boolean(formState.formData.name) &&\n // Only require card expiry if CardSection exists\n (!this.cardSection || Boolean(formState.formData.cardExpiry));\n\n return hasErrors || !isValid || this.isSubmitting;\n }\n\n private setLoadingState(isLoading: boolean): void {\n // Only used during form initialization\n // If consumer provided a loading state handler, use it\n if (this.options.onLoadingStateChange) {\n this.options.onLoadingStateChange(isLoading);\n return;\n }\n\n // Otherwise, fall back to internal spinner implementation\n if (isLoading) {\n this.hideSpinner(); // Remove existing spinner before showing a new one\n this.spinner = new Spinner();\n this.appendChild(this.spinner);\n } else {\n this.hideSpinner();\n }\n }\n\n private showSpinner(text: string): void {\n this.hideSpinner(); // Remove existing spinner before showing a new one\n this.spinner = new Spinner({ text });\n this.appendChild(this.spinner);\n }\n\n private hideSpinner(): void {\n if (this.spinner) {\n this.spinner.getElement().remove();\n this.spinner = undefined;\n }\n }\n\n private handleSubmit = async (event: Event): Promise<void> => {\n event.preventDefault();\n\n if (this.isFormDisabled()) return;\n\n try {\n if (!this.iframeHook) {\n throw new Error('TokenEx iframe not initialized');\n }\n\n this.isSubmitting = true;\n this.updateFormUI();\n\n this.showSpinner(this.translation.t('loading'));\n\n await this.iframeHook.tokenize(async (tokenizeData: TokenizeData) => {\n try {\n await this.options.onSubmit({\n formData: this.formManager.getFormState().formData,\n tokenexData: tokenizeData,\n });\n\n this.hideSpinner();\n this.isSubmitting = false;\n this.updateFormUI();\n } catch {\n this.handleSubmitError(\n 'Payment processing failed. Please try again.',\n );\n }\n });\n } catch {\n this.handleSubmitError('Payment processing failed. Please try again.');\n }\n };\n\n private handleSubmitError(message: string): void {\n this.hideSpinner();\n this.isSubmitting = false;\n\n this.setErrorMessage(message);\n this.updateFormUI();\n }\n\n private handlePaypalSubmit = async (): Promise<void> => {\n this.isSubmitting = true;\n this.updateFormUI();\n\n this.showSpinner(this.translation.t('loading'));\n\n try {\n // In a real implementation, you would redirect to PayPal or process the payment\n\n // Call the onSubmit callback with PayPal data\n await this.options.onSubmit({\n formData: null,\n tokenexData: null, // No tokenization for PayPal\n });\n\n this.hideSpinner();\n this.isSubmitting = false;\n this.updateFormUI();\n } catch {\n this.setErrorMessage('PayPal processing failed. Please try again.');\n } finally {\n this.hideSpinner();\n this.isSubmitting = false;\n this.updateFormUI();\n }\n };\n\n // Public methods\n\n /**\n * Update the form error message\n */\n public setErrorMessage(message: string): this {\n if (this.alert) {\n this.alert.getElement().remove();\n this.alert = undefined;\n }\n this.alert = new Alert({ message });\n\n // Insert the alert at the beginning of the form instead of appending at the end\n this.element.insertBefore(this.alert.getElement(), this.element.firstChild);\n\n return this;\n }\n\n /**\n * Clean up resources when the form is destroyed\n */\n public override destroy(): void {\n // Clean up the TokenEx script\n if (this.scriptCleanup) {\n this.scriptCleanup();\n this.scriptCleanup = undefined;\n }\n\n // Clean up Google Font\n if (this.fontCleanup) {\n this.fontCleanup();\n this.fontCleanup = undefined;\n }\n\n // Clean up iframe resources\n if (this.iframeHook) {\n this.iframeHook.cleanup();\n }\n\n // Remove event listeners\n this.getElement().removeEventListener('submit', this.handleSubmit);\n this.getElement().removeEventListener('keydown', this.handleKeyDown);\n this.getElement().removeEventListener('keydown', this.handleKeyDown);\n\n // Clean up components\n if (this.emailField) {\n this.emailField.getElement().remove();\n this.emailField = undefined;\n }\n if (this.cardSection) {\n this.cardSection.getElement().remove();\n this.cardSection = undefined;\n }\n if (this.cardholderSection) {\n this.cardholderSection.getElement().remove();\n this.cardholderSection = undefined;\n }\n if (this.submitButton) {\n this.submitButton.getElement().remove();\n this.submitButton = undefined;\n }\n if (this.paymentMethods) {\n this.paymentMethods.getElement().remove();\n this.paymentMethods = undefined;\n }\n if (this.spinner) {\n this.spinner.getElement().remove();\n this.spinner = undefined;\n }\n if (this.alert) {\n this.alert.getElement().remove();\n this.alert = undefined;\n }\n\n // Remove self from DOM\n this.getElement().remove();\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n // If Enter key is pressed and the form is not disabled, submit the form\n if (event.key === 'Enter' && !this.isFormDisabled()) {\n // Prevent default only if we're not in a textarea where Enter should create a new line\n if (!(event.target instanceof HTMLTextAreaElement)) {\n event.preventDefault();\n this.handleSubmit(event);\n }\n }\n };\n}\n","import { Form } from '../../components/checkout/form/Form';\nimport type { Environment } from '../../types/checkout/CheckoutConfig.type';\nimport type { FormData } from '../../types/common/FormData.type';\nimport type { Locale } from '../../types/common/Locale.type';\nimport type { TokenizeData } from '../../types/common/TokenizeData.type';\n\ntype FormOptions = {\n locale?: Locale | null;\n apiKey: string;\n profileId: string;\n disableErrorMessages: boolean;\n environment: Environment;\n onLoadingStateChange?: (isLoading: boolean) => void;\n};\n\ntype SubmitHandler = (data: {\n formData: FormData | null;\n tokenexData: TokenizeData | null;\n}) => Promise<void>;\n\nexport class CheckoutFormManager {\n private container: HTMLElement | null = null;\n private options: FormOptions;\n private onSubmit: SubmitHandler;\n private form: Form | null = null;\n\n constructor(options: FormOptions, onSubmit: SubmitHandler) {\n this.options = options;\n this.onSubmit = onSubmit;\n }\n\n mount(container: HTMLElement): void {\n this.unmount(); // Clean up if already mounted\n this.container = container;\n\n this.renderForm();\n }\n\n update(props: { errorMsg?: string }): void {\n if (this.container && this.form) {\n if (this.form && props.errorMsg && !this.options.disableErrorMessages) {\n this.form.setErrorMessage(props.errorMsg);\n } else {\n this.renderForm(props.errorMsg);\n }\n }\n }\n\n private renderForm(errorMsg?: string): void {\n if (!this.container) return;\n\n // Clean up any existing form\n if (this.form) {\n this.form.destroy();\n this.form = null;\n }\n\n // Create and initialize the Form component\n this.form = new Form({\n apiKey: this.options.apiKey,\n onSubmit: this.onSubmit,\n locale: this.options.locale,\n errorMsg: this.options.disableErrorMessages ? undefined : errorMsg,\n profileId: this.options.profileId,\n container: this.container,\n environment: this.options.environment,\n onLoadingStateChange: this.options.onLoadingStateChange,\n });\n }\n\n unmount(): void {\n if (this.form) {\n this.form.destroy();\n this.form = null;\n }\n }\n}\n","import type { CheckoutState } from '../../types/checkout/CheckoutState.type';\n\ntype StateListener = (state: CheckoutState) => void;\n\nexport class CheckoutStateManager {\n private state: CheckoutState;\n private listeners: Set<StateListener> = new Set();\n\n constructor(initialState: CheckoutState) {\n this.state = initialState;\n }\n\n getState(): CheckoutState {\n return { ...this.state };\n }\n\n updateState(partialState: Partial<CheckoutState>): void {\n this.state = { ...this.state, ...partialState };\n this.notifyListeners();\n }\n\n subscribe(listener: StateListener): () => void {\n this.listeners.add(listener);\n\n // Return unsubscribe function\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n private notifyListeners(): void {\n const state = this.getState();\n this.listeners.forEach((listener) => listener(state));\n }\n}\n","import type { ApiError } from '../../types/api/ApiError.type';\nimport type { CheckoutConfig } from '../../types/checkout/CheckoutConfig.type';\nimport type { FormData } from '../../types/common/FormData.type';\nimport type { TokenizeData } from '../../types/common/TokenizeData.type';\nimport type { Payment } from '../../types/payment/Payment.type';\nimport { CheckoutAPIService } from './CheckoutAPI.service';\nimport { CheckoutFormManager } from './CheckoutForm.service';\nimport { CheckoutStateManager } from './CheckoutState.service';\n\nclass Checkout {\n private config: Required<CheckoutConfig>;\n private apiService: CheckoutAPIService;\n private formManager: CheckoutFormManager;\n private stateManager: CheckoutStateManager;\n\n constructor(config: CheckoutConfig) {\n this.config = this.validateConfig(config);\n\n this.apiService = new CheckoutAPIService(\n this.config.apiKey,\n this.config.environment,\n );\n\n this.stateManager = new CheckoutStateManager({\n mounted: false,\n form: null,\n });\n\n this.formManager = new CheckoutFormManager(\n {\n locale: this.config.locale,\n apiKey: this.config.apiKey,\n profileId: this.config.profileId,\n disableErrorMessages: this.config.disableErrorMessages,\n environment: this.config.environment,\n onLoadingStateChange: this.config.callbacks.onLoadingStateChange,\n },\n this.handleSubmit.bind(this),\n );\n }\n\n private validateConfig(config: CheckoutConfig): Required<CheckoutConfig> {\n if (!config.apiKey) {\n throw new Error('API key is required');\n }\n\n if (!config.environment || !['test', 'live'].includes(config.environment)) {\n throw new Error('Environment must be \"test\" or \"live\"');\n }\n\n return {\n profileId: config.profileId,\n apiKey: config.apiKey,\n checkoutKey: config.checkoutKey,\n paymentId: config.paymentId,\n returnUrl: config.returnUrl,\n environment: config.environment,\n locale: config.locale || null,\n disableErrorMessages: config.disableErrorMessages ?? false,\n manualActionHandling: config.manualActionHandling ?? false,\n callbacks: {\n onPaymentSucceeded: config.callbacks?.onPaymentSucceeded || undefined,\n onPaymentFailed: config.callbacks?.onPaymentFailed || undefined,\n onActionRequired: config.callbacks?.onActionRequired || undefined,\n onLoadingStateChange:\n config.callbacks?.onLoadingStateChange || undefined,\n },\n };\n }\n\n public mount(containerId: string): this {\n const container = document.querySelector(containerId);\n\n if (!container) {\n throw new Error(`Container ${containerId} not found`);\n }\n\n const formContainer = document.createElement('div');\n container.appendChild(formContainer);\n\n this.stateManager.updateState({\n form: formContainer,\n mounted: true,\n });\n\n this.formManager.mount(formContainer);\n\n return this;\n }\n\n public unmount(): void {\n const { mounted } = this.stateManager.getState();\n if (!mounted) {\n return;\n }\n\n // Schedule unmount for the next tick to avoid React rendering conflicts\n Promise.resolve().then(() => {\n this.formManager.unmount();\n\n const { form } = this.stateManager.getState();\n if (form) {\n form.remove();\n }\n\n this.stateManager.updateState({\n form: null,\n mounted: false,\n });\n });\n }\n\n private async handleSubmit({\n tokenexData,\n formData,\n }: {\n formData: FormData | null;\n tokenexData: TokenizeData | null;\n }): Promise<void> {\n try {\n const authorizedPayment = await this.apiService.authorizePayment({\n checkoutKey: this.config.checkoutKey,\n formData: formData || null,\n token: tokenexData?.token || null,\n paymentId: this.config.paymentId,\n returnUrl: this.config.returnUrl,\n });\n\n this.handlePaymentResponse(authorizedPayment);\n } catch (error) {\n this.handleAuthorizationError(error as ApiError);\n }\n }\n\n private handlePaymentResponse(payment: Payment): void {\n if (payment.latestTransaction.status === 'authorized') {\n this.config.callbacks.onPaymentSucceeded?.(\n payment.latestTransaction.status,\n );\n }\n\n if (payment.latestTransaction.status === 'failed') {\n this.config.callbacks.onPaymentFailed?.(payment.latestTransaction.status);\n }\n\n if (payment.status === 'requires_action') {\n const { redirectUrl } = payment.action;\n\n if (this.config.manualActionHandling) {\n this.config.callbacks.onActionRequired?.(redirectUrl);\n } else {\n globalThis.location.href = redirectUrl;\n }\n }\n }\n\n private handleAuthorizationError(error: ApiError): void {\n // Call the error callback regardless of error status\n this.config.callbacks.onPaymentFailed?.(error.details?.message);\n\n // Update the form with the error message for all error types\n const { form } = this.stateManager.getState();\n if (form) {\n this.formManager.update({ errorMsg: error.details?.message });\n }\n }\n}\n\nexport { Checkout };\n","// Import the main Checkout class\nexport { Checkout as OdusCheckout } from './services/checkout/Checkout.service';\n\n// Export type definitions\nexport type { CheckoutConfig } from './types/checkout/CheckoutConfig.type';\nexport type { CheckoutInstance } from './types/checkout/CheckoutInstance.type';\n\nexport { default as deLocale } from './locales/de.json';\nexport { default as enLocale } from './locales/en.json';\nexport { default as esLocale } from './locales/es.json';\nexport { default as frLocale } from './locales/fr.json';\nexport { default as plLocale } from './locales/pl.json';\nexport { default as ptLocale } from './locales/pt.json';\n\nimport { Checkout } from './services/checkout/Checkout.service';\n// Expose OdusCheckout to the global object\nif (typeof globalThis !== 'undefined') {\n (globalThis as { OdusCheckout?: typeof Checkout }).OdusCheckout = Checkout;\n}\n"],"names":["getBaseUrl","environment","splitName","name","firstName","restNames","lastName","CheckoutAPIService","apiKey","browserInfo","endpoint","method","body","customHeaders","headers","response","errorDetails","error_","error","paymentId","checkoutKey","formData","token","returnUrl","cardData","expMonth","expYear","getCheckoutProfile","id","baseUrl","EventBus","eventName","callback","callbacks","data","globalEventBus","Store","initialState","eventBus","partialState","newState","key","createStore","createCheckoutProfile","profileId","profileStore","fetchCheckoutProfile","formatters","value","truncated","EMAIL_DOMAINS","checkForMissingDot","input","tlds","tld","tldIndex","levenshteinDistance","a","b","rows","cols","matrix","_","i","j","cost","findSimilarDomain","domain","closestDomain","closestDistance","lowercaseDomain","correctDomain","distance","emailValidator","t","createTranslations","email","basicEmailPattern","atIndex","username","fixedDomain","correctedDomain","suggestedEmail","createValidationSchema","validateEmail","result","sanitized","month","year","num","currentDate","currentYear","currentMonth","monthNum","yearNum","createForm","validationSchema","formStore","validateField","validator","validateForm","currentFormData","newErrors","field","checkFormValidity","formErrors","handleChange","state","formattedValue","newFormData","handleBlur","newTouched","setFormData","updatedFormData","generateIframeConfig","props","createIframeConfig","checkoutProfile","inputStyles","iframeStore","iframeRef","generateIframeConfiguration","initializeIframe","nameOnCard","cardExp","isCardValid","isCvvValid","possibleCardType","cleanup","tokenize","onTokenize","BUNDLED_TRANSLATIONS","enLocale","deLocale","esLocale","frLocale","plLocale","ptLocale","TranslationService","defaultLocale","locale","values","translation","bundledTranslations","found","obj","path","parts","current","part","text","match","replacement","SUPPORTED_LOCALES","DEFAULT_LOCALE","createTranslationStore","initialLocale","translationService","validLocale","browserLocale","store","translationStore","translate","getLocale","setLocale","subscribe","appendGoogleFont","fontFamily","formattedFont","fontUrl","googleFontLinks","link","newLink","existingFontLink","lastGoogleFontLink","appendScript","scriptSrc","async","script","loadPromise","resolve","reject","styleObjectToString","styleObject","formattedKey","getCheckoutFormStyles","baseStyles","placeholderStyles","errorStyles","focusStyles","formContainerStyle","Component","tagName","classNames","attributes","html","component","parent","type","listener","options","child","ComponentFactory","button","mergedAttributes","placeholder","forId","label","select","option","optionEl","src","alt","Alert","alertContainer","alertContent","iconContainer","textContainer","titleComponent","message","Spinner","loader","HelperText","span","InputLabel","element","Input","inputAttributes","errorMsg","CardholderSection","onChange","onBlur","translationFunc","event","trimmedValue","CardCvvElement","container","cardElement","isFocused","isLoading","amexSvg","discoverSvg","mastercardSvg","visaSvg","cards","CardNumberElement","labelElement","cardsPositionDiv","card","selectedCard","cardIconDiv","img","newCardType","effectiveNewCardType","CardSection","isCvvFocused","isCcValid","cardType","cardExpiry","cardExpiryError","cardExpiryTouched","cardGrid","cardDetails","keyEvent","cardExpiryElement","cvvWrapper","ccHelperText","cvvHelperText","touched","isValid","helperText","EmailField","PaypalIcon","PaypalButton","onSubmit","isSubmitting","PaymentMethods","onPaypalSubmit","enabledMethods","config","paypalButton","FULLY_ROUNDED_BORDER_RADIUS","Button","disabled","SubmitButton","TEST_TOKENEX_SCRIPT_URL","PROD_TOKENEX_SCRIPT_URL","Form","formState","errorMessage","profileState","errors","iframeState","tokenexScriptSrc","isLoaded","target","hasErrors","tokenizeData","CheckoutFormManager","CheckoutStateManager","Checkout","containerId","formContainer","mounted","form","tokenexData","authorizedPayment","payment","redirectUrl"],"mappings":"AAEa,MAAAA,IAAa,CAACC,MACrBA,MAAgB,SACX,iCAGLA,MAAgB,SACX,yBAIF,yBCZIC,IAAY,CAAC,EAAE,MAAAC,QAA6B;AACjD,QAAA,CAACC,GAAW,GAAGC,CAAS,IAAIF,GAAM,MAAM,GAAG,KAAK,CAAC,GACjD,CAACG,CAAQ,IAAID,EAAU,QAAQ;AAE9B,SAAA,EAAE,WAAAD,GAAW,UAAAE,EAAS;AAC/B;ACEO,MAAMC,EAAmB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EAER,YACEC,GACAP,GACAQ,GACA;AACA,SAAK,SAASD,GACT,KAAA,UAAUR,EAAWC,CAAW,GAErC,KAAK,cAAcQ,KAAe,EAAE,WAAW,UAAU,UAAU;AAAA,EAAA;AAAA,EAGrE,MAAM,SAAY;AAAA,IAChB,UAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,MAAAC;AAAA,IACA,eAAAC,IAAgB,CAAA;AAAA,EAAC,GAOJ;AACb,UAAMC,IAAU;AAAA,MACd,eAAe,UAAU,KAAK,MAAM;AAAA,MACpC,gBAAgB;AAAA,MAChB,GAAGD;AAAA,IACL;AAEI,QAAA;AACI,YAAAE,IAAW,MAAM,MAAM,GAAG,KAAK,OAAO,GAAGL,CAAQ,IAAI;AAAA,QACzD,QAAAC;AAAA,QACA,SAAAG;AAAA,QACA,MAAMF,IAAO,KAAK,UAAUA,CAAI,IAAI;AAAA,MAAA,CACrC;AAEG,UAAA,CAACG,EAAS,IAAI;AAEZ,YAAAC;AACA,YAAA;AACa,UAAAA,IAAA,MAAMD,EAAS,KAAK;AAAA,iBAC5BE,GAAQ;AACP,kBAAA,IAAI,SAASA,CAAM;AAAA,QAAA;AAYvB,cATkB;AAAA,UACtB,SACED,GAAc,QAAQ,CAAC,KACvB,uBAAuBD,EAAS,MAAM,IAA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