straumur-web-component 2.0.0-alpha.12 → 2.0.0-alpha.13

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/straumur-checkout.tsx","#style-inject:#style-inject","../src/styles/main.css","../src/env.ts","../src/adapter/straumur-adapter.ts","../src/localizations/translations.ts","../src/services/straumur-service.ts","../src/localizations/locale.ts","../src/features/straumur-checkout-container.tsx","../src/features/card/card-component.tsx","../src/features/card/card-component.css","../src/components/payment-method-group/payment-method-group-context.tsx","../src/localizations/i18n-context.tsx","../src/assets/icons/card.tsx","../src/utils/renderBrandIcons.tsx","../src/assets/icons/mastercard.tsx","../src/assets/icons/visa.tsx","../src/assets/icons/maestro.tsx","../src/assets/icons/amex.tsx","../src/assets/icons/jcb.tsx","../src/assets/icons/diners.tsx","../src/assets/icons/discover.tsx","../src/assets/icons/cup.tsx","../src/components/tooltip/tooltip.tsx","../src/components/tooltip/tooltip.css","../src/utils/custom-hooks/use-media-query.ts","../src/components/card-form/card-form.tsx","../src/assets/icons/info.tsx","../src/assets/icons/loader.tsx","../src/assets/icons/checkmark.tsx","../src/components/render-dual-brand/render-dual-brand.tsx","../src/models/models.ts","../src/flows/payment-flow.ts","../src/components/shared/before-submit-click.ts","../src/components/shared/create-adyen-handlers.ts","../src/utils/custom-hooks/use-adyen-locale-reinit.ts","../src/utils/custom-hooks/use-focus-on-activate.ts","../src/utils/custom-hooks/use-resolved-theme.ts","../src/utils/adyen-field-styles.ts","../src/components/payment-method-item/payment-method-item.tsx","../src/components/payment-method-item/payment-method-item.css","../src/features/google-pay/google-pay-component.tsx","../src/features/google-pay/google-pay-component.css","../src/assets/icons/googlepay.tsx","../src/components/google-pay-button/google-pay-button.css","../src/components/google-pay-button/google-pay-button.tsx","../src/components/shared/wallet-button.tsx","../src/models/constants.ts","../src/utils/wallet-button-theme.ts","../src/features/apple-pay/apple-pay-component.tsx","../src/features/apple-pay/apple-pay-component.css","../src/assets/icons/applepay.tsx","../src/components/apple-pay-button/apple-pay-button.css","../src/components/apple-pay-button/apple-pay-button.tsx","../src/features/stored-card/stored-card-container-component.tsx","../src/features/stored-card/stored-card-component.tsx","../src/features/stored-card/stored-card-component.css","../src/assets/icons/warning.tsx","../src/components/payment-method-group/payment-method-group.tsx","../src/components/payment-method-group/payment-method-group.css","../src/features/result-component/result-component.tsx","../src/features/result-component/result-component.css","../src/assets/icons/success.tsx","../src/assets/icons/result-icons.css","../src/assets/icons/failure.tsx","../src/features/payment-methods-wrapper/payment-methods-wrapper.tsx","../src/features/instantPayments/instant-payments-component.tsx","../src/features/instantPayments/instant-payments-component.css","../src/utils/payment-method-order.ts","../src/localizations/i18n-service.ts","../src/components/shared/status-screen.tsx","../src/services/advanced-normalizer.ts","../src/config/build-checkout-configuration.ts"],"sourcesContent":["export { default as StraumurCheckout } from \"./straumur-checkout\";\nexport type {\n StraumurWebConfiguration,\n PaymentCompletedData,\n PaymentFailedData,\n ResultCode,\n Placeholders,\n Theme,\n ThemeConfiguration,\n GooglePayButtonTheme,\n ApplePayButtonTheme,\n} from \"./models/models\";\nexport type { PaymentMethod, PaymentMethodOrder, OpenDefaultPaymentMethod } from \"./models/constants\";\n","import { h, render } from \"preact\";\nimport \"./styles/main.css\";\nimport {\n ResultMessage,\n StraumurCheckoutConfiguration,\n StraumurCheckoutUpdateOptions,\n StraumurWebAdvancedConfiguration,\n StraumurWebConfiguration,\n} from \"./models/models\";\nimport { setupPaymentMethods } from \"./services/straumur-service\";\nimport { normalizeLocale, PublicLocale } from \"./localizations/locale\";\nimport StraumurCheckoutContainer from \"./features/straumur-checkout-container\";\nimport { PaymentMethodsResponse, SuccessResponse } from \"./services/models\";\nimport { AdyenCheckout } from \"@adyen/adyen-web\";\nimport { I18nProvider } from \"./localizations/i18n-context\";\nimport { I18nService } from \"./localizations/i18n-service\";\nimport { SubmitApi } from \"./components/payment-method-group/payment-method-group-context\";\nimport { createAdyenPaymentHandlers } from \"./components/shared/create-adyen-handlers\";\nimport { LoaderScreen, RootComponent, StatusScreen } from \"./components/shared/status-screen\";\nimport { buildCheckoutConfiguration } from \"./config/build-checkout-configuration\";\n\nclass StraumurCheckout {\n private configuration: StraumurCheckoutConfiguration;\n private advancedConfiguration: StraumurWebAdvancedConfiguration | null = null;\n private paymentMethods: SuccessResponse | null = null;\n private mountElement: HTMLElement | null = null;\n private i18n: I18nService;\n private submitApi: SubmitApi | null = null;\n private initializationFailed = false;\n\n // Public signature accepts the session configuration only. The advanced-mode configuration\n // (internal, used by Straumur Hosted Checkout via the IIFE bundle) is detected at runtime.\n constructor(publicConfig: StraumurWebConfiguration) {\n const initialization = buildCheckoutConfiguration(publicConfig);\n\n this.configuration = initialization.configuration;\n this.advancedConfiguration = initialization.advancedConfiguration;\n this.paymentMethods = initialization.paymentMethods;\n this.initializationFailed = initialization.initializationFailed;\n this.i18n = new I18nService(this.configuration.locale, this.configuration.customLocalizations);\n }\n\n async mount(selector: HTMLElement | string): Promise<void> {\n try {\n this.mountElement = typeof selector === \"string\" ? document.querySelector(selector) : selector;\n\n if (!this.mountElement) {\n return;\n }\n\n if (this.initializationFailed) {\n this.handleError({ key: \"error.failedToInitializeStraumurWebComponent\" });\n return;\n }\n\n if (this.configuration.mode === \"advanced\") {\n this.renderComponent();\n return;\n }\n\n render(<LoaderScreen theme={this.configuration.theme} />, this.mountElement);\n\n const response = await setupPaymentMethods(this.configuration.environment, this.configuration.sessionId!);\n\n if (response.resultCode === \"Error\") {\n this.handleError({ key: response.error });\n return;\n }\n\n this.paymentMethods = response;\n\n this.renderComponent();\n } catch (error) {\n // Never throw into the host page, but leave a trace for the merchant's console.\n console.error(\"[StraumurCheckout] mount() failed:\", error);\n }\n }\n\n private renderComponent(): void {\n if (!this.mountElement) return;\n\n render(\n <RootComponent theme={this.configuration.theme}>\n <I18nProvider\n i18nService={this.i18n}\n onLanguageChange={(language) => {\n this.configuration.locale = language;\n this.renderComponent();\n }}\n >\n <StraumurCheckoutContainer\n configuration={this.configuration}\n paymentMethods={this.paymentMethods!}\n onSubmitApiReady={(api) => {\n this.submitApi = api;\n }}\n />\n </I18nProvider>\n </RootComponent>,\n this.mountElement\n );\n }\n\n handleSuccess(message: ResultMessage) {\n if (!this.mountElement) return;\n\n render(\n <StatusScreen variant=\"success\" message={message} i18n={this.i18n} theme={this.configuration.theme} />,\n this.mountElement\n );\n }\n\n handleError(message: ResultMessage) {\n if (!this.mountElement) return;\n\n render(\n <StatusScreen variant=\"failure\" message={message} i18n={this.i18n} theme={this.configuration.theme} />,\n this.mountElement\n );\n }\n\n // Resolves what the redirect-return Adyen bootstrap needs per mode, rendering the\n // failure screen and returning null when the context cannot be established.\n private async resolveRedirectContext(): Promise<{\n clientKey: string;\n paymentMethods: PaymentMethodsResponse;\n } | null> {\n if (this.configuration.mode === \"advanced\") {\n if (this.initializationFailed || !this.advancedConfiguration) {\n this.handleError({ key: \"error.failedToInitializeStraumurWebComponent\" });\n return null;\n }\n\n return {\n clientKey: this.advancedConfiguration.clientKey,\n paymentMethods: this.advancedConfiguration.paymentMethods,\n };\n }\n\n const response = await setupPaymentMethods(this.configuration.environment, this.configuration.sessionId!);\n\n if (response.resultCode === \"Error\") {\n this.handleError({ key: response.error });\n return null;\n }\n\n return { clientKey: response.clientKey, paymentMethods: response.paymentMethods };\n }\n\n // selector lets a page that never called mount() (e.g. a 3DS redirect return) show the result screens\n async submitDetails(redirectResult: string, selector?: HTMLElement | string) {\n try {\n if (selector) {\n this.mountElement = typeof selector === \"string\" ? document.querySelector(selector) : selector;\n }\n\n const redirectContext = await this.resolveRedirectContext();\n\n if (!redirectContext) {\n return;\n }\n\n const { handleOnSubmitAdditionalData } = createAdyenPaymentHandlers({\n configuration: this.configuration,\n handleSuccess: (message) => this.handleSuccess(message),\n handleError: (message) => this.handleError(message),\n setThreeDSecureActive: () => {},\n dispatchResultFromAdditionalDetails: true,\n });\n\n // Deliberately no core-level onPaymentCompleted/onPaymentFailed here: the handler above\n // dispatches the final result itself, and wiring both would double-fire the merchant callbacks.\n const checkout = await AdyenCheckout({\n environment: this.configuration.environment,\n clientKey: redirectContext.clientKey,\n paymentMethodsResponse: redirectContext.paymentMethods,\n countryCode: this.configuration.countryCode,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n });\n\n checkout.submitDetails({\n details: {\n redirectResult,\n },\n });\n } catch (error) {\n // Same no-throw philosophy as mount(): render the failure in-place, log for the console.\n console.error(\"[StraumurCheckout] submitDetails() failed:\", error);\n this.handleError({ key: \"error.failedToSubmitPaymentDetails\" });\n this.configuration.onPaymentFailed?.({ resultCode: \"Error\" });\n }\n }\n\n updateConfig(newConfig: StraumurCheckoutUpdateOptions): void {\n const { locale, ...rest } = newConfig;\n\n this.configuration = {\n ...this.configuration,\n ...rest,\n // The public vocabulary is short codes; normalizeLocale also tolerates legacy full tags at runtime.\n ...(locale ? { locale: normalizeLocale(locale) } : {}),\n };\n\n // Update i18n if locale or customLocalizations changed\n if (locale) {\n this.i18n.setLanguage(this.configuration.locale);\n }\n if (newConfig.customLocalizations) {\n this.i18n.updateCustomLocalizations(newConfig.customLocalizations);\n }\n\n // Re-render the component with new config\n if (this.mountElement) {\n this.renderComponent();\n }\n }\n\n setLanguage(locale: PublicLocale): void {\n this.updateConfig({\n locale: locale,\n });\n }\n\n destroy(): void {\n // Clean up resources\n if (this.mountElement) {\n render(null, this.mountElement);\n this.mountElement = null;\n }\n this.submitApi = null;\n }\n\n submitCard(): boolean {\n if (!this.mountElement) {\n console.warn(\"[StraumurCheckout] submitCard() called before the component was mounted.\");\n return false;\n }\n\n if (!this.submitApi) {\n console.warn(\"[StraumurCheckout] submitCard() called but the component is not ready yet.\");\n return false;\n }\n\n const triggered = this.submitApi.triggerSubmit();\n\n if (!triggered) {\n console.warn(\n \"[StraumurCheckout] submitCard() called but no card-type payment method is currently active and initialized.\"\n );\n }\n\n return triggered;\n }\n}\n\nexport default StraumurCheckout;\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\":root{--straumur__color-primary: #002649;--straumur__color-secondary: #72889d;--straumur__color-secondary-gamma: #eef0f2;--straumur__color-blue-beta: #bce6f3;--straumur__color-blue-gamma: #eff8fa;--straumur__color-neon-green-zeta: #88a64e;--straumur__color-red-beta: #d96666;--straumur__color-red-gamma: #fff8f5;--straumur__color-gray-epsilon: #e7e7e7;--straumur__color-cosmos-blue-delta: #cdd8e2;--straumur__color-cosmos-blue-gamma: #e6ebef;--straumur__color-white: #ffffff;--straumur__color-transparent: transparent;--straumur__color-brand-chip: #ffffff;--straumur__color-text: #00112c;--straumur__color-border: #dbdee2;--straumur__color-warning-text: #775d00;--straumur__color-warning-bg: #fff7db;--straumur__color-danger-text: #d03e00;--straumur__color-success: #1f9d57;--straumur__border-radius-xxs: 4px;--straumur__border-radius-xs: 6px;--straumur__border-radius-s: 8px;--straumur__border-radius-md: 10px;--straumur__border-radius-lg: 12px;--straumur__border-radius-xlg: 14px;--straumur__border-radius-xxlg: 16px;--straumur__space-xxs: 4px;--straumur__space-xs: 6px;--straumur__space-s: 8px;--straumur__space-md: 10px;--straumur__space-lg: 12px;--straumur__space-xlg: 14px;--straumur__space-xxlg: 16px;--straumur__space-3xlg: 18px;--straumur__space-4xlg: 20px;--straumur__space-5xlg: 24px;--straumur__space-6xlg: 32px;--straumur__space-7xlg: 40px;--straumur__space-8xlg: 48px;--apple-pay-button-width: 100%;--apple-pay-button-height: 48px;--apple-pay-button-border-radius: var(--straumur__border-radius-lg)}.straumur__root-component{font-family:AkzidenzGroteskPro,sans-serif;color:var(--straumur__color-text);min-width:320px;container:straumur / inline-size}.straumur__root-component[data-theme=dark]{--straumur__color-primary: #e8edf2;--straumur__color-secondary: #9aa7b5;--straumur__color-secondary-gamma: #2a313b;--straumur__color-blue-beta: #24506b;--straumur__color-blue-gamma: #1b2733;--straumur__color-neon-green-zeta: #9cbf5e;--straumur__color-red-beta: #e08a8a;--straumur__color-red-gamma: #2e2020;--straumur__color-gray-epsilon: #3a424d;--straumur__color-cosmos-blue-delta: #3a424d;--straumur__color-cosmos-blue-gamma: #262d36;--straumur__color-white: #0d0f13;--straumur__color-text: #e8edf2;--straumur__color-border: #3a424d;--straumur__color-warning-text: #e6c766;--straumur__color-warning-bg: #2f2a17;--straumur__color-danger-text: #f0895f;--straumur__color-success: #3fd98a}.straumur__component *{font-family:inherit}.straumur__render-brand-icons__overflow{color:var(--straumur__color-secondary)}.straumur__brand-chip{display:inline-flex;background:var(--straumur__color-brand-chip);border:1px solid var(--straumur__color-border);border-radius:var(--straumur__border-radius-xxs);overflow:hidden}.straumur__component{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--straumur__space-5xlg);padding:var(--straumur__space-6xlg);width:100%;min-height:300px;background-color:var(--straumur__color-white);border-radius:var(--straumur__border-radius-xxlg)}.straumur__result-message{max-width:320px;margin:0;padding:0 var(--straumur__space-4xlg);text-align:center;font-size:16px;line-height:24px;color:var(--straumur__color-text)}.js-iframe{border:none;color-scheme:auto;height:100%;overflow:hidden;width:100%}.adyen-checkout__threeds2__challenge.adyen-checkout__threeds2__challenge--05{background-color:transparent;display:block;height:inherit;min-height:400px;overflow:hidden;position:relative;width:100%}\\n\")","const getEnv = (): Env => {\n return {\n STAGING_BASE_URL: \"https://checkout-api.staging.straumur.is/api/v1/embeddedcheckout\",\n PRODUCTION_BASE_URL: \"https://greidslugatt.straumur.is/api/v1/embeddedcheckout\",\n\n GET_PAYMENT_METHODS_URL: \"payment-methods\",\n POST_PAYMENT_URL: \"payment\",\n POST_DETAILS_URL: \"details\",\n POST_DISABLE_TOKEN_URL: \"disable-token\",\n };\n};\n\ninterface Env {\n STAGING_BASE_URL: string;\n PRODUCTION_BASE_URL: string;\n\n GET_PAYMENT_METHODS_URL: string;\n POST_PAYMENT_URL: string;\n POST_DETAILS_URL: string;\n POST_DISABLE_TOKEN_URL: string;\n}\n\nexport const env = getEnv();\n","import { ICreateDetailsBody, ICreatePaymentBody, IGetPaymentMethodsBody, IPostDisableTokenBody } from \"./models\";\nimport { env } from \"../env\";\n\nfunction getBaseUrl(environment: \"test\" | \"live\"): string {\n switch (environment) {\n case \"test\":\n return env.STAGING_BASE_URL;\n case \"live\":\n return env.PRODUCTION_BASE_URL;\n default:\n throw new Error(`Unknown environment: ${environment}`);\n }\n}\n\nexport function getPaymentMethods(environment: \"test\" | \"live\", body: IGetPaymentMethodsBody) {\n return fetch(`${getBaseUrl(environment)}/${env.GET_PAYMENT_METHODS_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function createPaymentRequest(environment: \"test\" | \"live\", body: ICreatePaymentBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_PAYMENT_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function createDetailsRequest(environment: \"test\" | \"live\", body: ICreateDetailsBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_DETAILS_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function postDisableTokenRequest(environment: \"test\" | \"live\", body: IPostDisableTokenBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_DISABLE_TOKEN_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n","export const translations = {\n \"en-US\": {\n \"cards.title\": \"Card payment\",\n \"cards.cardNumber\": \"Card number\",\n \"cards.expiryDate\": \"Expiry date\",\n \"cards.securityCode3Digits\": \"Security code\",\n \"cards.securityCode3DigitsOptional\": \"Security code (optional)\",\n \"cards.securityCode3DigitsInfo\": \"3-digit on the back of the card\",\n \"cards.securityCode4DigitsInfo\": \"4-digit on the back of the card\",\n \"cards.storePaymentMethod\": \"Store payment information\",\n \"cards.saveCardDetails\": \"Save card details\",\n \"googlePay.title\": \"Google Pay\",\n \"applePay.title\": \"Apple Pay\",\n \"stored-cards.expiryDate\": \"Expiry date\",\n \"stored-cards.securityCode3Digits\": \"Security code\",\n \"stored-cards.securityCode3DigitsOptional\": \"Security code (optional)\",\n \"stored-cards.securityCode3DigitsInfo\": \"3-digit on the back of the card\",\n \"stored-cards.securityCode4DigitsInfo\": \"4-digit on the back of the card\",\n \"stored-cards.removeStoredCard\": \"Remove\",\n \"stored-cards.removeStoredCardQuestion\": \"Remove stored payment method?\",\n \"stored-cards.removeStoredCardQuestionYesRemove\": \"Yes, remove\",\n \"stored-cards.removeStoredCardQuestionCancel\": \"Cancel\",\n \"stored-cards.saveCardDetails\": \"Save card details\",\n\n \"success.paymentAuthorized\": \"Payment authorized\",\n\n \"error.unknownError\": \"Unknown error occurred\",\n \"error.failedToInitializeStraumurWebComponent\": \"Failed to initialize Straumur Web component\",\n \"error.failedToInitializePaymentMethods\": \"Failed to initialize payment methods\",\n \"error.failedToSubmitPayment\": \"Failed to submit payment\",\n \"error.paymentFailed\": \"Payment failed\",\n \"error.paymentUnsuccessful\": \"Payment unsuccessful\",\n \"error.failedToSubmitPaymentDetails\": \"Failed to submit payment details\",\n \"error.paymentDetailsFailed\": \"Payment details failed\",\n \"error.googlePayNotAvailable\": \"Google Pay not available\",\n \"error.applePayNotAvailable\": \"Apple Pay not available\",\n \"error.failedToSubmitRemoveStoredPaymentCard\": \"Failed to remove stored payment card\",\n \"error.failedToRemoveStoredPaymentCard\": \"Stored payment card was not removed\",\n },\n \"is-IS\": {\n \"cards.title\": \"Greiða með korti\",\n \"cards.cardNumber\": \"Kortanúmer\",\n \"cards.expiryDate\": \"Gildisdagur\",\n \"cards.securityCode3Digits\": \"Öryggiskóði\",\n \"cards.securityCode3DigitsOptional\": \"Öryggiskóði (valkvætt)\",\n \"cards.securityCode3DigitsInfo\": \"3 tölustafir aftan á kortinu\",\n \"cards.securityCode4DigitsInfo\": \"4 tölustafir aftan á kortinu\",\n \"cards.storePaymentMethod\": \"Vista greiðsluupplýsingar\",\n \"cards.saveCardDetails\": \"Vista kortaupplýsingar\",\n \"googlePay.title\": \"Google Pay\",\n \"applePay.title\": \"Apple Pay\",\n \"stored-cards.expiryDate\": \"Gildisdagur\",\n \"stored-cards.securityCode3Digits\": \"Öryggiskóði\",\n \"stored-cards.securityCode3DigitsOptional\": \"Öryggiskóði (valkvætt)\",\n \"stored-cards.securityCode3DigitsInfo\": \"3 tölustafir aftan á kortinu\",\n \"stored-cards.securityCode4DigitsInfo\": \"4 tölustafir aftan á kortinu\",\n \"stored-cards.removeStoredCard\": \"Fjarlægja\",\n \"stored-cards.removeStoredCardQuestion\": \"Fjarlægja geymdan greiðslumáta?\",\n \"stored-cards.removeStoredCardQuestionYesRemove\": \"Já, fjarlægja\",\n \"stored-cards.removeStoredCardQuestionCancel\": \"Hætta við\",\n \"stored-cards.saveCardDetails\": \"Vista kortaupplýsingar\",\n\n \"success.paymentAuthorized\": \"Greiðsla samþykkt\",\n\n \"error.unknownError\": \"Óþekkt villa kom upp\",\n \"error.failedToInitializeStraumurWebComponent\": \"Mistókst að sækja Straumur Web hluta\",\n \"error.failedToInitializePaymentMethods\": \"Mistókst að sækja greiðslumáta\",\n \"error.failedToSubmitPayment\": \"Mistókst að senda greiðslu\",\n \"error.paymentFailed\": \"Greiðsla mistókst\",\n \"error.paymentUnsuccessful\": \"Greiðsla ekki tekin\",\n \"error.failedToSubmitPaymentDetails\": \"Mistókst að senda greiðsluupplýsingar\",\n \"error.paymentDetailsFailed\": \"Mistókst að sækja greiðsluupplýsingar\",\n \"error.googlePayNotAvailable\": \"Google Pay ekki í boði\",\n \"error.applePayNotAvailable\": \"Apple Pay ekki í boði\",\n \"error.failedToSubmitRemoveStoredPaymentCard\": \"Mistókst að fjarlægja geymdan greiðslumáta\",\n \"error.failedToRemoveStoredPaymentCard\": \"Geymdur greiðslumáti var ekki fjarlægður\",\n },\n};\n\nexport type Language = keyof typeof translations;\nexport type TranslationKey = keyof (typeof translations)[\"en-US\"] | keyof (typeof translations)[\"is-IS\"];\n\n/** Narrows an untrusted string (e.g. a server error code) to a known translation key. */\nexport function isTranslationKey(value: unknown): value is TranslationKey {\n return typeof value === \"string\" && (value in translations[\"en-US\"] || value in translations[\"is-IS\"]);\n}\n","import { getPaymentMethods } from \"../adapter/straumur-adapter\";\nimport { isTranslationKey, TranslationKey } from \"../localizations/translations\";\nimport { StraumurCheckoutPaymentMethods, StraumurCheckoutPaymentMethodsResponse } from \"./models\";\n\nexport async function setupPaymentMethods(\n environment: \"test\" | \"live\",\n sessionId: string\n): Promise<StraumurCheckoutPaymentMethodsResponse> {\n try {\n const fetchResponse = await getPaymentMethods(environment, {\n sessionId,\n });\n\n if (!fetchResponse.ok) {\n const contentType = fetchResponse.headers.get(\"content-type\");\n let errorMessage: TranslationKey = \"error.failedToInitializePaymentMethods\";\n if (contentType && contentType.includes(\"application/json\")) {\n // The server's errorMessage is untrusted input: only adopt it when it is a known\n // translation key, otherwise the raw string would be shown to the buyer verbatim.\n const serverErrorMessage: unknown = (await fetchResponse.json()).errorMessage;\n if (isTranslationKey(serverErrorMessage)) {\n errorMessage = serverErrorMessage;\n }\n }\n\n return {\n resultCode: \"Error\",\n error: errorMessage,\n };\n }\n\n const data: StraumurCheckoutPaymentMethods = await fetchResponse.json();\n\n return {\n resultCode: \"Success\",\n ...data,\n };\n } catch {\n return {\n resultCode: \"Error\",\n error: \"error.failedToInitializePaymentMethods\",\n };\n }\n}\n","import { Language } from \"./translations\";\n\n/** The locale vocabulary of the public API: short codes only. */\nexport type PublicLocale = \"is\" | \"en\";\n\n/**\n * Normalizes a public locale to the internal BCP-47 Language.\n *\n * Tolerates the legacy full tags (\"en-US\"/\"is-IS\") at runtime — 1.x accepted them in\n * setLanguage/updateConfig and IIFE consumers get no compile-time checking — while the\n * public types narrow to short codes. Anything unrecognized falls back to Icelandic,\n * matching the constructor's historical default.\n */\nexport function normalizeLocale(locale: PublicLocale | Language | undefined): Language {\n switch (locale) {\n case \"en\":\n case \"en-US\":\n return \"en-US\";\n default:\n return \"is-IS\";\n }\n}\n","import { h } from \"preact\";\nimport { StraumurCheckoutConfiguration } from \"../models/models\";\nimport { SuccessResponse } from \"../services/models\";\nimport CardComponent from \"./card/card-component\";\nimport GooglePayComponent from \"./google-pay/google-pay-component\";\nimport ApplePayComponent from \"./apple-pay/apple-pay-component\";\nimport StoredCardContainerComponent from \"./stored-card/stored-card-container-component\";\nimport PaymentMethodGroup from \"../components/payment-method-group/payment-method-group\";\nimport ResultComponent from \"./result-component/result-component\";\nimport PaymentMethodsWrapper from \"./payment-methods-wrapper/payment-methods-wrapper\";\nimport InstantPaymentsComponent from \"./instantPayments/instant-payments-component\";\nimport { OpenDefaultPaymentMethod, PaymentMethod, PaymentMethodOrder } from \"../models/constants\";\nimport { resolvePaymentMethodOrder } from \"../utils/payment-method-order\";\nimport { SubmitApi } from \"../components/payment-method-group/payment-method-group-context\";\n\ninterface StraumurCheckoutContainerProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}\n\nexport function determineInitialState(\n hasCard: boolean,\n hasGooglePay: boolean,\n hasApplePay: boolean,\n storedCount: number,\n instantPayments: StraumurCheckoutConfiguration[\"instantPayments\"],\n openDefaultPaymentMethod?: OpenDefaultPaymentMethod\n): { initialPaymentMethod: PaymentMethod | null; isSolePaymentMethod: boolean } {\n const gpayInStandard = hasGooglePay && !instantPayments?.some((x) => x === \"googlepay\");\n const apayInStandard = hasApplePay && !instantPayments?.some((x) => x === \"applepay\");\n\n const totalOptions = storedCount + (hasCard ? 1 : 0) + (gpayInStandard ? 1 : 0) + (apayInStandard ? 1 : 0);\n\n // Exactly one option: auto-select it and hide the chooser (sole mode).\n if (totalOptions === 1) {\n if (storedCount === 1) return { initialPaymentMethod: \"storedcard\", isSolePaymentMethod: true };\n if (hasCard) return { initialPaymentMethod: \"card\", isSolePaymentMethod: true };\n if (gpayInStandard) return { initialPaymentMethod: \"googlepay\", isSolePaymentMethod: true };\n if (apayInStandard) return { initialPaymentMethod: \"applepay\", isSolePaymentMethod: true };\n return { initialPaymentMethod: null, isSolePaymentMethod: false };\n }\n\n // More than one (or zero) options: pre-open the requested method only if it's available. If it\n // isn't (a wallet moved to instantPayments, or no saved cards), leave the chooser collapsed — the\n // same as when no option is given. Never fall back to opening a different method.\n if (openDefaultPaymentMethod === \"card\" && hasCard)\n return { initialPaymentMethod: \"card\", isSolePaymentMethod: false };\n if (openDefaultPaymentMethod === \"googlepay\" && gpayInStandard)\n return { initialPaymentMethod: \"googlepay\", isSolePaymentMethod: false };\n if (openDefaultPaymentMethod === \"applepay\" && apayInStandard)\n return { initialPaymentMethod: \"applepay\", isSolePaymentMethod: false };\n if (openDefaultPaymentMethod === \"firstStoredCard\" && storedCount > 0)\n return { initialPaymentMethod: \"storedcard\", isSolePaymentMethod: false };\n\n return { initialPaymentMethod: null, isSolePaymentMethod: false };\n}\n\nfunction StraumurCheckoutContainer({\n configuration,\n paymentMethods,\n onSubmitApiReady,\n}: StraumurCheckoutContainerProps): h.JSX.Element {\n const methods = paymentMethods.paymentMethods.paymentMethods ?? [];\n const stored = paymentMethods.paymentMethods.storedPaymentMethods ?? [];\n\n const isAllowed = (method: PaymentMethod): boolean =>\n !configuration.allowedPaymentMethods || configuration.allowedPaymentMethods.includes(method);\n\n const hasCard = methods.some((x) => x.type === \"scheme\") && isAllowed(\"card\");\n const hasGooglePay = methods.some((x) => x.type === \"googlepay\") && isAllowed(\"googlepay\");\n const hasApplePay = methods.some((x) => x.type === \"applepay\") && isAllowed(\"applepay\");\n const storedCount = isAllowed(\"storedcard\") ? stored.length : 0;\n const hasStoredPaymentMethods = storedCount > 0;\n\n const { initialPaymentMethod, isSolePaymentMethod } = determineInitialState(\n hasCard,\n hasGooglePay,\n hasApplePay,\n storedCount,\n configuration.instantPayments,\n configuration.openDefaultPaymentMethod\n );\n\n // Opening \"firstStoredCard\" resolves to the storedcard method above; seed the specific card id\n // (the first saved card) so exactly that stored-card row opens. Sole mode needs no id — the lone\n // stored card matches on the method alone.\n const initialStoredPaymentMethodId =\n initialPaymentMethod === \"storedcard\" && !isSolePaymentMethod ? (stored[0]?.id ?? null) : null;\n\n // Each component self-guards on availability and instant-vs-standalone; the order only controls\n // which slot renders where. A wallet in instantPayments returns null from its standalone slot.\n const componentsBySlot: Record<PaymentMethodOrder, h.JSX.Element> = {\n instantpayments: (\n <InstantPaymentsComponent key=\"instantpayments\" configuration={configuration} paymentMethods={paymentMethods} />\n ),\n storedcard: (\n <StoredCardContainerComponent key=\"storedcard\" configuration={configuration} paymentMethods={paymentMethods} />\n ),\n card: <CardComponent key=\"card\" configuration={configuration} paymentMethods={paymentMethods} />,\n googlepay: <GooglePayComponent key=\"googlepay\" configuration={configuration} paymentMethods={paymentMethods} />,\n applepay: <ApplePayComponent key=\"applepay\" configuration={configuration} paymentMethods={paymentMethods} />,\n };\n\n const order = resolvePaymentMethodOrder(configuration.orderPaymentMethods);\n\n return (\n <PaymentMethodGroup\n initialValue={initialPaymentMethod}\n initialStoredPaymentMethodId={initialStoredPaymentMethodId}\n isSolePaymentMethod={isSolePaymentMethod}\n hasCard={hasCard}\n hasGooglePay={hasGooglePay}\n hasApplePay={hasApplePay}\n hasStoredPaymentMethods={hasStoredPaymentMethods}\n onSubmitApiReady={onSubmitApiReady}\n >\n <PaymentMethodsWrapper>{order.map((slot) => componentsBySlot[slot])}</PaymentMethodsWrapper>\n\n <ResultComponent />\n </PaymentMethodGroup>\n );\n}\n\nexport default StraumurCheckoutContainer;\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./card-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport CardIcon from \"../../assets/icons/card\";\nimport { BrandHidden, RenderBrandIcons } from \"../../utils/renderBrandIcons\";\nimport { CardComponentProps } from \"./models\";\nimport CardForm from \"../../components/card-form/card-form\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\n\nfunction CardComponent({ configuration, paymentMethods }: CardComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const [brandHidden, setBrandHidden] = useState<BrandHidden[]>([]);\n const resolvedTheme = useResolvedTheme(configuration.theme);\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasCard } =\n usePaymentMethodGroup();\n\n if (!hasCard || isObscuredByThreeDS(\"card\")) {\n return null;\n }\n\n const schemeBrands = paymentMethods.paymentMethods.paymentMethods!.find((x) => x.type === \"scheme\")!.brands!;\n\n const brands = schemeBrands.map((x) => {\n return { brand: x, brandFullName: x };\n });\n\n return (\n <PaymentMethodItem\n icon={<CardIcon />}\n title={i18n.t(\"cards.title\")}\n isActive={activePaymentMethod === \"card\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"card\")}\n headerRight={\n <span className=\"straumur__card-component--brands\">\n <RenderBrandIcons brands={brands} brandHidden={brandHidden} theme={resolvedTheme} />\n </span>\n }\n >\n <CardForm configuration={configuration} paymentMethods={paymentMethods} onBrandHidden={setBrandHidden} />\n </PaymentMethodItem>\n );\n}\n\nexport default CardComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__card-component--brands{display:flex;margin-left:auto;align-items:center;gap:var(--straumur__space-xxs)}.straumur__card-component__expandable{background:var(--straumur__color-white)}.straumur__card-component__loading-text{display:flex;justify-content:center}.straumur__card-component__form{display:flex;padding-top:var(--straumur__space-xxlg);flex-direction:column;gap:var(--straumur__space-5xlg)}.straumur__card-component__form--wrapper{display:flex;flex-direction:column;justify-items:start;position:relative;width:100%}.straumur__card-component__form--wrapper--error{color:var(--straumur__color-red-beta);font-size:12px}.straumur__card-component__form--wrapper--label{transform:translate(var(--straumur__space-md)) translateY(-50%);z-index:1;background:linear-gradient(to top,var(--straumur__color-secondary-gamma) 53%,var(--straumur__color-transparent) 50%);position:absolute;font-weight:500;font-size:14px;padding:0 var(--straumur__space-xxs)}.straumur__card-component__form--wrapper--label--error{color:var(--straumur__color-red-beta);background:linear-gradient(to top,var(--straumur__color-red-gamma) 53%,var(--straumur__color-transparent) 50%)}.straumur__card-component__form--wrapper--label--info{position:absolute;top:33%;right:var(--straumur__space-md)}.straumur__card-component__form--wrapper--input{background:var(--straumur__color-secondary-gamma);color:var(--straumur__color-text);display:block;font-family:inherit;border:1px solid var(--straumur__color-transparent);border-radius:var(--straumur__border-radius-s);font-size:16px;height:48px;outline:none;padding-left:var(--straumur__space-lg);transition:border .2s ease-out,box-shadow .2s ease-out}.straumur__card-component__form--wrapper--input:hover{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__card-component__form--wrapper--input--error{background:var(--straumur__color-red-gamma);border:1px solid var(--straumur__color-red-beta)}.straumur__card-component__form--wrapper--input--error:hover{border:1px solid var(--straumur__color-red-beta)}.straumur__card-component__form--field-wrapper{display:flex;width:100%;gap:var(--straumur__space-lg)}.straumur__card-component__submit-button{background:var(--straumur__color-primary);border:none;border-radius:var(--straumur__border-radius-s);color:var(--straumur__color-white);cursor:pointer;font-size:16px;height:40px;outline:none;padding:0 var(--straumur__space-xxlg);transition:background .2s ease-out;width:100%}.straumur__card-component__submit-button:hover{background:var(--straumur__color-primary);border:1px solid var(--straumur__color-border)}.straumur__card-component__submit-button:disabled{background:var(--straumur__color-secondary);border:1px solid var(--straumur__color-border);cursor:not-allowed}.straumur__card-component__form--wrapper--label-checkbox{height:38px;display:flex;align-items:center;padding:8px;gap:var(--straumur__space-s);border-radius:var(--straumur__border-radius-s);cursor:pointer;user-select:none;transition:background-color .25s ease-in-out}.straumur__card-component__form--wrapper--label-checkbox:hover{background-color:var(--straumur__color-blue-gamma)}.straumur__card-component__form--wrapper--label-checkbox:hover .straumur__card-component__form--wrapper--label-checkbox--checkmark{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__card-component__form--wrapper--label-checkbox--checkmark{height:var(--straumur__space-5xlg);width:var(--straumur__space-5xlg);background-color:var(--straumur__color-secondary-gamma);border-radius:var(--straumur__border-radius-xxs);flex-shrink:0;border:1px solid var(--straumur__color-transparent);transition:all .2s ease-in}.straumur__card-component__form--wrapper--label-checkbox:hover .straumur__card-component__form--wrapper--label-checkbox--checkmark.straumur__card-component__form--wrapper--label-checkbox--checkmark--checked{border:1px solid var(--straumur__color-transparent)}.straumur__card-component__form--wrapper--label-checkbox--checkmark--checked{background-color:var(--straumur__color-blue-beta)}.straumur__card-component__form--wrapper--label-checkbox--checkmark--icon{height:100%;display:flex;justify-content:center;align-items:center;font-size:9px;opacity:0;visibility:hidden;transition:all .2s ease-in}.straumur__card-component__form--wrapper--label-checkbox--checkmark--icon--checked{opacity:1;visibility:visible}.straumur__card-component__form--wrapper--label-checkbox--checkbox{display:none}.js-iframe{border:none;color-scheme:auto;height:100%;overflow:hidden;width:100%}.straumur__card-component__dual-branding{display:grid;grid-template-columns:1fr 1fr;gap:var(--straumur__space-lg)}.straumur__card-component__dual-branding--logo{display:flex;align-items:center;padding:var(--straumur__space-xs);border:1px solid var(--straumur__color-secondary-gamma);border-radius:var(--straumur__border-radius-s)}.straumur__card-component__dual-branding--logo--item{display:flex;pointer-events:none}.straumur__card-component__dual-branding--logo--selected{border:1px solid var(--straumur__color-cosmos-blue-delta);justify-content:space-between}\\n\")","import { h } from \"preact\";\nimport { createContext, ComponentChildren } from \"preact\";\nimport { useState, useContext, useCallback, useRef, useLayoutEffect } from \"preact/hooks\";\nimport { PaymentMethod } from \"../../models/constants\";\nimport { ResultMessage } from \"../../models/models\";\n\n/** A submit trigger registered by the active card-type component. May be async — see SubmitApi. */\nexport type SubmitHandler = () => void | Promise<void>;\n\nexport type SubmitApi = {\n /**\n * Invokes the active card form's submit handler. The boolean only says a handler existed\n * and was invoked — the submission itself runs asynchronously and reports its outcome\n * through onPaymentCompleted/onPaymentFailed.\n */\n triggerSubmit: () => boolean;\n};\n\ntype PaymentMethodContextType = {\n activePaymentMethod: PaymentMethod | null;\n setActivePaymentMethod: (value: PaymentMethod | null) => void;\n activeStoredPaymentMethodId: string | null;\n setActiveStoredPaymentMethodId: (value: string) => void;\n isPaymentMethodInitialized: Record<PaymentMethod, boolean>;\n updatePaymentMethodInitialization: (paymentMethod: PaymentMethod, isInitialized: boolean) => void;\n isStoredCardInitialized: Record<string, boolean>;\n updateStoredCardInitialization: (storedPaymentMethod: string, isInitialized: boolean) => void;\n handleSuccess: (success: ResultMessage) => void;\n success: ResultMessage | null;\n handleError: (error: ResultMessage) => void;\n error: ResultMessage | null;\n threeDSecureActive: boolean;\n setThreeDSecureActive: (value: boolean) => void;\n /**\n * True while a 3DS challenge run by ANOTHER payment method takes over the widget —\n * the asking component must render nothing. Components matching a specific stored card\n * additionally check their own card id (see stored-card-component).\n */\n isObscuredByThreeDS: (method: PaymentMethod) => boolean;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n registerSubmitHandler: (handler: SubmitHandler) => void;\n unregisterSubmitHandler: (handler: SubmitHandler) => void;\n};\n\nconst PaymentMethodContext = createContext<PaymentMethodContextType | undefined>(undefined);\n\nconst defaultIsInitialized: Record<PaymentMethod, boolean> = {\n card: false,\n storedcard: false,\n googlepay: false,\n applepay: false,\n};\n\nexport const PaymentMethodGroupContext = ({\n children,\n initialValue,\n initialStoredPaymentMethodId = null,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n onSubmitApiReady,\n}: {\n children: ComponentChildren;\n initialValue: PaymentMethod | null;\n initialStoredPaymentMethodId?: string | null;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}): h.JSX.Element => {\n const [activePaymentMethod, setActivePaymentMethod] = useState(initialValue);\n const activeSubmitHandlerRef = useRef<SubmitHandler | null>(null);\n\n const registerSubmitHandler = useCallback((handler: SubmitHandler): void => {\n activeSubmitHandlerRef.current = handler;\n }, []);\n\n const unregisterSubmitHandler = useCallback((handler: SubmitHandler): void => {\n // Identity check guards against effect-cleanup ordering races when switching\n // between card-type payment methods: an outgoing form's cleanup must not\n // clobber a handler an incoming form already registered.\n if (activeSubmitHandlerRef.current === handler) {\n activeSubmitHandlerRef.current = null;\n }\n }, []);\n\n const triggerSubmit = useCallback((): boolean => {\n const handler = activeSubmitHandlerRef.current;\n\n if (!handler) {\n return false;\n }\n\n handler();\n return true;\n }, []);\n\n useLayoutEffect(() => {\n onSubmitApiReady?.({ triggerSubmit });\n }, []);\n const [activeStoredPaymentMethodId, setActiveStoredPaymentMethodId] = useState<string | null>(\n initialStoredPaymentMethodId\n );\n const [threeDSecureActive, setThreeDSecureActive] = useState<boolean>(false);\n const [isPaymentMethodInitialized, setIsPaymentMethodInitialized] = useState(defaultIsInitialized);\n const [isStoredCardInitialized, setIsStoredCardInitialized] = useState<Record<string, boolean>>({});\n\n const [success, setSuccess] = useState<ResultMessage | null>(null);\n const [error, setError] = useState<ResultMessage | null>(null);\n\n const updatePaymentMethodInitialization = (paymentMethod: PaymentMethod, isInitialized: boolean) => {\n setIsPaymentMethodInitialized((prevState) => ({\n ...prevState,\n [paymentMethod]: isInitialized,\n }));\n };\n\n const updateStoredCardInitialization = (storedPaymentMethod: string, isInitialized: boolean) => {\n setIsStoredCardInitialized((prevState) => ({\n ...prevState,\n [storedPaymentMethod]: isInitialized,\n }));\n };\n\n const isObscuredByThreeDS = useCallback(\n (method: PaymentMethod): boolean => threeDSecureActive && activePaymentMethod !== method,\n [threeDSecureActive, activePaymentMethod]\n );\n\n const handleError = (error: ResultMessage) => {\n setError(error);\n };\n\n const handleSuccess = (success: ResultMessage) => {\n setSuccess(success);\n };\n\n return (\n <PaymentMethodContext.Provider\n value={{\n activePaymentMethod,\n setActivePaymentMethod,\n activeStoredPaymentMethodId,\n setActiveStoredPaymentMethodId,\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n isStoredCardInitialized,\n updateStoredCardInitialization,\n handleSuccess,\n success,\n handleError,\n error,\n threeDSecureActive,\n setThreeDSecureActive,\n isObscuredByThreeDS,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n registerSubmitHandler,\n unregisterSubmitHandler,\n }}\n >\n {children}\n </PaymentMethodContext.Provider>\n );\n};\n\nexport const usePaymentMethodGroup = (): PaymentMethodContextType => {\n const context = useContext(PaymentMethodContext);\n if (context === undefined) {\n throw new Error(\"usePaymentMethodGroup must be used within a PaymentMethodGroup\");\n }\n return context as PaymentMethodContextType;\n};\n","import { h } from \"preact\";\nimport { createContext, ComponentChildren } from \"preact\";\nimport { useContext } from \"preact/hooks\";\nimport { Language } from \"./translations\";\nimport { I18nService } from \"./i18n-service\";\n\ntype I18nContextType = {\n i18n: I18nService;\n changeLanguage: (language: Language) => void;\n};\n\nconst I18nContext = createContext<I18nContextType | undefined>(undefined);\n\nexport const I18nProvider = ({\n children,\n i18nService,\n onLanguageChange,\n}: {\n children: ComponentChildren;\n i18nService: I18nService; // Use existing instance from StraumurCheckout\n onLanguageChange?: (language: Language) => void;\n}): h.JSX.Element => {\n const changeLanguage = (newLanguage: Language) => {\n i18nService.setLanguage(newLanguage);\n onLanguageChange?.(newLanguage);\n };\n\n return <I18nContext.Provider value={{ i18n: i18nService, changeLanguage }}>{children}</I18nContext.Provider>;\n};\n\nexport const useI18n = (): I18nContextType => {\n const context = useContext(I18nContext);\n if (!context) {\n throw new Error(\"useI18n must be used within an I18nProvider\");\n }\n return context;\n};\n","import { h } from \"preact\";\n\nconst CardIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M24 11H0V7H24V11Z\" fill=\"currentColor\" />\n <path\n opacity=\"0.4\"\n d=\"M21.3333 3C22.8042 3 24 4.19375 24 5.66667V7H0V5.66667C0 4.19375 1.19375 3 2.66667 3H21.3333ZM24 19C24 20.4708 22.8042 21.6667 21.3333 21.6667H2.66667C1.19375 21.6667 0 20.4708 0 19V11H24V19ZM4.66667 16.3333C4.3 16.3333 4 16.6333 4 17C4 17.3667 4.3 17.6667 4.66667 17.6667H7.33333C7.7 17.6667 8 17.3667 8 17C8 16.6333 7.7 16.3333 7.33333 16.3333H4.66667ZM10 17.6667H15.3333C15.7 17.6667 16 17.3667 16 17C16 16.6333 15.7 16.3333 15.3333 16.3333H10C9.63333 16.3333 9.33333 16.6333 9.33333 17C9.33333 17.3667 9.63333 17.6667 10 17.6667Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default CardIcon;\n","import { Fragment, h } from \"preact\";\nimport MasterCardIcon from \"../assets/icons/mastercard\";\nimport VisaIcon from \"../assets/icons/visa\";\nimport MaestroIcon from \"../assets/icons/maestro\";\nimport AmexIcon from \"../assets/icons/amex\";\nimport JcbIcon from \"../assets/icons/jcb\";\nimport DinersIcon from \"../assets/icons/diners\";\nimport DiscoverIcon from \"../assets/icons/discover\";\nimport CupIcon from \"../assets/icons/cup\";\nimport { Tooltip } from \"../components/tooltip/tooltip\";\nimport { useMediaQuery } from \"./custom-hooks/use-media-query\";\nimport { ResolvedTheme } from \"../models/models\";\n\ninterface BrandIcon {\n brand: string;\n brandFullName: string;\n}\n\nexport interface BrandHidden {\n brand: string;\n}\n\ninterface RenderBrandIconsProps {\n brands: BrandIcon[];\n brandHidden?: BrandHidden[];\n limit?: number;\n /** Resolved widget theme. On \"dark\" the brand marks switch to their reversed/chipped variants. */\n theme?: ResolvedTheme;\n}\n\n// Preferred display order for the most common card brands; anything not listed is appended after\n// these, keeping the order the backend sent them in (Array.prototype.sort is stable).\nconst BRAND_DISPLAY_ORDER = [\"visa\", \"mc\", \"maestro\", \"amex\", \"jcb\", \"cup\"];\n\nconst brandRank = (brand: string): number => {\n const index = BRAND_DISPLAY_ORDER.indexOf(brand);\n\n return index === -1 ? BRAND_DISPLAY_ORDER.length : index;\n};\n\nexport function RenderBrandIcons({\n brands,\n brandHidden = [],\n limit = 4,\n theme = \"light\",\n}: RenderBrandIconsProps): h.JSX.Element {\n const isWidth380 = useMediaQuery(\"(max-width: 380px)\");\n const isWidth335 = useMediaQuery(\"(max-width: 335px)\");\n const widthLimit = isWidth335 ? 1 : isWidth380 ? 2 : limit;\n\n const brandToShow = brands\n .filter((brand) => !brandHidden.some((x) => x.brand === brand.brand))\n .sort((a, b) => brandRank(a.brand) - brandRank(b.brand));\n\n return (\n <Fragment>\n {brandToShow.map(({ brand }, index) => {\n if (index >= Math.min(limit, widthLimit)) {\n if (index === Math.min(limit, widthLimit)) {\n return (\n <Tooltip\n content={\n <span style={{ display: \"flex\", gap: \"4px\", overflow: \"visible\" }}>\n {brandToShow.slice(Math.min(limit, widthLimit)).map(({ brand }) => (\n <RenderBrandIcon key={brand} brand={brand} theme={theme} />\n ))}\n </span>\n }\n >\n <span key={brand} className=\"straumur__render-brand-icons__overflow\">\n +{brandToShow.length - Math.min(limit, widthLimit)}\n </span>\n </Tooltip>\n );\n }\n return null;\n }\n\n return <RenderBrandIcon key={brand} brand={brand} theme={theme} />;\n })}\n </Fragment>\n );\n}\n\n// Networks that publish a reversed mark: on dark we render them without the white box (in white ink\n// where needed). The rest keep their multicolor logo on a light \"chip\" so they stay brand-compliant.\nconst withChip = (icon: h.JSX.Element, isDark: boolean): h.JSX.Element =>\n isDark ? <span className=\"straumur__brand-chip\">{icon}</span> : icon;\n\nexport const RenderBrandIcon = ({\n brand,\n theme = \"light\",\n defaultToBrandName = true,\n}: {\n brand: string;\n theme?: ResolvedTheme;\n defaultToBrandName?: boolean;\n}): h.JSX.Element => {\n const isDark = theme === \"dark\";\n\n switch (brand) {\n case \"visa\":\n return <VisaIcon reversed={isDark} />;\n case \"mc\":\n return <MasterCardIcon reversed={isDark} />;\n case \"maestro\":\n return <MaestroIcon reversed={isDark} />;\n case \"discover\":\n return <DiscoverIcon reversed={isDark} />;\n case \"amex\":\n // Already a white logo on the Amex-blue box — reads fine on either theme.\n return <AmexIcon />;\n case \"jcb\":\n return withChip(<JcbIcon />, isDark);\n case \"diners\":\n return withChip(<DinersIcon />, isDark);\n case \"cup\":\n return withChip(<CupIcon />, isDark);\n default:\n if (defaultToBrandName) {\n return <span>{brand}</span>;\n }\n return <Fragment></Fragment>;\n }\n};\n","import { h } from \"preact\";\n\ninterface MasterCardIconProps {\n opacity?: number;\n /** Dark-theme reversed mark: drop the white background; the interlocking circles work on dark. */\n reversed?: boolean;\n}\n\nconst MasterCardIcon = ({ opacity = 1, reversed = false }: MasterCardIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" viewBox=\"0 0 40 26\" opacity={opacity}>\n {!reversed && <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />}\n <path fill=\"#F06022\" d=\"M16.13 19.29h7.74V6.7h-7.74v12.58z\" />\n <path\n fill=\"#EA1D25\"\n d=\"M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13\"\n />\n <path\n fill=\"#F79D1D\"\n d=\"M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13\"\n />\n </svg>\n);\n\nexport default MasterCardIcon;\n","import { h } from \"preact\";\n\ninterface VisaIconProps {\n opacity?: number;\n /** Dark-theme reversed mark: drop the white background and render the wordmark in white. */\n reversed?: boolean;\n}\n\nconst VisaIcon = ({ opacity = 1, reversed = false }: VisaIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n {!reversed && <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />}\n <path\n fill={reversed ? \"#fff\" : \"#1434CB\"}\n d=\"m15.9 7.7-4.43 10.6h-2.9l-2.2-8.47c-.13-.52-.25-.71-.65-.93C5.05 8.55 3.96 8.2 3 8l.07-.32h4.67c.6 0 1.13.4 1.27 1.09l1.15 6.14 2.86-7.23h2.89Zm11.39 7.15c0-2.8-3.88-2.96-3.85-4.21 0-.38.37-.79 1.16-.9a5.2 5.2 0 0 1 2.71.48l.48-2.25a7.4 7.4 0 0 0-2.57-.47c-2.71 0-4.62 1.44-4.64 3.51-.02 1.53 1.36 2.38 2.4 2.9 1.08.51 1.44.85 1.43 1.31 0 .71-.85 1.03-1.64 1.04-1.39.02-2.19-.37-2.82-.67l-.5 2.33c.64.29 1.82.55 3.05.56 2.89 0 4.78-1.42 4.79-3.63Zm7.17 3.46H37L34.78 7.7h-2.34c-.53 0-.98.3-1.17.78l-4.12 9.84h2.88l.57-1.58h3.53l.33 1.58Zm-3.07-3.76 1.45-3.99.83 4H31.4ZM19.83 7.7l-2.27 10.62h-2.74L17.09 7.7h2.74Z\"\n />\n </svg>\n);\n\nexport default VisaIcon;\n","import { h } from \"preact\";\n\ninterface MaestroIconProps {\n opacity?: number;\n /** Dark-theme reversed mark: drop the white background; the interlocking circles work on dark. */\n reversed?: boolean;\n}\n\nconst MaestroIcon = ({ opacity = 1, reversed = false }: MaestroIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n {!reversed && <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />}\n <path fill=\"#7773B4\" d=\"M16.13 19.29h7.74V6.7h-7.74v12.58z\" />\n <path\n fill=\"#EA1D25\"\n d=\"M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13\"\n />\n <path\n fill=\"#139FDA\"\n d=\"M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13\"\n />\n </svg>\n);\n\nexport default MaestroIcon;\n","import { h } from \"preact\";\n\ninterface AmexIconProps {\n opacity?: number;\n}\n\nconst AmexIcon = ({ opacity = 1 }: AmexIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"30\" height=\"19.5\" opacity={opacity}>\n <path fill=\"#016FD0\" d=\"M0 26h40V0H0v26z\" />\n <path\n fill=\"#fff\"\n fill-rule=\"evenodd\"\n d=\"M30.69 13.63v1.64h-4.17v1.14h4.07v1.64h-4.07v1.12h4.17v1.66l3.38-3.6-3.38-3.6zm-1.1-6.14-1.4-3.19h-4l-4.1 9.32h3.33v8.27l10.28.01 1.61-1.8 1.63 1.8H40v-2.63l-1.92-2.06L40 15.16v-2.59l-1.93.01V7.6l-1.81 4.98H34.5l-1.86-5v5h-4.2l-.6-1.46h-3.3l-.6 1.46h-2.22l3.23-7.27V5.3h2.55l3.19 7.21V5.3l3.1.01 1.6 4.47 1.62-4.48H40v-1h-3.77l-.85 2.39-.85-2.39h-4.94v3.19zm-5.06 6.11v7.27h6.16v-.01h2.54l2.1-2.32 2.12 2.32H40v-.1l-3.34-3.53L40 13.65v-.05h-2.52l-2.1 2.3-2.08-2.3h-8.77zm.7-4.11.96-2.31.97 2.31h-1.93z\"\n />\n </svg>\n);\n\nexport default AmexIcon;\n","import { h } from \"preact\";\n\ninterface JcbIconProps {\n opacity?: number;\n}\n\nconst JcbIcon = ({ opacity = 1 }: JcbIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <g clip-path=\"url(#a)\">\n <path fill=\"#fff\" d=\"M0 0h40v26H0V0Z\" />\n <path fill=\"#fff\" d=\"M36.6 20.66a5.22 5.22 0 0 1-5.22 5.22H3V5.22A5.22 5.22 0 0 1 8.22 0H36.6v20.66Z\" />\n <path\n fill=\"url(#b)\"\n d=\"M27.36 15.36h2.15l.27-.02a.96.96 0 0 0 .76-.96 1 1 0 0 0-.76-.97c-.06-.02-.19-.02-.27-.02h-2.15v1.97Z\"\n />\n <path\n fill=\"url(#c)\"\n d=\"M29.27 1.75a3.74 3.74 0 0 0-3.74 3.73v3.89h5.28c.12 0 .26 0 .37.02 1.19.06 2.07.67 2.07 1.74 0 .84-.6 1.56-1.7 1.7v.05c1.2.08 2.13.76 2.13 1.8 0 1.13-1.03 1.87-2.38 1.87h-5.8v7.6H31a3.74 3.74 0 0 0 3.73-3.74V1.75h-5.46Z\"\n />\n <path\n fill=\"url(#d)\"\n d=\"M30.27 11.38c0-.5-.35-.82-.76-.89l-.2-.02h-1.95v1.81h1.95c.06 0 .18 0 .2-.02a.87.87 0 0 0 .76-.88Z\"\n />\n <path\n fill=\"url(#e)\"\n d=\"M8.6 1.75a3.74 3.74 0 0 0-3.73 3.73v9.22a7.4 7.4 0 0 0 3.22.85c1.3 0 2-.78 2-1.85V9.34h3.2v4.34c0 1.68-1.05 3.06-4.6 3.06-2.16 0-3.84-.47-3.84-.47v7.86h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75H8.6Z\"\n />\n <path\n fill=\"url(#f)\"\n d=\"M18.94 1.75a3.74 3.74 0 0 0-3.74 3.73v4.9c.94-.8 2.59-1.32 5.24-1.2 1.41.06 2.93.45 2.93.45v1.58a7.1 7.1 0 0 0-2.83-.82c-2.01-.14-3.23.84-3.23 2.57 0 1.74 1.22 2.73 3.23 2.57a7.46 7.46 0 0 0 2.83-.82v1.58s-1.5.39-2.93.45c-2.65.12-4.3-.4-5.24-1.2v8.63h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75h-5.48Z\"\n />\n </g>\n <defs>\n <linearGradient id=\"b\" x1=\"25.52\" x2=\"34.75\" y1=\"14.38\" y2=\"14.38\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"c\" x1=\"25.52\" x2=\"34.75\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"d\" x1=\"25.52\" x2=\"34.75\" y1=\"11.37\" y2=\"11.37\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"e\" x1=\"4.86\" x2=\"14.24\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#1F286F\" />\n <stop offset=\".48\" stop-color=\"#004E94\" />\n <stop offset=\".83\" stop-color=\"#0066B1\" />\n <stop offset=\"1\" stop-color=\"#006FBC\" />\n </linearGradient>\n <linearGradient id=\"f\" x1=\"15.15\" x2=\"24.25\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#6C2C2F\" />\n <stop offset=\".17\" stop-color=\"#882730\" />\n <stop offset=\".57\" stop-color=\"#BE1833\" />\n <stop offset=\".86\" stop-color=\"#DC0436\" />\n <stop offset=\"1\" stop-color=\"#E60039\" />\n </linearGradient>\n <clipPath id=\"a\">\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default JcbIcon;\n","import { h } from \"preact\";\n\ninterface DinersIconProps {\n opacity?: number;\n}\n\nconst DinersIcon = ({ opacity = 1 }: DinersIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"30\" height=\"19.5\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <g fill=\"#1a1918\">\n <path d=\"M5.96 15.58c0-.56-.3-.52-.58-.53v-.16H7.2a2.28 2.28 0 0 1 2.5 2.2c0 .61-.36 2.17-2.57 2.17H5.38v-.16c.38-.04.56-.05.58-.48zm.61 2.94c0 .49.35.54.65.54a1.75 1.75 0 0 0 1.8-1.95 1.88 1.88 0 0 0-1.96-2.02c-.26 0-.37.02-.49.02zm3.36.58h.12c.17 0 .3 0 .3-.2v-1.7c0-.28-.1-.32-.33-.44v-.1l.67-.23a.22.22 0 0 1 .11-.03c.03 0 .05.04.05.09v2.4c0 .21.13.21.3.21h.11v.16H9.93zm.67-3.67a.3.3 0 0 1 0-.61.3.3 0 0 1 .3.3.31.31 0 0 1-.3.31zm1.26 1.8c0-.23-.07-.3-.36-.41v-.12a8.44 8.44 0 0 0 .82-.3c.02 0 .04.01.04.06v.4a1.83 1.83 0 0 1 1.08-.46c.53 0 .72.39.72.88v1.61c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.11c.18 0 .3 0 .3-.2v-1.63c0-.36-.22-.53-.57-.53a1.66 1.66 0 0 0-.73.3v1.85c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.1c.18 0 .3 0 .3-.2v-1.67m3.21.3a1.55 1.55 0 0 0 0 .37 1.05 1.05 0 0 0 .92 1.08 1.2 1.2 0 0 0 .85-.42l.08.09a1.47 1.47 0 0 1-1.15.7 1.26 1.26 0 0 1-1.2-1.36c0-1.23.83-1.6 1.27-1.6a1 1 0 0 1 1.05 1 .74.74 0 0 1 0 .1l-.06.04zm1.11-.2c.16 0 .18-.08.18-.16a.53.53 0 0 0-.55-.57c-.38 0-.64.28-.72.73zm.86 1.77h.17c.17 0 .3 0 .3-.2v-1.77c0-.2-.23-.23-.33-.28v-.1c.46-.19.7-.35.77-.35.03 0 .05.02.05.08v.56H18c.16-.24.42-.64.8-.64a.34.34 0 0 1 .36.33.3.3 0 0 1-.3.32c-.19 0-.19-.15-.4-.15a.53.53 0 0 0-.46.52v1.47c0 .21.12.21.3.21h.35v.16h-.88a26 26 0 0 0-.74 0zm2.41-.7a.83.83 0 0 0 .78.76.44.44 0 0 0 .51-.45c0-.74-1.36-.5-1.36-1.5a.86.86 0 0 1 .97-.81 1.64 1.64 0 0 1 .71.18l.04.64h-.14a.64.64 0 0 0-.68-.62.44.44 0 0 0-.49.41c0 .74 1.45.51 1.45 1.5 0 .4-.33.85-1.07.85a1.64 1.64 0 0 1-.77-.22l-.07-.72.12-.03m7.44-2.37h-.15A1.2 1.2 0 0 0 25.39 15a1.79 1.79 0 0 0-1.77 2 2.04 2.04 0 0 0 1.87 2.17 1.27 1.27 0 0 0 1.25-1.09l.15.04-.15.91a3.5 3.5 0 0 1-1.38.34A2.23 2.23 0 0 1 22.97 17a2.3 2.3 0 0 1 2.37-2.2 4.5 4.5 0 0 1 1.48.33l.06.9m.22 3.07h.13c.17 0 .3 0 .3-.2v-3.5c0-.4-.1-.42-.34-.49v-.1a3.96 3.96 0 0 0 .65-.27.66.66 0 0 1 .14-.07c.03 0 .05.04.05.1v4.32c0 .21.13.21.3.21h.12v.16H27.1zm4.02-.18c0 .11.07.12.18.12h.25v.12a6.33 6.33 0 0 0-.9.2l-.03-.02v-.5a1.69 1.69 0 0 1-1.11.52.68.68 0 0 1-.69-.75v-1.6c0-.17-.02-.32-.37-.35v-.12l.8-.05c.07 0 .07.05.07.18v1.62c0 .19 0 .73.55.73a1.4 1.4 0 0 0 .75-.38v-1.7c0-.12-.3-.18-.52-.25v-.11c.56-.04.91-.09.97-.09.05 0 .05.05.05.11zm1.25-2.07a1.58 1.58 0 0 1 .93-.45 1.22 1.22 0 0 1 1.16 1.31 1.58 1.58 0 0 1-1.5 1.65 1.84 1.84 0 0 1-.86-.22l-.19.14-.13-.07a7.37 7.37 0 0 0 .09-1.11v-2.7c0-.4-.1-.42-.33-.49v-.1a3.93 3.93 0 0 0 .64-.27.67.67 0 0 1 .14-.07c.04 0 .05.04.05.1zm0 1.7a.67.67 0 0 0 .64.64c.67 0 .95-.65.95-1.21a1.2 1.2 0 0 0-1-1.24.96.96 0 0 0-.6.3v1.51zM5.38 22.91h.04c.13 0 .26-.02.26-.2v-1.78c0-.18-.13-.2-.26-.2h-.04v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L5.88 23l-.5.01z\" />\n <path d=\"M6.42 23.03 5.88 23l-.5.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.07v.13h-.06c-.13 0-.24.01-.24.18v1.79c0 .16.11.17.24.17h.06v.14zM6.4 23v-.08h-.03c-.12 0-.27-.02-.27-.2v-1.8c0-.18.15-.2.27-.2h.03v-.07h-1v.07h.03c.13 0 .27.02.27.2v1.8c0 .18-.14.2-.27.2H5.4V23l.49-.02.52.02zm2.35-.66h.01v-1.29a.28.28 0 0 0-.3-.32H8.4v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L7.07 21.1v1.41c0 .3.06.4.32.4h.06v.1L7 23l-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01 1.51 1.71\" />\n <path d=\"M8.95 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01L7 23l-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.19-.3-.29-.3h-.09v-.13h.94v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.27 2.27 0 0 0 .02.34v.02zm-.13-.03h.11a2.3 2.3 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07H8.4v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07H7.4c-.27 0-.34-.12-.34-.42v-1.44l1.77 1.98zm-.07-.71.01-.01v.01zm0 0v-.01zM9.8 20.8c-.26 0-.27.06-.32.31h-.1l.04-.29a2.04 2.04 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .18-.1h.09l-.04.28v.28l-.11.04c0-.13-.02-.33-.25-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1l-.56-.01-.57.01v-.1h.06c.19 0 .28-.02.28-.29V20.8z\" />\n <path d=\"m11.14 23.03-.56-.02-.57.02h-.02v-.14h.08c.19 0 .26 0 .27-.27v-1.8H9.8v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03a3.96 3.96 0 0 1 .04-.53h-.05c-.02.1-.11.1-.2.1H9.71c-.08 0-.17 0-.2-.1h-.06a2.04 2.04 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.3a1.93 1.93 0 0 0 .02-.28v-.01h.11c.03.1.09.1.18.1h1.77c.1 0 .16 0 .17-.1v-.01h.02l.1.02-.01.01-.04.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.55v1.8c0 .25.11.27.27.27h.08v.14zm.71-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.85.01.87-.01.01.52-.1.03c-.02-.22-.06-.4-.42-.4h-.47v.9h.4c.2 0 .25-.12.27-.3h.1v.78l-.1.02c-.02-.2-.03-.33-.26-.33h-.4v.79c0 .22.19.22.4.22.41 0 .6-.03.7-.41l.1.02a7.7 7.7 0 0 0-.12.54l-.92-.01-.9.01v-.1\" />\n <path d=\"m13.68 23.03-.92-.02-.9.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.75v.01a4.18 4.18 0 0 0 0 .52v.01l-.13.04v-.02c-.02-.22-.05-.38-.4-.38h-.46v.86h.4c.2 0 .23-.1.25-.29v-.01h.13v.01a8.08 8.08 0 0 0 0 .8h-.01l-.12.03v-.02c-.02-.2-.03-.32-.25-.32h-.4v.78c0 .2.18.2.4.2.42 0 .58-.02.68-.4v-.01h.02l.1.03v.01a7.8 7.8 0 0 0-.11.54v.02zm-.02-.03.11-.52-.06-.02c-.1.39-.3.42-.7.42-.22 0-.43 0-.44-.24v-.8H13c.24-.01.26.13.28.33l.07-.02a7.25 7.25 0 0 1 0-.76h-.07c-.02.18-.08.3-.29.3h-.42v-.92h.5c.35 0 .4.18.42.4l.07-.03a5.76 5.76 0 0 1 0-.5l-.86.02-.83-.01v.07h.03c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.89-.02zm.59-2c0-.26-.14-.27-.24-.27h-.06v-.1l.53.01.54-.01c.43 0 .81.12.81.6a.64.64 0 0 1-.47.6l.58.87a.38.38 0 0 0 .33.21v.1l-.33-.01-.32.01a9.45 9.45 0 0 1-.7-1.1h-.23v.73c0 .26.12.27.28.27h.06v.1l-.59-.01-.5.01v-.1h.07c.13 0 .24-.06.24-.18v-1.74zm.44.78h.16c.34 0 .53-.13.53-.53a.47.47 0 0 0-.5-.5 1.65 1.65 0 0 0-.2.02v1.01z\" />\n <path d=\"m16.27 23.03-.33-.02c-.1 0-.21.02-.33.01a9.54 9.54 0 0 1-.7-1.1h-.2v.72c0 .25.1.25.26.25h.07v.14h-.01l-.59-.02-.5.02v-.14H14c.12 0 .22-.05.23-.16v-1.74c0-.24-.13-.24-.23-.24h-.08v-.13h1.09c.43 0 .83.11.83.61a.65.65 0 0 1-.47.6l.57.87a.37.37 0 0 0 .32.2h.02v.13zm-1.58-1.14h.23a10.55 10.55 0 0 0 .7 1.1h.64v-.07a.39.39 0 0 1-.33-.2l-.6-.9h.02a.63.63 0 0 0 .47-.59c0-.47-.37-.58-.8-.58h-1.06v.07h.05c.1 0 .26.02.26.27v1.74c0 .13-.13.2-.26.2h-.05V23l.48-.02.57.02v-.07h-.04c-.16 0-.3-.02-.3-.3v-.74zm0-.1h-.02v-1.04h.01a1.63 1.63 0 0 1 .2-.01.48.48 0 0 1 .51.51c0 .4-.2.55-.54.55zm.16-.02c.34 0 .51-.12.51-.52a.45.45 0 0 0-.48-.48 1.33 1.33 0 0 0-.18.01v.99zm3.73.57h.01v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L16.9 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01z\" />\n <path d=\"M18.78 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01l-.44-.02-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.71l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.09v-.13h.93v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.15 2.15 0 0 0 .02.34v.02zm-.13-.03h.11a2.34 2.34 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07h-.87v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07h-.04c-.27 0-.34-.12-.34-.42v-1.44zm-.07-.71.01-.01v.01zm0 0v-.01zm1.08.18a1.38 1.38 0 0 0-.07.27c0 .1.14.12.25.12h.04v.1a7.72 7.72 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.54-1.57a2.87 2.87 0 0 0 .13-.42 1.73 1.73 0 0 0 .3-.15.08.08 0 0 1 .04 0 .02.02 0 0 1 .02 0l.03.1.63 1.78.12.34a.22.22 0 0 0 .23.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.03c.08 0 .22-.01.22-.1a1.1 1.1 0 0 0-.07-.25l-.14-.4h-.77l-.1.36zm.5-1.5-.32.96h.63l-.31-.97z\" />\n <path d=\"M21.48 23.03 21 23l-.51.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.1 1.1 0 0 0-.07-.24l-.13-.39h-.75l-.1.35a1.41 1.41 0 0 0-.08.26c0 .08.13.1.24.1h.06v.14h-.02l-.41-.02-.37.02h-.01v-.14h.03a.3.3 0 0 0 .28-.2l.55-1.57a4.05 4.05 0 0 0 .13-.44 1.75 1.75 0 0 0 .31-.14.09.09 0 0 1 .03-.01.04.04 0 0 1 .04.02l.03.09.63 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zM20.5 23l.5-.02.45.02v-.07a.23.23 0 0 1-.24-.15c-.05-.1-.09-.23-.13-.35l-.62-1.78-.03-.09h-.02a.08.08 0 0 0-.01 0 1.26 1.26 0 0 1-.3.14 2.83 2.83 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.03c-.1 0-.26-.02-.27-.14a1.35 1.35 0 0 1 .08-.27h.01-.01l.11-.36h.8l.13.4a1.04 1.04 0 0 1 .07.25c0 .1-.15.11-.23.12h-.02zm-.7-1 .33-1h.03l.32 1zm.05-.04h.6l-.3-.91zm.28-.94h.01zm1.5-.22c-.26 0-.27.06-.32.31h-.1l.04-.29a2.1 2.1 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .19-.1h.08l-.04.28v.28l-.1.04c-.02-.13-.03-.33-.26-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1L22.4 23l-.57.01v-.1h.06c.19 0 .29-.02.29-.29V20.8h-.56\" />\n <path d=\"M22.97 23.03 22.4 23l-.57.02h-.02v-.14h.08c.19 0 .27 0 .27-.27v-1.8h-.54v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03v-.27l.04-.26h-.05c-.02.1-.11.1-.2.1h-1.77c-.08 0-.17 0-.2-.1h-.06a2 2 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.29a1.98 1.98 0 0 0 .02-.29v-.01h.11c.03.1.1.1.18.1h1.77c.1 0 .17 0 .17-.1v-.01h.02l.1.02v.01l-.05.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.54v1.8c0 .25.1.27.26.27h.08v.14h-.01m.74-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L24.2 23l-.5.01z\" />\n <path d=\"M24.74 23.03 24.2 23l-.5.02h-.01v-.14h.06c.12 0 .24 0 .24-.17v-1.8c0-.16-.12-.17-.24-.17h-.06v-.13h1.07v.13h-.07c-.12 0-.23.01-.23.18v1.79c0 .16.1.17.23.17h.07v.14zm-.01-.03v-.07h-.04c-.12 0-.26-.03-.26-.21v-1.8c0-.18.14-.2.26-.2h.04v-.07H23.7v.07h.04c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.48-.02.53.02zm1.37-2.42a1.2 1.2 0 0 1 1.3 1.18 1.25 1.25 0 0 1-1.28 1.3 1.2 1.2 0 0 1-1.28-1.22 1.24 1.24 0 0 1 1.26-1.26m.05 2.33c.66 0 .78-.58.78-1.08s-.27-1.1-.84-1.1c-.6 0-.77.53-.77.99 0 .6.28 1.2.83 1.2\" />\n <path d=\"M24.83 21.84a1.26 1.26 0 0 1 1.27-1.28v.03a1.23 1.23 0 0 0-1.24 1.25 1.19 1.19 0 0 0 1.26 1.2 1.24 1.24 0 0 0 1.27-1.28 1.18 1.18 0 0 0-1.3-1.17v-.03a1.21 1.21 0 0 1 1.33 1.2 1.27 1.27 0 0 1-1.3 1.32 1.22 1.22 0 0 1-1.3-1.24m.48-.12c0-.46.18-1 .8-1 .57 0 .84.61.84 1.11s-.12 1.1-.79 1.1v-.03c.65 0 .76-.57.76-1.07s-.26-1.08-.82-1.09c-.58 0-.75.52-.76.98 0 .6.28 1.18.82 1.18v.03c-.56 0-.84-.6-.85-1.21m4.4.62v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.05c-.15 0-.3.03-.3.44v1.55a2.2 2.2 0 0 0 .01.34h-.12L28 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.46.01v-.1h.05c.23 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.39.01.3-.01 1.52 1.71\" />\n <path d=\"M29.9 23.08h-.15l-1.72-1.94v1.37c0 .3.05.38.3.38h.07v.14h-.01l-.44-.02-.46.02h-.02v-.14h.07c.22 0 .28-.14.29-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.1v-.13h.94v.13h-.06c-.14 0-.29.01-.3.42v1.55a2.26 2.26 0 0 0 .03.34v.02zm-.13-.03h.1a2.42 2.42 0 0 1-.01-.33v-1.55c0-.41.17-.45.32-.45h.03v-.07h-.86v.07h.06a.3.3 0 0 1 .3.33v1.3l-.01.01-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .33.32v1.44c0 .27-.08.44-.32.45h-.04V23l.45-.02.43.02v-.07h-.05c-.27 0-.33-.12-.33-.42v-1.44zm-.07-.71v-.01zm-.01 0v-.01zm1.09.18a1.43 1.43 0 0 0-.08.27c0 .1.14.12.26.12h.03v.1a7.71 7.71 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.55-1.57a2.79 2.79 0 0 0 .12-.42 1.75 1.75 0 0 0 .31-.15.07.07 0 0 1 .03 0 .02.02 0 0 1 .02 0l.03.1.63 1.78c.04.11.08.24.13.34a.22.22 0 0 0 .22.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.04c.08 0 .2-.01.2-.1a1.1 1.1 0 0 0-.06-.25l-.13-.4h-.78zm.5-1.5h-.01l-.32.96h.64l-.32-.97z\" />\n <path d=\"m32.59 23.03-.47-.02-.5.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.06 1.06 0 0 0-.07-.24l-.13-.39h-.76l-.1.35a1.44 1.44 0 0 0-.07.26c0 .08.12.1.24.1H31v.14h-.02l-.4-.02-.38.02h-.01v-.14h.03a.3.3 0 0 0 .29-.2l.54-1.57a4.27 4.27 0 0 0 .14-.44 1.85 1.85 0 0 0 .3-.14.08.08 0 0 1 .04 0 .04.04 0 0 1 .04.01l.03.09.62 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zm-.97-.03.5-.02.46.02v-.08h-.01a.23.23 0 0 1-.24-.14l-.12-.35-.63-1.78a3.61 3.61 0 0 1-.03-.09h-.01a.06.06 0 0 0-.02 0 1.3 1.3 0 0 1-.3.14 2.94 2.94 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.02c-.11 0-.27-.02-.27-.14a1.42 1.42 0 0 1 .07-.27h.02-.02l.11-.36h.8l.13.4a1.07 1.07 0 0 1 .07.25c0 .1-.15.11-.22.12h-.03zm-.7-1 .34-1h.02l.33 1zm.05-.04h.6l-.3-.91zm2.48.72c0 .13.1.18.2.19a2.47 2.47 0 0 0 .45 0 .48.48 0 0 0 .33-.2.78.78 0 0 0 .1-.24h.1l-.12.58-.9-.01-.9.01v-.1h.05c.12 0 .25-.02.25-.23v-1.75c0-.18-.13-.2-.25-.2h-.05v-.1l.54.01.51-.01v.1h-.08c-.13 0-.23 0-.23.19z\" />\n <path d=\"m34.5 23.03-.9-.02-.9.02v-.14h.06c.12 0 .24 0 .24-.2v-1.76c0-.17-.12-.18-.24-.18h-.07v-.13h1.09v.13h-.1c-.13 0-.21 0-.22.17v1.76c0 .13.09.16.2.17l.18.01a2.46 2.46 0 0 0 .26-.01.48.48 0 0 0 .32-.18.77.77 0 0 0 .1-.24v-.01h.13v.02l-.13.58zm0-.03.11-.55h-.07a.77.77 0 0 1-.1.24.5.5 0 0 1-.34.19 2.6 2.6 0 0 1-.26.01h-.19c-.11-.02-.22-.07-.22-.21v-1.76c0-.2.12-.2.25-.2h.07v-.07h-1.03v.07h.04c.12 0 .27.02.27.2v1.76c0 .22-.15.24-.27.24h-.04V23l.89-.02.88.02zm.1-2.47a.36.36 0 1 1-.37.36.35.35 0 0 1 .36-.36zm0 .66a.3.3 0 1 0-.3-.3.29.29 0 0 0 .3.3zm-.19-.1v-.02c.05-.01.05 0 .05-.04v-.26c0-.04 0-.05-.05-.05v-.02h.19c.06 0 .12.03.12.1a.11.11 0 0 1-.09.1l.06.09a.38.38 0 0 0 .08.08v.01h-.07c-.03 0-.06-.07-.13-.16h-.04v.12c0 .02.01.02.06.03v.01zm.12-.2h.05c.04 0 .06-.03.06-.09s-.03-.08-.07-.08h-.04z\" />\n </g>\n <path fill=\"#fff\" d=\"M13.33 8.58a5.77 5.77 0 1 1 5.76 5.78 5.77 5.77 0 0 1-5.76-5.78\" />\n <path\n fill=\"#154a78\"\n d=\"M22.58 8.47a3.48 3.48 0 0 0-2.23-3.24v6.48a3.48 3.48 0 0 0 2.23-3.24zm-4.7 3.24V5.23a3.47 3.47 0 0 0 0 6.48zM19.1 3a5.48 5.48 0 1 0 5.47 5.48A5.47 5.47 0 0 0 19.11 3zm0 11.48a5.99 5.99 0 0 1-6.03-5.94A5.9 5.9 0 0 1 19.1 2.5h1.55a6.1 6.1 0 0 1 6.24 6.03 6.22 6.22 0 0 1-6.24 5.94z\"\n />\n </svg>\n);\n\nexport default DinersIcon;\n","import { h } from \"preact\";\n\ninterface DiscoverIconProps {\n opacity?: number;\n /** Dark-theme reversed mark: drop the white background and render the wordmark in white\n * (the orange globe is kept — it reads fine on dark). */\n reversed?: boolean;\n}\n\nconst DiscoverIcon = ({ opacity = 1, reversed = false }: DiscoverIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n {!reversed && <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />}\n <g clip-path=\"url(#a)\">\n <g clip-path=\"url(#b)\">\n <path\n fill={reversed ? \"#fff\" : \"#000\"}\n d=\"M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z\"\n />\n </g>\n <path\n fill={reversed ? \"#fff\" : \"#000\"}\n d=\"M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z\"\n />\n <path fill=\"url(#c)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <path fill=\"url(#d)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <mask id=\"e\" width=\"6\" height=\"6\" x=\"18\" y=\"10\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:luminance\">\n <path fill=\"#fff\" d=\"M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z\" />\n </mask>\n <g mask=\"url(#e)\">\n <path fill=\"url(#f)\" d=\"M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z\" />\n </g>\n </g>\n <g clip-path=\"url(#g)\">\n <g clip-path=\"url(#h)\">\n <path\n fill={reversed ? \"#fff\" : \"#000\"}\n d=\"M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z\"\n />\n </g>\n <path\n fill={reversed ? \"#fff\" : \"#000\"}\n d=\"M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z\"\n />\n <path fill=\"url(#i)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <path fill=\"url(#j)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <mask id=\"k\" width=\"6\" height=\"6\" x=\"18\" y=\"10\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:luminance\">\n <path fill=\"#fff\" d=\"M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z\" />\n </mask>\n <g mask=\"url(#k)\">\n <path fill=\"url(#l)\" d=\"M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z\" />\n </g>\n </g>\n <defs>\n <linearGradient id=\"c\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F59F00\" />\n <stop offset=\".19\" stop-color=\"#F49B00\" />\n <stop offset=\".37\" stop-color=\"#F29101\" />\n <stop offset=\".5\" stop-color=\"#F08302\" />\n <stop offset=\".6\" stop-color=\"#EE7905\" />\n <stop offset=\".76\" stop-color=\"#EC7008\" />\n <stop offset=\"1\" stop-color=\"#EC6D09\" />\n </linearGradient>\n <linearGradient id=\"d\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".04\" stop-color=\"#F48C1C\" stop-opacity=\".08\" />\n <stop offset=\".2\" stop-color=\"#F77314\" stop-opacity=\".32\" />\n <stop offset=\".35\" stop-color=\"#F95D0E\" stop-opacity=\".53\" />\n <stop offset=\".5\" stop-color=\"#FB4B09\" stop-opacity=\".7\" />\n <stop offset=\".64\" stop-color=\"#FD3D05\" stop-opacity=\".83\" />\n <stop offset=\".77\" stop-color=\"#FE3302\" stop-opacity=\".92\" />\n <stop offset=\".9\" stop-color=\"#FF2D01\" stop-opacity=\".98\" />\n <stop offset=\"1\" stop-color=\"#FF2B00\" />\n </linearGradient>\n <radialGradient\n id=\"f\"\n cx=\"0\"\n cy=\"0\"\n r=\"1\"\n gradientTransform=\"rotate(4.24 -167.26 291.02) scale(3.3208)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".45\" stop-color=\"#EA8D1D\" stop-opacity=\".05\" />\n <stop offset=\".66\" stop-color=\"#CA7618\" stop-opacity=\".2\" />\n <stop offset=\".83\" stop-color=\"#924D10\" stop-opacity=\".48\" />\n <stop offset=\".96\" stop-color=\"#441304\" stop-opacity=\".87\" />\n <stop offset=\".99\" stop-color=\"#2F0401\" stop-opacity=\".97\" />\n </radialGradient>\n <linearGradient id=\"i\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F59F00\" />\n <stop offset=\".19\" stop-color=\"#F49B00\" />\n <stop offset=\".37\" stop-color=\"#F29101\" />\n <stop offset=\".5\" stop-color=\"#F08302\" />\n <stop offset=\".6\" stop-color=\"#EE7905\" />\n <stop offset=\".76\" stop-color=\"#EC7008\" />\n <stop offset=\"1\" stop-color=\"#EC6D09\" />\n </linearGradient>\n <linearGradient id=\"j\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".04\" stop-color=\"#F48C1C\" stop-opacity=\".08\" />\n <stop offset=\".2\" stop-color=\"#F77314\" stop-opacity=\".32\" />\n <stop offset=\".35\" stop-color=\"#F95D0E\" stop-opacity=\".53\" />\n <stop offset=\".5\" stop-color=\"#FB4B09\" stop-opacity=\".7\" />\n <stop offset=\".64\" stop-color=\"#FD3D05\" stop-opacity=\".83\" />\n <stop offset=\".77\" stop-color=\"#FE3302\" stop-opacity=\".92\" />\n <stop offset=\".9\" stop-color=\"#FF2D01\" stop-opacity=\".98\" />\n <stop offset=\"1\" stop-color=\"#FF2B00\" />\n </linearGradient>\n <radialGradient\n id=\"l\"\n cx=\"0\"\n cy=\"0\"\n r=\"1\"\n gradientTransform=\"rotate(4.24 -167.26 291.02) scale(3.3208)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".45\" stop-color=\"#EA8D1D\" stop-opacity=\".05\" />\n <stop offset=\".66\" stop-color=\"#CA7618\" stop-opacity=\".2\" />\n <stop offset=\".83\" stop-color=\"#924D10\" stop-opacity=\".48\" />\n <stop offset=\".96\" stop-color=\"#441304\" stop-opacity=\".87\" />\n <stop offset=\".99\" stop-color=\"#2F0401\" stop-opacity=\".97\" />\n </radialGradient>\n <clipPath id=\"a\">\n <path fill=\"#fff\" d=\"M0 0h33v5.55H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"b\">\n <path fill=\"#fff\" d=\"M0 0h33v5.86H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"g\">\n <path fill=\"#fff\" d=\"M0 0h33v5.55H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"h\">\n <path fill=\"#fff\" d=\"M0 0h33v5.86H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default DiscoverIcon;\n","import { h } from \"preact\";\n\ninterface CupIconProps {\n opacity?: number;\n}\n\nconst CupIcon = ({ opacity = 1 }: CupIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"30\" height=\"19.5\" opacity={opacity}>\n <rect width=\"45.3\" height=\"27\" x=\"-3.3\" y=\"-.79\" fill=\"#fff\" rx=\"2.82\" />\n <path\n fill=\"#01798a\"\n d=\"M27.27-.79a4.06 4.06 0 0 0-3.6 2.8l-4.96 23.42a2.14 2.14 0 0 0 2 2.8h18.35a2.81 2.81 0 0 0 2.8-2.82V1.15A2.25 2.25 0 0 0 40-.8\"\n />\n <rect width=\"20.38\" height=\"29.02\" x=\"-4\" y=\"-.79\" fill=\"#dc1f2b\" rx=\"2.82\" />\n <path\n fill=\"#1a4580\"\n d=\"M24.37 2.02a3.98 3.98 0 0 1 3.48-2.8H14.18a3.97 3.97 0 0 0-3.5 2.8l-4.85 23.4a2.13 2.13 0 0 0 1.94 2.81h13.7a2.13 2.13 0 0 1-1.94-2.8z\"\n />\n <path\n fill=\"#fff\"\n d=\"M16.63 15.04h.18a.32.32 0 0 0 .32-.17l.46-.7h1.24l-.26.47h1.49l-.2.7H18.1a.82.82 0 0 1-.75.44h-.92zm-.2 1h3.25l-.21.77h-1.3l-.2.74h1.27l-.21.77h-1.27l-.3 1.09c-.07.18.02.26.29.24h1.03l-.19.71H16.6q-.57 0-.39-.65l.38-1.4h-.81l.2-.76h.82l.2-.74h-.78l.2-.76zm5.19-1.87-.06.45a2.37 2.37 0 0 1 1.18-.47h2.05l-.78 2.88q-.1.5-.84.5h-2.34l-.54 2.01c-.03.11.01.17.13.17h.46l-.17.62h-1.17q-.67 0-.56-.4l1.54-5.76zm1.74.81h-1.84l-.22.78a1.52 1.52 0 0 1 .82-.23h1.1zm-.67 1.8c.14.02.22-.03.22-.16l.12-.4h-1.84l-.16.57zm-1.24.93h1.06l-.02.47h.29c.14 0 .2-.05.2-.14l.1-.3h.87l-.11.44a.76.76 0 0 1-.8.57h-.56v.8c-.01.12.1.18.33.18h.53l-.17.63H21.9c-.36.02-.53-.15-.53-.52zM8.6 10.34a2.62 2.62 0 0 1-1 1.64 3.24 3.24 0 0 1-1.98.58 2.16 2.16 0 0 1-1.68-.59 1.54 1.54 0 0 1-.37-1.06 2.86 2.86 0 0 1 .06-.57l.87-4.2h1.3l-.85 4.15a1.35 1.35 0 0 0-.04.32.82.82 0 0 0 .16.52.89.89 0 0 0 .75.3 1.56 1.56 0 0 0 1-.3 1.37 1.37 0 0 0 .5-.84l.84-4.15h1.3zm5.47-1.65h1.02l-.8 3.74h-1.02zm.32-1.37h1.03l-.2.91H14.2l.19-.9M16 12.15a1.39 1.39 0 0 1-.41-1.05 2.45 2.45 0 0 1 .01-.25l.04-.27a2.55 2.55 0 0 1 .78-1.45 2.07 2.07 0 0 1 1.43-.54 1.5 1.5 0 0 1 1.1.39 1.4 1.4 0 0 1 .4 1.06 2.59 2.59 0 0 1-.02.26l-.05.28a2.48 2.48 0 0 1-.77 1.42 2.08 2.08 0 0 1-1.43.53 1.5 1.5 0 0 1-1.09-.38m1.95-.74a1.84 1.84 0 0 0 .38-.9.58.58 0 0 0 .03-.19 1.74 1.74 0 0 0 .01-.17.76.76 0 0 0-.17-.54.64.64 0 0 0-.5-.2.89.89 0 0 0-.7.3 1.9 1.9 0 0 0-.38.92l-.03.18a1.36 1.36 0 0 0-.01.17.75.75 0 0 0 .17.54.64.64 0 0 0 .5.18.9.9 0 0 0 .7-.3m8.02 3.67.25-.87h1.24l-.05.32a3.1 3.1 0 0 1 1.09-.32h1.54l-.25.87h-.24l-1.16 4.12h.24l-.23.82h-.24l-.1.36h-1.2l.1-.36h-2.38l.23-.82h.24l1.16-4.12zm1.34 0L27 16.2a5.13 5.13 0 0 1 1-.27c.1-.4.24-.85.24-.85zm-.46 1.64-.32 1.17a3.44 3.44 0 0 1 1.01-.33l.24-.84zm.23 2.48.24-.84h-.93l-.24.84zm3.01-5.05h1.17l.05.44c0 .11.06.16.2.16h.2l-.2.74h-.87c-.32.02-.5-.1-.5-.38zm-.34 1.59h3.79l-.23.79h-1.2l-.2.74h1.2l-.23.79h-1.34l-.3.46h.65l.16.93c.01.09.1.13.23.13h.2l-.2.77h-.73c-.37.02-.57-.1-.58-.38l-.18-.85-.6.9a.65.65 0 0 1-.65.36h-1.1l.22-.77h.34a.46.46 0 0 0 .36-.19l.94-1.36h-1.2l.22-.8h1.3l.21-.73h-1.3l.22-.8zM9.8 8.69h.92l-.1.54.12-.16a1.43 1.43 0 0 1 1.1-.48 1 1 0 0 1 .83.34 1.15 1.15 0 0 1 .14.95l-.5 2.56h-.95l.46-2.32a.74.74 0 0 0-.04-.53.44.44 0 0 0-.4-.17.88.88 0 0 0-.62.23 1.14 1.14 0 0 0-.34.63L10 12.44h-.94zm10.55 0h.92l-.1.54.13-.16a1.43 1.43 0 0 1 1.08-.48.99.99 0 0 1 .85.34 1.14 1.14 0 0 1 .13.95l-.5 2.56h-.95l.46-2.32a.75.75 0 0 0-.04-.53.45.45 0 0 0-.4-.17.89.89 0 0 0-.62.23 1.12 1.12 0 0 0-.33.63l-.43 2.16h-.94zm4.55-2.33h2.67a1.8 1.8 0 0 1 1.19.35 1.25 1.25 0 0 1 .4 1v.02a3.77 3.77 0 0 1-.06.59 2.38 2.38 0 0 1-.81 1.4 2.29 2.29 0 0 1-1.5.52h-1.44l-.44 2.2h-1.24zm.67 2.82h1.19a1.14 1.14 0 0 0 .73-.21 1.14 1.14 0 0 0 .36-.67l.03-.15v-.13a.52.52 0 0 0-.22-.47 1.35 1.35 0 0 0-.72-.15h-1zm9.15 3.98a5.91 5.91 0 0 1-.98 1.56 1.99 1.99 0 0 1-1.7.71l.08-.64c.89-.27 1.36-1.51 1.64-2.06l-.33-4.03.68-.01h.58l.06 2.53 1.07-2.53h1.09zM31.68 9l-.43.3a1.35 1.35 0 0 0-1.66-.21c-1.08.5-1.98 4.4 1 3.11l.17.2 1.17.04.77-3.54zm-.66 1.92c-.2.56-.61.94-.94.83-.33-.1-.45-.64-.26-1.2.19-.57.61-.94.94-.83.33.1.45.64.26 1.2\"\n />\n </svg>\n);\n\nexport default CupIcon;\n","import { h, FunctionalComponent, ComponentChildren } from \"preact\";\nimport \"./tooltip.css\";\nimport { useRef, useState } from \"preact/hooks\";\n\ninterface TooltipProps {\n children: ComponentChildren;\n content: ComponentChildren;\n /**\n * Which side of the trigger the tooltip opens toward. Defaults to \"bottom\".\n * Use \"top\" inside overflow:hidden containers (e.g. the card form's expandable) where a\n * downward tooltip would be clipped.\n */\n placement?: \"top\" | \"bottom\";\n}\n\nexport const Tooltip: FunctionalComponent<TooltipProps> = ({\n children,\n content,\n placement = \"bottom\",\n}): h.JSX.Element | null => {\n const [isVisible, setIsVisible] = useState(false);\n const triggerRef = useRef<HTMLDivElement>(null);\n\n const handleMouseEnter = () => {\n setIsVisible(true);\n };\n\n const handleMouseLeave = () => {\n setIsVisible(false);\n };\n\n return (\n <div style={{ position: \"relative\" }}>\n <div ref={triggerRef} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {children}\n </div>\n {isVisible && triggerRef && (\n <div className={`straumur__tooltip__content straumur__tooltip__content--${placement}`}>{content}</div>\n )}\n </div>\n );\n};\n","import styleInject from '#style-inject';styleInject(\".straumur__tooltip__content{position:absolute;z-index:50;padding:var(--straumur__space-s);border-radius:var(--straumur__border-radius-s);right:40%;width:max-content;color:var(--straumur__color-white);background-color:var(--straumur__color-primary);box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}.straumur__tooltip__content--bottom{top:100%}.straumur__tooltip__content--top{bottom:100%}\\n\")","import { useEffect, useState } from \"preact/hooks\";\n\n/**\n * Hook to listen for a CSS media query.\n * @param query - The media query string (e.g., '(min-width: 768px)')\n * @returns true if the query matches\n */\nexport function useMediaQuery(query: string): boolean {\n const getMatch = () => window.matchMedia(query).matches;\n\n const [matches, setMatches] = useState(getMatch);\n\n useEffect(() => {\n const mediaQueryList = window.matchMedia(query);\n const listener = (event: MediaQueryListEvent) => setMatches(event.matches);\n\n // Initial match check\n setMatches(mediaQueryList.matches);\n\n // Listen for changes\n mediaQueryList.addEventListener(\"change\", listener);\n\n return () => {\n mediaQueryList.removeEventListener(\"change\", listener);\n };\n }, [query]);\n\n return matches;\n}\n","import { Fragment, h } from \"preact\";\nimport { useRef, useState, useEffect, StateUpdater, Dispatch } from \"preact/hooks\";\nimport { usePaymentMethodGroup } from \"../payment-method-group/payment-method-group-context\";\nimport { AdyenCheckout, AdyenCheckoutError, CustomCard, ICore, UIElement, UIElementProps } from \"@adyen/adyen-web\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { Tooltip } from \"../tooltip/tooltip\";\nimport InfoIcon from \"../../assets/icons/info\";\nimport { BrandHidden } from \"../../utils/renderBrandIcons\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport CheckmarkIcon from \"../../assets/icons/checkmark\";\nimport { RenderDualBrandComponent, DualBrandConfiguration } from \"../render-dual-brand/render-dual-brand\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { createAdyenPaymentHandlers } from \"../shared/create-adyen-handlers\";\nimport { submitCardWithGate } from \"../shared/before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useFocusOnActivate } from \"../../utils/custom-hooks/use-focus-on-activate\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { getAdyenFieldStyles } from \"../../utils/adyen-field-styles\";\n\nexport interface CardFormProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n onBrandHidden: Dispatch<StateUpdater<BrandHidden[]>>;\n}\n\ntype CardFormError = {\n encryptedCardNumber: {\n visible: boolean;\n message?: string;\n };\n encryptedExpiryDate: {\n visible: boolean;\n message?: string;\n };\n encryptedSecurityCode: {\n visible: boolean;\n message?: string;\n };\n};\n\ntype CardFormErrorField = keyof CardFormError;\n\nfunction CardForm({ configuration, paymentMethods, onBrandHidden }: CardFormProps): h.JSX.Element | null {\n const cardElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const customCardRef = useRef<CustomCard>();\n const { i18n } = useI18n();\n const [payButtonDisabled, setPayButtonDisabled] = useState<boolean>(true);\n const [securityCodePolicy, setSecurityCodePolicy] = useState<\"hidden\" | \"optional\" | \"required\">(\"required\");\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [isDualBrand, setIsDualBrand] = useState(false);\n const [dualBrandConfiguration, setDualBrandConfiguration] = useState<DualBrandConfiguration | null>(null);\n const [selectedBrand, setSelectedBrand] = useState<string | null>(null);\n const storePaymentMethodRef = useRef(false);\n const [formErrors, setFormErrors] = useState<CardFormError>({\n encryptedCardNumber: { visible: false },\n encryptedExpiryDate: { visible: false },\n encryptedSecurityCode: { visible: false },\n });\n\n const {\n activePaymentMethod,\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isObscuredByThreeDS,\n hasCard,\n registerSubmitHandler,\n unregisterSubmitHandler,\n } = usePaymentMethodGroup();\n\n // Adyen's card iframes can't read our CSS, so the field colors are passed in per theme.\n const resolvedTheme = useResolvedTheme(configuration.theme);\n\n async function handleSubmitClick(): Promise<void> {\n await submitCardWithGate(configuration.paymentFlow, () => customCardRef.current);\n }\n\n useEffect(() => {\n // Treat the card as inactive while a 3DS challenge is showing: it takes over the card container,\n // so a host's external submit button must not stay visible/clickable during the challenge.\n const isActive = activePaymentMethod === \"card\" && isPaymentMethodInitialized.card && !threeDSecureActive;\n if (!isActive) {\n // Nothing selected yet, a different method is active, or 3DS is in progress - tell the host\n // explicitly so a custom submit button hides (and defaults to disabled when it reappears).\n configuration.onCardValidityChanged?.(false, false);\n return;\n }\n\n registerSubmitHandler(handleSubmitClick);\n // Signal \"active but not yet valid\" on activation so a host's custom submit button can appear\n // (disabled) right away. onAllValid then updates the valid state as the shopper fills fields.\n configuration.onCardValidityChanged?.(false, true);\n return () => {\n unregisterSubmitHandler(handleSubmitClick);\n configuration.onCardValidityChanged?.(false, false);\n };\n }, [\n activePaymentMethod,\n isPaymentMethodInitialized.card,\n threeDSecureActive,\n registerSubmitHandler,\n unregisterSubmitHandler,\n ]);\n\n // Computed defensively (optional chaining + fallback) because it runs on every render,\n // ahead of the render guards below. Keeping every hook unconditional satisfies the Rules\n // of Hooks; initializeAdyenComponent is only ever invoked while the card method is active.\n const schemeBrands = paymentMethods.paymentMethods?.paymentMethods?.find((x) => x.type === \"scheme\")?.brands ?? [];\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData: (data) => ({\n ...data,\n storePaymentMethod: storePaymentMethodRef.current,\n }),\n });\n\n function handleOnError(_: AdyenCheckoutError, __?: UIElement<UIElementProps> | undefined): void {\n handleError({ key: \"error.unknownError\" });\n }\n\n const initializeAdyenComponent = async () => {\n // Fully tear down any previous instance before re-initializing (e.g. on locale change),\n // otherwise the old secure iframes leak and stack up on the same DOM node. Uses remove()\n // (destroy-style cleanup) to match the wallet components (google-pay/apple-pay buttons).\n customCardRef.current?.remove();\n\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n paymentMethodsResponse: paymentMethods.paymentMethods,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n onSubmit: handleOnSubmit,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onError: handleOnError,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n customCardRef.current = new CustomCard(adyenCheckoutRef.current, {\n brands: schemeBrands,\n placeholders: configuration.placeholders,\n styles: getAdyenFieldStyles(resolvedTheme),\n challengeWindowSize: \"05\",\n onBinLookup: (event) => {\n if (event.supportedBrandsRaw && event.supportedBrandsRaw.length > 1) {\n setIsDualBrand(true);\n\n setDualBrandConfiguration({\n brand1: event.supportedBrandsRaw[0].brand,\n brand1Name: event.supportedBrandsRaw[0].localeBrand,\n brand1ImageUrl: event.supportedBrandsRaw[0].brandImageUrl,\n brand2: event.supportedBrandsRaw[1].brand,\n brand2Name: event.supportedBrandsRaw[1].localeBrand,\n brand2ImageUrl: event.supportedBrandsRaw[1].brandImageUrl,\n });\n }\n },\n onBrand: (event) => {\n setSecurityCodePolicy(event.cvcPolicy);\n if (event.brand === \"card\") {\n onBrandHidden([]);\n setSelectedBrand(null);\n return;\n }\n\n const selectedBrands = schemeBrands\n .filter((x) => x !== event.brand)\n .map((x) => {\n return {\n brand: x,\n };\n });\n\n onBrandHidden(selectedBrands);\n\n if (\n schemeBrands\n .filter((x) => x === event.brand)\n .map((x) => {\n return {\n brand: x,\n };\n }).length === 1\n ) {\n setSelectedBrand(event.brand);\n }\n },\n onConfigSuccess() {\n updatePaymentMethodInitialization(\"card\", true);\n },\n onValidationError: (event) => {\n const defaultErrors: CardFormError = {\n encryptedCardNumber: { visible: false, message: undefined },\n encryptedExpiryDate: { visible: false, message: undefined },\n encryptedSecurityCode: { visible: false, message: undefined },\n };\n\n event\n .filter((x) => x.error)\n .forEach((x) => {\n defaultErrors[x.fieldType as CardFormErrorField].visible = true;\n defaultErrors[x.fieldType as CardFormErrorField].message = x.errorI18n;\n });\n\n setFormErrors(defaultErrors);\n },\n onAllValid: (event) => {\n setPayButtonDisabled(!event.allValid);\n configuration.onCardValidityChanged?.(event.allValid, true);\n },\n });\n\n if (cardElementRef.current) {\n customCardRef.current.mount(cardElementRef.current);\n }\n };\n\n useEffect(() => {\n if (hasCard && activePaymentMethod === \"card\" && !isPaymentMethodInitialized.card) {\n initializeAdyenComponent();\n }\n }, [configuration, activePaymentMethod]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(customCardRef.current && isPaymentMethodInitialized.card),\n () => {\n initializeAdyenComponent();\n setFormErrors({\n encryptedCardNumber: { visible: false, message: undefined },\n encryptedExpiryDate: { visible: false, message: undefined },\n encryptedSecurityCode: { visible: false, message: undefined },\n });\n }\n );\n\n useEffect(() => {\n storePaymentMethodRef.current = storePaymentMethod;\n }, [storePaymentMethod]);\n\n function dualBrandListener(e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) {\n customCardRef.current!.dualBrandingChangeHandler(e);\n }\n\n function handleStorePaymentMethodChange(event: h.JSX.TargetedEvent<HTMLInputElement, Event>) {\n setStorePaymentMethod(event.currentTarget.checked);\n }\n\n // When the 3DS challenge replaces the card fields, move focus into the container.\n useFocusOnActivate(cardElementRef, threeDSecureActive && activePaymentMethod === \"card\");\n\n // Render guards live below all hooks so hook order is identical on every render.\n if (!hasCard || isObscuredByThreeDS(\"card\")) {\n return null;\n }\n\n if (paymentMethods.paymentMethods?.paymentMethods?.length === 0) {\n return null;\n }\n\n return (\n <div\n className=\"straumur__card-component__expandable\"\n ref={cardElementRef}\n tabIndex={-1}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n }}\n >\n {!isPaymentMethodInitialized.card && (\n <div className=\"straumur__card-component__loading-text\">\n <LoaderIcon />\n </div>\n )}\n\n <div\n className=\"straumur__card-component__form\"\n style={{\n opacity: isPaymentMethodInitialized.card && !threeDSecureActive ? 1 : 0,\n position: isPaymentMethodInitialized.card && !threeDSecureActive ? \"relative\" : \"absolute\",\n transition: \"opacity 0.3s ease-in-out\",\n }}\n >\n <div className=\"straumur__card-component__form--wrapper\">\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedCardNumber.visible ? \"straumur__card-component__form--wrapper--label--error\" : \"\"\n }`}\n >\n {i18n.t(\"cards.cardNumber\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedCardNumber.visible ? \"straumur__card-component__form--wrapper--input--error\" : \"\"\n }`}\n data-cse=\"encryptedCardNumber\"\n role=\"group\"\n aria-label={i18n.t(\"cards.cardNumber\")}\n />\n {formErrors.encryptedCardNumber.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedCardNumber.message}\n </span>\n )}\n </div>\n <div className=\"straumur__card-component__form--field-wrapper\">\n <div className=\"straumur__card-component__form--wrapper\">\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedExpiryDate.visible ? \"straumur__card-component__form--wrapper--label--error\" : \"\"\n }`}\n >\n {i18n.t(\"cards.expiryDate\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedExpiryDate.visible ? \"straumur__card-component__form--wrapper--input--error\" : \"\"\n }`}\n data-cse=\"encryptedExpiryDate\"\n role=\"group\"\n aria-label={i18n.t(\"cards.expiryDate\")}\n />\n {formErrors.encryptedExpiryDate.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedExpiryDate.message}\n </span>\n )}\n </div>\n\n <div className=\"straumur__card-component__form--wrapper\">\n {(securityCodePolicy === \"optional\" || securityCodePolicy === \"required\") && (\n <Fragment>\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__card-component__form--wrapper--label--error\"\n : \"\"\n }`}\n >\n {securityCodePolicy === \"optional\"\n ? i18n.t(\"cards.securityCode3DigitsOptional\")\n : i18n.t(\"cards.securityCode3Digits\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__card-component__form--wrapper--input--error\"\n : \"\"\n }`}\n data-cse=\"encryptedSecurityCode\"\n role=\"group\"\n aria-label={i18n.t(\"cards.securityCode3Digits\")}\n />\n {formErrors.encryptedSecurityCode.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedSecurityCode.message}\n </span>\n )}\n <div className=\"straumur__card-component__form--wrapper--label--info\">\n <Tooltip content={<span>{i18n.t(\"cards.securityCode3DigitsInfo\")}</span>} placement=\"top\">\n <InfoIcon />\n </Tooltip>\n </div>\n </Fragment>\n )}\n </div>\n </div>\n\n {isDualBrand && dualBrandConfiguration && (\n <RenderDualBrandComponent\n dualBrandConfiguration={dualBrandConfiguration}\n selectedBrand={selectedBrand}\n onBrandClick={dualBrandListener}\n />\n )}\n\n {paymentMethods.enableStoreDetails === \"AskForConsent\" && (\n <label className=\"straumur__card-component__form--wrapper--label-checkbox\">\n <div\n className={`${\"straumur__card-component__form--wrapper--label-checkbox--checkmark\"} ${\n storePaymentMethod ? \"straumur__card-component__form--wrapper--label-checkbox--checkmark--checked\" : \"\"\n }`}\n >\n <div\n className={`${\"straumur__card-component__form--wrapper--label-checkbox--checkmark--icon\"} ${\n storePaymentMethod\n ? \"straumur__card-component__form--wrapper--label-checkbox--checkmark--icon--checked\"\n : \"\"\n }`}\n >\n <CheckmarkIcon />\n </div>\n </div>\n <input\n type=\"checkbox\"\n className=\"straumur__card-component__form--wrapper--label-checkbox--checkbox\"\n checked={storePaymentMethod}\n onChange={handleStorePaymentMethodChange}\n />\n {i18n.t(\"cards.storePaymentMethod\")}\n </label>\n )}\n\n {!configuration.hideSubmitButton && (\n <button\n className=\"straumur__card-component__submit-button\"\n disabled={payButtonDisabled}\n onClick={handleSubmitClick}\n >\n {paymentMethods.minorUnitsAmount === 0 ? i18n.t(\"cards.saveCardDetails\") : paymentMethods.formattedAmount}\n </button>\n )}\n </div>\n </div>\n );\n}\n\nexport default CardForm;\n","import { h } from \"preact\";\n\nconst InfoIcon = () => (\n <svg width=\"21\" height=\"20\" viewBox=\"0 0 21 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_10626_39119)\">\n <path\n d=\"M10.6641 7.5C11.3543 7.5 11.9141 6.94023 11.9141 6.25C11.9141 5.55977 11.3543 5 10.6641 5C9.97383 5 9.41406 5.55859 9.41406 6.25C9.41406 6.94141 9.97266 7.5 10.6641 7.5ZM12.2266 13.125H11.6016V9.6875C11.6016 9.17188 11.1836 8.75 10.6641 8.75H9.41406C8.89844 8.75 8.47656 9.17188 8.47656 9.6875C8.47656 10.2031 8.89844 10.625 9.41406 10.625H9.72656V13.125H9.10156C8.58594 13.125 8.16406 13.5469 8.16406 14.0625C8.16406 14.5781 8.58594 15 9.10156 15H12.2266C12.7441 15 13.1641 14.5801 13.1641 14.0625C13.1641 13.5449 12.7461 13.125 12.2266 13.125Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.4\"\n d=\"M10.6641 0C5.14062 0 0.664062 4.47656 0.664062 10C0.664062 15.5234 5.14062 20 10.6641 20C16.1875 20 20.6641 15.5234 20.6641 10C20.6641 4.47656 16.1875 0 10.6641 0ZM10.6641 5C11.3543 5 11.9141 5.55977 11.9141 6.25C11.9141 6.94023 11.3543 7.5 10.6641 7.5C9.97383 7.5 9.41406 6.94141 9.41406 6.25C9.41406 5.55859 9.97266 5 10.6641 5ZM12.2266 15H9.10156C8.58594 15 8.16406 14.582 8.16406 14.0625C8.16406 13.543 8.58398 13.125 9.10156 13.125H9.72656V10.625H9.41406C8.89648 10.625 8.47656 10.2051 8.47656 9.6875C8.47656 9.16992 8.89844 8.75 9.41406 8.75H10.6641C11.1816 8.75 11.6016 9.16992 11.6016 9.6875V13.125H12.2266C12.7441 13.125 13.1641 13.5449 13.1641 14.0625C13.1641 14.5801 12.7461 15 12.2266 15Z\"\n fill=\"currentColor\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10626_39119\">\n <rect width=\"20\" height=\"20\" fill=\"white\" transform=\"translate(0.664062)\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default InfoIcon;\n","import { h } from \"preact\";\n\nconst LoaderIcon = () => (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\">\n <g fill=\"none\" fill-rule=\"evenodd\">\n <g transform=\"translate(2 2)\" stroke-width=\"4\">\n <circle stroke-opacity=\".3\" cx=\"18\" cy=\"18\" r=\"18\" />\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 18 18\"\n to=\"360 18 18\"\n dur=\"1s\"\n repeatCount=\"indefinite\"\n />\n </path>\n </g>\n </g>\n </svg>\n);\n\nexport default LoaderIcon;\n","import { h } from \"preact\";\n\nconst CheckmarkIcon = ({ color = \"var(--straumur__color-primary)\" }: { color?: string }) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"13\" viewBox=\"0 0 16 13\" fill=\"none\">\n <path d=\"M2 7L6 11L14 2\" stroke={color} stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n);\n\nexport default CheckmarkIcon;\n","import { h } from \"preact\";\nimport { RenderBrandIcon } from \"../../utils/renderBrandIcons\";\nimport CheckmarkIcon from \"../../assets/icons/checkmark\";\n\ntype DualBrandConfiguration = {\n brand1: string;\n brand1Name?: string;\n brand1ImageUrl?: string;\n brand2: string;\n brand2Name?: string;\n brand2ImageUrl?: string;\n};\n\ninterface RenderDualBrandComponentProps {\n dualBrandConfiguration: DualBrandConfiguration;\n selectedBrand: string | null;\n onBrandClick: (e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) => void;\n}\n\ninterface BrandOptionProps {\n brand: string;\n brandName?: string;\n isSelected: boolean;\n onBrandClick: (e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) => void;\n}\n\nfunction BrandOption({ brand, brandName, isSelected, onBrandClick }: BrandOptionProps): h.JSX.Element {\n // Enter/Space activate the option like a click. Synthesizing a real click (rather than calling\n // onBrandClick directly) keeps the currentTarget/data-value that Adyen's dualBrandingChangeHandler reads.\n const handleKeyDown = (e: h.JSX.TargetedKeyboardEvent<HTMLSpanElement>) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n e.currentTarget.click();\n }\n };\n\n return (\n <span\n className={\n `straumur__card-component__dual-branding--logo` +\n (isSelected ? \" straumur__card-component__dual-branding--logo--selected\" : \"\")\n }\n title={brand}\n data-value={brand}\n onClick={onBrandClick}\n onKeyDown={handleKeyDown}\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={brandName ?? brand}\n tabIndex={0}\n >\n <div className=\"straumur__card-component__dual-branding--logo--item\">\n <RenderBrandIcon brand={brand} defaultToBrandName={false} />\n &nbsp;{brandName ?? \"\"}\n </div>\n {isSelected && <CheckmarkIcon color=\"var(--straumur__color-neon-green-zeta)\" />}\n </span>\n );\n}\n\nexport function RenderDualBrandComponent({\n dualBrandConfiguration,\n selectedBrand,\n onBrandClick,\n}: RenderDualBrandComponentProps): h.JSX.Element {\n return (\n <div className=\"straumur__card-component__dual-branding\" role=\"radiogroup\" aria-label=\"Card brand\">\n <BrandOption\n brand={dualBrandConfiguration.brand1}\n brandName={dualBrandConfiguration.brand1Name}\n isSelected={selectedBrand === dualBrandConfiguration.brand1}\n onBrandClick={onBrandClick}\n />\n <BrandOption\n brand={dualBrandConfiguration.brand2}\n brandName={dualBrandConfiguration.brand2Name}\n isSelected={selectedBrand === dualBrandConfiguration.brand2}\n onBrandClick={onBrandClick}\n />\n </div>\n );\n}\n\nexport type { DualBrandConfiguration };\n","import { Language, TranslationKey } from \"../localizations/translations\";\nimport { PublicLocale } from \"../localizations/locale\";\nimport { OpenDefaultPaymentMethod, PaymentMethod, PaymentMethodOrder } from \"./constants\";\nimport { ICreateDetailsBody, ICreatePaymentBody } from \"../adapter/models\";\nimport { PaymentMethodsResponse } from \"../services/models\";\n\n// configuration options shared by both session and advanced mode\ntype StraumurWebBaseConfiguration = {\n environment: \"test\" | \"live\";\n onPaymentCompleted?: (data: PaymentCompletedData) => void;\n onPaymentFailed?: (data: PaymentFailedData) => void;\n placeholders?: Placeholders;\n locale?: PublicLocale;\n localizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>;\n instantPayments?: UniqueInstantPayments;\n hideSubmitButton?: boolean;\n onCardValidityChanged?: (isValid: boolean, isActive: boolean) => void;\n allowedPaymentMethods?: PaymentMethod[];\n /**\n * Top-to-bottom order of the payment-method options. Tokens: \"card\", \"storedcard\", \"googlepay\",\n * \"applepay\", and \"instantpayments\" (the express wallet row). A wallet listed in `instantPayments`\n * renders only inside the \"instantpayments\" slot, never standalone, so its standalone token here is\n * effectively ignored. Any available method you omit is appended in the default order. Defaults to\n * [\"instantpayments\", \"storedcard\", \"card\", \"googlepay\", \"applepay\"].\n */\n orderPaymentMethods?: PaymentMethodOrder[];\n /**\n * Which payment method to open (expand) on load: \"card\", \"firstStoredCard\", \"googlepay\" or\n * \"applepay\". If that method isn't available — a wallet that's in `instantPayments`, or\n * \"firstStoredCard\" with no saved cards — it's ignored and no method is pre-opened (the chooser\n * stays collapsed). Omit for the same collapsed default.\n */\n openDefaultPaymentMethod?: OpenDefaultPaymentMethod;\n /**\n * Color theme for the widget. Accepts a mode (\"light\" | \"dark\" | \"system\"), or a\n * {@link ThemeConfiguration} object to also override the wallet button styling. \"system\" follows\n * the shopper's OS/browser preference (`prefers-color-scheme`) and updates live if it changes.\n * Defaults to \"light\".\n */\n theme?: Theme | ThemeConfiguration;\n};\n\nexport type Theme = \"light\" | \"dark\" | \"system\";\n\n/** The resolved theme actually applied to the DOM (\"system\" collapses to one of these). */\nexport type ResolvedTheme = \"light\" | \"dark\";\n\n/** Google Pay button style override: \"white\" = light button, \"dark\" = black button. */\nexport type GooglePayButtonTheme = \"dark\" | \"white\";\n\n/** Apple Pay button style override: \"light\" = white button, \"dark\" = black button. */\nexport type ApplePayButtonTheme = \"dark\" | \"light\";\n\n/**\n * Object form of `theme`: the widget color mode plus optional per-wallet button overrides.\n * When an override is omitted the wallet button follows the mode — a light widget gets a\n * light/white button, a dark widget gets a black one.\n */\nexport type ThemeConfiguration = {\n theme: Theme;\n googlePayButtonTheme?: GooglePayButtonTheme;\n applePayButtonTheme?: ApplePayButtonTheme;\n};\n\n// the public configuration (session mode): the component loads everything itself from the Straumur API using the sessionId\nexport type StraumurWebConfiguration = StraumurWebBaseConfiguration & {\n sessionId: string;\n};\n\n// INTERNAL — advanced mode: the host page provides the payment methods and controls all network calls\n// through onSubmit / onAdditionalDetails (and optionally onDisableToken).\n// Used only by Straumur's own Hosted Checkout page; not exported from the package entry point,\n// not documented for integrators, and not part of the supported public API.\nexport type StraumurWebAdvancedConfiguration = StraumurWebBaseConfiguration & {\n sessionId?: never;\n clientKey: string;\n countryCode: string;\n paymentMethods: PaymentMethodsResponse;\n /**\n * The amount of the transaction, in minor units. For example, value 1000 means 10.00.\n */\n amount: { value: number; currency: string };\n formattedAmount: string;\n merchantName: string;\n enableStoreDetails: \"Enabled\" | \"Disabled\" | \"AskForConsent\";\n onSubmit: (state: AdvancedSubmitState, actions: AdvancedPaymentActions) => void | Promise<void>;\n onAdditionalDetails: (state: AdvancedAdditionalDetailsState, actions: AdvancedPaymentActions) => void | Promise<void>;\n onDisableToken?: (data: DisableTokenData, actions: DisableTokenActions) => void | Promise<void>;\n /**\n * Called before a payment is submitted. Return false to abort the submission.\n * Keep it synchronous when Apple Pay is offered — the payment sheet must open within the user gesture.\n */\n onBeforeSubmit?: () => boolean | Promise<boolean>;\n};\n\n// INTERNAL — union the constructor actually accepts at runtime (public signature stays session-only)\nexport type StraumurWebInternalConfiguration = StraumurWebConfiguration | StraumurWebAdvancedConfiguration;\n\nconst RESULT_CODES = [\n \"AuthenticationFinished\",\n \"AuthenticationNotRequired\",\n \"Authorised\",\n \"Cancelled\",\n \"ChallengeShopper\",\n \"Error\",\n \"IdentifyShopper\",\n \"PartiallyAuthorised\",\n \"Pending\",\n \"PresentToShopper\",\n \"Received\",\n \"RedirectShopper\",\n \"Refused\",\n] as const;\n\nexport type ResultCode = (typeof RESULT_CODES)[number];\n\n/** Narrows a resultCode string from the Adyen boundary to our ResultCode union; unknown values map to \"Error\". */\nexport function toResultCode(value: string | undefined): ResultCode {\n return value && (RESULT_CODES as readonly string[]).includes(value) ? (value as ResultCode) : \"Error\";\n}\n\nexport type PaymentCompletedData = {\n resultCode: ResultCode;\n};\n\nexport type PaymentFailedData = {\n resultCode: ResultCode;\n};\n\nexport type AdvancedSubmitState = {\n data: Omit<ICreatePaymentBody, \"sessionId\">;\n};\n\nexport type AdvancedAdditionalDetailsState = {\n data: Omit<ICreateDetailsBody, \"sessionId\">;\n};\n\nexport type PaymentFlowResult = {\n resultCode: ResultCode;\n action?: unknown;\n /**\n * Optional buyer-friendly failure message shown on the built-in failure screen\n * instead of the generic localized one (advanced mode only).\n */\n errorMessage?: string;\n};\n\nexport type AdvancedPaymentActions = {\n resolve: (result: PaymentFlowResult) => void;\n reject: (errorMessage?: string) => void;\n};\n\nexport type DisableTokenData = {\n storedPaymentMethodId: string;\n};\n\nexport type DisableTokenActions = {\n resolve: () => void;\n reject: () => void;\n};\n\n// abstraction over how payments reach the backend: session mode calls the Straumur API itself,\n// advanced mode delegates to the host page's handlers\nexport interface PaymentFlow {\n submitPayment(data: AdvancedSubmitState[\"data\"]): Promise<PaymentFlowResult>;\n submitAdditionalDetails(data: AdvancedAdditionalDetailsState[\"data\"]): Promise<PaymentFlowResult>;\n disableToken?: (storedPaymentMethodId: string) => Promise<void>;\n beforeSubmit?: () => boolean | Promise<boolean>;\n}\n\n// message shown on the built-in result screens: either a translation key or raw text supplied by the host\nexport type ResultMessage = { key: TranslationKey } | { text: string };\n\ntype UniqueInstantPayments =\n | [Extract<PaymentMethod, \"googlepay\">]\n | [Extract<PaymentMethod, \"applepay\">]\n | [Extract<PaymentMethod, \"googlepay\">, Extract<PaymentMethod, \"applepay\">]\n | [Extract<PaymentMethod, \"applepay\">, Extract<PaymentMethod, \"googlepay\">];\n\n// this will be used for internal configuration of the checkout component\nexport type StraumurCheckoutConfiguration = {\n mode: \"session\" | \"advanced\";\n sessionId?: string;\n environment: \"test\" | \"live\";\n countryCode: string;\n paymentFlow: PaymentFlow;\n onPaymentCompleted?: (data: PaymentCompletedData) => void;\n onPaymentFailed?: (data: PaymentFailedData) => void;\n placeholders?: Placeholders;\n locale: Language;\n customLocalizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>;\n instantPayments?: UniqueInstantPayments;\n hideSubmitButton?: boolean;\n onCardValidityChanged?: (isValid: boolean, isActive: boolean) => void;\n allowedPaymentMethods?: PaymentMethod[];\n orderPaymentMethods?: PaymentMethodOrder[];\n openDefaultPaymentMethod?: OpenDefaultPaymentMethod;\n theme: Theme;\n googlePayButtonTheme?: GooglePayButtonTheme;\n applePayButtonTheme?: ApplePayButtonTheme;\n};\n\n// What updateConfig() accepts: internal config fields minus the immutable ones,\n// with locale in the public short-code vocabulary.\nexport type StraumurCheckoutUpdateOptions = Partial<\n Omit<StraumurCheckoutConfiguration, \"mode\" | \"paymentFlow\" | \"locale\">\n> & {\n locale?: PublicLocale;\n};\n\ntype PlaceholderKeys =\n \"cardNumber\" | \"expiryDate\" | \"expiryMonth\" | \"expiryYear\" | \"securityCodeThreeDigits\" | \"securityCodeFourDigits\";\n\n// Partial makes all records optional so we can have a configuration without placeholders\n// Record creates a type with keys of type PlaceholderKeys and values of type string\nexport type Placeholders = Partial<Record<PlaceholderKeys, string>>;\n\nexport type ErrorCode = TranslationKey;\n","import { ICreateDetailsBody, ICreatePaymentBody, IPostDisableTokenBody } from \"../adapter/models\";\nimport { createDetailsRequest, createPaymentRequest, postDisableTokenRequest } from \"../adapter/straumur-adapter\";\nimport { PaymentFlow, PaymentFlowResult, ResultMessage, StraumurWebAdvancedConfiguration } from \"../models/models\";\nimport { TranslationKey } from \"../localizations/translations\";\n\nexport class PaymentFlowError extends Error {\n messageKey: TranslationKey;\n messageText?: string;\n\n constructor(messageKey: TranslationKey, messageText?: string) {\n super(messageText ?? messageKey);\n this.messageKey = messageKey;\n this.messageText = messageText;\n }\n}\n\nexport function toResultMessage(error: unknown, fallbackKey: TranslationKey): ResultMessage {\n if (error instanceof PaymentFlowError) {\n return error.messageText ? { text: error.messageText } : { key: error.messageKey };\n }\n\n return { key: fallbackKey };\n}\n\nexport function createSessionPaymentFlow(environment: \"test\" | \"live\", sessionId: string): PaymentFlow {\n return {\n async submitPayment(data) {\n const body: ICreatePaymentBody = { ...data, sessionId };\n\n const fetchResponse = await createPaymentRequest(environment, body);\n\n // We will always get 200 OK unless there is an error in our server code.\n // Payment unsuccessful still returns 200 OK, but with resultCode Refused.\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitPayment\");\n }\n\n const response = await fetchResponse.json();\n\n // ResultCode should never be empty.\n if (!response.resultCode) {\n throw new PaymentFlowError(\"error.paymentFailed\");\n }\n\n return { resultCode: response.resultCode, action: response.action };\n },\n async submitAdditionalDetails(data) {\n const body: ICreateDetailsBody = { ...data, sessionId };\n\n const fetchResponse = await createDetailsRequest(environment, body);\n\n // We will always get 200 OK unless there is an error in our server code.\n // Payment unsuccessful still returns 200 OK, but with resultCode Refused.\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitPaymentDetails\");\n }\n\n const response = await fetchResponse.json();\n\n // ResultCode should always be either Authorised or Refused or IdentifyShopper. Never empty.\n if (!response.resultCode) {\n throw new PaymentFlowError(\"error.paymentDetailsFailed\");\n }\n\n return { resultCode: response.resultCode, action: response.action };\n },\n async disableToken(storedPaymentMethodId) {\n const body: IPostDisableTokenBody = { storedPaymentMethodId, sessionId };\n\n const fetchResponse = await postDisableTokenRequest(environment, body);\n\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitRemoveStoredPaymentCard\");\n }\n\n const disableTokenResponse = await fetchResponse.json();\n\n if (!disableTokenResponse.success) {\n throw new PaymentFlowError(\"error.failedToRemoveStoredPaymentCard\");\n }\n },\n };\n}\n\nexport function createAdvancedPaymentFlow(configuration: StraumurWebAdvancedConfiguration): PaymentFlow {\n // Wraps whatever the host handler throws (synchronously or asynchronously) in a PaymentFlowError,\n // so callers can rely on a single error contract.\n function invokeHostHandler<T>(\n invoke: (resolve: (value: T) => void, reject: (error: PaymentFlowError) => void) => void | Promise<void>,\n resolve: (value: T) => void,\n reject: (error: unknown) => void,\n thrownErrorKey: TranslationKey\n ): void {\n const rejectWithFlowError = (error: unknown) =>\n reject(error instanceof PaymentFlowError ? error : new PaymentFlowError(thrownErrorKey));\n\n try {\n Promise.resolve(invoke(resolve, reject)).catch(rejectWithFlowError);\n } catch (error) {\n rejectWithFlowError(error);\n }\n }\n\n const flow: PaymentFlow = {\n submitPayment(data) {\n return new Promise<PaymentFlowResult>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n configuration.onSubmit(\n { data },\n {\n resolve: res,\n reject: (errorMessage) => rej(new PaymentFlowError(\"error.failedToSubmitPayment\", errorMessage)),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitPayment\"\n );\n });\n },\n submitAdditionalDetails(data) {\n return new Promise<PaymentFlowResult>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n configuration.onAdditionalDetails(\n { data },\n {\n resolve: res,\n reject: (errorMessage) => rej(new PaymentFlowError(\"error.failedToSubmitPaymentDetails\", errorMessage)),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitPaymentDetails\"\n );\n });\n },\n beforeSubmit: configuration.onBeforeSubmit,\n };\n\n const { onDisableToken } = configuration;\n\n if (onDisableToken) {\n flow.disableToken = (storedPaymentMethodId) =>\n new Promise<void>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n onDisableToken(\n { storedPaymentMethodId },\n {\n resolve: () => res(),\n reject: () => rej(new PaymentFlowError(\"error.failedToRemoveStoredPaymentCard\")),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitRemoveStoredPaymentCard\"\n );\n });\n }\n\n return flow;\n}\n","import { PaymentFlow } from \"../../models/models\";\n\n/** Runs the flow's optional beforeSubmit gate; resolves to whether submission may proceed. */\nexport async function runBeforeSubmit(paymentFlow: PaymentFlow): Promise<boolean> {\n const { beforeSubmit } = paymentFlow;\n\n return !beforeSubmit || (await beforeSubmit());\n}\n\n/**\n * Card submit-button behavior shared by card-form and stored-card: run the beforeSubmit gate,\n * then submit the Adyen element (re-read after the gate — it may have been torn down while awaiting).\n */\nexport async function submitCardWithGate(\n paymentFlow: PaymentFlow,\n getElement: () => { submit: () => void } | undefined | null\n): Promise<void> {\n if (!getElement()) {\n return;\n }\n\n if (!(await runBeforeSubmit(paymentFlow))) {\n return;\n }\n\n getElement()?.submit();\n}\n\n// Adyen wallet elements support onClick(resolve, reject) before opening the payment sheet.\n// Apple Pay requires resolve() within the user gesture, so keep beforeSubmit synchronous when Apple Pay is offered —\n// this handler must NOT be collapsed into the async runBeforeSubmit path.\nexport function createBeforeSubmitClickHandler(paymentFlow: PaymentFlow) {\n return (resolve: () => void, reject: () => void): void => {\n const { beforeSubmit } = paymentFlow;\n\n if (!beforeSubmit) {\n resolve();\n return;\n }\n\n const result = beforeSubmit();\n\n if (result instanceof Promise) {\n result.then((valid) => (valid ? resolve() : reject())).catch(() => reject());\n return;\n }\n\n if (result) {\n resolve();\n return;\n }\n\n reject();\n };\n}\n","import {\n AdditionalDetailsActions,\n AdditionalDetailsData,\n PaymentCompletedData,\n PaymentFailedData,\n SubmitActions,\n SubmitData,\n UIElement,\n UIElementProps,\n} from \"@adyen/adyen-web\";\nimport {\n AdvancedSubmitState,\n ResultCode,\n ResultMessage,\n StraumurCheckoutConfiguration,\n toResultCode,\n} from \"../../models/models\";\nimport { toResultMessage } from \"../../flows/payment-flow\";\nimport { runBeforeSubmit } from \"./before-submit-click\";\n\nexport interface AdyenPaymentHandlersOptions {\n configuration: StraumurCheckoutConfiguration;\n handleSuccess: (message: ResultMessage) => void;\n handleError: (message: ResultMessage) => void;\n setThreeDSecureActive: (value: boolean) => void;\n enrichSubmitData?: (data: SubmitData[\"data\"]) => AdvancedSubmitState[\"data\"];\n onSubmitStart?: () => void;\n /**\n * Redirect-return path only (submitDetails after a 3DS redirect): that Adyen bootstrap wires\n * no core-level onPaymentCompleted/onPaymentFailed, so the additional-details handler must\n * dispatch the final result itself. Leave unset for mounted components — Adyen invokes the\n * core-level callbacks there, and dispatching here too would double-fire the merchant callbacks.\n */\n dispatchResultFromAdditionalDetails?: boolean;\n}\n\nexport interface AdyenPaymentHandlers {\n handleOnSubmit: (state: SubmitData, element: UIElement<UIElementProps>, actions: SubmitActions) => Promise<void>;\n handleOnSubmitAdditionalData: (\n state: AdditionalDetailsData,\n element: UIElement<UIElementProps>,\n actions: AdditionalDetailsActions\n ) => Promise<void>;\n handlePaymentCompleted: (data: PaymentCompletedData, element?: UIElement<UIElementProps>) => void;\n handlePaymentFailed: (data?: PaymentFailedData, element?: UIElement<UIElementProps>) => void;\n}\n\n// Merchant callbacks follow Adyen Web 6 semantics: these resultCodes are failures.\nconst FAILED_RESULT_CODES: readonly ResultCode[] = [\"Refused\", \"Cancelled\", \"Error\"];\n\nexport function createAdyenPaymentHandlers(options: AdyenPaymentHandlersOptions): AdyenPaymentHandlers {\n const {\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData,\n onSubmitStart,\n dispatchResultFromAdditionalDetails,\n } = options;\n\n // Buyer-friendly failure message from the host (advanced mode). Set on submit, shown when the payment fails.\n let failureMessage: string | undefined;\n\n function failureResultMessage(): ResultMessage {\n return failureMessage ? { text: failureMessage } : { key: \"error.paymentUnsuccessful\" };\n }\n\n function dispatchFinalResult(resultCode: ResultCode): void {\n // The built-in screens keep their own rule: the success screen only for Authorised.\n if (resultCode === \"Authorised\") {\n handleSuccess({ key: \"success.paymentAuthorized\" });\n } else {\n handleError(failureResultMessage());\n }\n\n if (FAILED_RESULT_CODES.includes(resultCode)) {\n configuration.onPaymentFailed?.({ resultCode });\n } else {\n configuration.onPaymentCompleted?.({ resultCode });\n }\n }\n\n async function handleOnSubmit(state: SubmitData, _: UIElement<UIElementProps>, actions: SubmitActions) {\n onSubmitStart?.();\n\n const { paymentFlow } = configuration;\n\n if (!(await runBeforeSubmit(paymentFlow))) {\n actions.reject();\n return;\n }\n\n try {\n const data = enrichSubmitData ? enrichSubmitData(state.data) : (state.data as AdvancedSubmitState[\"data\"]);\n\n const { resultCode, action, errorMessage } = await paymentFlow.submitPayment(data);\n\n failureMessage = errorMessage;\n\n if (resultCode === \"ChallengeShopper\" || resultCode === \"IdentifyShopper\") {\n setThreeDSecureActive(true);\n }\n\n // If the /payments request from your server is successful, you must call this to resolve whichever of the listed objects are available.\n // You must call this, even if the result of the payment is unsuccessful.\n actions.resolve({ resultCode, action } as Parameters<SubmitActions[\"resolve\"]>[0]);\n } catch (error) {\n actions.reject();\n handleError(toResultMessage(error, \"error.failedToSubmitPayment\"));\n }\n }\n\n async function handleOnSubmitAdditionalData(\n state: AdditionalDetailsData,\n _: UIElement<UIElementProps>,\n actions: AdditionalDetailsActions\n ) {\n try {\n const { resultCode, action, errorMessage } = await configuration.paymentFlow.submitAdditionalDetails(state.data);\n\n failureMessage = errorMessage;\n\n // If the /payments/details request from your server is successful, you must call this to resolve whichever of the listed objects are available.\n // You must call this, even if the result of the payment is unsuccessful.\n actions.resolve({ resultCode, action } as Parameters<AdditionalDetailsActions[\"resolve\"]>[0]);\n\n if (dispatchResultFromAdditionalDetails) {\n dispatchFinalResult(resultCode);\n }\n } catch (error) {\n actions.reject();\n handleError(toResultMessage(error, \"error.failedToSubmitPaymentDetails\"));\n\n if (dispatchResultFromAdditionalDetails) {\n configuration.onPaymentFailed?.({ resultCode: \"Error\" });\n }\n }\n }\n\n function handlePaymentCompleted(data: PaymentCompletedData, _?: UIElement<UIElementProps> | undefined): void {\n dispatchFinalResult(toResultCode(data.resultCode));\n }\n\n function handlePaymentFailed(data?: PaymentFailedData | undefined, _?: UIElement<UIElementProps> | undefined): void {\n // Adyen occasionally reports failure without a payload; synthesize one so the\n // merchant callback always receives a resultCode.\n dispatchFinalResult(data ? toResultCode(data.resultCode) : \"Error\");\n }\n\n return { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed };\n}\n","import { useEffect } from \"preact/hooks\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\n\n/**\n * Re-initializes an Adyen element when the checkout configuration changes.\n *\n * Adyen elements cannot change locale through `.update()` (Adyen issue #2407), so an\n * already-initialized component must be torn down and rebuilt. The configuration object's\n * identity is the trigger: `updateConfig`/`setLanguage` create a fresh object per change,\n * while re-renders reuse the same one.\n *\n * @param configuration the internal checkout configuration (identity-stable per config change)\n * @param isReady whether the Adyen element is currently initialized and safe to rebuild\n * @param reinitialize tears down (if needed) and rebuilds the Adyen element\n */\nexport function useAdyenLocaleReinit(\n configuration: StraumurCheckoutConfiguration,\n isReady: () => boolean,\n reinitialize: () => void\n): void {\n useEffect(() => {\n if (isReady()) {\n reinitialize();\n }\n // Deliberately keyed on configuration identity only: isReady/reinitialize are\n // fresh closures every render and must not re-trigger the rebuild.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [configuration]);\n}\n","import { useEffect } from \"preact/hooks\";\nimport { RefObject } from \"preact\";\n\n/**\n * Moves keyboard focus into `ref` when `active` transitions from false to true.\n *\n * Used when a 3-D Secure challenge takes over the widget: the content the shopper was\n * interacting with is replaced, so focus must follow into the challenge or a keyboard /\n * screen-reader user is stranded on a now-hidden control. The target needs `tabIndex={-1}`\n * to be programmatically focusable.\n *\n * The dependency array does the gating: the effect only runs when `active` changes, so a\n * re-render while it stays active will not steal focus back.\n */\nexport function useFocusOnActivate(ref: RefObject<HTMLElement>, active: boolean): void {\n useEffect(() => {\n if (active) {\n ref.current?.focus();\n }\n }, [active, ref]);\n}\n","import { useEffect, useState } from \"preact/hooks\";\nimport { ResolvedTheme, Theme } from \"../../models/models\";\n\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nfunction systemPrefersDark(): boolean {\n return typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(DARK_QUERY).matches\n : false;\n}\n\n/**\n * Resolves a Theme to the concrete \"light\" | \"dark\" applied to the DOM.\n *\n * For \"system\" it reads `prefers-color-scheme` and subscribes to changes, so the widget\n * flips live when the shopper switches their OS/browser appearance. For explicit\n * \"light\"/\"dark\" it returns that value and attaches no listener.\n */\nexport function useResolvedTheme(theme: Theme): ResolvedTheme {\n const [systemDark, setSystemDark] = useState<boolean>(systemPrefersDark);\n\n useEffect(() => {\n if (theme !== \"system\" || typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return;\n }\n\n const query = window.matchMedia(DARK_QUERY);\n const onChange = (event: MediaQueryListEvent) => setSystemDark(event.matches);\n\n // Re-sync in case the preference changed between mount and effect.\n setSystemDark(query.matches);\n query.addEventListener(\"change\", onChange);\n\n return () => query.removeEventListener(\"change\", onChange);\n }, [theme]);\n\n if (theme === \"system\") {\n return systemDark ? \"dark\" : \"light\";\n }\n\n return theme;\n}\n","import { ResolvedTheme } from \"../models/models\";\n\n/**\n * Color values for the Adyen secured-field iframes (card number / expiry / CVC).\n *\n * Those fields render inside cross-origin iframes our CSS cannot reach, so their text,\n * placeholder, and error colors must be passed to Adyen as literal values — they cannot use\n * the CSS custom properties in styles/main.css. Keep these in sync with the palette tokens\n * there (the light values mirror --straumur__color-text / -secondary / -red-beta, the dark\n * values mirror their [data-theme=\"dark\"] overrides).\n *\n * Structurally compatible with Adyen's StylesObject (which the SDK does not export).\n */\nexport function getAdyenFieldStyles(theme: ResolvedTheme) {\n if (theme === \"dark\") {\n return {\n base: { color: \"#e8edf2\" },\n // Lighter than the palette's -secondary so the placeholder stays legible on the dark input.\n placeholder: { color: \"#aab4bf\" },\n error: { color: \"#e08a8a\" },\n };\n }\n\n return {\n base: { color: \"#00112c\" },\n placeholder: { color: \"#72889d\" },\n error: { color: \"#d96666\" },\n };\n}\n","import { h, ComponentChildren } from \"preact\";\nimport \"./payment-method-item.css\";\n\ninterface PaymentMethodItemProps {\n icon: h.JSX.Element;\n title: string;\n isActive: boolean;\n isSole: boolean;\n onChange: () => void;\n children: ComponentChildren;\n headerRight?: h.JSX.Element | null;\n confirmSection?: h.JSX.Element;\n}\n\nfunction PaymentMethodItem({\n icon,\n title,\n isActive,\n isSole,\n onChange,\n children,\n headerRight,\n confirmSection,\n}: PaymentMethodItemProps): h.JSX.Element {\n return (\n <label className={`straumur__payment-method-item${isSole ? \" straumur__payment-method-item--sole\" : \"\"}`}>\n {!isSole && (\n <input\n type=\"radio\"\n className=\"straumur__payment-method-item__radio-selector\"\n checked={isActive}\n onChange={onChange}\n />\n )}\n <span\n className={`straumur__payment-method-item__content${isSole ? \" straumur__payment-method-item__content--expanded\" : \"\"}`}\n >\n {!isSole && <span className=\"straumur__payment-method-item--circle\" />}\n {icon}\n <span className=\"straumur__payment-method-item--title\">{title}</span>\n {headerRight}\n </span>\n {confirmSection}\n <div\n className={`straumur__payment-method-item__expandable${isSole ? \" straumur__payment-method-item__expandable--visible\" : \"\"}`}\n >\n {children}\n </div>\n </label>\n );\n}\n\nexport default PaymentMethodItem;\n","import styleInject from '#style-inject';styleInject(\".straumur__payment-method-item{position:relative;cursor:pointer;background:var(--straumur__color-white);border-radius:var(--straumur__border-radius-lg);transition:all .3s ease;padding:var(--straumur__space-xxlg) var(--straumur__space-5xlg)}.straumur__payment-method-item--sole{cursor:default}.straumur__payment-method-item:has(.straumur__payment-method-item__radio-selector:checked){cursor:default}.straumur__payment-method-item__radio-selector{position:absolute;opacity:0;cursor:pointer}.straumur__payment-method-item__content{display:flex;align-items:center;gap:var(--straumur__space-lg);transition:background-color .3s ease}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content{padding-bottom:var(--straumur__space-xxlg)}.straumur__payment-method-item__content--expanded{padding-bottom:var(--straumur__space-xxlg)}.straumur__payment-method-item--circle{width:var(--straumur__space-5xlg);height:var(--straumur__space-5xlg);border:1px solid var(--straumur__color-cosmos-blue-gamma);background:var(--straumur__color-secondary-gamma);border-radius:50%;position:relative;transition:all .3s ease;flex-shrink:0}.straumur__payment-method-item__content:hover .straumur__payment-method-item--circle{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__payment-method-item--circle:after{content:\\\"\\\";position:absolute;width:100%;height:100%;border-radius:50%;top:50%;left:50%;transform:translate(-50%,-50%) scale(0);transition:transform .2s ease}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content .straumur__payment-method-item--circle{background:var(--straumur__color-blue-beta);border-color:var(--straumur__color-transparent)}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content .straumur__payment-method-item--circle:after{transform:translate(-50%,-50%) scale(1);background:var(--straumur__color-primary);height:var(--straumur__space-md);width:var(--straumur__space-md)}.straumur__payment-method-item--title{color:var(--straumur__color-text);font-size:16px;user-select:none}.straumur__payment-method-item__expandable{background:var(--straumur__color-white);max-height:0;overflow:hidden;transition:all .3s ease;opacity:0}.straumur__payment-method-item__radio-selector:checked~.straumur__payment-method-item__expandable{max-height:600px;opacity:1}.straumur__payment-method-item__expandable--visible{max-height:600px;opacity:1}\\n\")","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./google-pay-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport GooglePayIcon from \"../../assets/icons/googlepay\";\nimport GooglePayButton from \"../../components/google-pay-button/google-pay-button\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\ninterface GooglePayComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction GooglePayComponent({ configuration, paymentMethods }: GooglePayComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasGooglePay } =\n usePaymentMethodGroup();\n const [isUnavailable, setIsUnavailable] = useState(false);\n\n if (!hasGooglePay || isUnavailable) {\n return null;\n }\n\n if (configuration.instantPayments && configuration.instantPayments.some((x) => x === \"googlepay\")) {\n return null;\n }\n\n if (isObscuredByThreeDS(\"googlepay\")) {\n return null;\n }\n\n return (\n <PaymentMethodItem\n icon={<GooglePayIcon />}\n title={i18n.t(\"googlePay.title\")}\n isActive={activePaymentMethod === \"googlepay\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"googlepay\")}\n >\n <GooglePayButton\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={false}\n onUnavailable={() => setIsUnavailable(true)}\n />\n </PaymentMethodItem>\n );\n}\n\nexport default GooglePayComponent;\n","import styleInject from '#style-inject';styleInject(\".adyen-checkout__paywithgoogle{height:var(--straumur__space-8xlg)}\\n\")","import { h } from \"preact\";\n\nconst GooglePayIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\">\n <path\n fill=\"#fff\"\n d=\"M29.13 2.41H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z\"\n />\n <path\n fill=\"#3C4043\"\n d=\"M29.13 3.27c1.28 0 2.52.26 3.7.77a9.6 9.6 0 0 1 5.08 5.19 9.78 9.78 0 0 1 0 7.55 9.83 9.83 0 0 1-5.08 5.18 9.26 9.26 0 0 1-3.7.77H10.87a9.24 9.24 0 0 1-3.7-.77 9.6 9.6 0 0 1-5.08-5.18 9.78 9.78 0 0 1 0-7.55 9.83 9.83 0 0 1 5.08-5.19 9.24 9.24 0 0 1 3.7-.77h18.26Zm0-.86H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z\"\n />\n <path\n fill=\"#3C4043\"\n d=\"M19.1 13.75v3.2h-1v-7.9h2.64c.67 0 1.24.23 1.7.68.49.46.72 1.01.72 1.67a2.2 2.2 0 0 1-.71 1.68c-.46.45-1.03.67-1.7.67H19.1Zm0-3.73v2.76h1.66c.4 0 .73-.14.99-.4.26-.28.4-.6.4-.98 0-.36-.14-.68-.4-.95a1.28 1.28 0 0 0-.99-.42H19.1Zm6.67 1.35c.73 0 1.31.2 1.74.6.42.4.64.95.64 1.65v3.34h-.95v-.76h-.04a1.9 1.9 0 0 1-1.65.93 2.1 2.1 0 0 1-1.46-.53c-.4-.35-.6-.8-.6-1.32 0-.56.21-1 .63-1.34.41-.33.97-.5 1.66-.5.59 0 1.07.12 1.45.34v-.23c0-.36-.13-.65-.4-.9a1.4 1.4 0 0 0-.97-.37c-.56 0-1 .24-1.32.72l-.88-.56a2.42 2.42 0 0 1 2.15-1.07Zm-1.29 3.92c0 .27.11.5.33.67.22.17.48.26.78.26.42 0 .79-.16 1.12-.48.32-.31.49-.68.49-1.11a2.02 2.02 0 0 0-1.3-.38c-.4 0-.74.1-1.01.3a.9.9 0 0 0-.4.74Zm9.08-3.75-3.32 7.8h-1.02l1.23-2.73-2.19-5.07h1.09l1.57 3.89h.02l1.54-3.89h1.08Z\"\n />\n <path\n fill=\"#4285F4\"\n d=\"M15.14 13.1c0-.32-.03-.64-.09-.95h-4.17v1.75h2.4a2.1 2.1 0 0 1-.89 1.4v1.14h1.43a4.49 4.49 0 0 0 1.32-3.33Z\"\n />\n <path fill=\"#34A853\" d=\"M12.4 15.3a2.66 2.66 0 0 1-4-1.44H6.9v1.18a4.43 4.43 0 0 0 6.91 1.4l-1.43-1.13Z\" />\n <path\n fill=\"#FABB05\"\n d=\"M8.25 13c0-.3.05-.59.14-.86v-1.17H6.9a4.59 4.59 0 0 0 0 4.07l1.48-1.17a2.79 2.79 0 0 1-.14-.86Z\"\n />\n <path\n fill=\"#E94235\"\n d=\"M10.88 10.27c.66 0 1.24.23 1.7.68l1.27-1.3a4.22 4.22 0 0 0-2.97-1.18 4.44 4.44 0 0 0-3.97 2.5l1.48 1.17a2.66 2.66 0 0 1 2.5-1.87Z\"\n />\n </svg>\n);\n\nexport default GooglePayIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__google-pay-button__loading{display:flex;justify-content:center}\\n\")","import \"./google-pay-button.css\";\nimport { h } from \"preact\";\nimport WalletButton, { WalletButtonProps } from \"../shared/wallet-button\";\n\ntype GooglePayButtonProps = Omit<WalletButtonProps, \"method\">;\n\nfunction GooglePayButton(props: GooglePayButtonProps): h.JSX.Element | null {\n return <WalletButton method=\"googlepay\" {...props} />;\n}\n\nexport default GooglePayButton;\n","import { Fragment, h } from \"preact\";\nimport { useEffect, useRef } from \"preact/hooks\";\nimport {\n AdyenCheckout,\n AdyenCheckoutError,\n ApplePay,\n ApplePayConfiguration,\n GooglePay,\n GooglePayConfiguration,\n ICore,\n UIElement,\n UIElementProps,\n} from \"@adyen/adyen-web\";\nimport { usePaymentMethodGroup } from \"../payment-method-group/payment-method-group-context\";\nimport { ResolvedTheme, StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { CANCEL } from \"../../models/constants\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { AdyenPaymentHandlers, createAdyenPaymentHandlers } from \"./create-adyen-handlers\";\nimport { createBeforeSubmitClickHandler } from \"./before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { resolveApplePayButtonColor, resolveGooglePayButtonColor } from \"../../utils/wallet-button-theme\";\n\nexport type WalletMethod = \"applepay\" | \"googlepay\";\n\nexport interface WalletButtonProps {\n method: WalletMethod;\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n isInstantPayment: boolean;\n onUnavailable?: () => void;\n}\n\ntype WalletElement = ApplePay | GooglePay;\n\n/** Merchant identifiers Adyen requires inside the wallet element's configuration. */\ntype WalletMerchantConfig = { gatewayMerchantId: string; merchantId: string };\n\ninterface WalletContext {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n walletConfig: WalletMerchantConfig;\n handleOnSubmit: AdyenPaymentHandlers[\"handleOnSubmit\"];\n resolvedTheme: ResolvedTheme;\n}\n\ninterface WalletDescriptor {\n loadingClassName: string;\n createElement(core: ICore, context: WalletContext): WalletElement;\n}\n\n// Everything the two wallets share lives in WalletButton below; per-wallet differences\n// (the Adyen element class and its configuration deltas) live in this descriptor map.\nconst WALLETS: Record<WalletMethod, WalletDescriptor> = {\n applepay: {\n loadingClassName: \"straumur__apple-pay-button__loading\",\n createElement(core, { configuration, paymentMethods, walletConfig, handleOnSubmit, resolvedTheme }) {\n const applePayConfiguration: ApplePayConfiguration = {\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n environment: configuration.environment,\n onSubmit: handleOnSubmit,\n onClick: createBeforeSubmitClickHandler(configuration.paymentFlow),\n // Follows the widget theme (light → white-outline, dark → black); overridable via applePayButtonTheme.\n buttonColor: resolveApplePayButtonColor(resolvedTheme, configuration.applePayButtonTheme),\n configuration: {\n ...walletConfig,\n merchantName: paymentMethods.merchantName,\n },\n };\n\n return new ApplePay(core, applePayConfiguration);\n },\n },\n googlepay: {\n loadingClassName: \"straumur__google-pay-button__loading\",\n createElement(core, { configuration, paymentMethods, walletConfig, handleOnSubmit, resolvedTheme }) {\n const googlePayConfiguration: GooglePayConfiguration = {\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n challengeWindowSize: \"05\",\n countryCode: configuration.countryCode,\n environment: configuration.environment,\n onSubmit: handleOnSubmit,\n onClick: createBeforeSubmitClickHandler(configuration.paymentFlow),\n // Follows the widget theme (light → white, dark → black); overridable via googlePayButtonTheme.\n buttonColor: resolveGooglePayButtonColor(resolvedTheme, configuration.googlePayButtonTheme),\n buttonSizeMode: \"fill\",\n // px — Adyen draws the Google Pay button, so its radius can't come from CSS. Keep this in\n // sync with --straumur__border-radius-lg (12px), matching the payment-method \"card box\"\n // and the Apple Pay button (--apple-pay-button-border-radius), since the express wallet\n // buttons sit as tiles alongside that box.\n buttonRadius: 12,\n configuration: {\n ...walletConfig,\n merchantName: paymentMethods.merchantName,\n },\n };\n\n return new GooglePay(core, googlePayConfiguration);\n },\n },\n};\n\nfunction WalletButton({\n method,\n configuration,\n paymentMethods,\n isInstantPayment,\n onUnavailable,\n}: WalletButtonProps): h.JSX.Element | null {\n const wallet = WALLETS[method];\n const resolvedTheme = useResolvedTheme(configuration.theme);\n const walletElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const walletRef = useRef<WalletElement>();\n const {\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isObscuredByThreeDS,\n setActivePaymentMethod,\n activePaymentMethod,\n } = usePaymentMethodGroup();\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n onSubmitStart: () => {\n if (isInstantPayment) {\n setActivePaymentMethod(method);\n }\n },\n });\n\n function handleOnError(data: AdyenCheckoutError, _?: UIElement<UIElementProps> | undefined): void {\n if (data.name !== CANCEL) {\n handleError({ key: \"error.unknownError\" });\n }\n }\n\n function markUnavailable(): void {\n // Initialized-but-unavailable: the loader must disappear and the method must not stay selected.\n updatePaymentMethodInitialization(method, true);\n if (activePaymentMethod === method) {\n setActivePaymentMethod(null);\n }\n onUnavailable?.();\n }\n\n const initializeAdyenComponent = async () => {\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n paymentMethodsResponse: paymentMethods.paymentMethods,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n onError: handleOnError,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n const walletPaymentMethod = paymentMethods.paymentMethods.paymentMethods?.find((x) => x.type === method);\n const walletConfig = walletPaymentMethod?.configuration as WalletMerchantConfig | undefined;\n\n if (!walletConfig) {\n // No usable wallet configuration in the response: treat it like an unavailable wallet instead of crashing.\n markUnavailable();\n return;\n }\n\n walletRef.current = wallet.createElement(adyenCheckoutRef.current, {\n configuration,\n paymentMethods,\n walletConfig,\n handleOnSubmit,\n resolvedTheme,\n });\n\n walletRef.current\n .isAvailable()\n .then(() => {\n walletRef.current!.mount(walletElementRef.current!);\n updatePaymentMethodInitialization(method, true);\n })\n .catch(() => {\n markUnavailable();\n });\n };\n\n useEffect(() => {\n if (!isPaymentMethodInitialized[method]) {\n initializeAdyenComponent();\n }\n }, [configuration]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(walletRef.current && isPaymentMethodInitialized[method]),\n () => {\n walletRef.current!.remove();\n initializeAdyenComponent();\n }\n );\n\n if (isObscuredByThreeDS(method)) {\n return null;\n }\n\n return (\n <Fragment>\n {isPaymentMethodInitialized[method] === false && (\n <div className={wallet.loadingClassName}>\n <LoaderIcon />\n </div>\n )}\n <div\n ref={walletElementRef}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n position: isPaymentMethodInitialized[method] ? \"static\" : \"absolute\",\n }}\n />\n </Fragment>\n );\n}\n\nexport default WalletButton;\n","export type PaymentMethod = \"card\" | \"storedcard\" | \"googlepay\" | \"applepay\";\n\n/**\n * A slot in the rendered payment-method list: a standalone method, or \"instantpayments\" for the\n * express wallet row. Used to order the options via `orderPaymentMethods`.\n */\nexport type PaymentMethodOrder = PaymentMethod | \"instantpayments\";\n\n/**\n * Which payment method to open (expand) on load via `openDefaultPaymentMethod`. \"firstStoredCard\"\n * opens the first saved card. Ignored (nothing pre-opened, chooser stays collapsed) when the\n * requested method isn't available (e.g. a wallet that's in `instantPayments`, or no saved cards).\n */\nexport type OpenDefaultPaymentMethod = \"card\" | \"firstStoredCard\" | \"googlepay\" | \"applepay\";\n\nexport const NETWORK_ERROR = \"NETWORK_ERROR\";\nexport const CANCEL = \"CANCEL\";\nexport const IMPLEMENTATION_ERROR = \"IMPLEMENTATION_ERROR\";\nexport const API_ERROR = \"API_ERROR\";\nexport const ERROR = \"ERROR\";\nexport const SCRIPT_ERROR = \"SCRIPT_ERROR\";\nexport const SDK_ERROR = \"SDK_ERROR\";\n","import { ApplePayButtonTheme, GooglePayButtonTheme, ResolvedTheme } from \"../models/models\";\n\n// Adyen's own button-color unions, mirrored here so this util doesn't import the Adyen SDK just for\n// two string-literal types (keeps it trivially unit-testable).\ntype GooglePayButtonColor = \"default\" | \"black\" | \"white\";\ntype ApplePayButtonColor = \"black\" | \"white\" | \"white-outline\";\n\n/**\n * Google Pay button color derived from the resolved widget theme, overridable via\n * `googlePayButtonTheme`. Default: light widget → white button, dark widget → black button.\n */\nexport function resolveGooglePayButtonColor(\n theme: ResolvedTheme,\n override?: GooglePayButtonTheme\n): GooglePayButtonColor {\n const choice = override ?? (theme === \"dark\" ? \"dark\" : \"white\");\n\n return choice === \"dark\" ? \"black\" : \"white\";\n}\n\n/**\n * Apple Pay button style derived from the resolved widget theme, overridable via\n * `applePayButtonTheme`. Default: light widget → \"white-outline\" (a plain white button would vanish\n * against the widget's white surface), dark widget → black button.\n */\nexport function resolveApplePayButtonColor(theme: ResolvedTheme, override?: ApplePayButtonTheme): ApplePayButtonColor {\n const choice = override ?? (theme === \"dark\" ? \"dark\" : \"light\");\n\n return choice === \"dark\" ? \"black\" : \"white-outline\";\n}\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./apple-pay-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport ApplePayIcon from \"../../assets/icons/applepay\";\nimport ApplePayButton from \"../../components/apple-pay-button/apple-pay-button\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\ninterface ApplePayComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction ApplePayComponent({ configuration, paymentMethods }: ApplePayComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasApplePay } =\n usePaymentMethodGroup();\n const [isUnavailable, setIsUnavailable] = useState(false);\n\n if (!hasApplePay || isUnavailable) {\n return null;\n }\n\n if (configuration.instantPayments && configuration.instantPayments.some((x) => x === \"applepay\")) {\n return null;\n }\n\n if (isObscuredByThreeDS(\"applepay\")) {\n return null;\n }\n\n return (\n <PaymentMethodItem\n icon={<ApplePayIcon />}\n title={i18n.t(\"applePay.title\")}\n isActive={activePaymentMethod === \"applepay\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"applepay\")}\n >\n <ApplePayButton\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={false}\n onUnavailable={() => setIsUnavailable(true)}\n />\n </PaymentMethodItem>\n );\n}\n\nexport default ApplePayComponent;\n","import styleInject from '#style-inject';styleInject(\"\")","import { h } from \"preact\";\n\nconst ApplePayIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\">\n <path\n fill=\"#000\"\n d=\"M36.42 0H3.58a69.25 69.25 0 0 0-.75 0c-.25.01-.5.03-.76.07a2.51 2.51 0 0 0-1.32.7A2.43 2.43 0 0 0 .07 2.1 5.14 5.14 0 0 0 0 3.22v19.91c.01.25.03.51.07.76a2.6 2.6 0 0 0 .68 1.35 2.39 2.39 0 0 0 1.32.69 4.98 4.98 0 0 0 1.1.07h34a5 5 0 0 0 .76-.07 2.5 2.5 0 0 0 1.32-.7 2.44 2.44 0 0 0 .68-1.34 5.13 5.13 0 0 0 .07-1.11V2.87a6.5 6.5 0 0 0-.07-.76 2.58 2.58 0 0 0-.68-1.35 2.4 2.4 0 0 0-1.32-.69 4.96 4.96 0 0 0-1.1-.07h-.41Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M36.42.87h.73c.2 0 .42.02.62.06a1.67 1.67 0 0 1 .88.44 1.58 1.58 0 0 1 .44.89 4.38 4.38 0 0 1 .06.97v19.55a14.67 14.67 0 0 1-.06.96 1.7 1.7 0 0 1-.44.89 1.54 1.54 0 0 1-.87.44 4.27 4.27 0 0 1-.96.06H2.85a3.7 3.7 0 0 1-.63-.06 1.66 1.66 0 0 1-.87-.45 1.56 1.56 0 0 1-.44-.88 4.35 4.35 0 0 1-.06-.97V2.9c.01-.2.02-.42.06-.63.03-.18.08-.34.16-.49A1.56 1.56 0 0 1 2.22.93a4.2 4.2 0 0 1 .96-.06h33.24\"\n />\n <path\n fill=\"#000\"\n d=\"M10.92 8.61c.34-.43.57-1 .51-1.59a2.21 2.21 0 0 0-1.99 2.3c.56.04 1.12-.3 1.48-.7Zm.51.81c-.82-.05-1.52.46-1.9.46-.4 0-1-.43-1.64-.42-.84 0-1.62.48-2.05 1.24-.88 1.52-.23 3.76.62 5 .42.6.92 1.27 1.58 1.25.62-.02.86-.4 1.62-.4.75 0 .97.4 1.63.39.69-.01 1.11-.61 1.53-1.22.47-.7.67-1.37.68-1.4-.01-.02-1.32-.52-1.33-2.02-.01-1.26 1.03-1.85 1.07-1.9a2.34 2.34 0 0 0-1.81-.98Zm7.11-1.7a2.87 2.87 0 0 1 3.02 3c0 1.8-1.27 3.03-3.06 3.03h-1.97v3.12h-1.42V7.72h3.43Zm-2 4.83h1.62c1.24 0 1.94-.66 1.94-1.82 0-1.15-.7-1.81-1.93-1.81h-1.64v3.63Zm5.39 2.43c0-1.17.9-1.89 2.48-1.98l1.83-.1v-.52c0-.74-.5-1.18-1.34-1.18-.8 0-1.3.38-1.41.97h-1.3c.08-1.2 1.1-2.09 2.76-2.09 1.62 0 2.65.86 2.65 2.2v4.6h-1.31v-1.1h-.04a2.38 2.38 0 0 1-2.1 1.2c-1.3 0-2.22-.8-2.22-2Zm4.3-.6v-.53l-1.64.1c-.82.06-1.28.42-1.28.99 0 .58.48.96 1.22.96.96 0 1.7-.66 1.7-1.52Zm2.61 4.95v-1.11c.1.03.33.03.44.03.64 0 .98-.27 1.19-.96l.12-.4-2.41-6.69h1.48l1.7 5.43h.02l1.69-5.43h1.44l-2.5 7.02c-.57 1.62-1.23 2.14-2.61 2.14a5.3 5.3 0 0 1-.56-.03Z\"\n />\n </svg>\n);\n\nexport default ApplePayIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__apple-pay-button__loading{display:flex;justify-content:center}\\n\")","import \"./apple-pay-button.css\";\nimport { h } from \"preact\";\nimport WalletButton, { WalletButtonProps } from \"../shared/wallet-button\";\n\ntype ApplePayButtonProps = Omit<WalletButtonProps, \"method\">;\n\nfunction ApplePayButton(props: ApplePayButtonProps): h.JSX.Element | null {\n return <WalletButton method=\"applepay\" {...props} />;\n}\n\nexport default ApplePayButton;\n","import { Fragment, h } from \"preact\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { StoredPaymentMethod, SuccessResponse } from \"../../services/models\";\nimport StoredCardComponent from \"./stored-card-component\";\nimport { useState } from \"preact/hooks\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface StoredCardContainerComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction StoredCardContainerComponent({\n configuration,\n paymentMethods,\n}: StoredCardContainerComponentProps): h.JSX.Element | null {\n const [storedPaymentMethods, setStoredPaymentMethods] = useState<StoredPaymentMethod[]>(\n paymentMethods.paymentMethods.storedPaymentMethods ?? []\n );\n const { isObscuredByThreeDS, hasStoredPaymentMethods } = usePaymentMethodGroup();\n\n if (!hasStoredPaymentMethods || isObscuredByThreeDS(\"storedcard\")) {\n return null;\n }\n\n function handleStoredCardRemoved(storedPaymentMethodId: string): void {\n setStoredPaymentMethods((prevStoredPaymentMethods) =>\n prevStoredPaymentMethods.filter((storedPaymentMethod) => storedPaymentMethod.id !== storedPaymentMethodId)\n );\n }\n\n return (\n <Fragment>\n {storedPaymentMethods?.map((storedPaymentMethod) => (\n <StoredCardComponent\n key={storedPaymentMethod.id}\n configuration={configuration}\n storedPaymentMethod={storedPaymentMethod}\n paymentMethods={paymentMethods}\n onStoredCardRemoved={handleStoredCardRemoved}\n />\n ))}\n </Fragment>\n );\n}\n\nexport default StoredCardContainerComponent;\n","import { Fragment, h } from \"preact\";\nimport { useEffect, useRef, useState } from \"preact/hooks\";\nimport \"./stored-card-component.css\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { Tooltip } from \"../../components/tooltip/tooltip\";\nimport InfoIcon from \"../../assets/icons/info\";\nimport { AdyenCheckout, AdyenCheckoutError, CustomCard, ICore, UIElement, UIElementProps } from \"@adyen/adyen-web\";\nimport { RenderBrandIcons } from \"../../utils/renderBrandIcons\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { StoredCardComponentProps, StoredCardFormError, StoredCardFormErrorField } from \"./models\";\nimport WarningIcon from \"../../assets/icons/warning\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\nimport { createAdyenPaymentHandlers } from \"../../components/shared/create-adyen-handlers\";\nimport { submitCardWithGate } from \"../../components/shared/before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useFocusOnActivate } from \"../../utils/custom-hooks/use-focus-on-activate\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { getAdyenFieldStyles } from \"../../utils/adyen-field-styles\";\nimport { toResultMessage } from \"../../flows/payment-flow\";\n\nfunction StoredCardComponent({\n configuration,\n paymentMethods,\n storedPaymentMethod,\n onStoredCardRemoved,\n}: StoredCardComponentProps): h.JSX.Element | null {\n const storedCardElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const customCardRef = useRef<CustomCard>();\n const { i18n } = useI18n();\n const [payButtonDisabled, setPayButtonDisabled] = useState<boolean>(true);\n const [securityCodePolicy, setSecurityCodePolicy] = useState<\"hidden\" | \"optional\" | \"required\">(\"required\");\n const [askConfirmRemoveStoredCard, setAskConfirmRemoveStoredCard] = useState<boolean>(false);\n const [formErrors, setFormErrors] = useState<StoredCardFormError>({\n encryptedSecurityCode: { visible: false },\n });\n const {\n activePaymentMethod,\n setActivePaymentMethod,\n activeStoredPaymentMethodId,\n setActiveStoredPaymentMethodId,\n isStoredCardInitialized,\n updateStoredCardInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isSolePaymentMethod,\n registerSubmitHandler,\n unregisterSubmitHandler,\n } = usePaymentMethodGroup();\n\n // In sole mode there is only one stored card, so being the active payment method is enough.\n // In normal mode both the method and the specific card ID must match.\n const isActive = isSolePaymentMethod\n ? activePaymentMethod === \"storedcard\"\n : activePaymentMethod === \"storedcard\" && activeStoredPaymentMethodId === storedPaymentMethod.id;\n\n const resolvedTheme = useResolvedTheme(configuration.theme);\n\n async function handleSubmitClick(): Promise<void> {\n await submitCardWithGate(configuration.paymentFlow, () => customCardRef.current);\n }\n\n useEffect(() => {\n // Treat the stored card as inactive while a 3DS challenge is showing: it takes over the card\n // container, so a host's external submit button must not stay visible/clickable during it.\n const ready = isActive && isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive;\n if (!ready) {\n // Nothing selected yet, a different method is active, or 3DS is in progress - tell the host\n // explicitly so a custom submit button hides (and defaults to disabled when it reappears).\n configuration.onCardValidityChanged?.(false, false);\n return;\n }\n\n registerSubmitHandler(handleSubmitClick);\n // Signal \"active but not yet valid\" on activation so a host's custom submit button can appear\n // (disabled) right away. onAllValid then updates the valid state as the shopper fills the CVC.\n configuration.onCardValidityChanged?.(false, true);\n return () => {\n unregisterSubmitHandler(handleSubmitClick);\n configuration.onCardValidityChanged?.(false, false);\n };\n }, [\n isActive,\n isStoredCardInitialized[storedPaymentMethod.id],\n threeDSecureActive,\n registerSubmitHandler,\n unregisterSubmitHandler,\n ]);\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData: (data) => ({\n ...data,\n paymentMethod: {\n ...data.paymentMethod,\n storedPaymentMethodId: storedPaymentMethod.id,\n },\n }),\n });\n\n function handleOnError(_: AdyenCheckoutError, __?: UIElement<UIElementProps> | undefined) {\n handleError({ key: \"error.unknownError\" });\n }\n\n const initializeAdyenComponent = async () => {\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n paymentMethodsResponse: paymentMethods.paymentMethods,\n onError: handleOnError,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n customCardRef.current = new CustomCard(adyenCheckoutRef.current, {\n brands: [storedPaymentMethod.brand!],\n styles: getAdyenFieldStyles(resolvedTheme),\n onSubmit: handleOnSubmit,\n onConfigSuccess() {\n updateStoredCardInitialization(storedPaymentMethod.id, true);\n },\n onBrand: (event) => {\n setSecurityCodePolicy(event.cvcPolicy);\n },\n onValidationError: (event) => {\n const defaultErrors: StoredCardFormError = {\n encryptedSecurityCode: { visible: false, message: undefined },\n };\n\n event\n .filter((x) => x.error)\n .forEach((x) => {\n defaultErrors[x.fieldType as StoredCardFormErrorField].visible = true;\n defaultErrors[x.fieldType as StoredCardFormErrorField].message = x.errorI18n;\n });\n\n setFormErrors(defaultErrors);\n },\n onAllValid: (event) => {\n setPayButtonDisabled(!event.allValid);\n configuration.onCardValidityChanged?.(event.allValid, true);\n },\n placeholders: configuration.placeholders,\n // Adyen appears to ignore challengeWindowSize on CustomCard; kept for parity with the wallet configs.\n challengeWindowSize: \"05\",\n });\n\n if (storedCardElementRef.current) {\n customCardRef.current.mount(storedCardElementRef.current);\n }\n };\n\n useEffect(() => {\n if (isActive && !isStoredCardInitialized[storedPaymentMethod.id]) {\n initializeAdyenComponent();\n }\n }, [configuration, isActive]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(customCardRef.current && isStoredCardInitialized[activeStoredPaymentMethodId!]),\n () => {\n initializeAdyenComponent();\n setFormErrors({ encryptedSecurityCode: { visible: false, message: undefined } });\n }\n );\n\n useEffect(() => {\n setAskConfirmRemoveStoredCard(false);\n }, [activePaymentMethod, activeStoredPaymentMethodId]);\n\n // When the 3DS challenge replaces the stored-card field, move focus into the container.\n useFocusOnActivate(storedCardElementRef, threeDSecureActive && isActive);\n\n // Keep this guard below every hook call: returning early above a hook violates the\n // rules of hooks and corrupts hook ordering across renders.\n // Deliberately NOT isObscuredByThreeDS(\"storedcard\"): several stored-card components can be\n // mounted at once, so the one running the 3DS challenge is matched by card id via isActive.\n if (threeDSecureActive && !isActive) {\n return null;\n }\n\n function handleBoxChange() {\n setActivePaymentMethod(\"storedcard\");\n setActiveStoredPaymentMethodId(storedPaymentMethod.id);\n }\n\n function handleAskToConfirmRemoveCard() {\n setAskConfirmRemoveStoredCard(true);\n }\n\n function handleCancelRemoveStoredCard() {\n setAskConfirmRemoveStoredCard(false);\n }\n\n async function handleConfirmRemoveStoredCard() {\n const { disableToken } = configuration.paymentFlow;\n\n if (!disableToken) return;\n\n try {\n await disableToken(storedPaymentMethod.id);\n onStoredCardRemoved(storedPaymentMethod.id);\n } catch (error) {\n handleError(toResultMessage(error, \"error.failedToSubmitRemoveStoredPaymentCard\"));\n }\n }\n\n const canRemoveStoredCard = configuration.paymentFlow.disableToken !== undefined;\n\n const headerRight =\n canRemoveStoredCard && isActive && isStoredCardInitialized[storedPaymentMethod.id] ? (\n <div className=\"straumur__stored-card-component__remove-stored-card-button\">\n <button\n onClick={handleAskToConfirmRemoveCard}\n className=\"straumur__stored-card-component__remove-stored-card-button--text\"\n disabled={askConfirmRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCard\")}\n </button>\n </div>\n ) : null;\n\n const confirmSection = (\n <div\n className={`${\"straumur__stored-card-component__confirm-remove-stored-card\"} ${\n askConfirmRemoveStoredCard ? \"straumur__stored-card-component__confirm-remove-stored-card--expanded\" : \"\"\n }`}\n >\n <div className=\"straumur__stored-card-component__confirm-remove-stored-card--header\">\n <WarningIcon />\n <span className=\"straumur__stored-card-component__confirm-remove-stored-card--header--title\">\n {i18n.t(\"stored-cards.removeStoredCardQuestion\")}\n </span>\n </div>\n <div className=\"straumur__stored-card-component__confirm-remove-stored-card--actions\">\n <button\n className=\"straumur__stored-card-component__confirm-remove-stored-card--actions--button\"\n onClick={handleConfirmRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCardQuestionYesRemove\")}\n </button>\n <button\n className=\"straumur__stored-card-component__confirm-remove-stored-card--actions--button\"\n onClick={handleCancelRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCardQuestionCancel\")}\n </button>\n </div>\n </div>\n );\n\n return (\n <PaymentMethodItem\n icon={\n <RenderBrandIcons\n brands={[\n {\n brand: storedPaymentMethod.brand!,\n brandFullName: storedPaymentMethod.name,\n },\n ]}\n theme={resolvedTheme}\n />\n }\n title={`•••• ${storedPaymentMethod.lastFour}`}\n isActive={isActive}\n isSole={isSolePaymentMethod}\n onChange={handleBoxChange}\n headerRight={headerRight}\n confirmSection={confirmSection}\n >\n <div\n ref={storedCardElementRef}\n tabIndex={-1}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n }}\n >\n {!isStoredCardInitialized[storedPaymentMethod.id] && (\n <div className=\"straumur__stored-card-component__loading-text\">\n <LoaderIcon />\n </div>\n )}\n\n <div\n className=\"straumur__stored-card-component__form\"\n style={{\n opacity: isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive ? 1 : 0,\n position: isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive ? \"relative\" : \"absolute\",\n transition: \"opacity 0.3s ease-in-out\",\n }}\n >\n <div className=\"straumur__stored-card-component__form--field-wrapper\">\n <div className=\"straumur__stored-card-component__form--wrapper\">\n <label className=\"straumur__stored-card-component__form--wrapper--label straumur__stored-card-component__form--wrapper--label--readonly\">\n {i18n.t(\"stored-cards.expiryDate\")}\n </label>\n <span className=\"straumur__stored-card-component__form--wrapper--input straumur__stored-card-component__form--wrapper--input--readonly\">\n {storedPaymentMethod.expiryMonth}/{storedPaymentMethod.expiryYear}\n </span>\n </div>\n\n <div className=\"straumur__stored-card-component__form--wrapper\">\n {(securityCodePolicy === \"optional\" || securityCodePolicy === \"required\") && (\n <Fragment>\n <label\n className={`${\"straumur__stored-card-component__form--wrapper--label\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__stored-card-component__form--wrapper--label--error\"\n : \"\"\n }`}\n >\n {securityCodePolicy === \"optional\"\n ? i18n.t(\"stored-cards.securityCode3DigitsOptional\")\n : i18n.t(\"stored-cards.securityCode3Digits\")}\n </label>\n <span\n className={`${\"straumur__stored-card-component__form--wrapper--input\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__stored-card-component__form--wrapper--input--error\"\n : \"\"\n }`}\n data-cse=\"encryptedSecurityCode\"\n role=\"group\"\n aria-label={i18n.t(\"stored-cards.securityCode3Digits\")}\n >\n <div className=\"straumur__stored-card-component__form--wrapper--label--info\">\n <Tooltip content={i18n.t(\"stored-cards.securityCode3DigitsInfo\")} placement=\"top\">\n <InfoIcon />\n </Tooltip>\n </div>\n </span>\n </Fragment>\n )}\n {formErrors.encryptedSecurityCode.visible && (\n <span className=\"straumur__stored-card-component__form--wrapper--error\">\n {formErrors.encryptedSecurityCode.message}\n </span>\n )}\n </div>\n </div>\n\n {!configuration.hideSubmitButton && (\n <button\n className=\"straumur__stored-card-component__submit-button\"\n disabled={payButtonDisabled}\n onClick={handleSubmitClick}\n >\n {paymentMethods.minorUnitsAmount === 0\n ? i18n.t(\"stored-cards.saveCardDetails\")\n : paymentMethods.formattedAmount}\n </button>\n )}\n </div>\n </div>\n </PaymentMethodItem>\n );\n}\n\nexport default StoredCardComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__stored-card-component__remove-stored-card-button{margin-left:auto}.straumur__stored-card-component__remove-stored-card-button--text{color:var(--straumur__color-danger-text);text-decoration:none;background:none;border:none;cursor:pointer;transition:all .2s ease}.straumur__stored-card-component__remove-stored-card-button--text:disabled{cursor:not-allowed;color:var(--straumur__color-secondary)}.straumur__stored-card-component__confirm-remove-stored-card{background-color:var(--straumur__color-warning-bg);border-radius:var(--straumur__border-radius-s);max-height:0;overflow:hidden;transition:all .3s ease;opacity:0}.straumur__stored-card-component__confirm-remove-stored-card--expanded{padding:var(--straumur__space-xxlg);max-height:600px;opacity:1}.straumur__stored-card-component__confirm-remove-stored-card--header{display:flex;align-items:center;gap:var(--straumur__space-lg);color:var(--straumur__color-text);padding-bottom:var(--straumur__space-xxlg)}.straumur__stored-card-component__confirm-remove-stored-card--actions{display:flex;gap:var(--straumur__space-lg);justify-content:end}.straumur__stored-card-component__confirm-remove-stored-card--actions--button{color:var(--straumur__color-warning-text);background:none;border:none;cursor:pointer;text-decoration:none;font-weight:700}.straumur__stored-card-component__loading-text{display:flex;justify-content:center}.straumur__stored-card-component__form{display:flex;padding-top:var(--straumur__space-xxlg);flex-direction:column;gap:var(--straumur__space-5xlg)}.straumur__stored-card-component__form--wrapper{display:flex;flex-direction:column;justify-items:start;position:relative;width:100%}.straumur__stored-card-component__form--wrapper--error{color:var(--straumur__color-red-beta);font-size:12px}.straumur__stored-card-component__form--wrapper--label{transform:translate(10px) translateY(-50%);z-index:1;background:linear-gradient(to top,var(--straumur__color-secondary-gamma) 53%,var(--straumur__color-transparent) 50%);position:absolute;font-weight:500;font-size:14px;padding:0 var(--straumur__space-xxs)}.straumur__stored-card-component__form--wrapper--label--readonly{background:linear-gradient(to top,var(--straumur__color-gray-epsilon) 53%,var(--straumur__color-transparent) 50%)}.straumur__stored-card-component__form--wrapper--label--error{color:var(--straumur__color-red-beta);background:linear-gradient(to top,var(--straumur__color-red-gamma) 53%,var(--straumur__color-transparent) 50%);font-size:13px;font-weight:500}.straumur__stored-card-component__form--wrapper--label--info{position:absolute;top:33%;right:var(--straumur__space-md)}.straumur__stored-card-component__form--wrapper--input{background:var(--straumur__color-secondary-gamma);color:var(--straumur__color-text);display:flex;align-items:center;border:1px solid var(--straumur__color-transparent);border-radius:var(--straumur__border-radius-s);font-size:16px;height:48px;outline:none;padding-left:var(--straumur__space-lg);transition:border .2s ease-out,box-shadow .2s ease-out;position:relative}.straumur__stored-card-component__form--wrapper--input--readonly{background-color:var(--straumur__color-gray-epsilon)}.straumur__stored-card-component__form--wrapper--input:hover{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__stored-card-component__form--wrapper--input--readonly:hover{border:1px solid var(--straumur__color-transparent)}.straumur__stored-card-component__form--wrapper--input--error{background:var(--straumur__color-red-gamma);border:1px solid var(--straumur__color-red-beta)}.straumur__stored-card-component__form--wrapper--input--error:hover{border:1px solid var(--straumur__color-red-beta)}.straumur__stored-card-component__form--field-wrapper{display:flex;width:100%;gap:var(--straumur__space-lg)}.straumur__stored-card-component__submit-button{background:var(--straumur__color-primary);border:none;border-radius:var(--straumur__border-radius-s);color:var(--straumur__color-white);cursor:pointer;font-size:16px;height:40px;outline:none;padding:0 var(--straumur__space-xxlg);transition:background .2s ease-out;width:100%}.straumur__stored-card-component__submit-button:hover{background:var(--straumur__color-primary);border:1px solid var(--straumur__color-border)}.straumur__stored-card-component__submit-button:disabled{background:var(--straumur__color-secondary);border:1px solid var(--straumur__color-border);cursor:not-allowed}\\n\")","import { h } from \"preact\";\n\nconst WarningIcon = () => (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_10650_34968)\">\n <path\n d=\"M12.0011 15C12.6245 15 13.1261 14.4984 13.1261 13.875V7.875C13.1261 7.25391 12.6222 6.75 12.0433 6.75C11.4644 6.75 10.8761 7.25625 10.8761 7.875V13.875C10.8761 14.4984 11.3823 15 12.0011 15ZM12.0011 16.5516C11.1873 16.5516 10.5273 17.2116 10.5273 18.0253C10.5292 18.8391 11.1855 19.5 12.0011 19.5C12.8167 19.5 13.4748 18.84 13.4748 18.0262C13.473 17.2125 12.8167 16.5516 12.0011 16.5516Z\"\n fill=\"#DFAE00\"\n />\n <path\n opacity=\"0.4\"\n d=\"M23.7312 19.5469L13.7328 2.48438C12.9673 1.17188 11.0356 1.17188 10.2649 2.48438L0.271188 19.5469C-0.49803 20.8547 0.460048 22.5 2.00181 22.5H21.9987C23.5343 22.5 24.4953 20.8594 23.7312 19.5469ZM10.8734 7.875C10.8734 7.25391 11.3773 6.75 11.9984 6.75C12.6195 6.75 13.1234 7.25625 13.1234 7.875V13.875C13.1234 14.4961 12.6195 15 12.0406 15C11.4617 15 10.8734 14.4984 10.8734 13.875V7.875ZM11.9984 19.5C11.1846 19.5 10.5246 18.84 10.5246 18.0262C10.5246 17.2125 11.1842 16.5525 11.9984 16.5525C12.8126 16.5525 13.4721 17.2125 13.4721 18.0262C13.4703 18.8391 12.814 19.5 11.9984 19.5Z\"\n fill=\"#DFAE00\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10650_34968\">\n <rect width=\"24\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default WarningIcon;\n","import { h, ComponentChildren } from \"preact\";\nimport { PaymentMethodGroupContext, SubmitApi } from \"./payment-method-group-context\";\nimport \"./payment-method-group.css\";\nimport { PaymentMethod } from \"../../models/constants\";\n\ninterface PaymentMethodGroupProps {\n children: ComponentChildren;\n initialValue: PaymentMethod | null;\n initialStoredPaymentMethodId?: string | null;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}\n\nfunction PaymentMethodGroup({\n children,\n initialValue,\n initialStoredPaymentMethodId,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n onSubmitApiReady,\n}: PaymentMethodGroupProps): h.JSX.Element | null {\n return (\n <PaymentMethodGroupContext\n initialValue={initialValue}\n initialStoredPaymentMethodId={initialStoredPaymentMethodId}\n isSolePaymentMethod={isSolePaymentMethod}\n hasCard={hasCard}\n hasGooglePay={hasGooglePay}\n hasApplePay={hasApplePay}\n hasStoredPaymentMethods={hasStoredPaymentMethods}\n onSubmitApiReady={onSubmitApiReady}\n >\n <div className=\"straumur__payment-method-group\">{children}</div>\n </PaymentMethodGroupContext>\n );\n}\n\nexport default PaymentMethodGroup;\n","import styleInject from '#style-inject';styleInject(\".straumur__payment-method-group{display:flex;flex-direction:column;gap:var(--straumur__space-xxlg);width:100%}\\n\")","import { Fragment, h } from \"preact\";\nimport \"./result-component.css\";\nimport SuccessIcon from \"../../assets/icons/success\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport FailureIcon from \"../../assets/icons/failure\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { ResultMessage } from \"../../models/models\";\n\nfunction ResultComponent(): h.JSX.Element | null {\n const { error, success } = usePaymentMethodGroup();\n const { i18n } = useI18n();\n\n if (!error && !success) {\n return null;\n }\n\n const renderMessage = (message: ResultMessage) => (\"key\" in message ? i18n.t(message.key) : message.text);\n\n return (\n <div className=\"straumur__result-component\">\n {error && (\n <Fragment>\n <span aria-hidden=\"true\">\n <FailureIcon />\n </span>\n {/* role=\"alert\" announces the failure to screen readers assertively (a declined payment\n was previously silent). */}\n <p className=\"straumur__result-component__error--message straumur__result-message\" role=\"alert\">\n {renderMessage(error)}\n </p>\n </Fragment>\n )}\n\n {success && (\n <Fragment>\n <span aria-hidden=\"true\">\n <SuccessIcon />\n </span>\n <p className=\"straumur__result-component__success--message straumur__result-message\" role=\"status\">\n {renderMessage(success)}\n </p>\n </Fragment>\n )}\n </div>\n );\n}\n\nexport default ResultComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__result-component{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--straumur__space-5xlg);padding:var(--straumur__space-6xlg);width:100%;min-height:300px;background-color:var(--straumur__color-white);border-radius:var(--straumur__border-radius-xxlg)}\\n\")","import { h } from \"preact\";\nimport \"./result-icons.css\";\n\nconst SuccessIcon = () => (\n <svg\n className=\"straumur__result-icon straumur__result-icon--success\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"120\"\n height=\"120\"\n viewBox=\"0 0 120 120\"\n role=\"img\"\n >\n <circle className=\"straumur__result-icon__halo\" cx=\"60\" cy=\"60\" r=\"52\" />\n <circle className=\"straumur__result-icon__ring\" cx=\"60\" cy=\"60\" r=\"50\" pathLength=\"100\" />\n <path className=\"straumur__result-icon__check\" d=\"M37 62 L53 78 L84 44\" pathLength=\"100\" />\n </svg>\n);\n\nexport default SuccessIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__result-icon{display:block}.straumur__result-icon__ring,.straumur__result-icon__check,.straumur__result-icon__x,.straumur__result-icon__halo,.straumur__result-icon__cross{transform-box:fill-box;transform-origin:center}.straumur__result-icon__ring{fill:none;stroke-width:5;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100;animation:straumur-result-draw .6s cubic-bezier(.65,0,.35,1) forwards}.straumur__result-icon__halo{opacity:0;animation:straumur-result-halo .9s .45s ease-out}.straumur__result-icon__check{fill:none;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:100;stroke-dashoffset:100;animation:straumur-result-draw .4s .55s cubic-bezier(.65,0,.35,1) forwards,straumur-result-pop .45s .9s ease-out}.straumur__result-icon__x{fill:none;stroke-width:7;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100;animation:straumur-result-draw .3s cubic-bezier(.65,0,.35,1) forwards}.straumur__result-icon__x--1{animation-delay:.6s}.straumur__result-icon__x--2{animation-delay:.82s}.straumur__result-icon__cross{animation:straumur-result-shake .4s 1.15s ease-in-out}.straumur__result-icon--success .straumur__result-icon__ring,.straumur__result-icon--success .straumur__result-icon__check{stroke:var(--straumur__color-success)}.straumur__result-icon--success .straumur__result-icon__halo{fill:var(--straumur__color-success)}.straumur__result-icon--failure .straumur__result-icon__ring,.straumur__result-icon--failure .straumur__result-icon__x{stroke:var(--straumur__color-danger-text)}.straumur__result-icon--failure .straumur__result-icon__halo{fill:var(--straumur__color-danger-text)}@keyframes straumur-result-draw{to{stroke-dashoffset:0}}@keyframes straumur-result-pop{0%{transform:scale(1)}45%{transform:scale(1.12)}to{transform:scale(1)}}@keyframes straumur-result-halo{0%{opacity:.35;transform:scale(.55)}to{opacity:0;transform:scale(1.35)}}@keyframes straumur-result-shake{0%,to{transform:translate(0)}25%{transform:translate(-3px)}75%{transform:translate(3px)}}@media(prefers-reduced-motion:reduce){.straumur__result-icon__ring,.straumur__result-icon__check,.straumur__result-icon__x,.straumur__result-icon__halo,.straumur__result-icon__cross{animation:none}.straumur__result-icon__ring,.straumur__result-icon__check,.straumur__result-icon__x{stroke-dashoffset:0}.straumur__result-icon__halo{opacity:0}}\\n\")","import { h } from \"preact\";\nimport \"./result-icons.css\";\n\nconst FailureIcon = () => (\n <svg\n className=\"straumur__result-icon straumur__result-icon--failure\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"120\"\n height=\"120\"\n viewBox=\"0 0 120 120\"\n role=\"img\"\n >\n <circle className=\"straumur__result-icon__halo\" cx=\"60\" cy=\"60\" r=\"52\" />\n <circle className=\"straumur__result-icon__ring\" cx=\"60\" cy=\"60\" r=\"50\" pathLength=\"100\" />\n <g className=\"straumur__result-icon__cross\">\n <line\n className=\"straumur__result-icon__x straumur__result-icon__x--1\"\n x1=\"42\"\n y1=\"42\"\n x2=\"78\"\n y2=\"78\"\n pathLength=\"100\"\n />\n <line\n className=\"straumur__result-icon__x straumur__result-icon__x--2\"\n x1=\"78\"\n y1=\"42\"\n x2=\"42\"\n y2=\"78\"\n pathLength=\"100\"\n />\n </g>\n </svg>\n);\n\nexport default FailureIcon;\n","import { Fragment, h, ComponentChildren } from \"preact\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface PaymentMethodsWrapperProps {\n children: ComponentChildren;\n}\n\nfunction PaymentMethodsWrapper({ children }: PaymentMethodsWrapperProps): h.JSX.Element | null {\n const { error, success } = usePaymentMethodGroup();\n\n if (error || success) {\n return null;\n }\n\n return <Fragment>{children}</Fragment>;\n}\n\nexport default PaymentMethodsWrapper;\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./instant-payments-component.css\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport GooglePayButton from \"../../components/google-pay-button/google-pay-button\";\nimport ApplePayButton from \"../../components/apple-pay-button/apple-pay-button\";\nimport { PaymentMethod } from \"../../models/constants\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface InstantPaymentsComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction InstantPaymentsComponent({\n configuration,\n paymentMethods,\n}: InstantPaymentsComponentProps): h.JSX.Element | null {\n const { hasGooglePay, hasApplePay } = usePaymentMethodGroup();\n const [unavailableMethods, setUnavailableMethods] = useState<Set<string>>(new Set());\n\n const handleUnavailable = (method: string) => {\n setUnavailableMethods((prev) => new Set(prev).add(method));\n };\n\n if (!configuration.instantPayments) {\n return null;\n }\n\n // safeguard: filter out any invalid payment methods, only allow applepay and googlepay\n const validInstantPayments: Extract<PaymentMethod, \"googlepay\" | \"applepay\">[] = [\"googlepay\", \"applepay\"];\n const availableInstantPayments = configuration.instantPayments.filter((payment) =>\n validInstantPayments.includes(payment)\n );\n\n // ensure the payment method is actually available from the paymentMethods response\n const finalAvailableInstantPayments = availableInstantPayments.filter((payment) =>\n payment === \"googlepay\" ? hasGooglePay : hasApplePay\n );\n\n const visibleInstantPayments = finalAvailableInstantPayments.filter((payment) => !unavailableMethods.has(payment));\n\n if (finalAvailableInstantPayments.length === 0) {\n return null;\n }\n\n return (\n // The unprefixed instant-payments classes predate the straumur__ convention and may be\n // targeted by host-page styles; keep them alongside the prefixed ones.\n <div\n className={`straumur__instant-payments instant-payments ${\n visibleInstantPayments.length > 1\n ? \"straumur__instant-payments--multiple instant-payments--multiple\"\n : \"straumur__instant-payments--single instant-payments--single\"\n }`}\n style={{ display: visibleInstantPayments.length === 0 ? \"none\" : undefined }}\n >\n {finalAvailableInstantPayments.map((paymentMethod) => {\n if (paymentMethod === \"googlepay\") {\n return (\n <GooglePayButton\n key={paymentMethod}\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={true}\n onUnavailable={() => handleUnavailable(\"googlepay\")}\n />\n );\n }\n if (paymentMethod === \"applepay\") {\n return (\n <ApplePayButton\n key={paymentMethod}\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={true}\n onUnavailable={() => handleUnavailable(\"applepay\")}\n />\n );\n }\n\n // this should never happen due to our filtering above, but typescript safeguard\n return null;\n })}\n </div>\n );\n}\n\nexport default InstantPaymentsComponent;\n","import styleInject from '#style-inject';styleInject(\".instant-payments{display:grid;gap:var(--straumur__space-lg);grid-template-columns:1fr 1fr}.instant-payments--single{grid-template-columns:1fr}@container straumur (max-width: 420px){.instant-payments{grid-template-columns:1fr}}\\n\")","import { PaymentMethodOrder } from \"../models/constants\";\n\n// Default top-to-bottom order, used when no custom order is given and to append any slots the caller\n// omitted from a custom order (so an available method is never silently hidden just by being left out).\nexport const DEFAULT_PAYMENT_METHOD_ORDER: PaymentMethodOrder[] = [\n \"instantpayments\",\n \"storedcard\",\n \"card\",\n \"googlepay\",\n \"applepay\",\n];\n\nconst VALID_TOKENS = new Set<string>(DEFAULT_PAYMENT_METHOD_ORDER);\n\n/**\n * Resolves the render order for the payment-method slots. Unknown tokens are ignored, duplicates are\n * collapsed to their first occurrence, and any valid slot the caller omitted is appended in the\n * default order. A wallet listed in `instantPayments` still renders only inside the \"instantpayments\"\n * slot — its standalone component self-guards to null — so keeping its token here is harmless.\n */\nexport function resolvePaymentMethodOrder(order: readonly string[] | undefined): PaymentMethodOrder[] {\n if (!order) {\n return [...DEFAULT_PAYMENT_METHOD_ORDER];\n }\n\n const seen = new Set<PaymentMethodOrder>();\n const resolved: PaymentMethodOrder[] = [];\n\n for (const token of order) {\n if (VALID_TOKENS.has(token) && !seen.has(token as PaymentMethodOrder)) {\n seen.add(token as PaymentMethodOrder);\n resolved.push(token as PaymentMethodOrder);\n }\n }\n\n for (const token of DEFAULT_PAYMENT_METHOD_ORDER) {\n if (!seen.has(token)) {\n resolved.push(token);\n }\n }\n\n return resolved;\n}\n","import { Language, TranslationKey, translations } from \"./translations\";\n\nexport class I18nService {\n constructor(\n private language: Language,\n private customLocalizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>\n ) {}\n\n t(key: TranslationKey): string {\n const localizedString = this.customLocalizations?.[this.language]?.[key];\n return localizedString || translations[this.language][key] || key;\n }\n\n setLanguage(language: Language): void {\n this.language = language;\n }\n\n updateCustomLocalizations(\n customLocalizations: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>\n ): void {\n this.customLocalizations = customLocalizations;\n }\n}\n","import { h, ComponentChildren } from \"preact\";\nimport SuccessIcon from \"../../assets/icons/success\";\nimport FailureIcon from \"../../assets/icons/failure\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { ResultMessage, Theme } from \"../../models/models\";\nimport { I18nService } from \"../../localizations/i18n-service\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\n\n// The widget's outer wrapper. Carries data-theme so the dark palette is scoped to the\n// widget (never leaks to the host page); \"system\" resolves live via prefers-color-scheme.\nexport function RootComponent({ children, theme = \"light\" }: { children: ComponentChildren; theme?: Theme }) {\n const resolvedTheme = useResolvedTheme(theme);\n return (\n <div className=\"straumur__root-component\" data-theme={resolvedTheme}>\n {children}\n </div>\n );\n}\n\n/** Full-widget loader shown while session mode fetches its payment methods. */\nexport function LoaderScreen({ theme }: { theme?: Theme }) {\n return (\n <RootComponent theme={theme}>\n <div className=\"straumur__component\">\n <LoaderIcon />\n </div>\n </RootComponent>\n );\n}\n\n/** Full-widget success/failure screen rendered imperatively by the StraumurCheckout class. */\nexport function StatusScreen({\n variant,\n message,\n i18n,\n theme,\n}: {\n variant: \"success\" | \"failure\";\n message: ResultMessage;\n i18n: I18nService;\n theme?: Theme;\n}) {\n return (\n <RootComponent theme={theme}>\n <div className=\"straumur__component\">\n <span aria-hidden=\"true\">{variant === \"success\" ? <SuccessIcon /> : <FailureIcon />}</span>\n {/* Failure is announced assertively (role=\"alert\"); success politely (role=\"status\"). */}\n <p className=\"straumur__result-message\" role={variant === \"success\" ? \"status\" : \"alert\"}>\n {\"key\" in message ? i18n.t(message.key) : message.text}\n </p>\n </div>\n </RootComponent>\n );\n}\n","import { Language } from \"../localizations/translations\";\nimport { StraumurWebAdvancedConfiguration } from \"../models/models\";\nimport { SuccessResponse } from \"./models\";\n\n// shapes the advanced-mode configuration into the same response object the session-mode\n// payment-methods call returns, so the component tree consumes both modes identically\nexport function normalizeAdvancedConfiguration(\n configuration: StraumurWebAdvancedConfiguration,\n locale: Language\n): SuccessResponse {\n return {\n resultCode: \"Success\",\n clientKey: configuration.clientKey,\n paymentMethods: configuration.paymentMethods,\n minorUnitsAmount: configuration.amount.value,\n currency: configuration.amount.currency,\n amount: configuration.amount.value / 100,\n formattedAmount: configuration.formattedAmount,\n merchantName: configuration.merchantName,\n enableStoreDetails: configuration.enableStoreDetails,\n locale,\n };\n}\n","import {\n ApplePayButtonTheme,\n GooglePayButtonTheme,\n StraumurCheckoutConfiguration,\n StraumurWebAdvancedConfiguration,\n StraumurWebConfiguration,\n StraumurWebInternalConfiguration,\n Theme,\n ThemeConfiguration,\n} from \"../models/models\";\nimport { createAdvancedPaymentFlow, createSessionPaymentFlow } from \"../flows/payment-flow\";\nimport { normalizeLocale } from \"../localizations/locale\";\nimport { normalizeAdvancedConfiguration } from \"../services/advanced-normalizer\";\nimport { SuccessResponse } from \"../services/models\";\n\n// Session mode has no countryCode input and the payment-methods response carries none,\n// so it is fixed to Iceland until the backend provides one.\nconst SESSION_COUNTRY_CODE = \"IS\";\n\nexport function isSessionConfiguration(config: StraumurWebInternalConfiguration): config is StraumurWebConfiguration {\n return typeof config.sessionId === \"string\" && config.sessionId.length > 0;\n}\n\n// The public `theme` accepts either a bare mode or a ThemeConfiguration object; flatten both into\n// the internal fields, defaulting the mode to \"light\".\nfunction normalizeTheme(theme: Theme | ThemeConfiguration | undefined): {\n theme: Theme;\n googlePayButtonTheme?: GooglePayButtonTheme;\n applePayButtonTheme?: ApplePayButtonTheme;\n} {\n if (typeof theme === \"object\") {\n return {\n theme: theme.theme ?? \"light\",\n googlePayButtonTheme: theme.googlePayButtonTheme,\n applePayButtonTheme: theme.applePayButtonTheme,\n };\n }\n\n return { theme: theme ?? \"light\" };\n}\n\n// the union only protects TypeScript consumers — IIFE consumers get no compile-time checking\nexport function isValidAdvancedConfiguration(config: StraumurWebAdvancedConfiguration): boolean {\n return (\n typeof config.clientKey === \"string\" &&\n config.clientKey.length > 0 &&\n typeof config.countryCode === \"string\" &&\n config.countryCode.length > 0 &&\n typeof config.paymentMethods === \"object\" &&\n config.paymentMethods !== null &&\n typeof config.amount === \"object\" &&\n config.amount !== null &&\n typeof config.amount.value === \"number\" &&\n typeof config.amount.currency === \"string\" &&\n typeof config.onSubmit === \"function\" &&\n typeof config.onAdditionalDetails === \"function\"\n );\n}\n\nexport interface CheckoutInitialization {\n configuration: StraumurCheckoutConfiguration;\n /** The raw advanced configuration when valid; null in session mode or when invalid. */\n advancedConfiguration: StraumurWebAdvancedConfiguration | null;\n /** Advanced mode only: the configuration normalized into a session-style Success response. */\n paymentMethods: SuccessResponse | null;\n initializationFailed: boolean;\n}\n\n/**\n * Maps the public constructor input (session, or the runtime-detected internal advanced\n * configuration) to the internal checkout state. Called exactly once per instance —\n * the returned configuration object's identity drives the components' reinit effects.\n */\nexport function buildCheckoutConfiguration(publicConfig: StraumurWebConfiguration): CheckoutInitialization {\n const config = publicConfig as StraumurWebInternalConfiguration;\n const locale = normalizeLocale(config.locale);\n const isSession = isSessionConfiguration(config);\n const themeConfig = normalizeTheme(config.theme);\n\n const configuration: StraumurCheckoutConfiguration = {\n mode: isSession ? \"session\" : \"advanced\",\n sessionId: config.sessionId,\n environment: config.environment,\n countryCode: isSession ? SESSION_COUNTRY_CODE : config.countryCode,\n paymentFlow: isSession\n ? createSessionPaymentFlow(config.environment, config.sessionId)\n : createAdvancedPaymentFlow(config),\n onPaymentCompleted: config.onPaymentCompleted,\n onPaymentFailed: config.onPaymentFailed,\n placeholders: config.placeholders,\n locale,\n customLocalizations: config.localizations,\n instantPayments: config.instantPayments,\n hideSubmitButton: config.hideSubmitButton,\n onCardValidityChanged: config.onCardValidityChanged,\n allowedPaymentMethods: config.allowedPaymentMethods,\n orderPaymentMethods: config.orderPaymentMethods,\n openDefaultPaymentMethod: config.openDefaultPaymentMethod,\n theme: themeConfig.theme,\n googlePayButtonTheme: themeConfig.googlePayButtonTheme,\n applePayButtonTheme: themeConfig.applePayButtonTheme,\n };\n\n if (isSession) {\n return { configuration, advancedConfiguration: null, paymentMethods: null, initializationFailed: false };\n }\n\n if (!isValidAdvancedConfiguration(config)) {\n return { configuration, advancedConfiguration: null, paymentMethods: null, initializationFailed: true };\n }\n\n return {\n configuration,\n advancedConfiguration: config,\n paymentMethods: normalizeAdvancedConfiguration(config, locale),\n initializationFailed: false,\n };\n}\n"],"mappings":"ubAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,sBAAAE,KAAA,eAAAC,GAAAH,ICAA,IAAAI,EAA0B,kBCCD,SAARC,EAA6BC,EAAK,CAAE,SAAAC,CAAS,EAAI,CAAC,EAAG,CAC1D,GAAI,CAACD,GAAO,OAAO,SAAa,IAAa,OAE7C,IAAME,EAAO,SAAS,MAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC,EAC/DC,EAAQ,SAAS,cAAc,OAAO,EAC5CA,EAAM,KAAO,WAETF,IAAa,OACXC,EAAK,WACPA,EAAK,aAAaC,EAAOD,EAAK,UAAU,EAK1CA,EAAK,YAAYC,CAAK,EAGpBA,EAAM,WACRA,EAAM,WAAW,QAAUH,EAE3BG,EAAM,YAAY,SAAS,eAAeH,CAAG,CAAC,CAElD,CCvB8BI,EAAY;AAAA,CAAm4G,ECAv7G,IAAMC,GAAS,KACN,CACL,iBAAkB,mEAClB,oBAAqB,2DAErB,wBAAyB,kBACzB,iBAAkB,UAClB,iBAAkB,UAClB,uBAAwB,eAC1B,GAaWC,GAAMD,GAAO,ECnB1B,SAASE,GAAWC,EAAsC,CACxD,OAAQA,EAAa,CACnB,IAAK,OACH,OAAOC,GAAI,iBACb,IAAK,OACH,OAAOA,GAAI,oBACb,QACE,MAAM,IAAI,MAAM,wBAAwBD,CAAW,EAAE,CACzD,CACF,CAEO,SAASE,GA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Y,OAAQ,CAAC,CAC9D,CACF,CAEA,aAAaY,EAAgD,CAC3D,GAAM,CAAE,OAAAC,EAAQ,GAAGC,CAAK,EAAIF,EAE5B,KAAK,cAAgB,CACnB,GAAG,KAAK,cACR,GAAGE,EAEH,GAAID,EAAS,CAAE,OAAQE,GAAgBF,CAAM,CAAE,EAAI,CAAC,CACtD,EAGIA,GACF,KAAK,KAAK,YAAY,KAAK,cAAc,MAAM,EAE7CD,EAAU,qBACZ,KAAK,KAAK,0BAA0BA,EAAU,mBAAmB,EAI/D,KAAK,cACP,KAAK,gBAAgB,CAEzB,CAEA,YAAYC,EAA4B,CACtC,KAAK,aAAa,CAChB,OAAQA,CACV,CAAC,CACH,CAEA,SAAgB,CAEV,KAAK,kBACP,UAAO,KAAM,KAAK,YAAY,EAC9B,KAAK,aAAe,MAEtB,KAAK,UAAY,IACnB,CAEA,YAAsB,CACpB,GAAI,CAAC,KAAK,aACR,eAAQ,KAAK,0EAA0E,EAChF,GAGT,GAAI,CAAC,KAAK,UACR,eAAQ,KAAK,4EAA4E,EAClF,GAGT,IAAMG,EAAY,KAAK,UAAU,cAAc,EAE/C,OAAKA,GACH,QAAQ,KACN,6GACF,EAGKA,CACT,CACF,EAEOC,GAAQ1B","names":["index_exports","__export","straumur_checkout_default","__toCommonJS","import_preact","styleInject","css","insertAt","head","style","styleInject","getEnv","env","getBaseUrl","environment","env","getPaymentMethods","body","createPaymentRequest","createDetailsRequest","postDisableTokenRequest","translations","isTranslationKey","value","setupPaymentMethods","environment","sessionId","fetchResponse","getPaymentMethods","contentType","errorMessage","serverErrorMessage","isTranslationKey","normalizeLocale","locale","import_preact","import_preact","import_hooks","styleInject","import_preact","import_hooks","PaymentMethodContext","defaultIsInitialized","PaymentMethodGroupContext","children","initialValue","initialStoredPaymentMethodId","isSolePaymentMethod","hasCard","hasGooglePay","hasApplePay","hasStoredPaymentMethods","onSubmitApiReady","activePaymentMethod","setActivePaymentMethod","activeSubmitHandlerRef","registerSubmitHandler","handler","unregisterSubmitHandler","triggerSubmit","activeStoredPaymentMethodId","setActiveStoredPaymentMethodId","threeDSecureActive","setThreeDSecureActive","isPaymentMethodInitialized","setIsPaymentMethodInitialized","isStoredCardInitialized","setIsStoredCardInitialized","success","setSuccess","error","setError","updatePaymentMethodInitialization","paymentMethod","isInitialized","prevState","updateStoredCardInitialization","storedPaymentMethod","isObscuredByThreeDS","method","handleError","handleSuccess","usePaymentMethodGroup","context","import_preact","import_hooks","I18nContext","I18nProvider","children","i18nService","onLanguageChange","changeLanguage","newLanguage","useI18n","context","import_preact","CardIcon","card_default","import_preact","import_preact","MasterCardIcon","opacity","reversed","mastercard_default","import_preact","VisaIcon","opacity","reversed","visa_default","import_preact","MaestroIcon","opacity","reversed","maestro_default","import_preact","AmexIcon","opacity","amex_default","import_preact","JcbIcon","opacity","jcb_default","import_preact","DinersIcon","opacity","diners_default","import_preact","DiscoverIcon","opacity","reversed","discover_default","import_preact","CupIcon","opacity","cup_default","import_preact","styleInject","import_hooks","Tooltip","children","content","placement","isVisible","setIsVisible","triggerRef","import_hooks","useMediaQuery","query","getMatch","matches","setMatches","mediaQueryList","listener","event","BRAND_DISPLAY_ORDER","brandRank","brand","index","RenderBrandIcons","brands","brandHidden","limit","theme","isWidth380","useMediaQuery","widthLimit","brandToShow","x","a","b","Tooltip","RenderBrandIcon","withChip","icon","isDark","defaultToBrandName","visa_default","mastercard_default","maestro_default","discover_default","amex_default","jcb_default","diners_default","cup_default","import_preact","import_hooks","import_adyen_web","import_preact","InfoIcon","info_default","import_preact","LoaderIcon","loader_default","import_preact","CheckmarkIcon","color","checkmark_default","import_preact","BrandOption","brand","brandName","isSelected","onBrandClick","handleKeyDown","e","RenderBrandIcon","checkmark_default","RenderDualBrandComponent","dualBrandConfiguration","selectedBrand","RESULT_CODES","toResultCode","value","PaymentFlowError","messageKey","messageText","toResultMessage","error","fallbackKey","createSessionPaymentFlow","environment","sessionId","data","body","fetchResponse","createPaymentRequest","response","createDetailsRequest","storedPaymentMethodId","postDisableTokenRequest","createAdvancedPaymentFlow","configuration","invokeHostHandler","invoke","resolve","reject","thrownErrorKey","rejectWithFlowError","flow","res","rej","errorMessage","onDisableToken","runBeforeSubmit","paymentFlow","beforeSubmit","submitCardWithGate","getElement","createBeforeSubmitClickHandler","resolve","reject","result","valid","FAILED_RESULT_CODES","createAdyenPaymentHandlers","options","configuration","handleSuccess","handleError","setThreeDSecureActive","enrichSubmitData","onSubmitStart","dispatchResultFromAdditionalDetails","failureMessage","failureResultMessage","dispatchFinalResult","resultCode","handleOnSubmit","state","_","actions","paymentFlow","runBeforeSubmit","data","action","errorMessage","error","toResultMessage","handleOnSubmitAdditionalData","handlePaymentCompleted","toResultCode","handlePaymentFailed","import_hooks","useAdyenLocaleReinit","configuration","isReady","reinitialize","import_hooks","useFocusOnActivate","ref","active","import_hooks","DARK_QUERY","systemPrefersDark","useResolvedTheme","theme","systemDark","setSystemDark","query","onChange","event","getAdyenFieldStyles","theme","CardForm","configuration","paymentMethods","onBrandHidden","cardElementRef","adyenCheckoutRef","customCardRef","i18n","useI18n","payButtonDisabled","setPayButtonDisabled","securityCodePolicy","setSecurityCodePolicy","storePaymentMethod","setStorePaymentMethod","isDualBrand","setIsDualBrand","dualBrandConfiguration","setDualBrandConfiguration","selectedBrand","setSelectedBrand","storePaymentMethodRef","formErrors","setFormErrors","activePaymentMethod","isPaymentMethodInitialized","updatePaymentMethodInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isObscuredByThreeDS","hasCard","registerSubmitHandler","unregisterSubmitHandler","usePaymentMethodGroup","resolvedTheme","useResolvedTheme","handleSubmitClick","submitCardWithGate","schemeBrands","x","handleOnSubmit","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","data","handleOnError","_","__","initializeAdyenComponent","getAdyenFieldStyles","event","selectedBrands","defaultErrors","useAdyenLocaleReinit","dualBrandListener","e","handleStorePaymentMethodChange","useFocusOnActivate","loader_default","Tooltip","info_default","RenderDualBrandComponent","checkmark_default","card_form_default","import_preact","styleInject","PaymentMethodItem","icon","title","isActive","isSole","onChange","children","headerRight","confirmSection","payment_method_item_default","CardComponent","configuration","paymentMethods","i18n","useI18n","brandHidden","setBrandHidden","resolvedTheme","useResolvedTheme","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasCard","usePaymentMethodGroup","brands","x","payment_method_item_default","card_default","RenderBrandIcons","card_form_default","card_component_default","import_preact","import_hooks","styleInject","import_preact","GooglePayIcon","googlepay_default","styleInject","import_preact","import_preact","import_hooks","import_adyen_web","CANCEL","resolveGooglePayButtonColor","theme","override","resolveApplePayButtonColor","WALLETS","core","configuration","paymentMethods","walletConfig","handleOnSubmit","resolvedTheme","applePayConfiguration","createBeforeSubmitClickHandler","resolveApplePayButtonColor","googlePayConfiguration","resolveGooglePayButtonColor","WalletButton","method","isInstantPayment","onUnavailable","wallet","useResolvedTheme","walletElementRef","adyenCheckoutRef","walletRef","isPaymentMethodInitialized","updatePaymentMethodInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isObscuredByThreeDS","setActivePaymentMethod","activePaymentMethod","usePaymentMethodGroup","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","handleOnError","data","_","CANCEL","markUnavailable","initializeAdyenComponent","x","useAdyenLocaleReinit","loader_default","wallet_button_default","GooglePayButton","props","wallet_button_default","google_pay_button_default","GooglePayComponent","configuration","paymentMethods","i18n","useI18n","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasGooglePay","usePaymentMethodGroup","isUnavailable","setIsUnavailable","x","payment_method_item_default","googlepay_default","google_pay_button_default","google_pay_component_default","import_preact","import_hooks","styleInject","import_preact","ApplePayIcon","applepay_default","styleInject","import_preact","ApplePayButton","props","wallet_button_default","apple_pay_button_default","ApplePayComponent","configuration","paymentMethods","i18n","useI18n","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasApplePay","usePaymentMethodGroup","isUnavailable","setIsUnavailable","x","payment_method_item_default","applepay_default","apple_pay_button_default","apple_pay_component_default","import_preact","import_preact","import_hooks","styleInject","import_adyen_web","import_preact","WarningIcon","warning_default","StoredCardComponent","configuration","paymentMethods","storedPaymentMethod","onStoredCardRemoved","storedCardElementRef","adyenCheckoutRef","customCardRef","i18n","useI18n","payButtonDisabled","setPayButtonDisabled","securityCodePolicy","setSecurityCodePolicy","askConfirmRemoveStoredCard","setAskConfirmRemoveStoredCard","formErrors","setFormErrors","activePaymentMethod","setActivePaymentMethod","activeStoredPaymentMethodId","setActiveStoredPaymentMethodId","isStoredCardInitialized","updateStoredCardInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isSolePaymentMethod","registerSubmitHandler","unregisterSubmitHandler","usePaymentMethodGroup","isActive","resolvedTheme","useResolvedTheme","handleSubmitClick","submitCardWithGate","handleOnSubmit","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","data","handleOnError","_","__","initializeAdyenComponent","getAdyenFieldStyles","event","defaultErrors","x","useAdyenLocaleReinit","useFocusOnActivate","handleBoxChange","handleAskToConfirmRemoveCard","handleCancelRemoveStoredCard","handleConfirmRemoveStoredCard","disableToken","error","toResultMessage","headerRight","confirmSection","warning_default","payment_method_item_default","RenderBrandIcons","loader_default","Tooltip","info_default","stored_card_component_default","import_hooks","StoredCardContainerComponent","configuration","paymentMethods","storedPaymentMethods","setStoredPaymentMethods","isObscuredByThreeDS","hasStoredPaymentMethods","usePaymentMethodGroup","handleStoredCardRemoved","storedPaymentMethodId","prevStoredPaymentMethods","storedPaymentMethod","stored_card_component_default","stored_card_container_component_default","import_preact","styleInject","PaymentMethodGroup","children","initialValue","initialStoredPaymentMethodId","isSolePaymentMethod","hasCard","hasGooglePay","hasApplePay","hasStoredPaymentMethods","onSubmitApiReady","PaymentMethodGroupContext","payment_method_group_default","import_preact","styleInject","import_preact","styleInject","SuccessIcon","success_default","import_preact","FailureIcon","failure_default","ResultComponent","error","success","usePaymentMethodGroup","i18n","useI18n","renderMessage","message","failure_default","success_default","result_component_default","import_preact","PaymentMethodsWrapper","children","error","success","usePaymentMethodGroup","payment_methods_wrapper_default","import_preact","import_hooks","styleInject","InstantPaymentsComponent","configuration","paymentMethods","hasGooglePay","hasApplePay","usePaymentMethodGroup","unavailableMethods","setUnavailableMethods","handleUnavailable","method","prev","validInstantPayments","finalAvailableInstantPayments","payment","visibleInstantPayments","paymentMethod","google_pay_button_default","apple_pay_button_default","instant_payments_component_default","DEFAULT_PAYMENT_METHOD_ORDER","VALID_TOKENS","resolvePaymentMethodOrder","order","seen","resolved","token","determineInitialState","hasCard","hasGooglePay","hasApplePay","storedCount","instantPayments","openDefaultPaymentMethod","gpayInStandard","x","apayInStandard","StraumurCheckoutContainer","configuration","paymentMethods","onSubmitApiReady","methods","stored","isAllowed","method","hasStoredPaymentMethods","initialPaymentMethod","isSolePaymentMethod","initialStoredPaymentMethodId","componentsBySlot","instant_payments_component_default","stored_card_container_component_default","card_component_default","google_pay_component_default","apple_pay_component_default","order","resolvePaymentMethodOrder","payment_method_group_default","payment_methods_wrapper_default","slot","result_component_default","straumur_checkout_container_default","import_adyen_web","I18nService","language","customLocalizations","key","translations","import_preact","RootComponent","children","theme","resolvedTheme","useResolvedTheme","LoaderScreen","loader_default","StatusScreen","variant","message","i18n","success_default","failure_default","normalizeAdvancedConfiguration","configuration","locale","SESSION_COUNTRY_CODE","isSessionConfiguration","config","normalizeTheme","theme","isValidAdvancedConfiguration","buildCheckoutConfiguration","publicConfig","locale","normalizeLocale","isSession","themeConfig","configuration","createSessionPaymentFlow","createAdvancedPaymentFlow","normalizeAdvancedConfiguration","StraumurCheckout","publicConfig","initialization","buildCheckoutConfiguration","I18nService","selector","LoaderScreen","response","setupPaymentMethods","error","RootComponent","I18nProvider","language","straumur_checkout_container_default","api","message","StatusScreen","redirectResult","redirectContext","handleOnSubmitAdditionalData","createAdyenPaymentHandlers","newConfig","locale","rest","normalizeLocale","triggered","straumur_checkout_default"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/straumur-checkout.tsx","#style-inject:#style-inject","../src/styles/main.css","../src/env.ts","../src/adapter/straumur-adapter.ts","../src/localizations/translations.ts","../src/services/straumur-service.ts","../src/localizations/locale.ts","../src/features/straumur-checkout-container.tsx","../src/features/card/card-component.tsx","../src/features/card/card-component.css","../src/components/payment-method-group/payment-method-group-context.tsx","../src/localizations/i18n-context.tsx","../src/assets/icons/card.tsx","../src/utils/renderBrandIcons.tsx","../src/assets/icons/mastercard.tsx","../src/assets/icons/visa.tsx","../src/assets/icons/maestro.tsx","../src/assets/icons/amex.tsx","../src/assets/icons/jcb.tsx","../src/assets/icons/diners.tsx","../src/assets/icons/discover.tsx","../src/assets/icons/cup.tsx","../src/components/tooltip/tooltip.tsx","../src/components/tooltip/tooltip.css","../src/utils/custom-hooks/use-media-query.ts","../src/components/card-form/card-form.tsx","../src/assets/icons/info.tsx","../src/assets/icons/loader.tsx","../src/assets/icons/checkmark.tsx","../src/components/render-dual-brand/render-dual-brand.tsx","../src/models/models.ts","../src/flows/payment-flow.ts","../src/components/shared/before-submit-click.ts","../src/components/shared/create-adyen-handlers.ts","../src/utils/custom-hooks/use-adyen-locale-reinit.ts","../src/utils/custom-hooks/use-focus-on-activate.ts","../src/utils/custom-hooks/use-resolved-theme.ts","../src/utils/adyen-field-styles.ts","../src/components/payment-method-item/payment-method-item.tsx","../src/components/payment-method-item/payment-method-item.css","../src/features/google-pay/google-pay-component.tsx","../src/features/google-pay/google-pay-component.css","../src/assets/icons/googlepay.tsx","../src/components/google-pay-button/google-pay-button.css","../src/components/google-pay-button/google-pay-button.tsx","../src/components/shared/wallet-button.tsx","../src/models/constants.ts","../src/utils/wallet-button-theme.ts","../src/features/apple-pay/apple-pay-component.tsx","../src/features/apple-pay/apple-pay-component.css","../src/assets/icons/applepay.tsx","../src/components/apple-pay-button/apple-pay-button.css","../src/components/apple-pay-button/apple-pay-button.tsx","../src/features/stored-card/stored-card-container-component.tsx","../src/features/stored-card/stored-card-component.tsx","../src/features/stored-card/stored-card-component.css","../src/assets/icons/warning.tsx","../src/components/payment-method-group/payment-method-group.tsx","../src/components/payment-method-group/payment-method-group.css","../src/features/result-component/result-component.tsx","../src/features/result-component/result-component.css","../src/assets/icons/success.tsx","../src/assets/icons/result-icons.css","../src/assets/icons/failure.tsx","../src/features/payment-methods-wrapper/payment-methods-wrapper.tsx","../src/features/instantPayments/instant-payments-component.tsx","../src/features/instantPayments/instant-payments-component.css","../src/utils/payment-method-order.ts","../src/localizations/i18n-service.ts","../src/components/shared/status-screen.tsx","../src/services/advanced-normalizer.ts","../src/config/build-checkout-configuration.ts"],"sourcesContent":["export { default as StraumurCheckout } from \"./straumur-checkout\";\nexport type {\n StraumurWebConfiguration,\n PaymentCompletedData,\n PaymentFailedData,\n ResultCode,\n Placeholders,\n Theme,\n ThemeConfiguration,\n GooglePayButtonTheme,\n ApplePayButtonTheme,\n} from \"./models/models\";\nexport type { PaymentMethod, PaymentMethodOrder, OpenDefaultPaymentMethod } from \"./models/constants\";\n","import { h, render } from \"preact\";\nimport \"./styles/main.css\";\nimport {\n ResultMessage,\n StraumurCheckoutConfiguration,\n StraumurCheckoutUpdateOptions,\n StraumurWebAdvancedConfiguration,\n StraumurWebConfiguration,\n} from \"./models/models\";\nimport { setupPaymentMethods } from \"./services/straumur-service\";\nimport { normalizeLocale, PublicLocale } from \"./localizations/locale\";\nimport StraumurCheckoutContainer from \"./features/straumur-checkout-container\";\nimport { PaymentMethodsResponse, SuccessResponse } from \"./services/models\";\nimport { AdyenCheckout } from \"@adyen/adyen-web\";\nimport { I18nProvider } from \"./localizations/i18n-context\";\nimport { I18nService } from \"./localizations/i18n-service\";\nimport { SubmitApi } from \"./components/payment-method-group/payment-method-group-context\";\nimport { createAdyenPaymentHandlers } from \"./components/shared/create-adyen-handlers\";\nimport { LoaderScreen, RootComponent, StatusScreen } from \"./components/shared/status-screen\";\nimport { buildCheckoutConfiguration } from \"./config/build-checkout-configuration\";\n\nclass StraumurCheckout {\n private configuration: StraumurCheckoutConfiguration;\n private advancedConfiguration: StraumurWebAdvancedConfiguration | null = null;\n private paymentMethods: SuccessResponse | null = null;\n private mountElement: HTMLElement | null = null;\n private i18n: I18nService;\n private submitApi: SubmitApi | null = null;\n private initializationFailed = false;\n\n // Public signature accepts the session configuration only. The advanced-mode configuration\n // (internal, used by Straumur Hosted Checkout via the IIFE bundle) is detected at runtime.\n constructor(publicConfig: StraumurWebConfiguration) {\n const initialization = buildCheckoutConfiguration(publicConfig);\n\n this.configuration = initialization.configuration;\n this.advancedConfiguration = initialization.advancedConfiguration;\n this.paymentMethods = initialization.paymentMethods;\n this.initializationFailed = initialization.initializationFailed;\n this.i18n = new I18nService(this.configuration.locale, this.configuration.customLocalizations);\n }\n\n async mount(selector: HTMLElement | string): Promise<void> {\n try {\n this.mountElement = typeof selector === \"string\" ? document.querySelector(selector) : selector;\n\n if (!this.mountElement) {\n return;\n }\n\n if (this.initializationFailed) {\n this.handleError({ key: \"error.failedToInitializeStraumurWebComponent\" });\n return;\n }\n\n if (this.configuration.mode === \"advanced\") {\n this.renderComponent();\n return;\n }\n\n render(<LoaderScreen theme={this.configuration.theme} />, this.mountElement);\n\n const response = await setupPaymentMethods(this.configuration.environment, this.configuration.sessionId!);\n\n if (response.resultCode === \"Error\") {\n this.handleError({ key: response.error });\n return;\n }\n\n this.paymentMethods = response;\n\n this.renderComponent();\n } catch (error) {\n // Never throw into the host page, but leave a trace for the merchant's console.\n console.error(\"[StraumurCheckout] mount() failed:\", error);\n }\n }\n\n private renderComponent(): void {\n if (!this.mountElement) return;\n\n render(\n <RootComponent theme={this.configuration.theme}>\n <I18nProvider\n i18nService={this.i18n}\n onLanguageChange={(language) => {\n this.configuration.locale = language;\n this.renderComponent();\n }}\n >\n <StraumurCheckoutContainer\n configuration={this.configuration}\n paymentMethods={this.paymentMethods!}\n onSubmitApiReady={(api) => {\n this.submitApi = api;\n }}\n />\n </I18nProvider>\n </RootComponent>,\n this.mountElement\n );\n }\n\n handleSuccess(message: ResultMessage) {\n if (!this.mountElement) return;\n\n render(\n <StatusScreen variant=\"success\" message={message} i18n={this.i18n} theme={this.configuration.theme} />,\n this.mountElement\n );\n }\n\n handleError(message: ResultMessage) {\n if (!this.mountElement) return;\n\n render(\n <StatusScreen variant=\"failure\" message={message} i18n={this.i18n} theme={this.configuration.theme} />,\n this.mountElement\n );\n }\n\n // Resolves what the redirect-return Adyen bootstrap needs per mode, rendering the\n // failure screen and returning null when the context cannot be established.\n private async resolveRedirectContext(): Promise<{\n clientKey: string;\n paymentMethods: PaymentMethodsResponse;\n } | null> {\n if (this.configuration.mode === \"advanced\") {\n if (this.initializationFailed || !this.advancedConfiguration) {\n this.handleError({ key: \"error.failedToInitializeStraumurWebComponent\" });\n return null;\n }\n\n return {\n clientKey: this.advancedConfiguration.clientKey,\n paymentMethods: this.advancedConfiguration.paymentMethods,\n };\n }\n\n const response = await setupPaymentMethods(this.configuration.environment, this.configuration.sessionId!);\n\n if (response.resultCode === \"Error\") {\n this.handleError({ key: response.error });\n return null;\n }\n\n return { clientKey: response.clientKey, paymentMethods: response.paymentMethods };\n }\n\n // selector lets a page that never called mount() (e.g. a 3DS redirect return) show the result screens\n async submitDetails(redirectResult: string, selector?: HTMLElement | string) {\n try {\n if (selector) {\n this.mountElement = typeof selector === \"string\" ? document.querySelector(selector) : selector;\n }\n\n const redirectContext = await this.resolveRedirectContext();\n\n if (!redirectContext) {\n return;\n }\n\n const { handleOnSubmitAdditionalData } = createAdyenPaymentHandlers({\n configuration: this.configuration,\n handleSuccess: (message) => this.handleSuccess(message),\n handleError: (message) => this.handleError(message),\n setThreeDSecureActive: () => {},\n dispatchResultFromAdditionalDetails: true,\n });\n\n // Deliberately no core-level onPaymentCompleted/onPaymentFailed here: the handler above\n // dispatches the final result itself, and wiring both would double-fire the merchant callbacks.\n const checkout = await AdyenCheckout({\n environment: this.configuration.environment,\n clientKey: redirectContext.clientKey,\n paymentMethodsResponse: redirectContext.paymentMethods,\n countryCode: this.configuration.countryCode,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n });\n\n checkout.submitDetails({\n details: {\n redirectResult,\n },\n });\n } catch (error) {\n // Same no-throw philosophy as mount(): render the failure in-place, log for the console.\n console.error(\"[StraumurCheckout] submitDetails() failed:\", error);\n this.handleError({ key: \"error.failedToSubmitPaymentDetails\" });\n this.configuration.onPaymentFailed?.({ resultCode: \"Error\" });\n }\n }\n\n updateConfig(newConfig: StraumurCheckoutUpdateOptions): void {\n const { locale, ...rest } = newConfig;\n\n this.configuration = {\n ...this.configuration,\n ...rest,\n // The public vocabulary is short codes; normalizeLocale also tolerates legacy full tags at runtime.\n ...(locale ? { locale: normalizeLocale(locale) } : {}),\n };\n\n // Update i18n if locale or customLocalizations changed\n if (locale) {\n this.i18n.setLanguage(this.configuration.locale);\n }\n if (newConfig.customLocalizations) {\n this.i18n.updateCustomLocalizations(newConfig.customLocalizations);\n }\n\n // Re-render the component with new config\n if (this.mountElement) {\n this.renderComponent();\n }\n }\n\n setLanguage(locale: PublicLocale): void {\n this.updateConfig({\n locale: locale,\n });\n }\n\n destroy(): void {\n // Clean up resources\n if (this.mountElement) {\n render(null, this.mountElement);\n this.mountElement = null;\n }\n this.submitApi = null;\n }\n\n submitCard(): boolean {\n if (!this.mountElement) {\n console.warn(\"[StraumurCheckout] submitCard() called before the component was mounted.\");\n return false;\n }\n\n if (!this.submitApi) {\n console.warn(\"[StraumurCheckout] submitCard() called but the component is not ready yet.\");\n return false;\n }\n\n const triggered = this.submitApi.triggerSubmit();\n\n if (!triggered) {\n console.warn(\n \"[StraumurCheckout] submitCard() called but no card-type payment method is currently active and initialized.\"\n );\n }\n\n return triggered;\n }\n}\n\nexport default StraumurCheckout;\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\":root{--straumur__color-primary: #002649;--straumur__color-secondary: #72889d;--straumur__color-secondary-gamma: #eef0f2;--straumur__color-blue-beta: #bce6f3;--straumur__color-blue-gamma: #eff8fa;--straumur__color-neon-green-zeta: #88a64e;--straumur__color-red-beta: #d96666;--straumur__color-red-gamma: #fff8f5;--straumur__color-gray-epsilon: #e7e7e7;--straumur__color-cosmos-blue-delta: #cdd8e2;--straumur__color-cosmos-blue-gamma: #e6ebef;--straumur__color-white: #ffffff;--straumur__color-transparent: transparent;--straumur__color-brand-chip: #ffffff;--straumur__color-text: #00112c;--straumur__color-border: #dbdee2;--straumur__color-warning-text: #775d00;--straumur__color-warning-bg: #fff7db;--straumur__color-danger-text: #d03e00;--straumur__color-success: #1f9d57;--straumur__border-radius-xxs: 4px;--straumur__border-radius-xs: 6px;--straumur__border-radius-s: 8px;--straumur__border-radius-md: 10px;--straumur__border-radius-lg: 12px;--straumur__border-radius-xlg: 14px;--straumur__border-radius-xxlg: 16px;--straumur__space-xxs: 4px;--straumur__space-xs: 6px;--straumur__space-s: 8px;--straumur__space-md: 10px;--straumur__space-lg: 12px;--straumur__space-xlg: 14px;--straumur__space-xxlg: 16px;--straumur__space-3xlg: 18px;--straumur__space-4xlg: 20px;--straumur__space-5xlg: 24px;--straumur__space-6xlg: 32px;--straumur__space-7xlg: 40px;--straumur__space-8xlg: 48px;--apple-pay-button-width: 100%;--apple-pay-button-height: 48px;--apple-pay-button-border-radius: var(--straumur__border-radius-lg)}.straumur__root-component{font-family:AkzidenzGroteskPro,sans-serif;color:var(--straumur__color-text);min-width:320px;container:straumur / inline-size}.straumur__root-component[data-theme=dark]{--straumur__color-primary: #e8edf2;--straumur__color-secondary: #9aa7b5;--straumur__color-secondary-gamma: #2a313b;--straumur__color-blue-beta: #24506b;--straumur__color-blue-gamma: #1b2733;--straumur__color-neon-green-zeta: #9cbf5e;--straumur__color-red-beta: #e08a8a;--straumur__color-red-gamma: #2e2020;--straumur__color-gray-epsilon: #3a424d;--straumur__color-cosmos-blue-delta: #3a424d;--straumur__color-cosmos-blue-gamma: #262d36;--straumur__color-white: #0d0f13;--straumur__color-text: #e8edf2;--straumur__color-border: #3a424d;--straumur__color-warning-text: #e6c766;--straumur__color-warning-bg: #2f2a17;--straumur__color-danger-text: #f0895f;--straumur__color-success: #3fd98a}.straumur__component *{font-family:inherit}.straumur__render-brand-icons__overflow{color:var(--straumur__color-secondary)}.straumur__brand-chip{display:inline-flex;background:var(--straumur__color-brand-chip);border:1px solid var(--straumur__color-border);border-radius:var(--straumur__border-radius-xxs);overflow:hidden}.straumur__component{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--straumur__space-5xlg);padding:var(--straumur__space-6xlg);width:100%;min-height:300px;background-color:var(--straumur__color-white);border-radius:var(--straumur__border-radius-xxlg)}.straumur__result-message{max-width:320px;margin:0;padding:0 var(--straumur__space-4xlg);text-align:center;font-size:16px;line-height:24px;color:var(--straumur__color-text)}.js-iframe{border:none;color-scheme:auto;height:100%;overflow:hidden;width:100%}.adyen-checkout__threeds2__challenge.adyen-checkout__threeds2__challenge--05{background-color:transparent;display:block;height:inherit;min-height:400px;overflow:hidden;position:relative;width:100%}\\n\")","const getEnv = (): Env => {\n return {\n STAGING_BASE_URL: \"https://checkout-api.staging.straumur.is/api/v1/embeddedcheckout\",\n PRODUCTION_BASE_URL: \"https://greidslugatt.straumur.is/api/v1/embeddedcheckout\",\n\n GET_PAYMENT_METHODS_URL: \"payment-methods\",\n POST_PAYMENT_URL: \"payment\",\n POST_DETAILS_URL: \"details\",\n POST_DISABLE_TOKEN_URL: \"disable-token\",\n };\n};\n\ninterface Env {\n STAGING_BASE_URL: string;\n PRODUCTION_BASE_URL: string;\n\n GET_PAYMENT_METHODS_URL: string;\n POST_PAYMENT_URL: string;\n POST_DETAILS_URL: string;\n POST_DISABLE_TOKEN_URL: string;\n}\n\nexport const env = getEnv();\n","import { ICreateDetailsBody, ICreatePaymentBody, IGetPaymentMethodsBody, IPostDisableTokenBody } from \"./models\";\nimport { env } from \"../env\";\n\nfunction getBaseUrl(environment: \"test\" | \"live\"): string {\n switch (environment) {\n case \"test\":\n return env.STAGING_BASE_URL;\n case \"live\":\n return env.PRODUCTION_BASE_URL;\n default:\n throw new Error(`Unknown environment: ${environment}`);\n }\n}\n\nexport function getPaymentMethods(environment: \"test\" | \"live\", body: IGetPaymentMethodsBody) {\n return fetch(`${getBaseUrl(environment)}/${env.GET_PAYMENT_METHODS_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function createPaymentRequest(environment: \"test\" | \"live\", body: ICreatePaymentBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_PAYMENT_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function createDetailsRequest(environment: \"test\" | \"live\", body: ICreateDetailsBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_DETAILS_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function postDisableTokenRequest(environment: \"test\" | \"live\", body: IPostDisableTokenBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_DISABLE_TOKEN_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n","export const translations = {\n \"en-US\": {\n \"cards.title\": \"Card payment\",\n \"cards.cardNumber\": \"Card number\",\n \"cards.expiryDate\": \"Expiry date\",\n \"cards.securityCode3Digits\": \"Security code\",\n \"cards.securityCode3DigitsOptional\": \"Security code (optional)\",\n \"cards.securityCode3DigitsInfo\": \"3-digit on the back of the card\",\n \"cards.securityCode4DigitsInfo\": \"4-digit on the back of the card\",\n \"cards.storePaymentMethod\": \"Store payment information\",\n \"cards.saveCardDetails\": \"Save card details\",\n \"googlePay.title\": \"Google Pay\",\n \"applePay.title\": \"Apple Pay\",\n \"stored-cards.expiryDate\": \"Expiry date\",\n \"stored-cards.securityCode3Digits\": \"Security code\",\n \"stored-cards.securityCode3DigitsOptional\": \"Security code (optional)\",\n \"stored-cards.securityCode3DigitsInfo\": \"3-digit on the back of the card\",\n \"stored-cards.securityCode4DigitsInfo\": \"4-digit on the back of the card\",\n \"stored-cards.removeStoredCard\": \"Remove\",\n \"stored-cards.removeStoredCardQuestion\": \"Remove stored payment method?\",\n \"stored-cards.removeStoredCardQuestionYesRemove\": \"Yes, remove\",\n \"stored-cards.removeStoredCardQuestionCancel\": \"Cancel\",\n \"stored-cards.saveCardDetails\": \"Save card details\",\n\n \"success.paymentAuthorized\": \"Payment authorized\",\n\n \"error.unknownError\": \"Unknown error occurred\",\n \"error.failedToInitializeStraumurWebComponent\": \"Failed to initialize Straumur Web component\",\n \"error.failedToInitializePaymentMethods\": \"Failed to initialize payment methods\",\n \"error.failedToSubmitPayment\": \"Failed to submit payment\",\n \"error.paymentFailed\": \"Payment failed\",\n \"error.paymentUnsuccessful\": \"Payment unsuccessful\",\n \"error.failedToSubmitPaymentDetails\": \"Failed to submit payment details\",\n \"error.paymentDetailsFailed\": \"Payment details failed\",\n \"error.googlePayNotAvailable\": \"Google Pay not available\",\n \"error.applePayNotAvailable\": \"Apple Pay not available\",\n \"error.failedToSubmitRemoveStoredPaymentCard\": \"Failed to remove stored payment card\",\n \"error.failedToRemoveStoredPaymentCard\": \"Stored payment card was not removed\",\n },\n \"is-IS\": {\n \"cards.title\": \"Greiða með korti\",\n \"cards.cardNumber\": \"Kortanúmer\",\n \"cards.expiryDate\": \"Gildisdagur\",\n \"cards.securityCode3Digits\": \"Öryggiskóði\",\n \"cards.securityCode3DigitsOptional\": \"Öryggiskóði (valkvætt)\",\n \"cards.securityCode3DigitsInfo\": \"3 tölustafir aftan á kortinu\",\n \"cards.securityCode4DigitsInfo\": \"4 tölustafir aftan á kortinu\",\n \"cards.storePaymentMethod\": \"Vista greiðsluupplýsingar\",\n \"cards.saveCardDetails\": \"Vista kortaupplýsingar\",\n \"googlePay.title\": \"Google Pay\",\n \"applePay.title\": \"Apple Pay\",\n \"stored-cards.expiryDate\": \"Gildisdagur\",\n \"stored-cards.securityCode3Digits\": \"Öryggiskóði\",\n \"stored-cards.securityCode3DigitsOptional\": \"Öryggiskóði (valkvætt)\",\n \"stored-cards.securityCode3DigitsInfo\": \"3 tölustafir aftan á kortinu\",\n \"stored-cards.securityCode4DigitsInfo\": \"4 tölustafir aftan á kortinu\",\n \"stored-cards.removeStoredCard\": \"Fjarlægja\",\n \"stored-cards.removeStoredCardQuestion\": \"Fjarlægja geymdan greiðslumáta?\",\n \"stored-cards.removeStoredCardQuestionYesRemove\": \"Já, fjarlægja\",\n \"stored-cards.removeStoredCardQuestionCancel\": \"Hætta við\",\n \"stored-cards.saveCardDetails\": \"Vista kortaupplýsingar\",\n\n \"success.paymentAuthorized\": \"Greiðsla samþykkt\",\n\n \"error.unknownError\": \"Óþekkt villa kom upp\",\n \"error.failedToInitializeStraumurWebComponent\": \"Mistókst að sækja Straumur Web hluta\",\n \"error.failedToInitializePaymentMethods\": \"Mistókst að sækja greiðslumáta\",\n \"error.failedToSubmitPayment\": \"Mistókst að senda greiðslu\",\n \"error.paymentFailed\": \"Greiðsla mistókst\",\n \"error.paymentUnsuccessful\": \"Greiðsla ekki tekin\",\n \"error.failedToSubmitPaymentDetails\": \"Mistókst að senda greiðsluupplýsingar\",\n \"error.paymentDetailsFailed\": \"Mistókst að sækja greiðsluupplýsingar\",\n \"error.googlePayNotAvailable\": \"Google Pay ekki í boði\",\n \"error.applePayNotAvailable\": \"Apple Pay ekki í boði\",\n \"error.failedToSubmitRemoveStoredPaymentCard\": \"Mistókst að fjarlægja geymdan greiðslumáta\",\n \"error.failedToRemoveStoredPaymentCard\": \"Geymdur greiðslumáti var ekki fjarlægður\",\n },\n};\n\nexport type Language = keyof typeof translations;\nexport type TranslationKey = keyof (typeof translations)[\"en-US\"] | keyof (typeof translations)[\"is-IS\"];\n\n/** Narrows an untrusted string (e.g. a server error code) to a known translation key. */\nexport function isTranslationKey(value: unknown): value is TranslationKey {\n return typeof value === \"string\" && (value in translations[\"en-US\"] || value in translations[\"is-IS\"]);\n}\n","import { getPaymentMethods } from \"../adapter/straumur-adapter\";\nimport { isTranslationKey, TranslationKey } from \"../localizations/translations\";\nimport { StraumurCheckoutPaymentMethods, StraumurCheckoutPaymentMethodsResponse } from \"./models\";\n\nexport async function setupPaymentMethods(\n environment: \"test\" | \"live\",\n sessionId: string\n): Promise<StraumurCheckoutPaymentMethodsResponse> {\n try {\n const fetchResponse = await getPaymentMethods(environment, {\n sessionId,\n });\n\n if (!fetchResponse.ok) {\n const contentType = fetchResponse.headers.get(\"content-type\");\n let errorMessage: TranslationKey = \"error.failedToInitializePaymentMethods\";\n if (contentType && contentType.includes(\"application/json\")) {\n // The server's errorMessage is untrusted input: only adopt it when it is a known\n // translation key, otherwise the raw string would be shown to the buyer verbatim.\n const serverErrorMessage: unknown = (await fetchResponse.json()).errorMessage;\n if (isTranslationKey(serverErrorMessage)) {\n errorMessage = serverErrorMessage;\n }\n }\n\n return {\n resultCode: \"Error\",\n error: errorMessage,\n };\n }\n\n const data: StraumurCheckoutPaymentMethods = await fetchResponse.json();\n\n return {\n resultCode: \"Success\",\n ...data,\n };\n } catch {\n return {\n resultCode: \"Error\",\n error: \"error.failedToInitializePaymentMethods\",\n };\n }\n}\n","import { Language } from \"./translations\";\n\n/** The locale vocabulary of the public API: short codes only. */\nexport type PublicLocale = \"is\" | \"en\";\n\n/**\n * Normalizes a public locale to the internal BCP-47 Language.\n *\n * Tolerates the legacy full tags (\"en-US\"/\"is-IS\") at runtime — 1.x accepted them in\n * setLanguage/updateConfig and IIFE consumers get no compile-time checking — while the\n * public types narrow to short codes. Anything unrecognized falls back to Icelandic,\n * matching the constructor's historical default.\n */\nexport function normalizeLocale(locale: PublicLocale | Language | undefined): Language {\n switch (locale) {\n case \"en\":\n case \"en-US\":\n return \"en-US\";\n default:\n return \"is-IS\";\n }\n}\n","import { h } from \"preact\";\nimport { StraumurCheckoutConfiguration } from \"../models/models\";\nimport { SuccessResponse } from \"../services/models\";\nimport CardComponent from \"./card/card-component\";\nimport GooglePayComponent from \"./google-pay/google-pay-component\";\nimport ApplePayComponent from \"./apple-pay/apple-pay-component\";\nimport StoredCardContainerComponent from \"./stored-card/stored-card-container-component\";\nimport PaymentMethodGroup from \"../components/payment-method-group/payment-method-group\";\nimport ResultComponent from \"./result-component/result-component\";\nimport PaymentMethodsWrapper from \"./payment-methods-wrapper/payment-methods-wrapper\";\nimport InstantPaymentsComponent from \"./instantPayments/instant-payments-component\";\nimport { OpenDefaultPaymentMethod, PaymentMethod, PaymentMethodOrder } from \"../models/constants\";\nimport { resolvePaymentMethodOrder } from \"../utils/payment-method-order\";\nimport { SubmitApi } from \"../components/payment-method-group/payment-method-group-context\";\n\ninterface StraumurCheckoutContainerProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}\n\nexport function determineInitialState(\n hasCard: boolean,\n hasGooglePay: boolean,\n hasApplePay: boolean,\n storedCount: number,\n instantPayments: StraumurCheckoutConfiguration[\"instantPayments\"],\n openDefaultPaymentMethod?: OpenDefaultPaymentMethod\n): { initialPaymentMethod: PaymentMethod | null; isSolePaymentMethod: boolean } {\n const gpayInStandard = hasGooglePay && !instantPayments?.some((x) => x === \"googlepay\");\n const apayInStandard = hasApplePay && !instantPayments?.some((x) => x === \"applepay\");\n\n const totalOptions = storedCount + (hasCard ? 1 : 0) + (gpayInStandard ? 1 : 0) + (apayInStandard ? 1 : 0);\n\n // Exactly one option: auto-select it and hide the chooser (sole mode).\n if (totalOptions === 1) {\n if (storedCount === 1) return { initialPaymentMethod: \"storedcard\", isSolePaymentMethod: true };\n if (hasCard) return { initialPaymentMethod: \"card\", isSolePaymentMethod: true };\n if (gpayInStandard) return { initialPaymentMethod: \"googlepay\", isSolePaymentMethod: true };\n if (apayInStandard) return { initialPaymentMethod: \"applepay\", isSolePaymentMethod: true };\n return { initialPaymentMethod: null, isSolePaymentMethod: false };\n }\n\n // More than one (or zero) options: pre-open the requested method only if it's available. If it\n // isn't (a wallet moved to instantPayments, or no saved cards), leave the chooser collapsed — the\n // same as when no option is given. Never fall back to opening a different method.\n if (openDefaultPaymentMethod === \"card\" && hasCard)\n return { initialPaymentMethod: \"card\", isSolePaymentMethod: false };\n if (openDefaultPaymentMethod === \"googlepay\" && gpayInStandard)\n return { initialPaymentMethod: \"googlepay\", isSolePaymentMethod: false };\n if (openDefaultPaymentMethod === \"applepay\" && apayInStandard)\n return { initialPaymentMethod: \"applepay\", isSolePaymentMethod: false };\n if (openDefaultPaymentMethod === \"firstStoredCard\" && storedCount > 0)\n return { initialPaymentMethod: \"storedcard\", isSolePaymentMethod: false };\n\n return { initialPaymentMethod: null, isSolePaymentMethod: false };\n}\n\nfunction StraumurCheckoutContainer({\n configuration,\n paymentMethods,\n onSubmitApiReady,\n}: StraumurCheckoutContainerProps): h.JSX.Element {\n const methods = paymentMethods.paymentMethods.paymentMethods ?? [];\n const stored = paymentMethods.paymentMethods.storedPaymentMethods ?? [];\n\n const isAllowed = (method: PaymentMethod): boolean =>\n !configuration.allowedPaymentMethods || configuration.allowedPaymentMethods.includes(method);\n\n const hasCard = methods.some((x) => x.type === \"scheme\") && isAllowed(\"card\");\n const hasGooglePay = methods.some((x) => x.type === \"googlepay\") && isAllowed(\"googlepay\");\n const hasApplePay = methods.some((x) => x.type === \"applepay\") && isAllowed(\"applepay\");\n const storedCount = isAllowed(\"storedcard\") ? stored.length : 0;\n const hasStoredPaymentMethods = storedCount > 0;\n\n const { initialPaymentMethod, isSolePaymentMethod } = determineInitialState(\n hasCard,\n hasGooglePay,\n hasApplePay,\n storedCount,\n configuration.instantPayments,\n configuration.openDefaultPaymentMethod\n );\n\n // Opening \"firstStoredCard\" resolves to the storedcard method above; seed the specific card id\n // (the first saved card) so exactly that stored-card row opens. Sole mode needs no id — the lone\n // stored card matches on the method alone.\n const initialStoredPaymentMethodId =\n initialPaymentMethod === \"storedcard\" && !isSolePaymentMethod ? (stored[0]?.id ?? null) : null;\n\n // Each component self-guards on availability and instant-vs-standalone; the order only controls\n // which slot renders where. A wallet in instantPayments returns null from its standalone slot.\n const componentsBySlot: Record<PaymentMethodOrder, h.JSX.Element> = {\n instantpayments: (\n <InstantPaymentsComponent key=\"instantpayments\" configuration={configuration} paymentMethods={paymentMethods} />\n ),\n storedcard: (\n <StoredCardContainerComponent key=\"storedcard\" configuration={configuration} paymentMethods={paymentMethods} />\n ),\n card: <CardComponent key=\"card\" configuration={configuration} paymentMethods={paymentMethods} />,\n googlepay: <GooglePayComponent key=\"googlepay\" configuration={configuration} paymentMethods={paymentMethods} />,\n applepay: <ApplePayComponent key=\"applepay\" configuration={configuration} paymentMethods={paymentMethods} />,\n };\n\n const order = resolvePaymentMethodOrder(configuration.orderPaymentMethods);\n\n return (\n <PaymentMethodGroup\n initialValue={initialPaymentMethod}\n initialStoredPaymentMethodId={initialStoredPaymentMethodId}\n isSolePaymentMethod={isSolePaymentMethod}\n hasCard={hasCard}\n hasGooglePay={hasGooglePay}\n hasApplePay={hasApplePay}\n hasStoredPaymentMethods={hasStoredPaymentMethods}\n onSubmitApiReady={onSubmitApiReady}\n >\n <PaymentMethodsWrapper>{order.map((slot) => componentsBySlot[slot])}</PaymentMethodsWrapper>\n\n <ResultComponent />\n </PaymentMethodGroup>\n );\n}\n\nexport default StraumurCheckoutContainer;\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./card-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport CardIcon from \"../../assets/icons/card\";\nimport { BrandHidden, RenderBrandIcons } from \"../../utils/renderBrandIcons\";\nimport { CardComponentProps } from \"./models\";\nimport CardForm from \"../../components/card-form/card-form\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\n\nfunction CardComponent({ configuration, paymentMethods }: CardComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const [brandHidden, setBrandHidden] = useState<BrandHidden[]>([]);\n const resolvedTheme = useResolvedTheme(configuration.theme);\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasCard } =\n usePaymentMethodGroup();\n\n if (!hasCard || isObscuredByThreeDS(\"card\")) {\n return null;\n }\n\n const schemeBrands = paymentMethods.paymentMethods.paymentMethods!.find((x) => x.type === \"scheme\")!.brands!;\n\n const brands = schemeBrands.map((x) => {\n return { brand: x, brandFullName: x };\n });\n\n return (\n <PaymentMethodItem\n icon={<CardIcon />}\n title={i18n.t(\"cards.title\")}\n isActive={activePaymentMethod === \"card\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"card\")}\n headerRight={\n <span className=\"straumur__card-component--brands\">\n <RenderBrandIcons brands={brands} brandHidden={brandHidden} theme={resolvedTheme} />\n </span>\n }\n >\n <CardForm configuration={configuration} paymentMethods={paymentMethods} onBrandHidden={setBrandHidden} />\n </PaymentMethodItem>\n );\n}\n\nexport default CardComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__card-component--brands{display:flex;margin-left:auto;align-items:center;gap:var(--straumur__space-xxs)}.straumur__card-component__expandable{background:var(--straumur__color-white)}.straumur__card-component__loading-text{display:flex;justify-content:center}.straumur__card-component__form{display:flex;padding-top:var(--straumur__space-xxlg);flex-direction:column;gap:var(--straumur__space-5xlg)}.straumur__card-component__form--wrapper{display:flex;flex-direction:column;justify-items:start;position:relative;width:100%}.straumur__card-component__form--wrapper--error{color:var(--straumur__color-red-beta);font-size:12px}.straumur__card-component__form--wrapper--label{transform:translate(var(--straumur__space-md)) translateY(-50%);z-index:1;background:linear-gradient(to top,var(--straumur__color-secondary-gamma) 53%,var(--straumur__color-transparent) 50%);position:absolute;font-weight:500;font-size:14px;padding:0 var(--straumur__space-xxs)}.straumur__card-component__form--wrapper--label--error{color:var(--straumur__color-red-beta);background:linear-gradient(to top,var(--straumur__color-red-gamma) 53%,var(--straumur__color-transparent) 50%)}.straumur__card-component__form--wrapper--label--info{position:absolute;top:33%;right:var(--straumur__space-md)}.straumur__card-component__form--wrapper--input{background:var(--straumur__color-secondary-gamma);color:var(--straumur__color-text);display:block;font-family:inherit;border:1px solid var(--straumur__color-transparent);border-radius:var(--straumur__border-radius-s);font-size:16px;height:48px;outline:none;padding-left:var(--straumur__space-lg);transition:border .2s ease-out,box-shadow .2s ease-out}.straumur__card-component__form--wrapper--input:hover{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__card-component__form--wrapper--input--error{background:var(--straumur__color-red-gamma);border:1px solid var(--straumur__color-red-beta)}.straumur__card-component__form--wrapper--input--error:hover{border:1px solid var(--straumur__color-red-beta)}.straumur__card-component__form--field-wrapper{display:flex;width:100%;gap:var(--straumur__space-lg)}.straumur__card-component__submit-button{background:var(--straumur__color-primary);border:none;border-radius:var(--straumur__border-radius-s);color:var(--straumur__color-white);cursor:pointer;font-size:16px;height:40px;outline:none;padding:0 var(--straumur__space-xxlg);transition:background .2s ease-out;width:100%}.straumur__card-component__submit-button:hover{background:var(--straumur__color-primary);border:1px solid var(--straumur__color-border)}.straumur__card-component__submit-button:disabled{background:var(--straumur__color-gray-epsilon);color:var(--straumur__color-secondary);border:1px solid var(--straumur__color-border);cursor:not-allowed}.straumur__card-component__form--wrapper--label-checkbox{height:38px;display:flex;align-items:center;padding:8px;gap:var(--straumur__space-s);border-radius:var(--straumur__border-radius-s);cursor:pointer;user-select:none;transition:background-color .25s ease-in-out}.straumur__card-component__form--wrapper--label-checkbox:hover{background-color:var(--straumur__color-blue-gamma)}.straumur__card-component__form--wrapper--label-checkbox:hover .straumur__card-component__form--wrapper--label-checkbox--checkmark{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__card-component__form--wrapper--label-checkbox--checkmark{height:var(--straumur__space-5xlg);width:var(--straumur__space-5xlg);background-color:var(--straumur__color-secondary-gamma);border-radius:var(--straumur__border-radius-xxs);flex-shrink:0;border:1px solid var(--straumur__color-transparent);transition:all .2s ease-in}.straumur__card-component__form--wrapper--label-checkbox:hover .straumur__card-component__form--wrapper--label-checkbox--checkmark.straumur__card-component__form--wrapper--label-checkbox--checkmark--checked{border:1px solid var(--straumur__color-transparent)}.straumur__card-component__form--wrapper--label-checkbox--checkmark--checked{background-color:var(--straumur__color-blue-beta)}.straumur__card-component__form--wrapper--label-checkbox--checkmark--icon{height:100%;display:flex;justify-content:center;align-items:center;font-size:9px;opacity:0;visibility:hidden;transition:all .2s ease-in}.straumur__card-component__form--wrapper--label-checkbox--checkmark--icon--checked{opacity:1;visibility:visible}.straumur__card-component__form--wrapper--label-checkbox--checkbox{display:none}.js-iframe{border:none;color-scheme:auto;height:100%;overflow:hidden;width:100%}.straumur__card-component__dual-branding{display:grid;grid-template-columns:1fr 1fr;gap:var(--straumur__space-lg)}.straumur__card-component__dual-branding--logo{display:flex;align-items:center;padding:var(--straumur__space-xs);border:1px solid var(--straumur__color-secondary-gamma);border-radius:var(--straumur__border-radius-s)}.straumur__card-component__dual-branding--logo--item{display:flex;pointer-events:none}.straumur__card-component__dual-branding--logo--selected{border:1px solid var(--straumur__color-cosmos-blue-delta);justify-content:space-between}\\n\")","import { h } from \"preact\";\nimport { createContext, ComponentChildren } from \"preact\";\nimport { useState, useContext, useCallback, useRef, useLayoutEffect } from \"preact/hooks\";\nimport { PaymentMethod } from \"../../models/constants\";\nimport { ResultMessage } from \"../../models/models\";\n\n/** A submit trigger registered by the active card-type component. May be async — see SubmitApi. */\nexport type SubmitHandler = () => void | Promise<void>;\n\nexport type SubmitApi = {\n /**\n * Invokes the active card form's submit handler. The boolean only says a handler existed\n * and was invoked — the submission itself runs asynchronously and reports its outcome\n * through onPaymentCompleted/onPaymentFailed.\n */\n triggerSubmit: () => boolean;\n};\n\ntype PaymentMethodContextType = {\n activePaymentMethod: PaymentMethod | null;\n setActivePaymentMethod: (value: PaymentMethod | null) => void;\n activeStoredPaymentMethodId: string | null;\n setActiveStoredPaymentMethodId: (value: string) => void;\n isPaymentMethodInitialized: Record<PaymentMethod, boolean>;\n updatePaymentMethodInitialization: (paymentMethod: PaymentMethod, isInitialized: boolean) => void;\n isStoredCardInitialized: Record<string, boolean>;\n updateStoredCardInitialization: (storedPaymentMethod: string, isInitialized: boolean) => void;\n handleSuccess: (success: ResultMessage) => void;\n success: ResultMessage | null;\n handleError: (error: ResultMessage) => void;\n error: ResultMessage | null;\n threeDSecureActive: boolean;\n setThreeDSecureActive: (value: boolean) => void;\n /**\n * True while a 3DS challenge run by ANOTHER payment method takes over the widget —\n * the asking component must render nothing. Components matching a specific stored card\n * additionally check their own card id (see stored-card-component).\n */\n isObscuredByThreeDS: (method: PaymentMethod) => boolean;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n registerSubmitHandler: (handler: SubmitHandler) => void;\n unregisterSubmitHandler: (handler: SubmitHandler) => void;\n};\n\nconst PaymentMethodContext = createContext<PaymentMethodContextType | undefined>(undefined);\n\nconst defaultIsInitialized: Record<PaymentMethod, boolean> = {\n card: false,\n storedcard: false,\n googlepay: false,\n applepay: false,\n};\n\nexport const PaymentMethodGroupContext = ({\n children,\n initialValue,\n initialStoredPaymentMethodId = null,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n onSubmitApiReady,\n}: {\n children: ComponentChildren;\n initialValue: PaymentMethod | null;\n initialStoredPaymentMethodId?: string | null;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}): h.JSX.Element => {\n const [activePaymentMethod, setActivePaymentMethod] = useState(initialValue);\n const activeSubmitHandlerRef = useRef<SubmitHandler | null>(null);\n\n const registerSubmitHandler = useCallback((handler: SubmitHandler): void => {\n activeSubmitHandlerRef.current = handler;\n }, []);\n\n const unregisterSubmitHandler = useCallback((handler: SubmitHandler): void => {\n // Identity check guards against effect-cleanup ordering races when switching\n // between card-type payment methods: an outgoing form's cleanup must not\n // clobber a handler an incoming form already registered.\n if (activeSubmitHandlerRef.current === handler) {\n activeSubmitHandlerRef.current = null;\n }\n }, []);\n\n const triggerSubmit = useCallback((): boolean => {\n const handler = activeSubmitHandlerRef.current;\n\n if (!handler) {\n return false;\n }\n\n handler();\n return true;\n }, []);\n\n useLayoutEffect(() => {\n onSubmitApiReady?.({ triggerSubmit });\n }, []);\n const [activeStoredPaymentMethodId, setActiveStoredPaymentMethodId] = useState<string | null>(\n initialStoredPaymentMethodId\n );\n const [threeDSecureActive, setThreeDSecureActive] = useState<boolean>(false);\n const [isPaymentMethodInitialized, setIsPaymentMethodInitialized] = useState(defaultIsInitialized);\n const [isStoredCardInitialized, setIsStoredCardInitialized] = useState<Record<string, boolean>>({});\n\n const [success, setSuccess] = useState<ResultMessage | null>(null);\n const [error, setError] = useState<ResultMessage | null>(null);\n\n const updatePaymentMethodInitialization = (paymentMethod: PaymentMethod, isInitialized: boolean) => {\n setIsPaymentMethodInitialized((prevState) => ({\n ...prevState,\n [paymentMethod]: isInitialized,\n }));\n };\n\n const updateStoredCardInitialization = (storedPaymentMethod: string, isInitialized: boolean) => {\n setIsStoredCardInitialized((prevState) => ({\n ...prevState,\n [storedPaymentMethod]: isInitialized,\n }));\n };\n\n const isObscuredByThreeDS = useCallback(\n (method: PaymentMethod): boolean => threeDSecureActive && activePaymentMethod !== method,\n [threeDSecureActive, activePaymentMethod]\n );\n\n const handleError = (error: ResultMessage) => {\n setError(error);\n };\n\n const handleSuccess = (success: ResultMessage) => {\n setSuccess(success);\n };\n\n return (\n <PaymentMethodContext.Provider\n value={{\n activePaymentMethod,\n setActivePaymentMethod,\n activeStoredPaymentMethodId,\n setActiveStoredPaymentMethodId,\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n isStoredCardInitialized,\n updateStoredCardInitialization,\n handleSuccess,\n success,\n handleError,\n error,\n threeDSecureActive,\n setThreeDSecureActive,\n isObscuredByThreeDS,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n registerSubmitHandler,\n unregisterSubmitHandler,\n }}\n >\n {children}\n </PaymentMethodContext.Provider>\n );\n};\n\nexport const usePaymentMethodGroup = (): PaymentMethodContextType => {\n const context = useContext(PaymentMethodContext);\n if (context === undefined) {\n throw new Error(\"usePaymentMethodGroup must be used within a PaymentMethodGroup\");\n }\n return context as PaymentMethodContextType;\n};\n","import { h } from \"preact\";\nimport { createContext, ComponentChildren } from \"preact\";\nimport { useContext } from \"preact/hooks\";\nimport { Language } from \"./translations\";\nimport { I18nService } from \"./i18n-service\";\n\ntype I18nContextType = {\n i18n: I18nService;\n changeLanguage: (language: Language) => void;\n};\n\nconst I18nContext = createContext<I18nContextType | undefined>(undefined);\n\nexport const I18nProvider = ({\n children,\n i18nService,\n onLanguageChange,\n}: {\n children: ComponentChildren;\n i18nService: I18nService; // Use existing instance from StraumurCheckout\n onLanguageChange?: (language: Language) => void;\n}): h.JSX.Element => {\n const changeLanguage = (newLanguage: Language) => {\n i18nService.setLanguage(newLanguage);\n onLanguageChange?.(newLanguage);\n };\n\n return <I18nContext.Provider value={{ i18n: i18nService, changeLanguage }}>{children}</I18nContext.Provider>;\n};\n\nexport const useI18n = (): I18nContextType => {\n const context = useContext(I18nContext);\n if (!context) {\n throw new Error(\"useI18n must be used within an I18nProvider\");\n }\n return context;\n};\n","import { h } from \"preact\";\n\nconst CardIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M24 11H0V7H24V11Z\" fill=\"currentColor\" />\n <path\n opacity=\"0.4\"\n d=\"M21.3333 3C22.8042 3 24 4.19375 24 5.66667V7H0V5.66667C0 4.19375 1.19375 3 2.66667 3H21.3333ZM24 19C24 20.4708 22.8042 21.6667 21.3333 21.6667H2.66667C1.19375 21.6667 0 20.4708 0 19V11H24V19ZM4.66667 16.3333C4.3 16.3333 4 16.6333 4 17C4 17.3667 4.3 17.6667 4.66667 17.6667H7.33333C7.7 17.6667 8 17.3667 8 17C8 16.6333 7.7 16.3333 7.33333 16.3333H4.66667ZM10 17.6667H15.3333C15.7 17.6667 16 17.3667 16 17C16 16.6333 15.7 16.3333 15.3333 16.3333H10C9.63333 16.3333 9.33333 16.6333 9.33333 17C9.33333 17.3667 9.63333 17.6667 10 17.6667Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default CardIcon;\n","import { Fragment, h } from \"preact\";\nimport MasterCardIcon from \"../assets/icons/mastercard\";\nimport VisaIcon from \"../assets/icons/visa\";\nimport MaestroIcon from \"../assets/icons/maestro\";\nimport AmexIcon from \"../assets/icons/amex\";\nimport JcbIcon from \"../assets/icons/jcb\";\nimport DinersIcon from \"../assets/icons/diners\";\nimport DiscoverIcon from \"../assets/icons/discover\";\nimport CupIcon from \"../assets/icons/cup\";\nimport { Tooltip } from \"../components/tooltip/tooltip\";\nimport { useMediaQuery } from \"./custom-hooks/use-media-query\";\nimport { ResolvedTheme } from \"../models/models\";\n\ninterface BrandIcon {\n brand: string;\n brandFullName: string;\n}\n\nexport interface BrandHidden {\n brand: string;\n}\n\ninterface RenderBrandIconsProps {\n brands: BrandIcon[];\n brandHidden?: BrandHidden[];\n limit?: number;\n /** Resolved widget theme. On \"dark\" the brand marks switch to their reversed/chipped variants. */\n theme?: ResolvedTheme;\n}\n\n// Preferred display order for the most common card brands; anything not listed is appended after\n// these, keeping the order the backend sent them in (Array.prototype.sort is stable).\nconst BRAND_DISPLAY_ORDER = [\"visa\", \"mc\", \"maestro\", \"amex\", \"jcb\", \"cup\"];\n\nconst brandRank = (brand: string): number => {\n const index = BRAND_DISPLAY_ORDER.indexOf(brand);\n\n return index === -1 ? BRAND_DISPLAY_ORDER.length : index;\n};\n\nexport function RenderBrandIcons({\n brands,\n brandHidden = [],\n limit = 4,\n theme = \"light\",\n}: RenderBrandIconsProps): h.JSX.Element {\n const isWidth380 = useMediaQuery(\"(max-width: 380px)\");\n const isWidth335 = useMediaQuery(\"(max-width: 335px)\");\n const widthLimit = isWidth335 ? 1 : isWidth380 ? 2 : limit;\n\n const brandToShow = brands\n .filter((brand) => !brandHidden.some((x) => x.brand === brand.brand))\n .sort((a, b) => brandRank(a.brand) - brandRank(b.brand));\n\n return (\n <Fragment>\n {brandToShow.map(({ brand }, index) => {\n if (index >= Math.min(limit, widthLimit)) {\n if (index === Math.min(limit, widthLimit)) {\n return (\n <Tooltip\n content={\n <span style={{ display: \"flex\", gap: \"4px\", overflow: \"visible\" }}>\n {brandToShow.slice(Math.min(limit, widthLimit)).map(({ brand }) => (\n <RenderBrandIcon key={brand} brand={brand} theme={theme} />\n ))}\n </span>\n }\n >\n <span key={brand} className=\"straumur__render-brand-icons__overflow\">\n +{brandToShow.length - Math.min(limit, widthLimit)}\n </span>\n </Tooltip>\n );\n }\n return null;\n }\n\n return <RenderBrandIcon key={brand} brand={brand} theme={theme} />;\n })}\n </Fragment>\n );\n}\n\n// Networks that publish a reversed mark: on dark we render them without the white box (in white ink\n// where needed). The rest keep their multicolor logo on a light \"chip\" so they stay brand-compliant.\nconst withChip = (icon: h.JSX.Element, isDark: boolean): h.JSX.Element =>\n isDark ? <span className=\"straumur__brand-chip\">{icon}</span> : icon;\n\nexport const RenderBrandIcon = ({\n brand,\n theme = \"light\",\n defaultToBrandName = true,\n}: {\n brand: string;\n theme?: ResolvedTheme;\n defaultToBrandName?: boolean;\n}): h.JSX.Element => {\n const isDark = theme === \"dark\";\n\n switch (brand) {\n case \"visa\":\n return <VisaIcon reversed={isDark} />;\n case \"mc\":\n return <MasterCardIcon reversed={isDark} />;\n case \"maestro\":\n return <MaestroIcon reversed={isDark} />;\n case \"discover\":\n return <DiscoverIcon reversed={isDark} />;\n case \"amex\":\n // Already a white logo on the Amex-blue box — reads fine on either theme.\n return <AmexIcon />;\n case \"jcb\":\n return withChip(<JcbIcon />, isDark);\n case \"diners\":\n return withChip(<DinersIcon />, isDark);\n case \"cup\":\n return withChip(<CupIcon />, isDark);\n default:\n if (defaultToBrandName) {\n return <span>{brand}</span>;\n }\n return <Fragment></Fragment>;\n }\n};\n","import { h } from \"preact\";\n\ninterface MasterCardIconProps {\n opacity?: number;\n /** Dark-theme reversed mark: drop the white background; the interlocking circles work on dark. */\n reversed?: boolean;\n}\n\nconst MasterCardIcon = ({ opacity = 1, reversed = false }: MasterCardIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" viewBox=\"0 0 40 26\" opacity={opacity}>\n {!reversed && <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />}\n <path fill=\"#F06022\" d=\"M16.13 19.29h7.74V6.7h-7.74v12.58z\" />\n <path\n fill=\"#EA1D25\"\n d=\"M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13\"\n />\n <path\n fill=\"#F79D1D\"\n d=\"M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13\"\n />\n </svg>\n);\n\nexport default MasterCardIcon;\n","import { h } from \"preact\";\n\ninterface VisaIconProps {\n opacity?: number;\n /** Dark-theme reversed mark: drop the white background and render the wordmark in white. */\n reversed?: boolean;\n}\n\nconst VisaIcon = ({ opacity = 1, reversed = false }: VisaIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n {!reversed && <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />}\n <path\n fill={reversed ? \"#fff\" : \"#1434CB\"}\n d=\"m15.9 7.7-4.43 10.6h-2.9l-2.2-8.47c-.13-.52-.25-.71-.65-.93C5.05 8.55 3.96 8.2 3 8l.07-.32h4.67c.6 0 1.13.4 1.27 1.09l1.15 6.14 2.86-7.23h2.89Zm11.39 7.15c0-2.8-3.88-2.96-3.85-4.21 0-.38.37-.79 1.16-.9a5.2 5.2 0 0 1 2.71.48l.48-2.25a7.4 7.4 0 0 0-2.57-.47c-2.71 0-4.62 1.44-4.64 3.51-.02 1.53 1.36 2.38 2.4 2.9 1.08.51 1.44.85 1.43 1.31 0 .71-.85 1.03-1.64 1.04-1.39.02-2.19-.37-2.82-.67l-.5 2.33c.64.29 1.82.55 3.05.56 2.89 0 4.78-1.42 4.79-3.63Zm7.17 3.46H37L34.78 7.7h-2.34c-.53 0-.98.3-1.17.78l-4.12 9.84h2.88l.57-1.58h3.53l.33 1.58Zm-3.07-3.76 1.45-3.99.83 4H31.4ZM19.83 7.7l-2.27 10.62h-2.74L17.09 7.7h2.74Z\"\n />\n </svg>\n);\n\nexport default VisaIcon;\n","import { h } from \"preact\";\n\ninterface MaestroIconProps {\n opacity?: number;\n /** Dark-theme reversed mark: drop the white background; the interlocking circles work on dark. */\n reversed?: boolean;\n}\n\nconst MaestroIcon = ({ opacity = 1, reversed = false }: MaestroIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n {!reversed && <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />}\n <path fill=\"#7773B4\" d=\"M16.13 19.29h7.74V6.7h-7.74v12.58z\" />\n <path\n fill=\"#EA1D25\"\n d=\"M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13\"\n />\n <path\n fill=\"#139FDA\"\n d=\"M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13\"\n />\n </svg>\n);\n\nexport default MaestroIcon;\n","import { h } from \"preact\";\n\ninterface AmexIconProps {\n opacity?: number;\n}\n\nconst AmexIcon = ({ opacity = 1 }: AmexIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"30\" height=\"19.5\" opacity={opacity}>\n <path fill=\"#016FD0\" d=\"M0 26h40V0H0v26z\" />\n <path\n fill=\"#fff\"\n fill-rule=\"evenodd\"\n d=\"M30.69 13.63v1.64h-4.17v1.14h4.07v1.64h-4.07v1.12h4.17v1.66l3.38-3.6-3.38-3.6zm-1.1-6.14-1.4-3.19h-4l-4.1 9.32h3.33v8.27l10.28.01 1.61-1.8 1.63 1.8H40v-2.63l-1.92-2.06L40 15.16v-2.59l-1.93.01V7.6l-1.81 4.98H34.5l-1.86-5v5h-4.2l-.6-1.46h-3.3l-.6 1.46h-2.22l3.23-7.27V5.3h2.55l3.19 7.21V5.3l3.1.01 1.6 4.47 1.62-4.48H40v-1h-3.77l-.85 2.39-.85-2.39h-4.94v3.19zm-5.06 6.11v7.27h6.16v-.01h2.54l2.1-2.32 2.12 2.32H40v-.1l-3.34-3.53L40 13.65v-.05h-2.52l-2.1 2.3-2.08-2.3h-8.77zm.7-4.11.96-2.31.97 2.31h-1.93z\"\n />\n </svg>\n);\n\nexport default AmexIcon;\n","import { h } from \"preact\";\n\ninterface JcbIconProps {\n opacity?: number;\n}\n\nconst JcbIcon = ({ opacity = 1 }: JcbIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <g clip-path=\"url(#a)\">\n <path fill=\"#fff\" d=\"M0 0h40v26H0V0Z\" />\n <path fill=\"#fff\" d=\"M36.6 20.66a5.22 5.22 0 0 1-5.22 5.22H3V5.22A5.22 5.22 0 0 1 8.22 0H36.6v20.66Z\" />\n <path\n fill=\"url(#b)\"\n d=\"M27.36 15.36h2.15l.27-.02a.96.96 0 0 0 .76-.96 1 1 0 0 0-.76-.97c-.06-.02-.19-.02-.27-.02h-2.15v1.97Z\"\n />\n <path\n fill=\"url(#c)\"\n d=\"M29.27 1.75a3.74 3.74 0 0 0-3.74 3.73v3.89h5.28c.12 0 .26 0 .37.02 1.19.06 2.07.67 2.07 1.74 0 .84-.6 1.56-1.7 1.7v.05c1.2.08 2.13.76 2.13 1.8 0 1.13-1.03 1.87-2.38 1.87h-5.8v7.6H31a3.74 3.74 0 0 0 3.73-3.74V1.75h-5.46Z\"\n />\n <path\n fill=\"url(#d)\"\n d=\"M30.27 11.38c0-.5-.35-.82-.76-.89l-.2-.02h-1.95v1.81h1.95c.06 0 .18 0 .2-.02a.87.87 0 0 0 .76-.88Z\"\n />\n <path\n fill=\"url(#e)\"\n d=\"M8.6 1.75a3.74 3.74 0 0 0-3.73 3.73v9.22a7.4 7.4 0 0 0 3.22.85c1.3 0 2-.78 2-1.85V9.34h3.2v4.34c0 1.68-1.05 3.06-4.6 3.06-2.16 0-3.84-.47-3.84-.47v7.86h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75H8.6Z\"\n />\n <path\n fill=\"url(#f)\"\n d=\"M18.94 1.75a3.74 3.74 0 0 0-3.74 3.73v4.9c.94-.8 2.59-1.32 5.24-1.2 1.41.06 2.93.45 2.93.45v1.58a7.1 7.1 0 0 0-2.83-.82c-2.01-.14-3.23.84-3.23 2.57 0 1.74 1.22 2.73 3.23 2.57a7.46 7.46 0 0 0 2.83-.82v1.58s-1.5.39-2.93.45c-2.65.12-4.3-.4-5.24-1.2v8.63h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75h-5.48Z\"\n />\n </g>\n <defs>\n <linearGradient id=\"b\" x1=\"25.52\" x2=\"34.75\" y1=\"14.38\" y2=\"14.38\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"c\" x1=\"25.52\" x2=\"34.75\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"d\" x1=\"25.52\" x2=\"34.75\" y1=\"11.37\" y2=\"11.37\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"e\" x1=\"4.86\" x2=\"14.24\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#1F286F\" />\n <stop offset=\".48\" stop-color=\"#004E94\" />\n <stop offset=\".83\" stop-color=\"#0066B1\" />\n <stop offset=\"1\" stop-color=\"#006FBC\" />\n </linearGradient>\n <linearGradient id=\"f\" x1=\"15.15\" x2=\"24.25\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#6C2C2F\" />\n <stop offset=\".17\" stop-color=\"#882730\" />\n <stop offset=\".57\" stop-color=\"#BE1833\" />\n <stop offset=\".86\" stop-color=\"#DC0436\" />\n <stop offset=\"1\" stop-color=\"#E60039\" />\n </linearGradient>\n <clipPath id=\"a\">\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default JcbIcon;\n","import { h } from \"preact\";\n\ninterface DinersIconProps {\n opacity?: number;\n}\n\nconst DinersIcon = ({ opacity = 1 }: DinersIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"30\" height=\"19.5\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <g fill=\"#1a1918\">\n <path d=\"M5.96 15.58c0-.56-.3-.52-.58-.53v-.16H7.2a2.28 2.28 0 0 1 2.5 2.2c0 .61-.36 2.17-2.57 2.17H5.38v-.16c.38-.04.56-.05.58-.48zm.61 2.94c0 .49.35.54.65.54a1.75 1.75 0 0 0 1.8-1.95 1.88 1.88 0 0 0-1.96-2.02c-.26 0-.37.02-.49.02zm3.36.58h.12c.17 0 .3 0 .3-.2v-1.7c0-.28-.1-.32-.33-.44v-.1l.67-.23a.22.22 0 0 1 .11-.03c.03 0 .05.04.05.09v2.4c0 .21.13.21.3.21h.11v.16H9.93zm.67-3.67a.3.3 0 0 1 0-.61.3.3 0 0 1 .3.3.31.31 0 0 1-.3.31zm1.26 1.8c0-.23-.07-.3-.36-.41v-.12a8.44 8.44 0 0 0 .82-.3c.02 0 .04.01.04.06v.4a1.83 1.83 0 0 1 1.08-.46c.53 0 .72.39.72.88v1.61c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.11c.18 0 .3 0 .3-.2v-1.63c0-.36-.22-.53-.57-.53a1.66 1.66 0 0 0-.73.3v1.85c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.1c.18 0 .3 0 .3-.2v-1.67m3.21.3a1.55 1.55 0 0 0 0 .37 1.05 1.05 0 0 0 .92 1.08 1.2 1.2 0 0 0 .85-.42l.08.09a1.47 1.47 0 0 1-1.15.7 1.26 1.26 0 0 1-1.2-1.36c0-1.23.83-1.6 1.27-1.6a1 1 0 0 1 1.05 1 .74.74 0 0 1 0 .1l-.06.04zm1.11-.2c.16 0 .18-.08.18-.16a.53.53 0 0 0-.55-.57c-.38 0-.64.28-.72.73zm.86 1.77h.17c.17 0 .3 0 .3-.2v-1.77c0-.2-.23-.23-.33-.28v-.1c.46-.19.7-.35.77-.35.03 0 .05.02.05.08v.56H18c.16-.24.42-.64.8-.64a.34.34 0 0 1 .36.33.3.3 0 0 1-.3.32c-.19 0-.19-.15-.4-.15a.53.53 0 0 0-.46.52v1.47c0 .21.12.21.3.21h.35v.16h-.88a26 26 0 0 0-.74 0zm2.41-.7a.83.83 0 0 0 .78.76.44.44 0 0 0 .51-.45c0-.74-1.36-.5-1.36-1.5a.86.86 0 0 1 .97-.81 1.64 1.64 0 0 1 .71.18l.04.64h-.14a.64.64 0 0 0-.68-.62.44.44 0 0 0-.49.41c0 .74 1.45.51 1.45 1.5 0 .4-.33.85-1.07.85a1.64 1.64 0 0 1-.77-.22l-.07-.72.12-.03m7.44-2.37h-.15A1.2 1.2 0 0 0 25.39 15a1.79 1.79 0 0 0-1.77 2 2.04 2.04 0 0 0 1.87 2.17 1.27 1.27 0 0 0 1.25-1.09l.15.04-.15.91a3.5 3.5 0 0 1-1.38.34A2.23 2.23 0 0 1 22.97 17a2.3 2.3 0 0 1 2.37-2.2 4.5 4.5 0 0 1 1.48.33l.06.9m.22 3.07h.13c.17 0 .3 0 .3-.2v-3.5c0-.4-.1-.42-.34-.49v-.1a3.96 3.96 0 0 0 .65-.27.66.66 0 0 1 .14-.07c.03 0 .05.04.05.1v4.32c0 .21.13.21.3.21h.12v.16H27.1zm4.02-.18c0 .11.07.12.18.12h.25v.12a6.33 6.33 0 0 0-.9.2l-.03-.02v-.5a1.69 1.69 0 0 1-1.11.52.68.68 0 0 1-.69-.75v-1.6c0-.17-.02-.32-.37-.35v-.12l.8-.05c.07 0 .07.05.07.18v1.62c0 .19 0 .73.55.73a1.4 1.4 0 0 0 .75-.38v-1.7c0-.12-.3-.18-.52-.25v-.11c.56-.04.91-.09.97-.09.05 0 .05.05.05.11zm1.25-2.07a1.58 1.58 0 0 1 .93-.45 1.22 1.22 0 0 1 1.16 1.31 1.58 1.58 0 0 1-1.5 1.65 1.84 1.84 0 0 1-.86-.22l-.19.14-.13-.07a7.37 7.37 0 0 0 .09-1.11v-2.7c0-.4-.1-.42-.33-.49v-.1a3.93 3.93 0 0 0 .64-.27.67.67 0 0 1 .14-.07c.04 0 .05.04.05.1zm0 1.7a.67.67 0 0 0 .64.64c.67 0 .95-.65.95-1.21a1.2 1.2 0 0 0-1-1.24.96.96 0 0 0-.6.3v1.51zM5.38 22.91h.04c.13 0 .26-.02.26-.2v-1.78c0-.18-.13-.2-.26-.2h-.04v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L5.88 23l-.5.01z\" />\n <path d=\"M6.42 23.03 5.88 23l-.5.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.07v.13h-.06c-.13 0-.24.01-.24.18v1.79c0 .16.11.17.24.17h.06v.14zM6.4 23v-.08h-.03c-.12 0-.27-.02-.27-.2v-1.8c0-.18.15-.2.27-.2h.03v-.07h-1v.07h.03c.13 0 .27.02.27.2v1.8c0 .18-.14.2-.27.2H5.4V23l.49-.02.52.02zm2.35-.66h.01v-1.29a.28.28 0 0 0-.3-.32H8.4v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L7.07 21.1v1.41c0 .3.06.4.32.4h.06v.1L7 23l-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01 1.51 1.71\" />\n <path d=\"M8.95 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01L7 23l-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.19-.3-.29-.3h-.09v-.13h.94v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.27 2.27 0 0 0 .02.34v.02zm-.13-.03h.11a2.3 2.3 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07H8.4v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07H7.4c-.27 0-.34-.12-.34-.42v-1.44l1.77 1.98zm-.07-.71.01-.01v.01zm0 0v-.01zM9.8 20.8c-.26 0-.27.06-.32.31h-.1l.04-.29a2.04 2.04 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .18-.1h.09l-.04.28v.28l-.11.04c0-.13-.02-.33-.25-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1l-.56-.01-.57.01v-.1h.06c.19 0 .28-.02.28-.29V20.8z\" />\n <path d=\"m11.14 23.03-.56-.02-.57.02h-.02v-.14h.08c.19 0 .26 0 .27-.27v-1.8H9.8v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03a3.96 3.96 0 0 1 .04-.53h-.05c-.02.1-.11.1-.2.1H9.71c-.08 0-.17 0-.2-.1h-.06a2.04 2.04 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.3a1.93 1.93 0 0 0 .02-.28v-.01h.11c.03.1.09.1.18.1h1.77c.1 0 .16 0 .17-.1v-.01h.02l.1.02-.01.01-.04.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.55v1.8c0 .25.11.27.27.27h.08v.14zm.71-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.85.01.87-.01.01.52-.1.03c-.02-.22-.06-.4-.42-.4h-.47v.9h.4c.2 0 .25-.12.27-.3h.1v.78l-.1.02c-.02-.2-.03-.33-.26-.33h-.4v.79c0 .22.19.22.4.22.41 0 .6-.03.7-.41l.1.02a7.7 7.7 0 0 0-.12.54l-.92-.01-.9.01v-.1\" />\n <path d=\"m13.68 23.03-.92-.02-.9.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.75v.01a4.18 4.18 0 0 0 0 .52v.01l-.13.04v-.02c-.02-.22-.05-.38-.4-.38h-.46v.86h.4c.2 0 .23-.1.25-.29v-.01h.13v.01a8.08 8.08 0 0 0 0 .8h-.01l-.12.03v-.02c-.02-.2-.03-.32-.25-.32h-.4v.78c0 .2.18.2.4.2.42 0 .58-.02.68-.4v-.01h.02l.1.03v.01a7.8 7.8 0 0 0-.11.54v.02zm-.02-.03.11-.52-.06-.02c-.1.39-.3.42-.7.42-.22 0-.43 0-.44-.24v-.8H13c.24-.01.26.13.28.33l.07-.02a7.25 7.25 0 0 1 0-.76h-.07c-.02.18-.08.3-.29.3h-.42v-.92h.5c.35 0 .4.18.42.4l.07-.03a5.76 5.76 0 0 1 0-.5l-.86.02-.83-.01v.07h.03c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.89-.02zm.59-2c0-.26-.14-.27-.24-.27h-.06v-.1l.53.01.54-.01c.43 0 .81.12.81.6a.64.64 0 0 1-.47.6l.58.87a.38.38 0 0 0 .33.21v.1l-.33-.01-.32.01a9.45 9.45 0 0 1-.7-1.1h-.23v.73c0 .26.12.27.28.27h.06v.1l-.59-.01-.5.01v-.1h.07c.13 0 .24-.06.24-.18v-1.74zm.44.78h.16c.34 0 .53-.13.53-.53a.47.47 0 0 0-.5-.5 1.65 1.65 0 0 0-.2.02v1.01z\" />\n <path d=\"m16.27 23.03-.33-.02c-.1 0-.21.02-.33.01a9.54 9.54 0 0 1-.7-1.1h-.2v.72c0 .25.1.25.26.25h.07v.14h-.01l-.59-.02-.5.02v-.14H14c.12 0 .22-.05.23-.16v-1.74c0-.24-.13-.24-.23-.24h-.08v-.13h1.09c.43 0 .83.11.83.61a.65.65 0 0 1-.47.6l.57.87a.37.37 0 0 0 .32.2h.02v.13zm-1.58-1.14h.23a10.55 10.55 0 0 0 .7 1.1h.64v-.07a.39.39 0 0 1-.33-.2l-.6-.9h.02a.63.63 0 0 0 .47-.59c0-.47-.37-.58-.8-.58h-1.06v.07h.05c.1 0 .26.02.26.27v1.74c0 .13-.13.2-.26.2h-.05V23l.48-.02.57.02v-.07h-.04c-.16 0-.3-.02-.3-.3v-.74zm0-.1h-.02v-1.04h.01a1.63 1.63 0 0 1 .2-.01.48.48 0 0 1 .51.51c0 .4-.2.55-.54.55zm.16-.02c.34 0 .51-.12.51-.52a.45.45 0 0 0-.48-.48 1.33 1.33 0 0 0-.18.01v.99zm3.73.57h.01v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L16.9 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01z\" />\n <path d=\"M18.78 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01l-.44-.02-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.71l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.09v-.13h.93v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.15 2.15 0 0 0 .02.34v.02zm-.13-.03h.11a2.34 2.34 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07h-.87v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07h-.04c-.27 0-.34-.12-.34-.42v-1.44zm-.07-.71.01-.01v.01zm0 0v-.01zm1.08.18a1.38 1.38 0 0 0-.07.27c0 .1.14.12.25.12h.04v.1a7.72 7.72 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.54-1.57a2.87 2.87 0 0 0 .13-.42 1.73 1.73 0 0 0 .3-.15.08.08 0 0 1 .04 0 .02.02 0 0 1 .02 0l.03.1.63 1.78.12.34a.22.22 0 0 0 .23.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.03c.08 0 .22-.01.22-.1a1.1 1.1 0 0 0-.07-.25l-.14-.4h-.77l-.1.36zm.5-1.5-.32.96h.63l-.31-.97z\" />\n <path d=\"M21.48 23.03 21 23l-.51.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.1 1.1 0 0 0-.07-.24l-.13-.39h-.75l-.1.35a1.41 1.41 0 0 0-.08.26c0 .08.13.1.24.1h.06v.14h-.02l-.41-.02-.37.02h-.01v-.14h.03a.3.3 0 0 0 .28-.2l.55-1.57a4.05 4.05 0 0 0 .13-.44 1.75 1.75 0 0 0 .31-.14.09.09 0 0 1 .03-.01.04.04 0 0 1 .04.02l.03.09.63 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zM20.5 23l.5-.02.45.02v-.07a.23.23 0 0 1-.24-.15c-.05-.1-.09-.23-.13-.35l-.62-1.78-.03-.09h-.02a.08.08 0 0 0-.01 0 1.26 1.26 0 0 1-.3.14 2.83 2.83 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.03c-.1 0-.26-.02-.27-.14a1.35 1.35 0 0 1 .08-.27h.01-.01l.11-.36h.8l.13.4a1.04 1.04 0 0 1 .07.25c0 .1-.15.11-.23.12h-.02zm-.7-1 .33-1h.03l.32 1zm.05-.04h.6l-.3-.91zm.28-.94h.01zm1.5-.22c-.26 0-.27.06-.32.31h-.1l.04-.29a2.1 2.1 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .19-.1h.08l-.04.28v.28l-.1.04c-.02-.13-.03-.33-.26-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1L22.4 23l-.57.01v-.1h.06c.19 0 .29-.02.29-.29V20.8h-.56\" />\n <path d=\"M22.97 23.03 22.4 23l-.57.02h-.02v-.14h.08c.19 0 .27 0 .27-.27v-1.8h-.54v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03v-.27l.04-.26h-.05c-.02.1-.11.1-.2.1h-1.77c-.08 0-.17 0-.2-.1h-.06a2 2 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.29a1.98 1.98 0 0 0 .02-.29v-.01h.11c.03.1.1.1.18.1h1.77c.1 0 .17 0 .17-.1v-.01h.02l.1.02v.01l-.05.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.54v1.8c0 .25.1.27.26.27h.08v.14h-.01m.74-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L24.2 23l-.5.01z\" />\n <path d=\"M24.74 23.03 24.2 23l-.5.02h-.01v-.14h.06c.12 0 .24 0 .24-.17v-1.8c0-.16-.12-.17-.24-.17h-.06v-.13h1.07v.13h-.07c-.12 0-.23.01-.23.18v1.79c0 .16.1.17.23.17h.07v.14zm-.01-.03v-.07h-.04c-.12 0-.26-.03-.26-.21v-1.8c0-.18.14-.2.26-.2h.04v-.07H23.7v.07h.04c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.48-.02.53.02zm1.37-2.42a1.2 1.2 0 0 1 1.3 1.18 1.25 1.25 0 0 1-1.28 1.3 1.2 1.2 0 0 1-1.28-1.22 1.24 1.24 0 0 1 1.26-1.26m.05 2.33c.66 0 .78-.58.78-1.08s-.27-1.1-.84-1.1c-.6 0-.77.53-.77.99 0 .6.28 1.2.83 1.2\" />\n <path d=\"M24.83 21.84a1.26 1.26 0 0 1 1.27-1.28v.03a1.23 1.23 0 0 0-1.24 1.25 1.19 1.19 0 0 0 1.26 1.2 1.24 1.24 0 0 0 1.27-1.28 1.18 1.18 0 0 0-1.3-1.17v-.03a1.21 1.21 0 0 1 1.33 1.2 1.27 1.27 0 0 1-1.3 1.32 1.22 1.22 0 0 1-1.3-1.24m.48-.12c0-.46.18-1 .8-1 .57 0 .84.61.84 1.11s-.12 1.1-.79 1.1v-.03c.65 0 .76-.57.76-1.07s-.26-1.08-.82-1.09c-.58 0-.75.52-.76.98 0 .6.28 1.18.82 1.18v.03c-.56 0-.84-.6-.85-1.21m4.4.62v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.05c-.15 0-.3.03-.3.44v1.55a2.2 2.2 0 0 0 .01.34h-.12L28 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.46.01v-.1h.05c.23 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.39.01.3-.01 1.52 1.71\" />\n <path d=\"M29.9 23.08h-.15l-1.72-1.94v1.37c0 .3.05.38.3.38h.07v.14h-.01l-.44-.02-.46.02h-.02v-.14h.07c.22 0 .28-.14.29-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.1v-.13h.94v.13h-.06c-.14 0-.29.01-.3.42v1.55a2.26 2.26 0 0 0 .03.34v.02zm-.13-.03h.1a2.42 2.42 0 0 1-.01-.33v-1.55c0-.41.17-.45.32-.45h.03v-.07h-.86v.07h.06a.3.3 0 0 1 .3.33v1.3l-.01.01-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .33.32v1.44c0 .27-.08.44-.32.45h-.04V23l.45-.02.43.02v-.07h-.05c-.27 0-.33-.12-.33-.42v-1.44zm-.07-.71v-.01zm-.01 0v-.01zm1.09.18a1.43 1.43 0 0 0-.08.27c0 .1.14.12.26.12h.03v.1a7.71 7.71 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.55-1.57a2.79 2.79 0 0 0 .12-.42 1.75 1.75 0 0 0 .31-.15.07.07 0 0 1 .03 0 .02.02 0 0 1 .02 0l.03.1.63 1.78c.04.11.08.24.13.34a.22.22 0 0 0 .22.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.04c.08 0 .2-.01.2-.1a1.1 1.1 0 0 0-.06-.25l-.13-.4h-.78zm.5-1.5h-.01l-.32.96h.64l-.32-.97z\" />\n <path d=\"m32.59 23.03-.47-.02-.5.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.06 1.06 0 0 0-.07-.24l-.13-.39h-.76l-.1.35a1.44 1.44 0 0 0-.07.26c0 .08.12.1.24.1H31v.14h-.02l-.4-.02-.38.02h-.01v-.14h.03a.3.3 0 0 0 .29-.2l.54-1.57a4.27 4.27 0 0 0 .14-.44 1.85 1.85 0 0 0 .3-.14.08.08 0 0 1 .04 0 .04.04 0 0 1 .04.01l.03.09.62 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zm-.97-.03.5-.02.46.02v-.08h-.01a.23.23 0 0 1-.24-.14l-.12-.35-.63-1.78a3.61 3.61 0 0 1-.03-.09h-.01a.06.06 0 0 0-.02 0 1.3 1.3 0 0 1-.3.14 2.94 2.94 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.02c-.11 0-.27-.02-.27-.14a1.42 1.42 0 0 1 .07-.27h.02-.02l.11-.36h.8l.13.4a1.07 1.07 0 0 1 .07.25c0 .1-.15.11-.22.12h-.03zm-.7-1 .34-1h.02l.33 1zm.05-.04h.6l-.3-.91zm2.48.72c0 .13.1.18.2.19a2.47 2.47 0 0 0 .45 0 .48.48 0 0 0 .33-.2.78.78 0 0 0 .1-.24h.1l-.12.58-.9-.01-.9.01v-.1h.05c.12 0 .25-.02.25-.23v-1.75c0-.18-.13-.2-.25-.2h-.05v-.1l.54.01.51-.01v.1h-.08c-.13 0-.23 0-.23.19z\" />\n <path d=\"m34.5 23.03-.9-.02-.9.02v-.14h.06c.12 0 .24 0 .24-.2v-1.76c0-.17-.12-.18-.24-.18h-.07v-.13h1.09v.13h-.1c-.13 0-.21 0-.22.17v1.76c0 .13.09.16.2.17l.18.01a2.46 2.46 0 0 0 .26-.01.48.48 0 0 0 .32-.18.77.77 0 0 0 .1-.24v-.01h.13v.02l-.13.58zm0-.03.11-.55h-.07a.77.77 0 0 1-.1.24.5.5 0 0 1-.34.19 2.6 2.6 0 0 1-.26.01h-.19c-.11-.02-.22-.07-.22-.21v-1.76c0-.2.12-.2.25-.2h.07v-.07h-1.03v.07h.04c.12 0 .27.02.27.2v1.76c0 .22-.15.24-.27.24h-.04V23l.89-.02.88.02zm.1-2.47a.36.36 0 1 1-.37.36.35.35 0 0 1 .36-.36zm0 .66a.3.3 0 1 0-.3-.3.29.29 0 0 0 .3.3zm-.19-.1v-.02c.05-.01.05 0 .05-.04v-.26c0-.04 0-.05-.05-.05v-.02h.19c.06 0 .12.03.12.1a.11.11 0 0 1-.09.1l.06.09a.38.38 0 0 0 .08.08v.01h-.07c-.03 0-.06-.07-.13-.16h-.04v.12c0 .02.01.02.06.03v.01zm.12-.2h.05c.04 0 .06-.03.06-.09s-.03-.08-.07-.08h-.04z\" />\n </g>\n <path fill=\"#fff\" d=\"M13.33 8.58a5.77 5.77 0 1 1 5.76 5.78 5.77 5.77 0 0 1-5.76-5.78\" />\n <path\n fill=\"#154a78\"\n d=\"M22.58 8.47a3.48 3.48 0 0 0-2.23-3.24v6.48a3.48 3.48 0 0 0 2.23-3.24zm-4.7 3.24V5.23a3.47 3.47 0 0 0 0 6.48zM19.1 3a5.48 5.48 0 1 0 5.47 5.48A5.47 5.47 0 0 0 19.11 3zm0 11.48a5.99 5.99 0 0 1-6.03-5.94A5.9 5.9 0 0 1 19.1 2.5h1.55a6.1 6.1 0 0 1 6.24 6.03 6.22 6.22 0 0 1-6.24 5.94z\"\n />\n </svg>\n);\n\nexport default DinersIcon;\n","import { h } from \"preact\";\n\ninterface DiscoverIconProps {\n opacity?: number;\n /** Dark-theme reversed mark: drop the white background and render the wordmark in white\n * (the orange globe is kept — it reads fine on dark). */\n reversed?: boolean;\n}\n\nconst DiscoverIcon = ({ opacity = 1, reversed = false }: DiscoverIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"19.5\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n {!reversed && <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />}\n <g clip-path=\"url(#a)\">\n <g clip-path=\"url(#b)\">\n <path\n fill={reversed ? \"#fff\" : \"#000\"}\n d=\"M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z\"\n />\n </g>\n <path\n fill={reversed ? \"#fff\" : \"#000\"}\n d=\"M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z\"\n />\n <path fill=\"url(#c)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <path fill=\"url(#d)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <mask id=\"e\" width=\"6\" height=\"6\" x=\"18\" y=\"10\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:luminance\">\n <path fill=\"#fff\" d=\"M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z\" />\n </mask>\n <g mask=\"url(#e)\">\n <path fill=\"url(#f)\" d=\"M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z\" />\n </g>\n </g>\n <g clip-path=\"url(#g)\">\n <g clip-path=\"url(#h)\">\n <path\n fill={reversed ? \"#fff\" : \"#000\"}\n d=\"M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z\"\n />\n </g>\n <path\n fill={reversed ? \"#fff\" : \"#000\"}\n d=\"M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z\"\n />\n <path fill=\"url(#i)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <path fill=\"url(#j)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <mask id=\"k\" width=\"6\" height=\"6\" x=\"18\" y=\"10\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:luminance\">\n <path fill=\"#fff\" d=\"M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z\" />\n </mask>\n <g mask=\"url(#k)\">\n <path fill=\"url(#l)\" d=\"M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z\" />\n </g>\n </g>\n <defs>\n <linearGradient id=\"c\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F59F00\" />\n <stop offset=\".19\" stop-color=\"#F49B00\" />\n <stop offset=\".37\" stop-color=\"#F29101\" />\n <stop offset=\".5\" stop-color=\"#F08302\" />\n <stop offset=\".6\" stop-color=\"#EE7905\" />\n <stop offset=\".76\" stop-color=\"#EC7008\" />\n <stop offset=\"1\" stop-color=\"#EC6D09\" />\n </linearGradient>\n <linearGradient id=\"d\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".04\" stop-color=\"#F48C1C\" stop-opacity=\".08\" />\n <stop offset=\".2\" stop-color=\"#F77314\" stop-opacity=\".32\" />\n <stop offset=\".35\" stop-color=\"#F95D0E\" stop-opacity=\".53\" />\n <stop offset=\".5\" stop-color=\"#FB4B09\" stop-opacity=\".7\" />\n <stop offset=\".64\" stop-color=\"#FD3D05\" stop-opacity=\".83\" />\n <stop offset=\".77\" stop-color=\"#FE3302\" stop-opacity=\".92\" />\n <stop offset=\".9\" stop-color=\"#FF2D01\" stop-opacity=\".98\" />\n <stop offset=\"1\" stop-color=\"#FF2B00\" />\n </linearGradient>\n <radialGradient\n id=\"f\"\n cx=\"0\"\n cy=\"0\"\n r=\"1\"\n gradientTransform=\"rotate(4.24 -167.26 291.02) scale(3.3208)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".45\" stop-color=\"#EA8D1D\" stop-opacity=\".05\" />\n <stop offset=\".66\" stop-color=\"#CA7618\" stop-opacity=\".2\" />\n <stop offset=\".83\" stop-color=\"#924D10\" stop-opacity=\".48\" />\n <stop offset=\".96\" stop-color=\"#441304\" stop-opacity=\".87\" />\n <stop offset=\".99\" stop-color=\"#2F0401\" stop-opacity=\".97\" />\n </radialGradient>\n <linearGradient id=\"i\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F59F00\" />\n <stop offset=\".19\" stop-color=\"#F49B00\" />\n <stop offset=\".37\" stop-color=\"#F29101\" />\n <stop offset=\".5\" stop-color=\"#F08302\" />\n <stop offset=\".6\" stop-color=\"#EE7905\" />\n <stop offset=\".76\" stop-color=\"#EC7008\" />\n <stop offset=\"1\" stop-color=\"#EC6D09\" />\n </linearGradient>\n <linearGradient id=\"j\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".04\" stop-color=\"#F48C1C\" stop-opacity=\".08\" />\n <stop offset=\".2\" stop-color=\"#F77314\" stop-opacity=\".32\" />\n <stop offset=\".35\" stop-color=\"#F95D0E\" stop-opacity=\".53\" />\n <stop offset=\".5\" stop-color=\"#FB4B09\" stop-opacity=\".7\" />\n <stop offset=\".64\" stop-color=\"#FD3D05\" stop-opacity=\".83\" />\n <stop offset=\".77\" stop-color=\"#FE3302\" stop-opacity=\".92\" />\n <stop offset=\".9\" stop-color=\"#FF2D01\" stop-opacity=\".98\" />\n <stop offset=\"1\" stop-color=\"#FF2B00\" />\n </linearGradient>\n <radialGradient\n id=\"l\"\n cx=\"0\"\n cy=\"0\"\n r=\"1\"\n gradientTransform=\"rotate(4.24 -167.26 291.02) scale(3.3208)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".45\" stop-color=\"#EA8D1D\" stop-opacity=\".05\" />\n <stop offset=\".66\" stop-color=\"#CA7618\" stop-opacity=\".2\" />\n <stop offset=\".83\" stop-color=\"#924D10\" stop-opacity=\".48\" />\n <stop offset=\".96\" stop-color=\"#441304\" stop-opacity=\".87\" />\n <stop offset=\".99\" stop-color=\"#2F0401\" stop-opacity=\".97\" />\n </radialGradient>\n <clipPath id=\"a\">\n <path fill=\"#fff\" d=\"M0 0h33v5.55H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"b\">\n <path fill=\"#fff\" d=\"M0 0h33v5.86H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"g\">\n <path fill=\"#fff\" d=\"M0 0h33v5.55H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"h\">\n <path fill=\"#fff\" d=\"M0 0h33v5.86H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default DiscoverIcon;\n","import { h } from \"preact\";\n\ninterface CupIconProps {\n opacity?: number;\n}\n\nconst CupIcon = ({ opacity = 1 }: CupIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"30\" height=\"19.5\" opacity={opacity}>\n <rect width=\"45.3\" height=\"27\" x=\"-3.3\" y=\"-.79\" fill=\"#fff\" rx=\"2.82\" />\n <path\n fill=\"#01798a\"\n d=\"M27.27-.79a4.06 4.06 0 0 0-3.6 2.8l-4.96 23.42a2.14 2.14 0 0 0 2 2.8h18.35a2.81 2.81 0 0 0 2.8-2.82V1.15A2.25 2.25 0 0 0 40-.8\"\n />\n <rect width=\"20.38\" height=\"29.02\" x=\"-4\" y=\"-.79\" fill=\"#dc1f2b\" rx=\"2.82\" />\n <path\n fill=\"#1a4580\"\n d=\"M24.37 2.02a3.98 3.98 0 0 1 3.48-2.8H14.18a3.97 3.97 0 0 0-3.5 2.8l-4.85 23.4a2.13 2.13 0 0 0 1.94 2.81h13.7a2.13 2.13 0 0 1-1.94-2.8z\"\n />\n <path\n fill=\"#fff\"\n d=\"M16.63 15.04h.18a.32.32 0 0 0 .32-.17l.46-.7h1.24l-.26.47h1.49l-.2.7H18.1a.82.82 0 0 1-.75.44h-.92zm-.2 1h3.25l-.21.77h-1.3l-.2.74h1.27l-.21.77h-1.27l-.3 1.09c-.07.18.02.26.29.24h1.03l-.19.71H16.6q-.57 0-.39-.65l.38-1.4h-.81l.2-.76h.82l.2-.74h-.78l.2-.76zm5.19-1.87-.06.45a2.37 2.37 0 0 1 1.18-.47h2.05l-.78 2.88q-.1.5-.84.5h-2.34l-.54 2.01c-.03.11.01.17.13.17h.46l-.17.62h-1.17q-.67 0-.56-.4l1.54-5.76zm1.74.81h-1.84l-.22.78a1.52 1.52 0 0 1 .82-.23h1.1zm-.67 1.8c.14.02.22-.03.22-.16l.12-.4h-1.84l-.16.57zm-1.24.93h1.06l-.02.47h.29c.14 0 .2-.05.2-.14l.1-.3h.87l-.11.44a.76.76 0 0 1-.8.57h-.56v.8c-.01.12.1.18.33.18h.53l-.17.63H21.9c-.36.02-.53-.15-.53-.52zM8.6 10.34a2.62 2.62 0 0 1-1 1.64 3.24 3.24 0 0 1-1.98.58 2.16 2.16 0 0 1-1.68-.59 1.54 1.54 0 0 1-.37-1.06 2.86 2.86 0 0 1 .06-.57l.87-4.2h1.3l-.85 4.15a1.35 1.35 0 0 0-.04.32.82.82 0 0 0 .16.52.89.89 0 0 0 .75.3 1.56 1.56 0 0 0 1-.3 1.37 1.37 0 0 0 .5-.84l.84-4.15h1.3zm5.47-1.65h1.02l-.8 3.74h-1.02zm.32-1.37h1.03l-.2.91H14.2l.19-.9M16 12.15a1.39 1.39 0 0 1-.41-1.05 2.45 2.45 0 0 1 .01-.25l.04-.27a2.55 2.55 0 0 1 .78-1.45 2.07 2.07 0 0 1 1.43-.54 1.5 1.5 0 0 1 1.1.39 1.4 1.4 0 0 1 .4 1.06 2.59 2.59 0 0 1-.02.26l-.05.28a2.48 2.48 0 0 1-.77 1.42 2.08 2.08 0 0 1-1.43.53 1.5 1.5 0 0 1-1.09-.38m1.95-.74a1.84 1.84 0 0 0 .38-.9.58.58 0 0 0 .03-.19 1.74 1.74 0 0 0 .01-.17.76.76 0 0 0-.17-.54.64.64 0 0 0-.5-.2.89.89 0 0 0-.7.3 1.9 1.9 0 0 0-.38.92l-.03.18a1.36 1.36 0 0 0-.01.17.75.75 0 0 0 .17.54.64.64 0 0 0 .5.18.9.9 0 0 0 .7-.3m8.02 3.67.25-.87h1.24l-.05.32a3.1 3.1 0 0 1 1.09-.32h1.54l-.25.87h-.24l-1.16 4.12h.24l-.23.82h-.24l-.1.36h-1.2l.1-.36h-2.38l.23-.82h.24l1.16-4.12zm1.34 0L27 16.2a5.13 5.13 0 0 1 1-.27c.1-.4.24-.85.24-.85zm-.46 1.64-.32 1.17a3.44 3.44 0 0 1 1.01-.33l.24-.84zm.23 2.48.24-.84h-.93l-.24.84zm3.01-5.05h1.17l.05.44c0 .11.06.16.2.16h.2l-.2.74h-.87c-.32.02-.5-.1-.5-.38zm-.34 1.59h3.79l-.23.79h-1.2l-.2.74h1.2l-.23.79h-1.34l-.3.46h.65l.16.93c.01.09.1.13.23.13h.2l-.2.77h-.73c-.37.02-.57-.1-.58-.38l-.18-.85-.6.9a.65.65 0 0 1-.65.36h-1.1l.22-.77h.34a.46.46 0 0 0 .36-.19l.94-1.36h-1.2l.22-.8h1.3l.21-.73h-1.3l.22-.8zM9.8 8.69h.92l-.1.54.12-.16a1.43 1.43 0 0 1 1.1-.48 1 1 0 0 1 .83.34 1.15 1.15 0 0 1 .14.95l-.5 2.56h-.95l.46-2.32a.74.74 0 0 0-.04-.53.44.44 0 0 0-.4-.17.88.88 0 0 0-.62.23 1.14 1.14 0 0 0-.34.63L10 12.44h-.94zm10.55 0h.92l-.1.54.13-.16a1.43 1.43 0 0 1 1.08-.48.99.99 0 0 1 .85.34 1.14 1.14 0 0 1 .13.95l-.5 2.56h-.95l.46-2.32a.75.75 0 0 0-.04-.53.45.45 0 0 0-.4-.17.89.89 0 0 0-.62.23 1.12 1.12 0 0 0-.33.63l-.43 2.16h-.94zm4.55-2.33h2.67a1.8 1.8 0 0 1 1.19.35 1.25 1.25 0 0 1 .4 1v.02a3.77 3.77 0 0 1-.06.59 2.38 2.38 0 0 1-.81 1.4 2.29 2.29 0 0 1-1.5.52h-1.44l-.44 2.2h-1.24zm.67 2.82h1.19a1.14 1.14 0 0 0 .73-.21 1.14 1.14 0 0 0 .36-.67l.03-.15v-.13a.52.52 0 0 0-.22-.47 1.35 1.35 0 0 0-.72-.15h-1zm9.15 3.98a5.91 5.91 0 0 1-.98 1.56 1.99 1.99 0 0 1-1.7.71l.08-.64c.89-.27 1.36-1.51 1.64-2.06l-.33-4.03.68-.01h.58l.06 2.53 1.07-2.53h1.09zM31.68 9l-.43.3a1.35 1.35 0 0 0-1.66-.21c-1.08.5-1.98 4.4 1 3.11l.17.2 1.17.04.77-3.54zm-.66 1.92c-.2.56-.61.94-.94.83-.33-.1-.45-.64-.26-1.2.19-.57.61-.94.94-.83.33.1.45.64.26 1.2\"\n />\n </svg>\n);\n\nexport default CupIcon;\n","import { h, FunctionalComponent, ComponentChildren } from \"preact\";\nimport \"./tooltip.css\";\nimport { useRef, useState } from \"preact/hooks\";\n\ninterface TooltipProps {\n children: ComponentChildren;\n content: ComponentChildren;\n /**\n * Which side of the trigger the tooltip opens toward. Defaults to \"bottom\".\n * Use \"top\" inside overflow:hidden containers (e.g. the card form's expandable) where a\n * downward tooltip would be clipped.\n */\n placement?: \"top\" | \"bottom\";\n}\n\nexport const Tooltip: FunctionalComponent<TooltipProps> = ({\n children,\n content,\n placement = \"bottom\",\n}): h.JSX.Element | null => {\n const [isVisible, setIsVisible] = useState(false);\n const triggerRef = useRef<HTMLDivElement>(null);\n\n const handleMouseEnter = () => {\n setIsVisible(true);\n };\n\n const handleMouseLeave = () => {\n setIsVisible(false);\n };\n\n return (\n <div style={{ position: \"relative\" }}>\n <div ref={triggerRef} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {children}\n </div>\n {isVisible && triggerRef && (\n <div className={`straumur__tooltip__content straumur__tooltip__content--${placement}`}>{content}</div>\n )}\n </div>\n );\n};\n","import styleInject from '#style-inject';styleInject(\".straumur__tooltip__content{position:absolute;z-index:50;padding:var(--straumur__space-s);border-radius:var(--straumur__border-radius-s);right:40%;width:max-content;color:var(--straumur__color-white);background-color:var(--straumur__color-primary);box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}.straumur__tooltip__content--bottom{top:100%}.straumur__tooltip__content--top{bottom:100%}\\n\")","import { useEffect, useState } from \"preact/hooks\";\n\n/**\n * Hook to listen for a CSS media query.\n * @param query - The media query string (e.g., '(min-width: 768px)')\n * @returns true if the query matches\n */\nexport function useMediaQuery(query: string): boolean {\n const getMatch = () => window.matchMedia(query).matches;\n\n const [matches, setMatches] = useState(getMatch);\n\n useEffect(() => {\n const mediaQueryList = window.matchMedia(query);\n const listener = (event: MediaQueryListEvent) => setMatches(event.matches);\n\n // Initial match check\n setMatches(mediaQueryList.matches);\n\n // Listen for changes\n mediaQueryList.addEventListener(\"change\", listener);\n\n return () => {\n mediaQueryList.removeEventListener(\"change\", listener);\n };\n }, [query]);\n\n return matches;\n}\n","import { Fragment, h } from \"preact\";\nimport { useRef, useState, useEffect, StateUpdater, Dispatch } from \"preact/hooks\";\nimport { usePaymentMethodGroup } from \"../payment-method-group/payment-method-group-context\";\nimport { AdyenCheckout, AdyenCheckoutError, CustomCard, ICore, UIElement, UIElementProps } from \"@adyen/adyen-web\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { Tooltip } from \"../tooltip/tooltip\";\nimport InfoIcon from \"../../assets/icons/info\";\nimport { BrandHidden } from \"../../utils/renderBrandIcons\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport CheckmarkIcon from \"../../assets/icons/checkmark\";\nimport { RenderDualBrandComponent, DualBrandConfiguration } from \"../render-dual-brand/render-dual-brand\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { createAdyenPaymentHandlers } from \"../shared/create-adyen-handlers\";\nimport { submitCardWithGate } from \"../shared/before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useFocusOnActivate } from \"../../utils/custom-hooks/use-focus-on-activate\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { getAdyenFieldStyles } from \"../../utils/adyen-field-styles\";\n\nexport interface CardFormProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n onBrandHidden: Dispatch<StateUpdater<BrandHidden[]>>;\n}\n\ntype CardFormError = {\n encryptedCardNumber: {\n visible: boolean;\n message?: string;\n };\n encryptedExpiryDate: {\n visible: boolean;\n message?: string;\n };\n encryptedSecurityCode: {\n visible: boolean;\n message?: string;\n };\n};\n\ntype CardFormErrorField = keyof CardFormError;\n\nfunction CardForm({ configuration, paymentMethods, onBrandHidden }: CardFormProps): h.JSX.Element | null {\n const cardElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const customCardRef = useRef<CustomCard>();\n const { i18n } = useI18n();\n const [payButtonDisabled, setPayButtonDisabled] = useState<boolean>(true);\n const [securityCodePolicy, setSecurityCodePolicy] = useState<\"hidden\" | \"optional\" | \"required\">(\"required\");\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [isDualBrand, setIsDualBrand] = useState(false);\n const [dualBrandConfiguration, setDualBrandConfiguration] = useState<DualBrandConfiguration | null>(null);\n const [selectedBrand, setSelectedBrand] = useState<string | null>(null);\n const storePaymentMethodRef = useRef(false);\n const [formErrors, setFormErrors] = useState<CardFormError>({\n encryptedCardNumber: { visible: false },\n encryptedExpiryDate: { visible: false },\n encryptedSecurityCode: { visible: false },\n });\n\n const {\n activePaymentMethod,\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isObscuredByThreeDS,\n hasCard,\n registerSubmitHandler,\n unregisterSubmitHandler,\n } = usePaymentMethodGroup();\n\n // Adyen's card iframes can't read our CSS, so the field colors are passed in per theme.\n const resolvedTheme = useResolvedTheme(configuration.theme);\n\n async function handleSubmitClick(): Promise<void> {\n await submitCardWithGate(configuration.paymentFlow, () => customCardRef.current);\n }\n\n useEffect(() => {\n // Treat the card as inactive while a 3DS challenge is showing: it takes over the card container,\n // so a host's external submit button must not stay visible/clickable during the challenge.\n const isActive = activePaymentMethod === \"card\" && isPaymentMethodInitialized.card && !threeDSecureActive;\n if (!isActive) {\n // Nothing selected yet, a different method is active, or 3DS is in progress - tell the host\n // explicitly so a custom submit button hides (and defaults to disabled when it reappears).\n configuration.onCardValidityChanged?.(false, false);\n return;\n }\n\n registerSubmitHandler(handleSubmitClick);\n // Signal \"active but not yet valid\" on activation so a host's custom submit button can appear\n // (disabled) right away. onAllValid then updates the valid state as the shopper fills fields.\n configuration.onCardValidityChanged?.(false, true);\n return () => {\n unregisterSubmitHandler(handleSubmitClick);\n configuration.onCardValidityChanged?.(false, false);\n };\n }, [\n activePaymentMethod,\n isPaymentMethodInitialized.card,\n threeDSecureActive,\n registerSubmitHandler,\n unregisterSubmitHandler,\n ]);\n\n // Computed defensively (optional chaining + fallback) because it runs on every render,\n // ahead of the render guards below. Keeping every hook unconditional satisfies the Rules\n // of Hooks; initializeAdyenComponent is only ever invoked while the card method is active.\n const schemeBrands = paymentMethods.paymentMethods?.paymentMethods?.find((x) => x.type === \"scheme\")?.brands ?? [];\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData: (data) => ({\n ...data,\n storePaymentMethod: storePaymentMethodRef.current,\n }),\n });\n\n function handleOnError(_: AdyenCheckoutError, __?: UIElement<UIElementProps> | undefined): void {\n handleError({ key: \"error.unknownError\" });\n }\n\n const initializeAdyenComponent = async () => {\n // Fully tear down any previous instance before re-initializing (e.g. on locale change),\n // otherwise the old secure iframes leak and stack up on the same DOM node. Uses remove()\n // (destroy-style cleanup) to match the wallet components (google-pay/apple-pay buttons).\n customCardRef.current?.remove();\n\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n paymentMethodsResponse: paymentMethods.paymentMethods,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n onSubmit: handleOnSubmit,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onError: handleOnError,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n customCardRef.current = new CustomCard(adyenCheckoutRef.current, {\n brands: schemeBrands,\n placeholders: configuration.placeholders,\n styles: getAdyenFieldStyles(resolvedTheme),\n challengeWindowSize: \"05\",\n onBinLookup: (event) => {\n if (event.supportedBrandsRaw && event.supportedBrandsRaw.length > 1) {\n setIsDualBrand(true);\n\n setDualBrandConfiguration({\n brand1: event.supportedBrandsRaw[0].brand,\n brand1Name: event.supportedBrandsRaw[0].localeBrand,\n brand1ImageUrl: event.supportedBrandsRaw[0].brandImageUrl,\n brand2: event.supportedBrandsRaw[1].brand,\n brand2Name: event.supportedBrandsRaw[1].localeBrand,\n brand2ImageUrl: event.supportedBrandsRaw[1].brandImageUrl,\n });\n }\n },\n onBrand: (event) => {\n setSecurityCodePolicy(event.cvcPolicy);\n if (event.brand === \"card\") {\n onBrandHidden([]);\n setSelectedBrand(null);\n return;\n }\n\n const selectedBrands = schemeBrands\n .filter((x) => x !== event.brand)\n .map((x) => {\n return {\n brand: x,\n };\n });\n\n onBrandHidden(selectedBrands);\n\n if (\n schemeBrands\n .filter((x) => x === event.brand)\n .map((x) => {\n return {\n brand: x,\n };\n }).length === 1\n ) {\n setSelectedBrand(event.brand);\n }\n },\n onConfigSuccess() {\n updatePaymentMethodInitialization(\"card\", true);\n },\n onValidationError: (event) => {\n const defaultErrors: CardFormError = {\n encryptedCardNumber: { visible: false, message: undefined },\n encryptedExpiryDate: { visible: false, message: undefined },\n encryptedSecurityCode: { visible: false, message: undefined },\n };\n\n event\n .filter((x) => x.error)\n .forEach((x) => {\n defaultErrors[x.fieldType as CardFormErrorField].visible = true;\n defaultErrors[x.fieldType as CardFormErrorField].message = x.errorI18n;\n });\n\n setFormErrors(defaultErrors);\n },\n onAllValid: (event) => {\n setPayButtonDisabled(!event.allValid);\n configuration.onCardValidityChanged?.(event.allValid, true);\n },\n });\n\n if (cardElementRef.current) {\n customCardRef.current.mount(cardElementRef.current);\n }\n };\n\n useEffect(() => {\n if (hasCard && activePaymentMethod === \"card\" && !isPaymentMethodInitialized.card) {\n initializeAdyenComponent();\n }\n }, [configuration, activePaymentMethod]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(customCardRef.current && isPaymentMethodInitialized.card),\n () => {\n initializeAdyenComponent();\n setFormErrors({\n encryptedCardNumber: { visible: false, message: undefined },\n encryptedExpiryDate: { visible: false, message: undefined },\n encryptedSecurityCode: { visible: false, message: undefined },\n });\n }\n );\n\n useEffect(() => {\n storePaymentMethodRef.current = storePaymentMethod;\n }, [storePaymentMethod]);\n\n function dualBrandListener(e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) {\n customCardRef.current!.dualBrandingChangeHandler(e);\n }\n\n function handleStorePaymentMethodChange(event: h.JSX.TargetedEvent<HTMLInputElement, Event>) {\n setStorePaymentMethod(event.currentTarget.checked);\n }\n\n // When the 3DS challenge replaces the card fields, move focus into the container.\n useFocusOnActivate(cardElementRef, threeDSecureActive && activePaymentMethod === \"card\");\n\n // Render guards live below all hooks so hook order is identical on every render.\n if (!hasCard || isObscuredByThreeDS(\"card\")) {\n return null;\n }\n\n if (paymentMethods.paymentMethods?.paymentMethods?.length === 0) {\n return null;\n }\n\n return (\n <div\n className=\"straumur__card-component__expandable\"\n ref={cardElementRef}\n tabIndex={-1}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n }}\n >\n {!isPaymentMethodInitialized.card && (\n <div className=\"straumur__card-component__loading-text\">\n <LoaderIcon />\n </div>\n )}\n\n <div\n className=\"straumur__card-component__form\"\n style={{\n opacity: isPaymentMethodInitialized.card && !threeDSecureActive ? 1 : 0,\n position: isPaymentMethodInitialized.card && !threeDSecureActive ? \"relative\" : \"absolute\",\n transition: \"opacity 0.3s ease-in-out\",\n }}\n >\n <div className=\"straumur__card-component__form--wrapper\">\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedCardNumber.visible ? \"straumur__card-component__form--wrapper--label--error\" : \"\"\n }`}\n >\n {i18n.t(\"cards.cardNumber\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedCardNumber.visible ? \"straumur__card-component__form--wrapper--input--error\" : \"\"\n }`}\n data-cse=\"encryptedCardNumber\"\n role=\"group\"\n aria-label={i18n.t(\"cards.cardNumber\")}\n />\n {formErrors.encryptedCardNumber.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedCardNumber.message}\n </span>\n )}\n </div>\n <div className=\"straumur__card-component__form--field-wrapper\">\n <div className=\"straumur__card-component__form--wrapper\">\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedExpiryDate.visible ? \"straumur__card-component__form--wrapper--label--error\" : \"\"\n }`}\n >\n {i18n.t(\"cards.expiryDate\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedExpiryDate.visible ? \"straumur__card-component__form--wrapper--input--error\" : \"\"\n }`}\n data-cse=\"encryptedExpiryDate\"\n role=\"group\"\n aria-label={i18n.t(\"cards.expiryDate\")}\n />\n {formErrors.encryptedExpiryDate.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedExpiryDate.message}\n </span>\n )}\n </div>\n\n <div className=\"straumur__card-component__form--wrapper\">\n {(securityCodePolicy === \"optional\" || securityCodePolicy === \"required\") && (\n <Fragment>\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__card-component__form--wrapper--label--error\"\n : \"\"\n }`}\n >\n {securityCodePolicy === \"optional\"\n ? i18n.t(\"cards.securityCode3DigitsOptional\")\n : i18n.t(\"cards.securityCode3Digits\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__card-component__form--wrapper--input--error\"\n : \"\"\n }`}\n data-cse=\"encryptedSecurityCode\"\n role=\"group\"\n aria-label={i18n.t(\"cards.securityCode3Digits\")}\n />\n {formErrors.encryptedSecurityCode.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedSecurityCode.message}\n </span>\n )}\n <div className=\"straumur__card-component__form--wrapper--label--info\">\n <Tooltip content={<span>{i18n.t(\"cards.securityCode3DigitsInfo\")}</span>} placement=\"top\">\n <InfoIcon />\n </Tooltip>\n </div>\n </Fragment>\n )}\n </div>\n </div>\n\n {isDualBrand && dualBrandConfiguration && (\n <RenderDualBrandComponent\n dualBrandConfiguration={dualBrandConfiguration}\n selectedBrand={selectedBrand}\n onBrandClick={dualBrandListener}\n />\n )}\n\n {paymentMethods.enableStoreDetails === \"AskForConsent\" && (\n <label className=\"straumur__card-component__form--wrapper--label-checkbox\">\n <div\n className={`${\"straumur__card-component__form--wrapper--label-checkbox--checkmark\"} ${\n storePaymentMethod ? \"straumur__card-component__form--wrapper--label-checkbox--checkmark--checked\" : \"\"\n }`}\n >\n <div\n className={`${\"straumur__card-component__form--wrapper--label-checkbox--checkmark--icon\"} ${\n storePaymentMethod\n ? \"straumur__card-component__form--wrapper--label-checkbox--checkmark--icon--checked\"\n : \"\"\n }`}\n >\n <CheckmarkIcon />\n </div>\n </div>\n <input\n type=\"checkbox\"\n className=\"straumur__card-component__form--wrapper--label-checkbox--checkbox\"\n checked={storePaymentMethod}\n onChange={handleStorePaymentMethodChange}\n />\n {i18n.t(\"cards.storePaymentMethod\")}\n </label>\n )}\n\n {!configuration.hideSubmitButton && (\n <button\n className=\"straumur__card-component__submit-button\"\n disabled={payButtonDisabled}\n onClick={handleSubmitClick}\n >\n {paymentMethods.minorUnitsAmount === 0 ? i18n.t(\"cards.saveCardDetails\") : paymentMethods.formattedAmount}\n </button>\n )}\n </div>\n </div>\n );\n}\n\nexport default CardForm;\n","import { h } from \"preact\";\n\nconst InfoIcon = () => (\n <svg width=\"21\" height=\"20\" viewBox=\"0 0 21 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_10626_39119)\">\n <path\n d=\"M10.6641 7.5C11.3543 7.5 11.9141 6.94023 11.9141 6.25C11.9141 5.55977 11.3543 5 10.6641 5C9.97383 5 9.41406 5.55859 9.41406 6.25C9.41406 6.94141 9.97266 7.5 10.6641 7.5ZM12.2266 13.125H11.6016V9.6875C11.6016 9.17188 11.1836 8.75 10.6641 8.75H9.41406C8.89844 8.75 8.47656 9.17188 8.47656 9.6875C8.47656 10.2031 8.89844 10.625 9.41406 10.625H9.72656V13.125H9.10156C8.58594 13.125 8.16406 13.5469 8.16406 14.0625C8.16406 14.5781 8.58594 15 9.10156 15H12.2266C12.7441 15 13.1641 14.5801 13.1641 14.0625C13.1641 13.5449 12.7461 13.125 12.2266 13.125Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.4\"\n d=\"M10.6641 0C5.14062 0 0.664062 4.47656 0.664062 10C0.664062 15.5234 5.14062 20 10.6641 20C16.1875 20 20.6641 15.5234 20.6641 10C20.6641 4.47656 16.1875 0 10.6641 0ZM10.6641 5C11.3543 5 11.9141 5.55977 11.9141 6.25C11.9141 6.94023 11.3543 7.5 10.6641 7.5C9.97383 7.5 9.41406 6.94141 9.41406 6.25C9.41406 5.55859 9.97266 5 10.6641 5ZM12.2266 15H9.10156C8.58594 15 8.16406 14.582 8.16406 14.0625C8.16406 13.543 8.58398 13.125 9.10156 13.125H9.72656V10.625H9.41406C8.89648 10.625 8.47656 10.2051 8.47656 9.6875C8.47656 9.16992 8.89844 8.75 9.41406 8.75H10.6641C11.1816 8.75 11.6016 9.16992 11.6016 9.6875V13.125H12.2266C12.7441 13.125 13.1641 13.5449 13.1641 14.0625C13.1641 14.5801 12.7461 15 12.2266 15Z\"\n fill=\"currentColor\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10626_39119\">\n <rect width=\"20\" height=\"20\" fill=\"white\" transform=\"translate(0.664062)\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default InfoIcon;\n","import { h } from \"preact\";\n\nconst LoaderIcon = () => (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\">\n <g fill=\"none\" fill-rule=\"evenodd\">\n <g transform=\"translate(2 2)\" stroke-width=\"4\">\n <circle stroke-opacity=\".3\" cx=\"18\" cy=\"18\" r=\"18\" />\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 18 18\"\n to=\"360 18 18\"\n dur=\"1s\"\n repeatCount=\"indefinite\"\n />\n </path>\n </g>\n </g>\n </svg>\n);\n\nexport default LoaderIcon;\n","import { h } from \"preact\";\n\nconst CheckmarkIcon = ({ color = \"var(--straumur__color-primary)\" }: { color?: string }) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"13\" viewBox=\"0 0 16 13\" fill=\"none\">\n <path d=\"M2 7L6 11L14 2\" stroke={color} stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n);\n\nexport default CheckmarkIcon;\n","import { h } from \"preact\";\nimport { RenderBrandIcon } from \"../../utils/renderBrandIcons\";\nimport CheckmarkIcon from \"../../assets/icons/checkmark\";\n\ntype DualBrandConfiguration = {\n brand1: string;\n brand1Name?: string;\n brand1ImageUrl?: string;\n brand2: string;\n brand2Name?: string;\n brand2ImageUrl?: string;\n};\n\ninterface RenderDualBrandComponentProps {\n dualBrandConfiguration: DualBrandConfiguration;\n selectedBrand: string | null;\n onBrandClick: (e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) => void;\n}\n\ninterface BrandOptionProps {\n brand: string;\n brandName?: string;\n isSelected: boolean;\n onBrandClick: (e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) => void;\n}\n\nfunction BrandOption({ brand, brandName, isSelected, onBrandClick }: BrandOptionProps): h.JSX.Element {\n // Enter/Space activate the option like a click. Synthesizing a real click (rather than calling\n // onBrandClick directly) keeps the currentTarget/data-value that Adyen's dualBrandingChangeHandler reads.\n const handleKeyDown = (e: h.JSX.TargetedKeyboardEvent<HTMLSpanElement>) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n e.currentTarget.click();\n }\n };\n\n return (\n <span\n className={\n `straumur__card-component__dual-branding--logo` +\n (isSelected ? \" straumur__card-component__dual-branding--logo--selected\" : \"\")\n }\n title={brand}\n data-value={brand}\n onClick={onBrandClick}\n onKeyDown={handleKeyDown}\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={brandName ?? brand}\n tabIndex={0}\n >\n <div className=\"straumur__card-component__dual-branding--logo--item\">\n <RenderBrandIcon brand={brand} defaultToBrandName={false} />\n &nbsp;{brandName ?? \"\"}\n </div>\n {isSelected && <CheckmarkIcon color=\"var(--straumur__color-neon-green-zeta)\" />}\n </span>\n );\n}\n\nexport function RenderDualBrandComponent({\n dualBrandConfiguration,\n selectedBrand,\n onBrandClick,\n}: RenderDualBrandComponentProps): h.JSX.Element {\n return (\n <div className=\"straumur__card-component__dual-branding\" role=\"radiogroup\" aria-label=\"Card brand\">\n <BrandOption\n brand={dualBrandConfiguration.brand1}\n brandName={dualBrandConfiguration.brand1Name}\n isSelected={selectedBrand === dualBrandConfiguration.brand1}\n onBrandClick={onBrandClick}\n />\n <BrandOption\n brand={dualBrandConfiguration.brand2}\n brandName={dualBrandConfiguration.brand2Name}\n isSelected={selectedBrand === dualBrandConfiguration.brand2}\n onBrandClick={onBrandClick}\n />\n </div>\n );\n}\n\nexport type { DualBrandConfiguration };\n","import { Language, TranslationKey } from \"../localizations/translations\";\nimport { PublicLocale } from \"../localizations/locale\";\nimport { OpenDefaultPaymentMethod, PaymentMethod, PaymentMethodOrder } from \"./constants\";\nimport { ICreateDetailsBody, ICreatePaymentBody } from \"../adapter/models\";\nimport { PaymentMethodsResponse } from \"../services/models\";\n\n// configuration options shared by both session and advanced mode\ntype StraumurWebBaseConfiguration = {\n environment: \"test\" | \"live\";\n onPaymentCompleted?: (data: PaymentCompletedData) => void;\n onPaymentFailed?: (data: PaymentFailedData) => void;\n placeholders?: Placeholders;\n locale?: PublicLocale;\n localizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>;\n instantPayments?: UniqueInstantPayments;\n hideSubmitButton?: boolean;\n onCardValidityChanged?: (isValid: boolean, isActive: boolean) => void;\n allowedPaymentMethods?: PaymentMethod[];\n /**\n * Top-to-bottom order of the payment-method options. Tokens: \"card\", \"storedcard\", \"googlepay\",\n * \"applepay\", and \"instantpayments\" (the express wallet row). A wallet listed in `instantPayments`\n * renders only inside the \"instantpayments\" slot, never standalone, so its standalone token here is\n * effectively ignored. Any available method you omit is appended in the default order. Defaults to\n * [\"instantpayments\", \"storedcard\", \"card\", \"googlepay\", \"applepay\"].\n */\n orderPaymentMethods?: PaymentMethodOrder[];\n /**\n * Which payment method to open (expand) on load: \"card\", \"firstStoredCard\", \"googlepay\" or\n * \"applepay\". If that method isn't available — a wallet that's in `instantPayments`, or\n * \"firstStoredCard\" with no saved cards — it's ignored and no method is pre-opened (the chooser\n * stays collapsed). Omit for the same collapsed default.\n */\n openDefaultPaymentMethod?: OpenDefaultPaymentMethod;\n /**\n * Color theme for the widget. Accepts a mode (\"light\" | \"dark\" | \"system\"), or a\n * {@link ThemeConfiguration} object to also override the wallet button styling. \"system\" follows\n * the shopper's OS/browser preference (`prefers-color-scheme`) and updates live if it changes.\n * Defaults to \"light\".\n */\n theme?: Theme | ThemeConfiguration;\n};\n\nexport type Theme = \"light\" | \"dark\" | \"system\";\n\n/** The resolved theme actually applied to the DOM (\"system\" collapses to one of these). */\nexport type ResolvedTheme = \"light\" | \"dark\";\n\n/** Google Pay button style override: \"white\" = light button, \"dark\" = black button. */\nexport type GooglePayButtonTheme = \"dark\" | \"white\";\n\n/** Apple Pay button style override: \"light\" = white button, \"dark\" = black button. */\nexport type ApplePayButtonTheme = \"dark\" | \"light\";\n\n/**\n * Object form of `theme`: the widget color mode plus optional per-wallet button overrides.\n * When an override is omitted the wallet button follows the mode — a light widget gets a\n * light/white button, a dark widget gets a black one.\n */\nexport type ThemeConfiguration = {\n theme: Theme;\n googlePayButtonTheme?: GooglePayButtonTheme;\n applePayButtonTheme?: ApplePayButtonTheme;\n};\n\n// the public configuration (session mode): the component loads everything itself from the Straumur API using the sessionId\nexport type StraumurWebConfiguration = StraumurWebBaseConfiguration & {\n sessionId: string;\n};\n\n// INTERNAL — advanced mode: the host page provides the payment methods and controls all network calls\n// through onSubmit / onAdditionalDetails (and optionally onDisableToken).\n// Used only by Straumur's own Hosted Checkout page; not exported from the package entry point,\n// not documented for integrators, and not part of the supported public API.\nexport type StraumurWebAdvancedConfiguration = StraumurWebBaseConfiguration & {\n sessionId?: never;\n clientKey: string;\n countryCode: string;\n paymentMethods: PaymentMethodsResponse;\n /**\n * The amount of the transaction, in minor units. For example, value 1000 means 10.00.\n */\n amount: { value: number; currency: string };\n formattedAmount: string;\n merchantName: string;\n enableStoreDetails: \"Enabled\" | \"Disabled\" | \"AskForConsent\";\n onSubmit: (state: AdvancedSubmitState, actions: AdvancedPaymentActions) => void | Promise<void>;\n onAdditionalDetails: (state: AdvancedAdditionalDetailsState, actions: AdvancedPaymentActions) => void | Promise<void>;\n onDisableToken?: (data: DisableTokenData, actions: DisableTokenActions) => void | Promise<void>;\n /**\n * Called before a payment is submitted. Return false to abort the submission.\n * Keep it synchronous when Apple Pay is offered — the payment sheet must open within the user gesture.\n */\n onBeforeSubmit?: () => boolean | Promise<boolean>;\n};\n\n// INTERNAL — union the constructor actually accepts at runtime (public signature stays session-only)\nexport type StraumurWebInternalConfiguration = StraumurWebConfiguration | StraumurWebAdvancedConfiguration;\n\nconst RESULT_CODES = [\n \"AuthenticationFinished\",\n \"AuthenticationNotRequired\",\n \"Authorised\",\n \"Cancelled\",\n \"ChallengeShopper\",\n \"Error\",\n \"IdentifyShopper\",\n \"PartiallyAuthorised\",\n \"Pending\",\n \"PresentToShopper\",\n \"Received\",\n \"RedirectShopper\",\n \"Refused\",\n] as const;\n\nexport type ResultCode = (typeof RESULT_CODES)[number];\n\n/** Narrows a resultCode string from the Adyen boundary to our ResultCode union; unknown values map to \"Error\". */\nexport function toResultCode(value: string | undefined): ResultCode {\n return value && (RESULT_CODES as readonly string[]).includes(value) ? (value as ResultCode) : \"Error\";\n}\n\nexport type PaymentCompletedData = {\n resultCode: ResultCode;\n};\n\nexport type PaymentFailedData = {\n resultCode: ResultCode;\n};\n\nexport type AdvancedSubmitState = {\n data: Omit<ICreatePaymentBody, \"sessionId\">;\n};\n\nexport type AdvancedAdditionalDetailsState = {\n data: Omit<ICreateDetailsBody, \"sessionId\">;\n};\n\nexport type PaymentFlowResult = {\n resultCode: ResultCode;\n action?: unknown;\n /**\n * Optional buyer-friendly failure message shown on the built-in failure screen\n * instead of the generic localized one (advanced mode only).\n */\n errorMessage?: string;\n};\n\nexport type AdvancedPaymentActions = {\n resolve: (result: PaymentFlowResult) => void;\n reject: (errorMessage?: string) => void;\n};\n\nexport type DisableTokenData = {\n storedPaymentMethodId: string;\n};\n\nexport type DisableTokenActions = {\n resolve: () => void;\n reject: () => void;\n};\n\n// abstraction over how payments reach the backend: session mode calls the Straumur API itself,\n// advanced mode delegates to the host page's handlers\nexport interface PaymentFlow {\n submitPayment(data: AdvancedSubmitState[\"data\"]): Promise<PaymentFlowResult>;\n submitAdditionalDetails(data: AdvancedAdditionalDetailsState[\"data\"]): Promise<PaymentFlowResult>;\n disableToken?: (storedPaymentMethodId: string) => Promise<void>;\n beforeSubmit?: () => boolean | Promise<boolean>;\n}\n\n// message shown on the built-in result screens: either a translation key or raw text supplied by the host\nexport type ResultMessage = { key: TranslationKey } | { text: string };\n\ntype UniqueInstantPayments =\n | [Extract<PaymentMethod, \"googlepay\">]\n | [Extract<PaymentMethod, \"applepay\">]\n | [Extract<PaymentMethod, \"googlepay\">, Extract<PaymentMethod, \"applepay\">]\n | [Extract<PaymentMethod, \"applepay\">, Extract<PaymentMethod, \"googlepay\">];\n\n// this will be used for internal configuration of the checkout component\nexport type StraumurCheckoutConfiguration = {\n mode: \"session\" | \"advanced\";\n sessionId?: string;\n environment: \"test\" | \"live\";\n countryCode: string;\n paymentFlow: PaymentFlow;\n onPaymentCompleted?: (data: PaymentCompletedData) => void;\n onPaymentFailed?: (data: PaymentFailedData) => void;\n placeholders?: Placeholders;\n locale: Language;\n customLocalizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>;\n instantPayments?: UniqueInstantPayments;\n hideSubmitButton?: boolean;\n onCardValidityChanged?: (isValid: boolean, isActive: boolean) => void;\n allowedPaymentMethods?: PaymentMethod[];\n orderPaymentMethods?: PaymentMethodOrder[];\n openDefaultPaymentMethod?: OpenDefaultPaymentMethod;\n theme: Theme;\n googlePayButtonTheme?: GooglePayButtonTheme;\n applePayButtonTheme?: ApplePayButtonTheme;\n};\n\n// What updateConfig() accepts: internal config fields minus the immutable ones,\n// with locale in the public short-code vocabulary.\nexport type StraumurCheckoutUpdateOptions = Partial<\n Omit<StraumurCheckoutConfiguration, \"mode\" | \"paymentFlow\" | \"locale\">\n> & {\n locale?: PublicLocale;\n};\n\ntype PlaceholderKeys =\n \"cardNumber\" | \"expiryDate\" | \"expiryMonth\" | \"expiryYear\" | \"securityCodeThreeDigits\" | \"securityCodeFourDigits\";\n\n// Partial makes all records optional so we can have a configuration without placeholders\n// Record creates a type with keys of type PlaceholderKeys and values of type string\nexport type Placeholders = Partial<Record<PlaceholderKeys, string>>;\n\nexport type ErrorCode = TranslationKey;\n","import { ICreateDetailsBody, ICreatePaymentBody, IPostDisableTokenBody } from \"../adapter/models\";\nimport { createDetailsRequest, createPaymentRequest, postDisableTokenRequest } from \"../adapter/straumur-adapter\";\nimport { PaymentFlow, PaymentFlowResult, ResultMessage, StraumurWebAdvancedConfiguration } from \"../models/models\";\nimport { TranslationKey } from \"../localizations/translations\";\n\nexport class PaymentFlowError extends Error {\n messageKey: TranslationKey;\n messageText?: string;\n\n constructor(messageKey: TranslationKey, messageText?: string) {\n super(messageText ?? messageKey);\n this.messageKey = messageKey;\n this.messageText = messageText;\n }\n}\n\nexport function toResultMessage(error: unknown, fallbackKey: TranslationKey): ResultMessage {\n if (error instanceof PaymentFlowError) {\n return error.messageText ? { text: error.messageText } : { key: error.messageKey };\n }\n\n return { key: fallbackKey };\n}\n\nexport function createSessionPaymentFlow(environment: \"test\" | \"live\", sessionId: string): PaymentFlow {\n return {\n async submitPayment(data) {\n const body: ICreatePaymentBody = { ...data, sessionId };\n\n const fetchResponse = await createPaymentRequest(environment, body);\n\n // We will always get 200 OK unless there is an error in our server code.\n // Payment unsuccessful still returns 200 OK, but with resultCode Refused.\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitPayment\");\n }\n\n const response = await fetchResponse.json();\n\n // ResultCode should never be empty.\n if (!response.resultCode) {\n throw new PaymentFlowError(\"error.paymentFailed\");\n }\n\n return { resultCode: response.resultCode, action: response.action };\n },\n async submitAdditionalDetails(data) {\n const body: ICreateDetailsBody = { ...data, sessionId };\n\n const fetchResponse = await createDetailsRequest(environment, body);\n\n // We will always get 200 OK unless there is an error in our server code.\n // Payment unsuccessful still returns 200 OK, but with resultCode Refused.\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitPaymentDetails\");\n }\n\n const response = await fetchResponse.json();\n\n // ResultCode should always be either Authorised or Refused or IdentifyShopper. Never empty.\n if (!response.resultCode) {\n throw new PaymentFlowError(\"error.paymentDetailsFailed\");\n }\n\n return { resultCode: response.resultCode, action: response.action };\n },\n async disableToken(storedPaymentMethodId) {\n const body: IPostDisableTokenBody = { storedPaymentMethodId, sessionId };\n\n const fetchResponse = await postDisableTokenRequest(environment, body);\n\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitRemoveStoredPaymentCard\");\n }\n\n const disableTokenResponse = await fetchResponse.json();\n\n if (!disableTokenResponse.success) {\n throw new PaymentFlowError(\"error.failedToRemoveStoredPaymentCard\");\n }\n },\n };\n}\n\nexport function createAdvancedPaymentFlow(configuration: StraumurWebAdvancedConfiguration): PaymentFlow {\n // Wraps whatever the host handler throws (synchronously or asynchronously) in a PaymentFlowError,\n // so callers can rely on a single error contract.\n function invokeHostHandler<T>(\n invoke: (resolve: (value: T) => void, reject: (error: PaymentFlowError) => void) => void | Promise<void>,\n resolve: (value: T) => void,\n reject: (error: unknown) => void,\n thrownErrorKey: TranslationKey\n ): void {\n const rejectWithFlowError = (error: unknown) =>\n reject(error instanceof PaymentFlowError ? error : new PaymentFlowError(thrownErrorKey));\n\n try {\n Promise.resolve(invoke(resolve, reject)).catch(rejectWithFlowError);\n } catch (error) {\n rejectWithFlowError(error);\n }\n }\n\n const flow: PaymentFlow = {\n submitPayment(data) {\n return new Promise<PaymentFlowResult>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n configuration.onSubmit(\n { data },\n {\n resolve: res,\n reject: (errorMessage) => rej(new PaymentFlowError(\"error.failedToSubmitPayment\", errorMessage)),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitPayment\"\n );\n });\n },\n submitAdditionalDetails(data) {\n return new Promise<PaymentFlowResult>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n configuration.onAdditionalDetails(\n { data },\n {\n resolve: res,\n reject: (errorMessage) => rej(new PaymentFlowError(\"error.failedToSubmitPaymentDetails\", errorMessage)),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitPaymentDetails\"\n );\n });\n },\n beforeSubmit: configuration.onBeforeSubmit,\n };\n\n const { onDisableToken } = configuration;\n\n if (onDisableToken) {\n flow.disableToken = (storedPaymentMethodId) =>\n new Promise<void>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n onDisableToken(\n { storedPaymentMethodId },\n {\n resolve: () => res(),\n reject: () => rej(new PaymentFlowError(\"error.failedToRemoveStoredPaymentCard\")),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitRemoveStoredPaymentCard\"\n );\n });\n }\n\n return flow;\n}\n","import { PaymentFlow } from \"../../models/models\";\n\n/** Runs the flow's optional beforeSubmit gate; resolves to whether submission may proceed. */\nexport async function runBeforeSubmit(paymentFlow: PaymentFlow): Promise<boolean> {\n const { beforeSubmit } = paymentFlow;\n\n return !beforeSubmit || (await beforeSubmit());\n}\n\n/**\n * Card submit-button behavior shared by card-form and stored-card: run the beforeSubmit gate,\n * then submit the Adyen element (re-read after the gate — it may have been torn down while awaiting).\n */\nexport async function submitCardWithGate(\n paymentFlow: PaymentFlow,\n getElement: () => { submit: () => void } | undefined | null\n): Promise<void> {\n if (!getElement()) {\n return;\n }\n\n if (!(await runBeforeSubmit(paymentFlow))) {\n return;\n }\n\n getElement()?.submit();\n}\n\n// Adyen wallet elements support onClick(resolve, reject) before opening the payment sheet.\n// Apple Pay requires resolve() within the user gesture, so keep beforeSubmit synchronous when Apple Pay is offered —\n// this handler must NOT be collapsed into the async runBeforeSubmit path.\nexport function createBeforeSubmitClickHandler(paymentFlow: PaymentFlow) {\n return (resolve: () => void, reject: () => void): void => {\n const { beforeSubmit } = paymentFlow;\n\n if (!beforeSubmit) {\n resolve();\n return;\n }\n\n const result = beforeSubmit();\n\n if (result instanceof Promise) {\n result.then((valid) => (valid ? resolve() : reject())).catch(() => reject());\n return;\n }\n\n if (result) {\n resolve();\n return;\n }\n\n reject();\n };\n}\n","import {\n AdditionalDetailsActions,\n AdditionalDetailsData,\n PaymentCompletedData,\n PaymentFailedData,\n SubmitActions,\n SubmitData,\n UIElement,\n UIElementProps,\n} from \"@adyen/adyen-web\";\nimport {\n AdvancedSubmitState,\n ResultCode,\n ResultMessage,\n StraumurCheckoutConfiguration,\n toResultCode,\n} from \"../../models/models\";\nimport { toResultMessage } from \"../../flows/payment-flow\";\nimport { runBeforeSubmit } from \"./before-submit-click\";\n\nexport interface AdyenPaymentHandlersOptions {\n configuration: StraumurCheckoutConfiguration;\n handleSuccess: (message: ResultMessage) => void;\n handleError: (message: ResultMessage) => void;\n setThreeDSecureActive: (value: boolean) => void;\n enrichSubmitData?: (data: SubmitData[\"data\"]) => AdvancedSubmitState[\"data\"];\n onSubmitStart?: () => void;\n /**\n * Redirect-return path only (submitDetails after a 3DS redirect): that Adyen bootstrap wires\n * no core-level onPaymentCompleted/onPaymentFailed, so the additional-details handler must\n * dispatch the final result itself. Leave unset for mounted components — Adyen invokes the\n * core-level callbacks there, and dispatching here too would double-fire the merchant callbacks.\n */\n dispatchResultFromAdditionalDetails?: boolean;\n}\n\nexport interface AdyenPaymentHandlers {\n handleOnSubmit: (state: SubmitData, element: UIElement<UIElementProps>, actions: SubmitActions) => Promise<void>;\n handleOnSubmitAdditionalData: (\n state: AdditionalDetailsData,\n element: UIElement<UIElementProps>,\n actions: AdditionalDetailsActions\n ) => Promise<void>;\n handlePaymentCompleted: (data: PaymentCompletedData, element?: UIElement<UIElementProps>) => void;\n handlePaymentFailed: (data?: PaymentFailedData, element?: UIElement<UIElementProps>) => void;\n}\n\n// Merchant callbacks follow Adyen Web 6 semantics: these resultCodes are failures.\nconst FAILED_RESULT_CODES: readonly ResultCode[] = [\"Refused\", \"Cancelled\", \"Error\"];\n\nexport function createAdyenPaymentHandlers(options: AdyenPaymentHandlersOptions): AdyenPaymentHandlers {\n const {\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData,\n onSubmitStart,\n dispatchResultFromAdditionalDetails,\n } = options;\n\n // Buyer-friendly failure message from the host (advanced mode). Set on submit, shown when the payment fails.\n let failureMessage: string | undefined;\n\n function failureResultMessage(): ResultMessage {\n return failureMessage ? { text: failureMessage } : { key: \"error.paymentUnsuccessful\" };\n }\n\n function dispatchFinalResult(resultCode: ResultCode): void {\n // The built-in screens keep their own rule: the success screen only for Authorised.\n if (resultCode === \"Authorised\") {\n handleSuccess({ key: \"success.paymentAuthorized\" });\n } else {\n handleError(failureResultMessage());\n }\n\n if (FAILED_RESULT_CODES.includes(resultCode)) {\n configuration.onPaymentFailed?.({ resultCode });\n } else {\n configuration.onPaymentCompleted?.({ resultCode });\n }\n }\n\n async function handleOnSubmit(state: SubmitData, _: UIElement<UIElementProps>, actions: SubmitActions) {\n onSubmitStart?.();\n\n const { paymentFlow } = configuration;\n\n if (!(await runBeforeSubmit(paymentFlow))) {\n actions.reject();\n return;\n }\n\n try {\n const data = enrichSubmitData ? enrichSubmitData(state.data) : (state.data as AdvancedSubmitState[\"data\"]);\n\n const { resultCode, action, errorMessage } = await paymentFlow.submitPayment(data);\n\n failureMessage = errorMessage;\n\n if (resultCode === \"ChallengeShopper\" || resultCode === \"IdentifyShopper\") {\n setThreeDSecureActive(true);\n }\n\n // If the /payments request from your server is successful, you must call this to resolve whichever of the listed objects are available.\n // You must call this, even if the result of the payment is unsuccessful.\n actions.resolve({ resultCode, action } as Parameters<SubmitActions[\"resolve\"]>[0]);\n } catch (error) {\n actions.reject();\n handleError(toResultMessage(error, \"error.failedToSubmitPayment\"));\n }\n }\n\n async function handleOnSubmitAdditionalData(\n state: AdditionalDetailsData,\n _: UIElement<UIElementProps>,\n actions: AdditionalDetailsActions\n ) {\n try {\n const { resultCode, action, errorMessage } = await configuration.paymentFlow.submitAdditionalDetails(state.data);\n\n failureMessage = errorMessage;\n\n // If the /payments/details request from your server is successful, you must call this to resolve whichever of the listed objects are available.\n // You must call this, even if the result of the payment is unsuccessful.\n actions.resolve({ resultCode, action } as Parameters<AdditionalDetailsActions[\"resolve\"]>[0]);\n\n if (dispatchResultFromAdditionalDetails) {\n dispatchFinalResult(resultCode);\n }\n } catch (error) {\n actions.reject();\n handleError(toResultMessage(error, \"error.failedToSubmitPaymentDetails\"));\n\n if (dispatchResultFromAdditionalDetails) {\n configuration.onPaymentFailed?.({ resultCode: \"Error\" });\n }\n }\n }\n\n function handlePaymentCompleted(data: PaymentCompletedData, _?: UIElement<UIElementProps> | undefined): void {\n dispatchFinalResult(toResultCode(data.resultCode));\n }\n\n function handlePaymentFailed(data?: PaymentFailedData | undefined, _?: UIElement<UIElementProps> | undefined): void {\n // Adyen occasionally reports failure without a payload; synthesize one so the\n // merchant callback always receives a resultCode.\n dispatchFinalResult(data ? toResultCode(data.resultCode) : \"Error\");\n }\n\n return { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed };\n}\n","import { useEffect } from \"preact/hooks\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\n\n/**\n * Re-initializes an Adyen element when the checkout configuration changes.\n *\n * Adyen elements cannot change locale through `.update()` (Adyen issue #2407), so an\n * already-initialized component must be torn down and rebuilt. The configuration object's\n * identity is the trigger: `updateConfig`/`setLanguage` create a fresh object per change,\n * while re-renders reuse the same one.\n *\n * @param configuration the internal checkout configuration (identity-stable per config change)\n * @param isReady whether the Adyen element is currently initialized and safe to rebuild\n * @param reinitialize tears down (if needed) and rebuilds the Adyen element\n */\nexport function useAdyenLocaleReinit(\n configuration: StraumurCheckoutConfiguration,\n isReady: () => boolean,\n reinitialize: () => void\n): void {\n useEffect(() => {\n if (isReady()) {\n reinitialize();\n }\n // Deliberately keyed on configuration identity only: isReady/reinitialize are\n // fresh closures every render and must not re-trigger the rebuild.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [configuration]);\n}\n","import { useEffect } from \"preact/hooks\";\nimport { RefObject } from \"preact\";\n\n/**\n * Moves keyboard focus into `ref` when `active` transitions from false to true.\n *\n * Used when a 3-D Secure challenge takes over the widget: the content the shopper was\n * interacting with is replaced, so focus must follow into the challenge or a keyboard /\n * screen-reader user is stranded on a now-hidden control. The target needs `tabIndex={-1}`\n * to be programmatically focusable.\n *\n * The dependency array does the gating: the effect only runs when `active` changes, so a\n * re-render while it stays active will not steal focus back.\n */\nexport function useFocusOnActivate(ref: RefObject<HTMLElement>, active: boolean): void {\n useEffect(() => {\n if (active) {\n ref.current?.focus();\n }\n }, [active, ref]);\n}\n","import { useEffect, useState } from \"preact/hooks\";\nimport { ResolvedTheme, Theme } from \"../../models/models\";\n\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nfunction systemPrefersDark(): boolean {\n return typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(DARK_QUERY).matches\n : false;\n}\n\n/**\n * Resolves a Theme to the concrete \"light\" | \"dark\" applied to the DOM.\n *\n * For \"system\" it reads `prefers-color-scheme` and subscribes to changes, so the widget\n * flips live when the shopper switches their OS/browser appearance. For explicit\n * \"light\"/\"dark\" it returns that value and attaches no listener.\n */\nexport function useResolvedTheme(theme: Theme): ResolvedTheme {\n const [systemDark, setSystemDark] = useState<boolean>(systemPrefersDark);\n\n useEffect(() => {\n if (theme !== \"system\" || typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return;\n }\n\n const query = window.matchMedia(DARK_QUERY);\n const onChange = (event: MediaQueryListEvent) => setSystemDark(event.matches);\n\n // Re-sync in case the preference changed between mount and effect.\n setSystemDark(query.matches);\n query.addEventListener(\"change\", onChange);\n\n return () => query.removeEventListener(\"change\", onChange);\n }, [theme]);\n\n if (theme === \"system\") {\n return systemDark ? \"dark\" : \"light\";\n }\n\n return theme;\n}\n","import { ResolvedTheme } from \"../models/models\";\n\n/**\n * Color values for the Adyen secured-field iframes (card number / expiry / CVC).\n *\n * Those fields render inside cross-origin iframes our CSS cannot reach, so their text,\n * placeholder, and error colors must be passed to Adyen as literal values — they cannot use\n * the CSS custom properties in styles/main.css. Keep these in sync with the palette tokens\n * there (the light values mirror --straumur__color-text / -secondary / -red-beta, the dark\n * values mirror their [data-theme=\"dark\"] overrides).\n *\n * Structurally compatible with Adyen's StylesObject (which the SDK does not export).\n */\nexport function getAdyenFieldStyles(theme: ResolvedTheme) {\n if (theme === \"dark\") {\n return {\n base: { color: \"#e8edf2\" },\n // Lighter than the palette's -secondary so the placeholder stays legible on the dark input.\n placeholder: { color: \"#aab4bf\" },\n error: { color: \"#e08a8a\" },\n };\n }\n\n return {\n base: { color: \"#00112c\" },\n placeholder: { color: \"#72889d\" },\n error: { color: \"#d96666\" },\n };\n}\n","import { h, ComponentChildren } from \"preact\";\nimport \"./payment-method-item.css\";\n\ninterface PaymentMethodItemProps {\n icon: h.JSX.Element;\n title: string;\n isActive: boolean;\n isSole: boolean;\n onChange: () => void;\n children: ComponentChildren;\n headerRight?: h.JSX.Element | null;\n confirmSection?: h.JSX.Element;\n}\n\nfunction PaymentMethodItem({\n icon,\n title,\n isActive,\n isSole,\n onChange,\n children,\n headerRight,\n confirmSection,\n}: PaymentMethodItemProps): h.JSX.Element {\n return (\n <label className={`straumur__payment-method-item${isSole ? \" straumur__payment-method-item--sole\" : \"\"}`}>\n {!isSole && (\n <input\n type=\"radio\"\n className=\"straumur__payment-method-item__radio-selector\"\n checked={isActive}\n onChange={onChange}\n />\n )}\n <span\n className={`straumur__payment-method-item__content${isSole ? \" straumur__payment-method-item__content--expanded\" : \"\"}`}\n >\n {!isSole && <span className=\"straumur__payment-method-item--circle\" />}\n {icon}\n <span className=\"straumur__payment-method-item--title\">{title}</span>\n {headerRight}\n </span>\n {confirmSection}\n <div\n className={`straumur__payment-method-item__expandable${isSole ? \" straumur__payment-method-item__expandable--visible\" : \"\"}`}\n >\n {children}\n </div>\n </label>\n );\n}\n\nexport default PaymentMethodItem;\n","import styleInject from '#style-inject';styleInject(\".straumur__payment-method-item{position:relative;cursor:pointer;background:var(--straumur__color-white);border-radius:var(--straumur__border-radius-lg);transition:all .3s ease;padding:var(--straumur__space-xxlg) var(--straumur__space-5xlg)}.straumur__payment-method-item--sole{cursor:default}.straumur__payment-method-item:has(.straumur__payment-method-item__radio-selector:checked){cursor:default}.straumur__payment-method-item__radio-selector{position:absolute;opacity:0;cursor:pointer}.straumur__payment-method-item__content{display:flex;align-items:center;gap:var(--straumur__space-lg);transition:background-color .3s ease}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content{padding-bottom:var(--straumur__space-xxlg)}.straumur__payment-method-item__content--expanded{padding-bottom:var(--straumur__space-xxlg)}.straumur__payment-method-item--circle{width:var(--straumur__space-5xlg);height:var(--straumur__space-5xlg);border:1px solid var(--straumur__color-cosmos-blue-gamma);background:var(--straumur__color-secondary-gamma);border-radius:50%;position:relative;transition:all .3s ease;flex-shrink:0}.straumur__payment-method-item__content:hover .straumur__payment-method-item--circle{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__payment-method-item--circle:after{content:\\\"\\\";position:absolute;width:100%;height:100%;border-radius:50%;top:50%;left:50%;transform:translate(-50%,-50%) scale(0);transition:transform .2s ease}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content .straumur__payment-method-item--circle{background:var(--straumur__color-blue-beta);border-color:var(--straumur__color-transparent)}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content .straumur__payment-method-item--circle:after{transform:translate(-50%,-50%) scale(1);background:var(--straumur__color-primary);height:var(--straumur__space-md);width:var(--straumur__space-md)}.straumur__payment-method-item--title{color:var(--straumur__color-text);font-size:16px;user-select:none}.straumur__payment-method-item__expandable{background:var(--straumur__color-white);max-height:0;overflow:hidden;transition:all .3s ease;opacity:0}.straumur__payment-method-item__radio-selector:checked~.straumur__payment-method-item__expandable{max-height:600px;opacity:1}.straumur__payment-method-item__expandable--visible{max-height:600px;opacity:1}\\n\")","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./google-pay-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport GooglePayIcon from \"../../assets/icons/googlepay\";\nimport GooglePayButton from \"../../components/google-pay-button/google-pay-button\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\ninterface GooglePayComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction GooglePayComponent({ configuration, paymentMethods }: GooglePayComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasGooglePay } =\n usePaymentMethodGroup();\n const [isUnavailable, setIsUnavailable] = useState(false);\n\n if (!hasGooglePay || isUnavailable) {\n return null;\n }\n\n if (configuration.instantPayments && configuration.instantPayments.some((x) => x === \"googlepay\")) {\n return null;\n }\n\n if (isObscuredByThreeDS(\"googlepay\")) {\n return null;\n }\n\n return (\n <PaymentMethodItem\n icon={<GooglePayIcon />}\n title={i18n.t(\"googlePay.title\")}\n isActive={activePaymentMethod === \"googlepay\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"googlepay\")}\n >\n <GooglePayButton\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={false}\n onUnavailable={() => setIsUnavailable(true)}\n />\n </PaymentMethodItem>\n );\n}\n\nexport default GooglePayComponent;\n","import styleInject from '#style-inject';styleInject(\".adyen-checkout__paywithgoogle{height:var(--straumur__space-8xlg)}\\n\")","import { h } from \"preact\";\n\nconst GooglePayIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\">\n <path\n fill=\"#fff\"\n d=\"M29.13 2.41H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z\"\n />\n <path\n fill=\"#3C4043\"\n d=\"M29.13 3.27c1.28 0 2.52.26 3.7.77a9.6 9.6 0 0 1 5.08 5.19 9.78 9.78 0 0 1 0 7.55 9.83 9.83 0 0 1-5.08 5.18 9.26 9.26 0 0 1-3.7.77H10.87a9.24 9.24 0 0 1-3.7-.77 9.6 9.6 0 0 1-5.08-5.18 9.78 9.78 0 0 1 0-7.55 9.83 9.83 0 0 1 5.08-5.19 9.24 9.24 0 0 1 3.7-.77h18.26Zm0-.86H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z\"\n />\n <path\n fill=\"#3C4043\"\n d=\"M19.1 13.75v3.2h-1v-7.9h2.64c.67 0 1.24.23 1.7.68.49.46.72 1.01.72 1.67a2.2 2.2 0 0 1-.71 1.68c-.46.45-1.03.67-1.7.67H19.1Zm0-3.73v2.76h1.66c.4 0 .73-.14.99-.4.26-.28.4-.6.4-.98 0-.36-.14-.68-.4-.95a1.28 1.28 0 0 0-.99-.42H19.1Zm6.67 1.35c.73 0 1.31.2 1.74.6.42.4.64.95.64 1.65v3.34h-.95v-.76h-.04a1.9 1.9 0 0 1-1.65.93 2.1 2.1 0 0 1-1.46-.53c-.4-.35-.6-.8-.6-1.32 0-.56.21-1 .63-1.34.41-.33.97-.5 1.66-.5.59 0 1.07.12 1.45.34v-.23c0-.36-.13-.65-.4-.9a1.4 1.4 0 0 0-.97-.37c-.56 0-1 .24-1.32.72l-.88-.56a2.42 2.42 0 0 1 2.15-1.07Zm-1.29 3.92c0 .27.11.5.33.67.22.17.48.26.78.26.42 0 .79-.16 1.12-.48.32-.31.49-.68.49-1.11a2.02 2.02 0 0 0-1.3-.38c-.4 0-.74.1-1.01.3a.9.9 0 0 0-.4.74Zm9.08-3.75-3.32 7.8h-1.02l1.23-2.73-2.19-5.07h1.09l1.57 3.89h.02l1.54-3.89h1.08Z\"\n />\n <path\n fill=\"#4285F4\"\n d=\"M15.14 13.1c0-.32-.03-.64-.09-.95h-4.17v1.75h2.4a2.1 2.1 0 0 1-.89 1.4v1.14h1.43a4.49 4.49 0 0 0 1.32-3.33Z\"\n />\n <path fill=\"#34A853\" d=\"M12.4 15.3a2.66 2.66 0 0 1-4-1.44H6.9v1.18a4.43 4.43 0 0 0 6.91 1.4l-1.43-1.13Z\" />\n <path\n fill=\"#FABB05\"\n d=\"M8.25 13c0-.3.05-.59.14-.86v-1.17H6.9a4.59 4.59 0 0 0 0 4.07l1.48-1.17a2.79 2.79 0 0 1-.14-.86Z\"\n />\n <path\n fill=\"#E94235\"\n d=\"M10.88 10.27c.66 0 1.24.23 1.7.68l1.27-1.3a4.22 4.22 0 0 0-2.97-1.18 4.44 4.44 0 0 0-3.97 2.5l1.48 1.17a2.66 2.66 0 0 1 2.5-1.87Z\"\n />\n </svg>\n);\n\nexport default GooglePayIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__google-pay-button__loading{display:flex;justify-content:center}\\n\")","import \"./google-pay-button.css\";\nimport { h } from \"preact\";\nimport WalletButton, { WalletButtonProps } from \"../shared/wallet-button\";\n\ntype GooglePayButtonProps = Omit<WalletButtonProps, \"method\">;\n\nfunction GooglePayButton(props: GooglePayButtonProps): h.JSX.Element | null {\n return <WalletButton method=\"googlepay\" {...props} />;\n}\n\nexport default GooglePayButton;\n","import { Fragment, h } from \"preact\";\nimport { useEffect, useRef } from \"preact/hooks\";\nimport {\n AdyenCheckout,\n AdyenCheckoutError,\n ApplePay,\n ApplePayConfiguration,\n GooglePay,\n GooglePayConfiguration,\n ICore,\n UIElement,\n UIElementProps,\n} from \"@adyen/adyen-web\";\nimport { usePaymentMethodGroup } from \"../payment-method-group/payment-method-group-context\";\nimport { ResolvedTheme, StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { CANCEL } from \"../../models/constants\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { AdyenPaymentHandlers, createAdyenPaymentHandlers } from \"./create-adyen-handlers\";\nimport { createBeforeSubmitClickHandler } from \"./before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { resolveApplePayButtonColor, resolveGooglePayButtonColor } from \"../../utils/wallet-button-theme\";\n\nexport type WalletMethod = \"applepay\" | \"googlepay\";\n\nexport interface WalletButtonProps {\n method: WalletMethod;\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n isInstantPayment: boolean;\n onUnavailable?: () => void;\n}\n\ntype WalletElement = ApplePay | GooglePay;\n\n/** Merchant identifiers Adyen requires inside the wallet element's configuration. */\ntype WalletMerchantConfig = { gatewayMerchantId: string; merchantId: string };\n\ninterface WalletContext {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n walletConfig: WalletMerchantConfig;\n handleOnSubmit: AdyenPaymentHandlers[\"handleOnSubmit\"];\n resolvedTheme: ResolvedTheme;\n}\n\ninterface WalletDescriptor {\n loadingClassName: string;\n createElement(core: ICore, context: WalletContext): WalletElement;\n}\n\n// Everything the two wallets share lives in WalletButton below; per-wallet differences\n// (the Adyen element class and its configuration deltas) live in this descriptor map.\nconst WALLETS: Record<WalletMethod, WalletDescriptor> = {\n applepay: {\n loadingClassName: \"straumur__apple-pay-button__loading\",\n createElement(core, { configuration, paymentMethods, walletConfig, handleOnSubmit, resolvedTheme }) {\n const applePayConfiguration: ApplePayConfiguration = {\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n environment: configuration.environment,\n onSubmit: handleOnSubmit,\n onClick: createBeforeSubmitClickHandler(configuration.paymentFlow),\n // Follows the widget theme (light → white-outline, dark → black); overridable via applePayButtonTheme.\n buttonColor: resolveApplePayButtonColor(resolvedTheme, configuration.applePayButtonTheme),\n configuration: {\n ...walletConfig,\n merchantName: paymentMethods.merchantName,\n },\n };\n\n return new ApplePay(core, applePayConfiguration);\n },\n },\n googlepay: {\n loadingClassName: \"straumur__google-pay-button__loading\",\n createElement(core, { configuration, paymentMethods, walletConfig, handleOnSubmit, resolvedTheme }) {\n const googlePayConfiguration: GooglePayConfiguration = {\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n challengeWindowSize: \"05\",\n countryCode: configuration.countryCode,\n environment: configuration.environment,\n onSubmit: handleOnSubmit,\n onClick: createBeforeSubmitClickHandler(configuration.paymentFlow),\n // Follows the widget theme (light → white, dark → black); overridable via googlePayButtonTheme.\n buttonColor: resolveGooglePayButtonColor(resolvedTheme, configuration.googlePayButtonTheme),\n buttonSizeMode: \"fill\",\n // px — Adyen draws the Google Pay button, so its radius can't come from CSS. Keep this in\n // sync with --straumur__border-radius-lg (12px), matching the payment-method \"card box\"\n // and the Apple Pay button (--apple-pay-button-border-radius), since the express wallet\n // buttons sit as tiles alongside that box.\n buttonRadius: 12,\n configuration: {\n ...walletConfig,\n merchantName: paymentMethods.merchantName,\n },\n };\n\n return new GooglePay(core, googlePayConfiguration);\n },\n },\n};\n\nfunction WalletButton({\n method,\n configuration,\n paymentMethods,\n isInstantPayment,\n onUnavailable,\n}: WalletButtonProps): h.JSX.Element | null {\n const wallet = WALLETS[method];\n const resolvedTheme = useResolvedTheme(configuration.theme);\n const walletElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const walletRef = useRef<WalletElement>();\n const {\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isObscuredByThreeDS,\n setActivePaymentMethod,\n activePaymentMethod,\n } = usePaymentMethodGroup();\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n onSubmitStart: () => {\n if (isInstantPayment) {\n setActivePaymentMethod(method);\n }\n },\n });\n\n function handleOnError(data: AdyenCheckoutError, _?: UIElement<UIElementProps> | undefined): void {\n if (data.name !== CANCEL) {\n handleError({ key: \"error.unknownError\" });\n }\n }\n\n function markUnavailable(): void {\n // Initialized-but-unavailable: the loader must disappear and the method must not stay selected.\n updatePaymentMethodInitialization(method, true);\n if (activePaymentMethod === method) {\n setActivePaymentMethod(null);\n }\n onUnavailable?.();\n }\n\n const initializeAdyenComponent = async () => {\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n paymentMethodsResponse: paymentMethods.paymentMethods,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n onError: handleOnError,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n const walletPaymentMethod = paymentMethods.paymentMethods.paymentMethods?.find((x) => x.type === method);\n const walletConfig = walletPaymentMethod?.configuration as WalletMerchantConfig | undefined;\n\n if (!walletConfig) {\n // No usable wallet configuration in the response: treat it like an unavailable wallet instead of crashing.\n markUnavailable();\n return;\n }\n\n walletRef.current = wallet.createElement(adyenCheckoutRef.current, {\n configuration,\n paymentMethods,\n walletConfig,\n handleOnSubmit,\n resolvedTheme,\n });\n\n walletRef.current\n .isAvailable()\n .then(() => {\n walletRef.current!.mount(walletElementRef.current!);\n updatePaymentMethodInitialization(method, true);\n })\n .catch(() => {\n markUnavailable();\n });\n };\n\n useEffect(() => {\n if (!isPaymentMethodInitialized[method]) {\n initializeAdyenComponent();\n }\n }, [configuration]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(walletRef.current && isPaymentMethodInitialized[method]),\n () => {\n walletRef.current!.remove();\n initializeAdyenComponent();\n }\n );\n\n if (isObscuredByThreeDS(method)) {\n return null;\n }\n\n return (\n <Fragment>\n {isPaymentMethodInitialized[method] === false && (\n <div className={wallet.loadingClassName}>\n <LoaderIcon />\n </div>\n )}\n <div\n ref={walletElementRef}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n position: isPaymentMethodInitialized[method] ? \"static\" : \"absolute\",\n }}\n />\n </Fragment>\n );\n}\n\nexport default WalletButton;\n","export type PaymentMethod = \"card\" | \"storedcard\" | \"googlepay\" | \"applepay\";\n\n/**\n * A slot in the rendered payment-method list: a standalone method, or \"instantpayments\" for the\n * express wallet row. Used to order the options via `orderPaymentMethods`.\n */\nexport type PaymentMethodOrder = PaymentMethod | \"instantpayments\";\n\n/**\n * Which payment method to open (expand) on load via `openDefaultPaymentMethod`. \"firstStoredCard\"\n * opens the first saved card. Ignored (nothing pre-opened, chooser stays collapsed) when the\n * requested method isn't available (e.g. a wallet that's in `instantPayments`, or no saved cards).\n */\nexport type OpenDefaultPaymentMethod = \"card\" | \"firstStoredCard\" | \"googlepay\" | \"applepay\";\n\nexport const NETWORK_ERROR = \"NETWORK_ERROR\";\nexport const CANCEL = \"CANCEL\";\nexport const IMPLEMENTATION_ERROR = \"IMPLEMENTATION_ERROR\";\nexport const API_ERROR = \"API_ERROR\";\nexport const ERROR = \"ERROR\";\nexport const SCRIPT_ERROR = \"SCRIPT_ERROR\";\nexport const SDK_ERROR = \"SDK_ERROR\";\n","import { ApplePayButtonTheme, GooglePayButtonTheme, ResolvedTheme } from \"../models/models\";\n\n// Adyen's own button-color unions, mirrored here so this util doesn't import the Adyen SDK just for\n// two string-literal types (keeps it trivially unit-testable).\ntype GooglePayButtonColor = \"default\" | \"black\" | \"white\";\ntype ApplePayButtonColor = \"black\" | \"white\" | \"white-outline\";\n\n/**\n * Google Pay button color derived from the resolved widget theme, overridable via\n * `googlePayButtonTheme`. Default: light widget → white button, dark widget → black button.\n */\nexport function resolveGooglePayButtonColor(\n theme: ResolvedTheme,\n override?: GooglePayButtonTheme\n): GooglePayButtonColor {\n const choice = override ?? (theme === \"dark\" ? \"dark\" : \"white\");\n\n return choice === \"dark\" ? \"black\" : \"white\";\n}\n\n/**\n * Apple Pay button style derived from the resolved widget theme, overridable via\n * `applePayButtonTheme`. Default: light widget → \"white-outline\" (a plain white button would vanish\n * against the widget's white surface), dark widget → black button.\n */\nexport function resolveApplePayButtonColor(theme: ResolvedTheme, override?: ApplePayButtonTheme): ApplePayButtonColor {\n const choice = override ?? (theme === \"dark\" ? \"dark\" : \"light\");\n\n return choice === \"dark\" ? \"black\" : \"white-outline\";\n}\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./apple-pay-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport ApplePayIcon from \"../../assets/icons/applepay\";\nimport ApplePayButton from \"../../components/apple-pay-button/apple-pay-button\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\ninterface ApplePayComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction ApplePayComponent({ configuration, paymentMethods }: ApplePayComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasApplePay } =\n usePaymentMethodGroup();\n const [isUnavailable, setIsUnavailable] = useState(false);\n\n if (!hasApplePay || isUnavailable) {\n return null;\n }\n\n if (configuration.instantPayments && configuration.instantPayments.some((x) => x === \"applepay\")) {\n return null;\n }\n\n if (isObscuredByThreeDS(\"applepay\")) {\n return null;\n }\n\n return (\n <PaymentMethodItem\n icon={<ApplePayIcon />}\n title={i18n.t(\"applePay.title\")}\n isActive={activePaymentMethod === \"applepay\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"applepay\")}\n >\n <ApplePayButton\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={false}\n onUnavailable={() => setIsUnavailable(true)}\n />\n </PaymentMethodItem>\n );\n}\n\nexport default ApplePayComponent;\n","import styleInject from '#style-inject';styleInject(\"\")","import { h } from \"preact\";\n\nconst ApplePayIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\">\n <path\n fill=\"#000\"\n d=\"M36.42 0H3.58a69.25 69.25 0 0 0-.75 0c-.25.01-.5.03-.76.07a2.51 2.51 0 0 0-1.32.7A2.43 2.43 0 0 0 .07 2.1 5.14 5.14 0 0 0 0 3.22v19.91c.01.25.03.51.07.76a2.6 2.6 0 0 0 .68 1.35 2.39 2.39 0 0 0 1.32.69 4.98 4.98 0 0 0 1.1.07h34a5 5 0 0 0 .76-.07 2.5 2.5 0 0 0 1.32-.7 2.44 2.44 0 0 0 .68-1.34 5.13 5.13 0 0 0 .07-1.11V2.87a6.5 6.5 0 0 0-.07-.76 2.58 2.58 0 0 0-.68-1.35 2.4 2.4 0 0 0-1.32-.69 4.96 4.96 0 0 0-1.1-.07h-.41Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M36.42.87h.73c.2 0 .42.02.62.06a1.67 1.67 0 0 1 .88.44 1.58 1.58 0 0 1 .44.89 4.38 4.38 0 0 1 .06.97v19.55a14.67 14.67 0 0 1-.06.96 1.7 1.7 0 0 1-.44.89 1.54 1.54 0 0 1-.87.44 4.27 4.27 0 0 1-.96.06H2.85a3.7 3.7 0 0 1-.63-.06 1.66 1.66 0 0 1-.87-.45 1.56 1.56 0 0 1-.44-.88 4.35 4.35 0 0 1-.06-.97V2.9c.01-.2.02-.42.06-.63.03-.18.08-.34.16-.49A1.56 1.56 0 0 1 2.22.93a4.2 4.2 0 0 1 .96-.06h33.24\"\n />\n <path\n fill=\"#000\"\n d=\"M10.92 8.61c.34-.43.57-1 .51-1.59a2.21 2.21 0 0 0-1.99 2.3c.56.04 1.12-.3 1.48-.7Zm.51.81c-.82-.05-1.52.46-1.9.46-.4 0-1-.43-1.64-.42-.84 0-1.62.48-2.05 1.24-.88 1.52-.23 3.76.62 5 .42.6.92 1.27 1.58 1.25.62-.02.86-.4 1.62-.4.75 0 .97.4 1.63.39.69-.01 1.11-.61 1.53-1.22.47-.7.67-1.37.68-1.4-.01-.02-1.32-.52-1.33-2.02-.01-1.26 1.03-1.85 1.07-1.9a2.34 2.34 0 0 0-1.81-.98Zm7.11-1.7a2.87 2.87 0 0 1 3.02 3c0 1.8-1.27 3.03-3.06 3.03h-1.97v3.12h-1.42V7.72h3.43Zm-2 4.83h1.62c1.24 0 1.94-.66 1.94-1.82 0-1.15-.7-1.81-1.93-1.81h-1.64v3.63Zm5.39 2.43c0-1.17.9-1.89 2.48-1.98l1.83-.1v-.52c0-.74-.5-1.18-1.34-1.18-.8 0-1.3.38-1.41.97h-1.3c.08-1.2 1.1-2.09 2.76-2.09 1.62 0 2.65.86 2.65 2.2v4.6h-1.31v-1.1h-.04a2.38 2.38 0 0 1-2.1 1.2c-1.3 0-2.22-.8-2.22-2Zm4.3-.6v-.53l-1.64.1c-.82.06-1.28.42-1.28.99 0 .58.48.96 1.22.96.96 0 1.7-.66 1.7-1.52Zm2.61 4.95v-1.11c.1.03.33.03.44.03.64 0 .98-.27 1.19-.96l.12-.4-2.41-6.69h1.48l1.7 5.43h.02l1.69-5.43h1.44l-2.5 7.02c-.57 1.62-1.23 2.14-2.61 2.14a5.3 5.3 0 0 1-.56-.03Z\"\n />\n </svg>\n);\n\nexport default ApplePayIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__apple-pay-button__loading{display:flex;justify-content:center}\\n\")","import \"./apple-pay-button.css\";\nimport { h } from \"preact\";\nimport WalletButton, { WalletButtonProps } from \"../shared/wallet-button\";\n\ntype ApplePayButtonProps = Omit<WalletButtonProps, \"method\">;\n\nfunction ApplePayButton(props: ApplePayButtonProps): h.JSX.Element | null {\n return <WalletButton method=\"applepay\" {...props} />;\n}\n\nexport default ApplePayButton;\n","import { Fragment, h } from \"preact\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { StoredPaymentMethod, SuccessResponse } from \"../../services/models\";\nimport StoredCardComponent from \"./stored-card-component\";\nimport { useState } from \"preact/hooks\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface StoredCardContainerComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction StoredCardContainerComponent({\n configuration,\n paymentMethods,\n}: StoredCardContainerComponentProps): h.JSX.Element | null {\n const [storedPaymentMethods, setStoredPaymentMethods] = useState<StoredPaymentMethod[]>(\n paymentMethods.paymentMethods.storedPaymentMethods ?? []\n );\n const { isObscuredByThreeDS, hasStoredPaymentMethods } = usePaymentMethodGroup();\n\n if (!hasStoredPaymentMethods || isObscuredByThreeDS(\"storedcard\")) {\n return null;\n }\n\n function handleStoredCardRemoved(storedPaymentMethodId: string): void {\n setStoredPaymentMethods((prevStoredPaymentMethods) =>\n prevStoredPaymentMethods.filter((storedPaymentMethod) => storedPaymentMethod.id !== storedPaymentMethodId)\n );\n }\n\n return (\n <Fragment>\n {storedPaymentMethods?.map((storedPaymentMethod) => (\n <StoredCardComponent\n key={storedPaymentMethod.id}\n configuration={configuration}\n storedPaymentMethod={storedPaymentMethod}\n paymentMethods={paymentMethods}\n onStoredCardRemoved={handleStoredCardRemoved}\n />\n ))}\n </Fragment>\n );\n}\n\nexport default StoredCardContainerComponent;\n","import { Fragment, h } from \"preact\";\nimport { useEffect, useRef, useState } from \"preact/hooks\";\nimport \"./stored-card-component.css\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { Tooltip } from \"../../components/tooltip/tooltip\";\nimport InfoIcon from \"../../assets/icons/info\";\nimport { AdyenCheckout, AdyenCheckoutError, CustomCard, ICore, UIElement, UIElementProps } from \"@adyen/adyen-web\";\nimport { RenderBrandIcons } from \"../../utils/renderBrandIcons\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { StoredCardComponentProps, StoredCardFormError, StoredCardFormErrorField } from \"./models\";\nimport WarningIcon from \"../../assets/icons/warning\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\nimport { createAdyenPaymentHandlers } from \"../../components/shared/create-adyen-handlers\";\nimport { submitCardWithGate } from \"../../components/shared/before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useFocusOnActivate } from \"../../utils/custom-hooks/use-focus-on-activate\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { getAdyenFieldStyles } from \"../../utils/adyen-field-styles\";\nimport { toResultMessage } from \"../../flows/payment-flow\";\n\nfunction StoredCardComponent({\n configuration,\n paymentMethods,\n storedPaymentMethod,\n onStoredCardRemoved,\n}: StoredCardComponentProps): h.JSX.Element | null {\n const storedCardElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const customCardRef = useRef<CustomCard>();\n const { i18n } = useI18n();\n const [payButtonDisabled, setPayButtonDisabled] = useState<boolean>(true);\n const [securityCodePolicy, setSecurityCodePolicy] = useState<\"hidden\" | \"optional\" | \"required\">(\"required\");\n const [askConfirmRemoveStoredCard, setAskConfirmRemoveStoredCard] = useState<boolean>(false);\n const [formErrors, setFormErrors] = useState<StoredCardFormError>({\n encryptedSecurityCode: { visible: false },\n });\n const {\n activePaymentMethod,\n setActivePaymentMethod,\n activeStoredPaymentMethodId,\n setActiveStoredPaymentMethodId,\n isStoredCardInitialized,\n updateStoredCardInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isSolePaymentMethod,\n registerSubmitHandler,\n unregisterSubmitHandler,\n } = usePaymentMethodGroup();\n\n // In sole mode there is only one stored card, so being the active payment method is enough.\n // In normal mode both the method and the specific card ID must match.\n const isActive = isSolePaymentMethod\n ? activePaymentMethod === \"storedcard\"\n : activePaymentMethod === \"storedcard\" && activeStoredPaymentMethodId === storedPaymentMethod.id;\n\n const resolvedTheme = useResolvedTheme(configuration.theme);\n\n async function handleSubmitClick(): Promise<void> {\n await submitCardWithGate(configuration.paymentFlow, () => customCardRef.current);\n }\n\n useEffect(() => {\n // Treat the stored card as inactive while a 3DS challenge is showing: it takes over the card\n // container, so a host's external submit button must not stay visible/clickable during it.\n const ready = isActive && isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive;\n if (!ready) {\n // Nothing selected yet, a different method is active, or 3DS is in progress - tell the host\n // explicitly so a custom submit button hides (and defaults to disabled when it reappears).\n configuration.onCardValidityChanged?.(false, false);\n return;\n }\n\n registerSubmitHandler(handleSubmitClick);\n // Signal \"active but not yet valid\" on activation so a host's custom submit button can appear\n // (disabled) right away. onAllValid then updates the valid state as the shopper fills the CVC.\n configuration.onCardValidityChanged?.(false, true);\n return () => {\n unregisterSubmitHandler(handleSubmitClick);\n configuration.onCardValidityChanged?.(false, false);\n };\n }, [\n isActive,\n isStoredCardInitialized[storedPaymentMethod.id],\n threeDSecureActive,\n registerSubmitHandler,\n unregisterSubmitHandler,\n ]);\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData: (data) => ({\n ...data,\n paymentMethod: {\n ...data.paymentMethod,\n storedPaymentMethodId: storedPaymentMethod.id,\n },\n }),\n });\n\n function handleOnError(_: AdyenCheckoutError, __?: UIElement<UIElementProps> | undefined) {\n handleError({ key: \"error.unknownError\" });\n }\n\n const initializeAdyenComponent = async () => {\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n paymentMethodsResponse: paymentMethods.paymentMethods,\n onError: handleOnError,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n customCardRef.current = new CustomCard(adyenCheckoutRef.current, {\n brands: [storedPaymentMethod.brand!],\n styles: getAdyenFieldStyles(resolvedTheme),\n onSubmit: handleOnSubmit,\n onConfigSuccess() {\n updateStoredCardInitialization(storedPaymentMethod.id, true);\n },\n onBrand: (event) => {\n setSecurityCodePolicy(event.cvcPolicy);\n },\n onValidationError: (event) => {\n const defaultErrors: StoredCardFormError = {\n encryptedSecurityCode: { visible: false, message: undefined },\n };\n\n event\n .filter((x) => x.error)\n .forEach((x) => {\n defaultErrors[x.fieldType as StoredCardFormErrorField].visible = true;\n defaultErrors[x.fieldType as StoredCardFormErrorField].message = x.errorI18n;\n });\n\n setFormErrors(defaultErrors);\n },\n onAllValid: (event) => {\n setPayButtonDisabled(!event.allValid);\n configuration.onCardValidityChanged?.(event.allValid, true);\n },\n placeholders: configuration.placeholders,\n // Adyen appears to ignore challengeWindowSize on CustomCard; kept for parity with the wallet configs.\n challengeWindowSize: \"05\",\n });\n\n if (storedCardElementRef.current) {\n customCardRef.current.mount(storedCardElementRef.current);\n }\n };\n\n useEffect(() => {\n if (isActive && !isStoredCardInitialized[storedPaymentMethod.id]) {\n initializeAdyenComponent();\n }\n }, [configuration, isActive]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(customCardRef.current && isStoredCardInitialized[activeStoredPaymentMethodId!]),\n () => {\n initializeAdyenComponent();\n setFormErrors({ encryptedSecurityCode: { visible: false, message: undefined } });\n }\n );\n\n useEffect(() => {\n setAskConfirmRemoveStoredCard(false);\n }, [activePaymentMethod, activeStoredPaymentMethodId]);\n\n // When the 3DS challenge replaces the stored-card field, move focus into the container.\n useFocusOnActivate(storedCardElementRef, threeDSecureActive && isActive);\n\n // Keep this guard below every hook call: returning early above a hook violates the\n // rules of hooks and corrupts hook ordering across renders.\n // Deliberately NOT isObscuredByThreeDS(\"storedcard\"): several stored-card components can be\n // mounted at once, so the one running the 3DS challenge is matched by card id via isActive.\n if (threeDSecureActive && !isActive) {\n return null;\n }\n\n function handleBoxChange() {\n setActivePaymentMethod(\"storedcard\");\n setActiveStoredPaymentMethodId(storedPaymentMethod.id);\n }\n\n function handleAskToConfirmRemoveCard() {\n setAskConfirmRemoveStoredCard(true);\n }\n\n function handleCancelRemoveStoredCard() {\n setAskConfirmRemoveStoredCard(false);\n }\n\n async function handleConfirmRemoveStoredCard() {\n const { disableToken } = configuration.paymentFlow;\n\n if (!disableToken) return;\n\n try {\n await disableToken(storedPaymentMethod.id);\n onStoredCardRemoved(storedPaymentMethod.id);\n } catch (error) {\n handleError(toResultMessage(error, \"error.failedToSubmitRemoveStoredPaymentCard\"));\n }\n }\n\n const canRemoveStoredCard = configuration.paymentFlow.disableToken !== undefined;\n\n const headerRight =\n canRemoveStoredCard && isActive && isStoredCardInitialized[storedPaymentMethod.id] ? (\n <div className=\"straumur__stored-card-component__remove-stored-card-button\">\n <button\n onClick={handleAskToConfirmRemoveCard}\n className=\"straumur__stored-card-component__remove-stored-card-button--text\"\n disabled={askConfirmRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCard\")}\n </button>\n </div>\n ) : null;\n\n const confirmSection = (\n <div\n className={`${\"straumur__stored-card-component__confirm-remove-stored-card\"} ${\n askConfirmRemoveStoredCard ? \"straumur__stored-card-component__confirm-remove-stored-card--expanded\" : \"\"\n }`}\n >\n <div className=\"straumur__stored-card-component__confirm-remove-stored-card--header\">\n <WarningIcon />\n <span className=\"straumur__stored-card-component__confirm-remove-stored-card--header--title\">\n {i18n.t(\"stored-cards.removeStoredCardQuestion\")}\n </span>\n </div>\n <div className=\"straumur__stored-card-component__confirm-remove-stored-card--actions\">\n <button\n className=\"straumur__stored-card-component__confirm-remove-stored-card--actions--button\"\n onClick={handleConfirmRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCardQuestionYesRemove\")}\n </button>\n <button\n className=\"straumur__stored-card-component__confirm-remove-stored-card--actions--button\"\n onClick={handleCancelRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCardQuestionCancel\")}\n </button>\n </div>\n </div>\n );\n\n return (\n <PaymentMethodItem\n icon={\n <RenderBrandIcons\n brands={[\n {\n brand: storedPaymentMethod.brand!,\n brandFullName: storedPaymentMethod.name,\n },\n ]}\n theme={resolvedTheme}\n />\n }\n title={`•••• ${storedPaymentMethod.lastFour}`}\n isActive={isActive}\n isSole={isSolePaymentMethod}\n onChange={handleBoxChange}\n headerRight={headerRight}\n confirmSection={confirmSection}\n >\n <div\n ref={storedCardElementRef}\n tabIndex={-1}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n }}\n >\n {!isStoredCardInitialized[storedPaymentMethod.id] && (\n <div className=\"straumur__stored-card-component__loading-text\">\n <LoaderIcon />\n </div>\n )}\n\n <div\n className=\"straumur__stored-card-component__form\"\n style={{\n opacity: isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive ? 1 : 0,\n position: isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive ? \"relative\" : \"absolute\",\n transition: \"opacity 0.3s ease-in-out\",\n }}\n >\n <div className=\"straumur__stored-card-component__form--field-wrapper\">\n <div className=\"straumur__stored-card-component__form--wrapper\">\n <label className=\"straumur__stored-card-component__form--wrapper--label straumur__stored-card-component__form--wrapper--label--readonly\">\n {i18n.t(\"stored-cards.expiryDate\")}\n </label>\n <span className=\"straumur__stored-card-component__form--wrapper--input straumur__stored-card-component__form--wrapper--input--readonly\">\n {storedPaymentMethod.expiryMonth}/{storedPaymentMethod.expiryYear}\n </span>\n </div>\n\n <div className=\"straumur__stored-card-component__form--wrapper\">\n {(securityCodePolicy === \"optional\" || securityCodePolicy === \"required\") && (\n <Fragment>\n <label\n className={`${\"straumur__stored-card-component__form--wrapper--label\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__stored-card-component__form--wrapper--label--error\"\n : \"\"\n }`}\n >\n {securityCodePolicy === \"optional\"\n ? i18n.t(\"stored-cards.securityCode3DigitsOptional\")\n : i18n.t(\"stored-cards.securityCode3Digits\")}\n </label>\n <span\n className={`${\"straumur__stored-card-component__form--wrapper--input\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__stored-card-component__form--wrapper--input--error\"\n : \"\"\n }`}\n data-cse=\"encryptedSecurityCode\"\n role=\"group\"\n aria-label={i18n.t(\"stored-cards.securityCode3Digits\")}\n >\n <div className=\"straumur__stored-card-component__form--wrapper--label--info\">\n <Tooltip content={i18n.t(\"stored-cards.securityCode3DigitsInfo\")} placement=\"top\">\n <InfoIcon />\n </Tooltip>\n </div>\n </span>\n </Fragment>\n )}\n {formErrors.encryptedSecurityCode.visible && (\n <span className=\"straumur__stored-card-component__form--wrapper--error\">\n {formErrors.encryptedSecurityCode.message}\n </span>\n )}\n </div>\n </div>\n\n {!configuration.hideSubmitButton && (\n <button\n className=\"straumur__stored-card-component__submit-button\"\n disabled={payButtonDisabled}\n onClick={handleSubmitClick}\n >\n {paymentMethods.minorUnitsAmount === 0\n ? i18n.t(\"stored-cards.saveCardDetails\")\n : paymentMethods.formattedAmount}\n </button>\n )}\n </div>\n </div>\n </PaymentMethodItem>\n );\n}\n\nexport default StoredCardComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__stored-card-component__remove-stored-card-button{margin-left:auto}.straumur__stored-card-component__remove-stored-card-button--text{color:var(--straumur__color-danger-text);text-decoration:none;background:none;border:none;cursor:pointer;transition:all .2s ease}.straumur__stored-card-component__remove-stored-card-button--text:disabled{cursor:not-allowed;color:var(--straumur__color-secondary)}.straumur__stored-card-component__confirm-remove-stored-card{background-color:var(--straumur__color-warning-bg);border-radius:var(--straumur__border-radius-s);max-height:0;overflow:hidden;transition:all .3s ease;opacity:0}.straumur__stored-card-component__confirm-remove-stored-card--expanded{padding:var(--straumur__space-xxlg);max-height:600px;opacity:1}.straumur__stored-card-component__confirm-remove-stored-card--header{display:flex;align-items:center;gap:var(--straumur__space-lg);color:var(--straumur__color-text);padding-bottom:var(--straumur__space-xxlg)}.straumur__stored-card-component__confirm-remove-stored-card--actions{display:flex;gap:var(--straumur__space-lg);justify-content:end}.straumur__stored-card-component__confirm-remove-stored-card--actions--button{color:var(--straumur__color-warning-text);background:none;border:none;cursor:pointer;text-decoration:none;font-weight:700}.straumur__stored-card-component__loading-text{display:flex;justify-content:center}.straumur__stored-card-component__form{display:flex;padding-top:var(--straumur__space-xxlg);flex-direction:column;gap:var(--straumur__space-5xlg)}.straumur__stored-card-component__form--wrapper{display:flex;flex-direction:column;justify-items:start;position:relative;width:100%}.straumur__stored-card-component__form--wrapper--error{color:var(--straumur__color-red-beta);font-size:12px}.straumur__stored-card-component__form--wrapper--label{transform:translate(10px) translateY(-50%);z-index:1;background:linear-gradient(to top,var(--straumur__color-secondary-gamma) 53%,var(--straumur__color-transparent) 50%);position:absolute;font-weight:500;font-size:14px;padding:0 var(--straumur__space-xxs)}.straumur__stored-card-component__form--wrapper--label--readonly{background:linear-gradient(to top,var(--straumur__color-gray-epsilon) 53%,var(--straumur__color-transparent) 50%)}.straumur__stored-card-component__form--wrapper--label--error{color:var(--straumur__color-red-beta);background:linear-gradient(to top,var(--straumur__color-red-gamma) 53%,var(--straumur__color-transparent) 50%);font-size:13px;font-weight:500}.straumur__stored-card-component__form--wrapper--label--info{position:absolute;top:33%;right:var(--straumur__space-md)}.straumur__stored-card-component__form--wrapper--input{background:var(--straumur__color-secondary-gamma);color:var(--straumur__color-text);display:flex;align-items:center;border:1px solid var(--straumur__color-transparent);border-radius:var(--straumur__border-radius-s);font-size:16px;height:48px;outline:none;padding-left:var(--straumur__space-lg);transition:border .2s ease-out,box-shadow .2s ease-out;position:relative}.straumur__stored-card-component__form--wrapper--input--readonly{background-color:var(--straumur__color-gray-epsilon)}.straumur__stored-card-component__form--wrapper--input:hover{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__stored-card-component__form--wrapper--input--readonly:hover{border:1px solid var(--straumur__color-transparent)}.straumur__stored-card-component__form--wrapper--input--error{background:var(--straumur__color-red-gamma);border:1px solid var(--straumur__color-red-beta)}.straumur__stored-card-component__form--wrapper--input--error:hover{border:1px solid var(--straumur__color-red-beta)}.straumur__stored-card-component__form--field-wrapper{display:flex;width:100%;gap:var(--straumur__space-lg)}.straumur__stored-card-component__submit-button{background:var(--straumur__color-primary);border:none;border-radius:var(--straumur__border-radius-s);color:var(--straumur__color-white);cursor:pointer;font-size:16px;height:40px;outline:none;padding:0 var(--straumur__space-xxlg);transition:background .2s ease-out;width:100%}.straumur__stored-card-component__submit-button:hover{background:var(--straumur__color-primary);border:1px solid var(--straumur__color-border)}.straumur__stored-card-component__submit-button:disabled{background:var(--straumur__color-gray-epsilon);color:var(--straumur__color-secondary);border:1px solid var(--straumur__color-border);cursor:not-allowed}\\n\")","import { h } from \"preact\";\n\nconst WarningIcon = () => (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_10650_34968)\">\n <path\n d=\"M12.0011 15C12.6245 15 13.1261 14.4984 13.1261 13.875V7.875C13.1261 7.25391 12.6222 6.75 12.0433 6.75C11.4644 6.75 10.8761 7.25625 10.8761 7.875V13.875C10.8761 14.4984 11.3823 15 12.0011 15ZM12.0011 16.5516C11.1873 16.5516 10.5273 17.2116 10.5273 18.0253C10.5292 18.8391 11.1855 19.5 12.0011 19.5C12.8167 19.5 13.4748 18.84 13.4748 18.0262C13.473 17.2125 12.8167 16.5516 12.0011 16.5516Z\"\n fill=\"#DFAE00\"\n />\n <path\n opacity=\"0.4\"\n d=\"M23.7312 19.5469L13.7328 2.48438C12.9673 1.17188 11.0356 1.17188 10.2649 2.48438L0.271188 19.5469C-0.49803 20.8547 0.460048 22.5 2.00181 22.5H21.9987C23.5343 22.5 24.4953 20.8594 23.7312 19.5469ZM10.8734 7.875C10.8734 7.25391 11.3773 6.75 11.9984 6.75C12.6195 6.75 13.1234 7.25625 13.1234 7.875V13.875C13.1234 14.4961 12.6195 15 12.0406 15C11.4617 15 10.8734 14.4984 10.8734 13.875V7.875ZM11.9984 19.5C11.1846 19.5 10.5246 18.84 10.5246 18.0262C10.5246 17.2125 11.1842 16.5525 11.9984 16.5525C12.8126 16.5525 13.4721 17.2125 13.4721 18.0262C13.4703 18.8391 12.814 19.5 11.9984 19.5Z\"\n fill=\"#DFAE00\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10650_34968\">\n <rect width=\"24\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default WarningIcon;\n","import { h, ComponentChildren } from \"preact\";\nimport { PaymentMethodGroupContext, SubmitApi } from \"./payment-method-group-context\";\nimport \"./payment-method-group.css\";\nimport { PaymentMethod } from \"../../models/constants\";\n\ninterface PaymentMethodGroupProps {\n children: ComponentChildren;\n initialValue: PaymentMethod | null;\n initialStoredPaymentMethodId?: string | null;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}\n\nfunction PaymentMethodGroup({\n children,\n initialValue,\n initialStoredPaymentMethodId,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n onSubmitApiReady,\n}: PaymentMethodGroupProps): h.JSX.Element | null {\n return (\n <PaymentMethodGroupContext\n initialValue={initialValue}\n initialStoredPaymentMethodId={initialStoredPaymentMethodId}\n isSolePaymentMethod={isSolePaymentMethod}\n hasCard={hasCard}\n hasGooglePay={hasGooglePay}\n hasApplePay={hasApplePay}\n hasStoredPaymentMethods={hasStoredPaymentMethods}\n onSubmitApiReady={onSubmitApiReady}\n >\n <div className=\"straumur__payment-method-group\">{children}</div>\n </PaymentMethodGroupContext>\n );\n}\n\nexport default PaymentMethodGroup;\n","import styleInject from '#style-inject';styleInject(\".straumur__payment-method-group{display:flex;flex-direction:column;gap:var(--straumur__space-xxlg);width:100%}\\n\")","import { Fragment, h } from \"preact\";\nimport \"./result-component.css\";\nimport SuccessIcon from \"../../assets/icons/success\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport FailureIcon from \"../../assets/icons/failure\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { ResultMessage } from \"../../models/models\";\n\nfunction ResultComponent(): h.JSX.Element | null {\n const { error, success } = usePaymentMethodGroup();\n const { i18n } = useI18n();\n\n if (!error && !success) {\n return null;\n }\n\n const renderMessage = (message: ResultMessage) => (\"key\" in message ? i18n.t(message.key) : message.text);\n\n return (\n <div className=\"straumur__result-component\">\n {error && (\n <Fragment>\n <span aria-hidden=\"true\">\n <FailureIcon />\n </span>\n {/* role=\"alert\" announces the failure to screen readers assertively (a declined payment\n was previously silent). */}\n <p className=\"straumur__result-component__error--message straumur__result-message\" role=\"alert\">\n {renderMessage(error)}\n </p>\n </Fragment>\n )}\n\n {success && (\n <Fragment>\n <span aria-hidden=\"true\">\n <SuccessIcon />\n </span>\n <p className=\"straumur__result-component__success--message straumur__result-message\" role=\"status\">\n {renderMessage(success)}\n </p>\n </Fragment>\n )}\n </div>\n );\n}\n\nexport default ResultComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__result-component{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--straumur__space-5xlg);padding:var(--straumur__space-6xlg);width:100%;min-height:300px;background-color:var(--straumur__color-white);border-radius:var(--straumur__border-radius-xxlg)}\\n\")","import { h } from \"preact\";\nimport \"./result-icons.css\";\n\nconst SuccessIcon = () => (\n <svg\n className=\"straumur__result-icon straumur__result-icon--success\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"120\"\n height=\"120\"\n viewBox=\"0 0 120 120\"\n role=\"img\"\n >\n <circle className=\"straumur__result-icon__halo\" cx=\"60\" cy=\"60\" r=\"52\" />\n <circle className=\"straumur__result-icon__ring\" cx=\"60\" cy=\"60\" r=\"50\" pathLength=\"100\" />\n <path className=\"straumur__result-icon__check\" d=\"M37 62 L53 78 L84 44\" pathLength=\"100\" />\n </svg>\n);\n\nexport default SuccessIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__result-icon{display:block}.straumur__result-icon__ring,.straumur__result-icon__check,.straumur__result-icon__x,.straumur__result-icon__halo,.straumur__result-icon__cross{transform-box:fill-box;transform-origin:center}.straumur__result-icon__ring{fill:none;stroke-width:5;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100;animation:straumur-result-draw .6s cubic-bezier(.65,0,.35,1) forwards}.straumur__result-icon__halo{opacity:0;animation:straumur-result-halo .9s .45s ease-out}.straumur__result-icon__check{fill:none;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:100;stroke-dashoffset:100;animation:straumur-result-draw .4s .55s cubic-bezier(.65,0,.35,1) forwards,straumur-result-pop .45s .9s ease-out}.straumur__result-icon__x{fill:none;stroke-width:7;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100;animation:straumur-result-draw .3s cubic-bezier(.65,0,.35,1) forwards}.straumur__result-icon__x--1{animation-delay:.6s}.straumur__result-icon__x--2{animation-delay:.82s}.straumur__result-icon__cross{animation:straumur-result-shake .4s 1.15s ease-in-out}.straumur__result-icon--success .straumur__result-icon__ring,.straumur__result-icon--success .straumur__result-icon__check{stroke:var(--straumur__color-success)}.straumur__result-icon--success .straumur__result-icon__halo{fill:var(--straumur__color-success)}.straumur__result-icon--failure .straumur__result-icon__ring,.straumur__result-icon--failure .straumur__result-icon__x{stroke:var(--straumur__color-danger-text)}.straumur__result-icon--failure .straumur__result-icon__halo{fill:var(--straumur__color-danger-text)}@keyframes straumur-result-draw{to{stroke-dashoffset:0}}@keyframes straumur-result-pop{0%{transform:scale(1)}45%{transform:scale(1.12)}to{transform:scale(1)}}@keyframes straumur-result-halo{0%{opacity:.35;transform:scale(.55)}to{opacity:0;transform:scale(1.35)}}@keyframes straumur-result-shake{0%,to{transform:translate(0)}25%{transform:translate(-3px)}75%{transform:translate(3px)}}@media(prefers-reduced-motion:reduce){.straumur__result-icon__ring,.straumur__result-icon__check,.straumur__result-icon__x,.straumur__result-icon__halo,.straumur__result-icon__cross{animation:none}.straumur__result-icon__ring,.straumur__result-icon__check,.straumur__result-icon__x{stroke-dashoffset:0}.straumur__result-icon__halo{opacity:0}}\\n\")","import { h } from \"preact\";\nimport \"./result-icons.css\";\n\nconst FailureIcon = () => (\n <svg\n className=\"straumur__result-icon straumur__result-icon--failure\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"120\"\n height=\"120\"\n viewBox=\"0 0 120 120\"\n role=\"img\"\n >\n <circle className=\"straumur__result-icon__halo\" cx=\"60\" cy=\"60\" r=\"52\" />\n <circle className=\"straumur__result-icon__ring\" cx=\"60\" cy=\"60\" r=\"50\" pathLength=\"100\" />\n <g className=\"straumur__result-icon__cross\">\n <line\n className=\"straumur__result-icon__x straumur__result-icon__x--1\"\n x1=\"42\"\n y1=\"42\"\n x2=\"78\"\n y2=\"78\"\n pathLength=\"100\"\n />\n <line\n className=\"straumur__result-icon__x straumur__result-icon__x--2\"\n x1=\"78\"\n y1=\"42\"\n x2=\"42\"\n y2=\"78\"\n pathLength=\"100\"\n />\n </g>\n </svg>\n);\n\nexport default FailureIcon;\n","import { Fragment, h, ComponentChildren } from \"preact\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface PaymentMethodsWrapperProps {\n children: ComponentChildren;\n}\n\nfunction PaymentMethodsWrapper({ children }: PaymentMethodsWrapperProps): h.JSX.Element | null {\n const { error, success } = usePaymentMethodGroup();\n\n if (error || success) {\n return null;\n }\n\n return <Fragment>{children}</Fragment>;\n}\n\nexport default PaymentMethodsWrapper;\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./instant-payments-component.css\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport GooglePayButton from \"../../components/google-pay-button/google-pay-button\";\nimport ApplePayButton from \"../../components/apple-pay-button/apple-pay-button\";\nimport { PaymentMethod } from \"../../models/constants\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface InstantPaymentsComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction InstantPaymentsComponent({\n configuration,\n paymentMethods,\n}: InstantPaymentsComponentProps): h.JSX.Element | null {\n const { hasGooglePay, hasApplePay } = usePaymentMethodGroup();\n const [unavailableMethods, setUnavailableMethods] = useState<Set<string>>(new Set());\n\n const handleUnavailable = (method: string) => {\n setUnavailableMethods((prev) => new Set(prev).add(method));\n };\n\n if (!configuration.instantPayments) {\n return null;\n }\n\n // safeguard: filter out any invalid payment methods, only allow applepay and googlepay\n const validInstantPayments: Extract<PaymentMethod, \"googlepay\" | \"applepay\">[] = [\"googlepay\", \"applepay\"];\n const availableInstantPayments = configuration.instantPayments.filter((payment) =>\n validInstantPayments.includes(payment)\n );\n\n // ensure the payment method is actually available from the paymentMethods response\n const finalAvailableInstantPayments = availableInstantPayments.filter((payment) =>\n payment === \"googlepay\" ? hasGooglePay : hasApplePay\n );\n\n const visibleInstantPayments = finalAvailableInstantPayments.filter((payment) => !unavailableMethods.has(payment));\n\n if (finalAvailableInstantPayments.length === 0) {\n return null;\n }\n\n return (\n // The unprefixed instant-payments classes predate the straumur__ convention and may be\n // targeted by host-page styles; keep them alongside the prefixed ones.\n <div\n className={`straumur__instant-payments instant-payments ${\n visibleInstantPayments.length > 1\n ? \"straumur__instant-payments--multiple instant-payments--multiple\"\n : \"straumur__instant-payments--single instant-payments--single\"\n }`}\n style={{ display: visibleInstantPayments.length === 0 ? \"none\" : undefined }}\n >\n {finalAvailableInstantPayments.map((paymentMethod) => {\n if (paymentMethod === \"googlepay\") {\n return (\n <GooglePayButton\n key={paymentMethod}\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={true}\n onUnavailable={() => handleUnavailable(\"googlepay\")}\n />\n );\n }\n if (paymentMethod === \"applepay\") {\n return (\n <ApplePayButton\n key={paymentMethod}\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={true}\n onUnavailable={() => handleUnavailable(\"applepay\")}\n />\n );\n }\n\n // this should never happen due to our filtering above, but typescript safeguard\n return null;\n })}\n </div>\n );\n}\n\nexport default InstantPaymentsComponent;\n","import styleInject from '#style-inject';styleInject(\".instant-payments{display:grid;gap:var(--straumur__space-lg);grid-template-columns:1fr 1fr}.instant-payments--single{grid-template-columns:1fr}@container straumur (max-width: 420px){.instant-payments{grid-template-columns:1fr}}\\n\")","import { PaymentMethodOrder } from \"../models/constants\";\n\n// Default top-to-bottom order, used when no custom order is given and to append any slots the caller\n// omitted from a custom order (so an available method is never silently hidden just by being left out).\nexport const DEFAULT_PAYMENT_METHOD_ORDER: PaymentMethodOrder[] = [\n \"instantpayments\",\n \"storedcard\",\n \"card\",\n \"googlepay\",\n \"applepay\",\n];\n\nconst VALID_TOKENS = new Set<string>(DEFAULT_PAYMENT_METHOD_ORDER);\n\n/**\n * Resolves the render order for the payment-method slots. Unknown tokens are ignored, duplicates are\n * collapsed to their first occurrence, and any valid slot the caller omitted is appended in the\n * default order. A wallet listed in `instantPayments` still renders only inside the \"instantpayments\"\n * slot — its standalone component self-guards to null — so keeping its token here is harmless.\n */\nexport function resolvePaymentMethodOrder(order: readonly string[] | undefined): PaymentMethodOrder[] {\n if (!order) {\n return [...DEFAULT_PAYMENT_METHOD_ORDER];\n }\n\n const seen = new Set<PaymentMethodOrder>();\n const resolved: PaymentMethodOrder[] = [];\n\n for (const token of order) {\n if (VALID_TOKENS.has(token) && !seen.has(token as PaymentMethodOrder)) {\n seen.add(token as PaymentMethodOrder);\n resolved.push(token as PaymentMethodOrder);\n }\n }\n\n for (const token of DEFAULT_PAYMENT_METHOD_ORDER) {\n if (!seen.has(token)) {\n resolved.push(token);\n }\n }\n\n return resolved;\n}\n","import { Language, TranslationKey, translations } from \"./translations\";\n\nexport class I18nService {\n constructor(\n private language: Language,\n private customLocalizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>\n ) {}\n\n t(key: TranslationKey): string {\n const localizedString = this.customLocalizations?.[this.language]?.[key];\n return localizedString || translations[this.language][key] || key;\n }\n\n setLanguage(language: Language): void {\n this.language = language;\n }\n\n updateCustomLocalizations(\n customLocalizations: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>\n ): void {\n this.customLocalizations = customLocalizations;\n }\n}\n","import { h, ComponentChildren } from \"preact\";\nimport SuccessIcon from \"../../assets/icons/success\";\nimport FailureIcon from \"../../assets/icons/failure\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { ResultMessage, Theme } from \"../../models/models\";\nimport { I18nService } from \"../../localizations/i18n-service\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\n\n// The widget's outer wrapper. Carries data-theme so the dark palette is scoped to the\n// widget (never leaks to the host page); \"system\" resolves live via prefers-color-scheme.\nexport function RootComponent({ children, theme = \"light\" }: { children: ComponentChildren; theme?: Theme }) {\n const resolvedTheme = useResolvedTheme(theme);\n return (\n <div className=\"straumur__root-component\" data-theme={resolvedTheme}>\n {children}\n </div>\n );\n}\n\n/** Full-widget loader shown while session mode fetches its payment methods. */\nexport function LoaderScreen({ theme }: { theme?: Theme }) {\n return (\n <RootComponent theme={theme}>\n <div className=\"straumur__component\">\n <LoaderIcon />\n </div>\n </RootComponent>\n );\n}\n\n/** Full-widget success/failure screen rendered imperatively by the StraumurCheckout class. */\nexport function StatusScreen({\n variant,\n message,\n i18n,\n theme,\n}: {\n variant: \"success\" | \"failure\";\n message: ResultMessage;\n i18n: I18nService;\n theme?: Theme;\n}) {\n return (\n <RootComponent theme={theme}>\n <div className=\"straumur__component\">\n <span aria-hidden=\"true\">{variant === \"success\" ? <SuccessIcon /> : <FailureIcon />}</span>\n {/* Failure is announced assertively (role=\"alert\"); success politely (role=\"status\"). */}\n <p className=\"straumur__result-message\" role={variant === \"success\" ? \"status\" : \"alert\"}>\n {\"key\" in message ? i18n.t(message.key) : message.text}\n </p>\n </div>\n </RootComponent>\n );\n}\n","import { Language } from \"../localizations/translations\";\nimport { StraumurWebAdvancedConfiguration } from \"../models/models\";\nimport { SuccessResponse } from \"./models\";\n\n// shapes the advanced-mode configuration into the same response object the session-mode\n// payment-methods call returns, so the component tree consumes both modes identically\nexport function normalizeAdvancedConfiguration(\n configuration: StraumurWebAdvancedConfiguration,\n locale: Language\n): SuccessResponse {\n return {\n resultCode: \"Success\",\n clientKey: configuration.clientKey,\n paymentMethods: configuration.paymentMethods,\n minorUnitsAmount: configuration.amount.value,\n currency: configuration.amount.currency,\n amount: configuration.amount.value / 100,\n formattedAmount: configuration.formattedAmount,\n merchantName: configuration.merchantName,\n enableStoreDetails: configuration.enableStoreDetails,\n locale,\n };\n}\n","import {\n ApplePayButtonTheme,\n GooglePayButtonTheme,\n StraumurCheckoutConfiguration,\n StraumurWebAdvancedConfiguration,\n StraumurWebConfiguration,\n StraumurWebInternalConfiguration,\n Theme,\n ThemeConfiguration,\n} from \"../models/models\";\nimport { createAdvancedPaymentFlow, createSessionPaymentFlow } from \"../flows/payment-flow\";\nimport { normalizeLocale } from \"../localizations/locale\";\nimport { normalizeAdvancedConfiguration } from \"../services/advanced-normalizer\";\nimport { SuccessResponse } from \"../services/models\";\n\n// Session mode has no countryCode input and the payment-methods response carries none,\n// so it is fixed to Iceland until the backend provides one.\nconst SESSION_COUNTRY_CODE = \"IS\";\n\nexport function isSessionConfiguration(config: StraumurWebInternalConfiguration): config is StraumurWebConfiguration {\n return typeof config.sessionId === \"string\" && config.sessionId.length > 0;\n}\n\n// The public `theme` accepts either a bare mode or a ThemeConfiguration object; flatten both into\n// the internal fields, defaulting the mode to \"light\".\nfunction normalizeTheme(theme: Theme | ThemeConfiguration | undefined): {\n theme: Theme;\n googlePayButtonTheme?: GooglePayButtonTheme;\n applePayButtonTheme?: ApplePayButtonTheme;\n} {\n if (typeof theme === \"object\") {\n return {\n theme: theme.theme ?? \"light\",\n googlePayButtonTheme: theme.googlePayButtonTheme,\n applePayButtonTheme: theme.applePayButtonTheme,\n };\n }\n\n return { theme: theme ?? \"light\" };\n}\n\n// the union only protects TypeScript consumers — IIFE consumers get no compile-time checking\nexport function isValidAdvancedConfiguration(config: StraumurWebAdvancedConfiguration): boolean {\n return (\n typeof config.clientKey === \"string\" &&\n config.clientKey.length > 0 &&\n typeof config.countryCode === \"string\" &&\n config.countryCode.length > 0 &&\n typeof config.paymentMethods === \"object\" &&\n config.paymentMethods !== null &&\n typeof config.amount === \"object\" &&\n config.amount !== null &&\n typeof config.amount.value === \"number\" &&\n typeof config.amount.currency === \"string\" &&\n typeof config.onSubmit === \"function\" &&\n typeof config.onAdditionalDetails === \"function\"\n );\n}\n\nexport interface CheckoutInitialization {\n configuration: StraumurCheckoutConfiguration;\n /** The raw advanced configuration when valid; null in session mode or when invalid. */\n advancedConfiguration: StraumurWebAdvancedConfiguration | null;\n /** Advanced mode only: the configuration normalized into a session-style Success response. */\n paymentMethods: SuccessResponse | null;\n initializationFailed: boolean;\n}\n\n/**\n * Maps the public constructor input (session, or the runtime-detected internal advanced\n * configuration) to the internal checkout state. Called exactly once per instance —\n * the returned configuration object's identity drives the components' reinit effects.\n */\nexport function buildCheckoutConfiguration(publicConfig: StraumurWebConfiguration): CheckoutInitialization {\n const config = publicConfig as StraumurWebInternalConfiguration;\n const locale = normalizeLocale(config.locale);\n const isSession = isSessionConfiguration(config);\n const themeConfig = normalizeTheme(config.theme);\n\n const configuration: StraumurCheckoutConfiguration = {\n mode: isSession ? \"session\" : \"advanced\",\n sessionId: config.sessionId,\n environment: config.environment,\n countryCode: isSession ? SESSION_COUNTRY_CODE : config.countryCode,\n paymentFlow: isSession\n ? createSessionPaymentFlow(config.environment, config.sessionId)\n : createAdvancedPaymentFlow(config),\n onPaymentCompleted: config.onPaymentCompleted,\n onPaymentFailed: config.onPaymentFailed,\n placeholders: config.placeholders,\n locale,\n customLocalizations: config.localizations,\n instantPayments: config.instantPayments,\n hideSubmitButton: config.hideSubmitButton,\n onCardValidityChanged: config.onCardValidityChanged,\n allowedPaymentMethods: config.allowedPaymentMethods,\n orderPaymentMethods: config.orderPaymentMethods,\n openDefaultPaymentMethod: config.openDefaultPaymentMethod,\n theme: themeConfig.theme,\n googlePayButtonTheme: themeConfig.googlePayButtonTheme,\n applePayButtonTheme: themeConfig.applePayButtonTheme,\n };\n\n if (isSession) {\n return { configuration, advancedConfiguration: null, paymentMethods: null, initializationFailed: false };\n }\n\n if (!isValidAdvancedConfiguration(config)) {\n return { configuration, advancedConfiguration: null, paymentMethods: null, initializationFailed: true };\n }\n\n return {\n configuration,\n advancedConfiguration: config,\n paymentMethods: normalizeAdvancedConfiguration(config, locale),\n initializationFailed: false,\n };\n}\n"],"mappings":"ubAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,sBAAAE,KAAA,eAAAC,GAAAH,ICAA,IAAAI,EAA0B,kBCCD,SAARC,EAA6BC,EAAK,CAAE,SAAAC,CAAS,EAAI,CAAC,EAAG,CAC1D,GAAI,CAACD,GAAO,OAAO,SAAa,IAAa,OAE7C,IAAME,EAAO,SAAS,MAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC,EAC/DC,EAAQ,SAAS,cAAc,OAAO,EAC5CA,EAAM,KAAO,WAETF,IAAa,OACXC,EAAK,WACPA,EAAK,aAAaC,EAAOD,EAAK,UAAU,EAK1CA,EAAK,YAAYC,CAAK,EAGpBA,EAAM,WACRA,EAAM,WAAW,QAAUH,EAE3BG,EAAM,YAAY,SAAS,eAAeH,CAAG,CAAC,CAElD,CCvB8BI,EAAY;AAAA,CAAm4G,ECAv7G,IAAMC,GAAS,KACN,CACL,iBAAkB,mEAClB,oBAAqB,2DAErB,wBAAyB,kBACzB,iBAAkB,UAClB,iBAAkB,UAClB,uBAAwB,eAC1B,GAaWC,GAAMD,GAAO,ECnB1B,SAASE,GAAWC,EAAsC,CACxD,OAAQA,EAAa,CACnB,IAAK,OACH,OAAOC,GAAI,iBACb,IAAK,OACH,OAAOA,GAAI,oBACb,QACE,MAAM,IAAI,MAAM,wBAAwBD,CAAW,EAAE,CACzD,CACF,CAEO,SAASE,GAAkBF,EAA8BG,EAA8B,CA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ACF,CAEA,aAAaY,EAAgD,CAC3D,GAAM,CAAE,OAAAC,EAAQ,GAAGC,CAAK,EAAIF,EAE5B,KAAK,cAAgB,CACnB,GAAG,KAAK,cACR,GAAGE,EAEH,GAAID,EAAS,CAAE,OAAQE,GAAgBF,CAAM,CAAE,EAAI,CAAC,CACtD,EAGIA,GACF,KAAK,KAAK,YAAY,KAAK,cAAc,MAAM,EAE7CD,EAAU,qBACZ,KAAK,KAAK,0BAA0BA,EAAU,mBAAmB,EAI/D,KAAK,cACP,KAAK,gBAAgB,CAEzB,CAEA,YAAYC,EAA4B,CACtC,KAAK,aAAa,CAChB,OAAQA,CACV,CAAC,CACH,CAEA,SAAgB,CAEV,KAAK,kBACP,UAAO,KAAM,KAAK,YAAY,EAC9B,KAAK,aAAe,MAEtB,KAAK,UAAY,IACnB,CAEA,YAAsB,CACpB,GAAI,CAAC,KAAK,aACR,eAAQ,KAAK,0EAA0E,EAChF,GAGT,GAAI,CAAC,KAAK,UACR,eAAQ,KAAK,4EAA4E,EAClF,GAGT,IAAMG,EAAY,KAAK,UAAU,cAAc,EAE/C,OAAKA,GACH,QAAQ,KACN,6GACF,EAGKA,CACT,CACF,EAEOC,GAAQ1B","names":["index_exports","__export","straumur_checkout_default","__toCommonJS","import_preact","styleInject","css","insertAt","head","style","styleInject","getEnv","env","getBaseUrl","environment","env","getPaymentMethods","body","createPaymentRequest","createDetailsRequest","postDisableTokenRequest","translations","isTranslationKey","value","setupPaymentMethods","environment","sessionId","fetchResponse","getPaymentMethods","contentType","errorMessage","serverErrorMessage","isTranslationKey","normalizeLocale","locale","import_preact","import_preact","import_hooks","styleInject","import_preact","import_hooks","PaymentMethodContext","defaultIsInitialized","PaymentMethodGroupContext","children","initialValue","initialStoredPaymentMethodId","isSolePaymentMethod","hasCard","hasGooglePay","hasApplePay","hasStoredPaymentMethods","onSubmitApiReady","activePaymentMethod","setActivePaymentMethod","activeSubmitHandlerRef","registerSubmitHandler","handler","unregisterSubmitHandler","triggerSubmit","activeStoredPaymentMethodId","setActiveStoredPaymentMethodId","threeDSecureActive","setThreeDSecureActive","isPaymentMethodInitialized","setIsPaymentMethodInitialized","isStoredCardInitialized","setIsStoredCardInitialized","success","setSuccess","error","setError","updatePaymentMethodInitialization","paymentMethod","isInitialized","prevState","updateStoredCardInitialization","storedPaymentMethod","isObscuredByThreeDS","method","handleError","handleSuccess","usePaymentMethodGroup","context","import_preact","import_hooks","I18nContext","I18nProvider","children","i18nService","onLanguageChange","changeLanguage","newLanguage","useI18n","context","import_preact","CardIcon","card_default","import_preact","import_preact","MasterCardIcon","opacity","reversed","mastercard_default","import_preact","VisaIcon","opacity","reversed","visa_default","import_preact","MaestroIcon","opacity","reversed","maestro_default","import_preact","AmexIcon","opacity","amex_default","import_preact","JcbIcon","opacity","jcb_default","import_preact","DinersIcon","opacity","diners_default","import_preact","DiscoverIcon","opacity","reversed","discover_default","import_preact","CupIcon","opacity","cup_default","import_preact","styleInject","import_hooks","Tooltip","children","content","placement","isVisible","setIsVisible","triggerRef","import_hooks","useMediaQuery","query","getMatch","matches","setMatches","mediaQueryList","listener","event","BRAND_DISPLAY_ORDER","brandRank","brand","index","RenderBrandIcons","brands","brandHidden","limit","theme","isWidth380","useMediaQuery","widthLimit","brandToShow","x","a","b","Tooltip","RenderBrandIcon","withChip","icon","isDark","defaultToBrandName","visa_default","mastercard_default","maestro_default","discover_default","amex_default","jcb_default","diners_default","cup_default","import_preact","import_hooks","import_adyen_web","import_preact","InfoIcon","info_default","import_preact","LoaderIcon","loader_default","import_preact","CheckmarkIcon","color","checkmark_default","import_preact","BrandOption","brand","brandName","isSelected","onBrandClick","handleKeyDown","e","RenderBrandIcon","checkmark_default","RenderDualBrandComponent","dualBrandConfiguration","selectedBrand","RESULT_CODES","toResultCode","value","PaymentFlowError","messageKey","messageText","toResultMessage","error","fallbackKey","createSessionPaymentFlow","environment","sessionId","data","body","fetchResponse","createPaymentRequest","response","createDetailsRequest","storedPaymentMethodId","postDisableTokenRequest","createAdvancedPaymentFlow","configuration","invokeHostHandler","invoke","resolve","reject","thrownErrorKey","rejectWithFlowError","flow","res","rej","errorMessage","onDisableToken","runBeforeSubmit","paymentFlow","beforeSubmit","submitCardWithGate","getElement","createBeforeSubmitClickHandler","resolve","reject","result","valid","FAILED_RESULT_CODES","createAdyenPaymentHandlers","options","configuration","handleSuccess","handleError","setThreeDSecureActive","enrichSubmitData","onSubmitStart","dispatchResultFromAdditionalDetails","failureMessage","failureResultMessage","dispatchFinalResult","resultCode","handleOnSubmit","state","_","actions","paymentFlow","runBeforeSubmit","data","action","errorMessage","error","toResultMessage","handleOnSubmitAdditionalData","handlePaymentCompleted","toResultCode","handlePaymentFailed","import_hooks","useAdyenLocaleReinit","configuration","isReady","reinitialize","import_hooks","useFocusOnActivate","ref","active","import_hooks","DARK_QUERY","systemPrefersDark","useResolvedTheme","theme","systemDark","setSystemDark","query","onChange","event","getAdyenFieldStyles","theme","CardForm","configuration","paymentMethods","onBrandHidden","cardElementRef","adyenCheckoutRef","customCardRef","i18n","useI18n","payButtonDisabled","setPayButtonDisabled","securityCodePolicy","setSecurityCodePolicy","storePaymentMethod","setStorePaymentMethod","isDualBrand","setIsDualBrand","dualBrandConfiguration","setDualBrandConfiguration","selectedBrand","setSelectedBrand","storePaymentMethodRef","formErrors","setFormErrors","activePaymentMethod","isPaymentMethodInitialized","updatePaymentMethodInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isObscuredByThreeDS","hasCard","registerSubmitHandler","unregisterSubmitHandler","usePaymentMethodGroup","resolvedTheme","useResolvedTheme","handleSubmitClick","submitCardWithGate","schemeBrands","x","handleOnSubmit","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","data","handleOnError","_","__","initializeAdyenComponent","getAdyenFieldStyles","event","selectedBrands","defaultErrors","useAdyenLocaleReinit","dualBrandListener","e","handleStorePaymentMethodChange","useFocusOnActivate","loader_default","Tooltip","info_default","RenderDualBrandComponent","checkmark_default","card_form_default","import_preact","styleInject","PaymentMethodItem","icon","title","isActive","isSole","onChange","children","headerRight","confirmSection","payment_method_item_default","CardComponent","configuration","paymentMethods","i18n","useI18n","brandHidden","setBrandHidden","resolvedTheme","useResolvedTheme","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasCard","usePaymentMethodGroup","brands","x","payment_method_item_default","card_default","RenderBrandIcons","card_form_default","card_component_default","import_preact","import_hooks","styleInject","import_preact","GooglePayIcon","googlepay_default","styleInject","import_preact","import_preact","import_hooks","import_adyen_web","CANCEL","resolveGooglePayButtonColor","theme","override","resolveApplePayButtonColor","WALLETS","core","configuration","paymentMethods","walletConfig","handleOnSubmit","resolvedTheme","applePayConfiguration","createBeforeSubmitClickHandler","resolveApplePayButtonColor","googlePayConfiguration","resolveGooglePayButtonColor","WalletButton","method","isInstantPayment","onUnavailable","wallet","useResolvedTheme","walletElementRef","adyenCheckoutRef","walletRef","isPaymentMethodInitialized","updatePaymentMethodInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isObscuredByThreeDS","setActivePaymentMethod","activePaymentMethod","usePaymentMethodGroup","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","handleOnError","data","_","CANCEL","markUnavailable","initializeAdyenComponent","x","useAdyenLocaleReinit","loader_default","wallet_button_default","GooglePayButton","props","wallet_button_default","google_pay_button_default","GooglePayComponent","configuration","paymentMethods","i18n","useI18n","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasGooglePay","usePaymentMethodGroup","isUnavailable","setIsUnavailable","x","payment_method_item_default","googlepay_default","google_pay_button_default","google_pay_component_default","import_preact","import_hooks","styleInject","import_preact","ApplePayIcon","applepay_default","styleInject","import_preact","ApplePayButton","props","wallet_button_default","apple_pay_button_default","ApplePayComponent","configuration","paymentMethods","i18n","useI18n","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasApplePay","usePaymentMethodGroup","isUnavailable","setIsUnavailable","x","payment_method_item_default","applepay_default","apple_pay_button_default","apple_pay_component_default","import_preact","import_preact","import_hooks","styleInject","import_adyen_web","import_preact","WarningIcon","warning_default","StoredCardComponent","configuration","paymentMethods","storedPaymentMethod","onStoredCardRemoved","storedCardElementRef","adyenCheckoutRef","customCardRef","i18n","useI18n","payButtonDisabled","setPayButtonDisabled","securityCodePolicy","setSecurityCodePolicy","askConfirmRemoveStoredCard","setAskConfirmRemoveStoredCard","formErrors","setFormErrors","activePaymentMethod","setActivePaymentMethod","activeStoredPaymentMethodId","setActiveStoredPaymentMethodId","isStoredCardInitialized","updateStoredCardInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isSolePaymentMethod","registerSubmitHandler","unregisterSubmitHandler","usePaymentMethodGroup","isActive","resolvedTheme","useResolvedTheme","handleSubmitClick","submitCardWithGate","handleOnSubmit","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","data","handleOnError","_","__","initializeAdyenComponent","getAdyenFieldStyles","event","defaultErrors","x","useAdyenLocaleReinit","useFocusOnActivate","handleBoxChange","handleAskToConfirmRemoveCard","handleCancelRemoveStoredCard","handleConfirmRemoveStoredCard","disableToken","error","toResultMessage","headerRight","confirmSection","warning_default","payment_method_item_default","RenderBrandIcons","loader_default","Tooltip","info_default","stored_card_component_default","import_hooks","StoredCardContainerComponent","configuration","paymentMethods","storedPaymentMethods","setStoredPaymentMethods","isObscuredByThreeDS","hasStoredPaymentMethods","usePaymentMethodGroup","handleStoredCardRemoved","storedPaymentMethodId","prevStoredPaymentMethods","storedPaymentMethod","stored_card_component_default","stored_card_container_component_default","import_preact","styleInject","PaymentMethodGroup","children","initialValue","initialStoredPaymentMethodId","isSolePaymentMethod","hasCard","hasGooglePay","hasApplePay","hasStoredPaymentMethods","onSubmitApiReady","PaymentMethodGroupContext","payment_method_group_default","import_preact","styleInject","import_preact","styleInject","SuccessIcon","success_default","import_preact","FailureIcon","failure_default","ResultComponent","error","success","usePaymentMethodGroup","i18n","useI18n","renderMessage","message","failure_default","success_default","result_component_default","import_preact","PaymentMethodsWrapper","children","error","success","usePaymentMethodGroup","payment_methods_wrapper_default","import_preact","import_hooks","styleInject","InstantPaymentsComponent","configuration","paymentMethods","hasGooglePay","hasApplePay","usePaymentMethodGroup","unavailableMethods","setUnavailableMethods","handleUnavailable","method","prev","validInstantPayments","finalAvailableInstantPayments","payment","visibleInstantPayments","paymentMethod","google_pay_button_default","apple_pay_button_default","instant_payments_component_default","DEFAULT_PAYMENT_METHOD_ORDER","VALID_TOKENS","resolvePaymentMethodOrder","order","seen","resolved","token","determineInitialState","hasCard","hasGooglePay","hasApplePay","storedCount","instantPayments","openDefaultPaymentMethod","gpayInStandard","x","apayInStandard","StraumurCheckoutContainer","configuration","paymentMethods","onSubmitApiReady","methods","stored","isAllowed","method","hasStoredPaymentMethods","initialPaymentMethod","isSolePaymentMethod","initialStoredPaymentMethodId","componentsBySlot","instant_payments_component_default","stored_card_container_component_default","card_component_default","google_pay_component_default","apple_pay_component_default","order","resolvePaymentMethodOrder","payment_method_group_default","payment_methods_wrapper_default","slot","result_component_default","straumur_checkout_container_default","import_adyen_web","I18nService","language","customLocalizations","key","translations","import_preact","RootComponent","children","theme","resolvedTheme","useResolvedTheme","LoaderScreen","loader_default","StatusScreen","variant","message","i18n","success_default","failure_default","normalizeAdvancedConfiguration","configuration","locale","SESSION_COUNTRY_CODE","isSessionConfiguration","config","normalizeTheme","theme","isValidAdvancedConfiguration","buildCheckoutConfiguration","publicConfig","locale","normalizeLocale","isSession","themeConfig","configuration","createSessionPaymentFlow","createAdvancedPaymentFlow","normalizeAdvancedConfiguration","StraumurCheckout","publicConfig","initialization","buildCheckoutConfiguration","I18nService","selector","LoaderScreen","response","setupPaymentMethods","error","RootComponent","I18nProvider","language","straumur_checkout_container_default","api","message","StatusScreen","redirectResult","redirectContext","handleOnSubmitAdditionalData","createAdyenPaymentHandlers","newConfig","locale","rest","normalizeLocale","triggered","straumur_checkout_default"]}