2&&(f.children=arguments.length>3?n.call(arguments,2):i),p(l.type,f,t||l.key,r||l.ref,null)}function F(n,l){var u={__c:l=\"__cC\"+e++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,m(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=s.slice,l={__e:function(n,l,u,i){for(var t,r,o;l=l.__;)if((t=l.__c)&&!t.__)try{if((r=t.constructor)&&null!=r.getDerivedStateFromError&&(t.setState(r.getDerivedStateFromError(n)),o=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),o=t.__d),o)return t.__E=t}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),\"function\"==typeof n&&(n=n(h({},u),this.props)),n&&h(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),m(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this))},k.prototype.render=_,t=[],o=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},w.__r=0,e=0;export{k as Component,_ as Fragment,E as cloneElement,F as createContext,y as createElement,d as createRef,y as h,D as hydrate,i as isValidElement,l as options,B as render,P as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n","/**\n * returns the indicated property of an object, if it exists.\n *\n * @param object - The object to query\n * @param path - The property name or path to the property\n * @returns The value at `obj[p]`.\n\n * @example\n * ```\n * getProp({x: 100}, 'x'); //=> 100\n * getProp({}, 'x'); //=> undefined\n * ```\n */\nconst getProp = (object: any, path: string): any => {\n const splitPath = path.split('.');\n const reducer = (xs, x) => (xs && xs[x] ? xs[x] : undefined);\n\n return splitPath.reduce(reducer, object);\n};\n\nexport default getProp;\n","class EventEmitter {\n public events = {};\n\n public on = (eventName: string, fn: Function): void => {\n this.events[eventName] = this.events[eventName] || [];\n this.events[eventName].push(fn);\n };\n\n public off = (eventName: string, fn: Function): void => {\n if (this.events[eventName]) {\n this.events[eventName] = this.events[eventName].reduce((acc, cur) => {\n if (cur !== fn) acc.push(cur);\n return acc;\n }, []);\n }\n };\n\n public emit = (eventName: string, data: any): void => {\n if (this.events[eventName]) {\n this.events[eventName].forEach(fn => {\n fn(data);\n });\n }\n };\n}\n\nexport default EventEmitter;\n","/* eslint-disable */\nexport default function uuidv4(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\n let r = (Math.random() * 16) | 0,\n v = c == 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n/* eslint-enable */\n","import { ComponentChild, render } from 'preact';\nimport getProp from '../utils/getProp';\nimport EventEmitter from './EventEmitter';\nimport uuid from '../utils/uuid';\nimport Core from '../core';\nimport { BaseElementProps, PaymentData } from './types';\nimport { RiskData } from '../core/RiskModule/RiskModule';\nimport { Resources } from '../core/Context/Resources';\n\nclass BaseElement {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public props: P;\n public state;\n protected static defaultProps = {};\n public _node;\n public _component;\n public eventEmitter = new EventEmitter();\n protected readonly _parentInstance: Core;\n\n protected resources: Resources;\n\n protected constructor(props: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], setStatusAutomatically: true, ...props });\n this._parentInstance = this.props._parentInstance;\n this._node = null;\n this.state = {};\n this.resources = this.props.modules ? this.props.modules.resources : undefined;\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n *\n * TODO: Replace 'any' by type PaymentMethodData - this change requires updating all payment methods,\n * properly adding the type of the formatData function\n */\n protected formatData(): any {\n return {};\n }\n\n protected setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n get data(): PaymentData | RiskData {\n const clientData = getProp(this.props, 'modules.risk.data');\n const useAnalytics = !!getProp(this.props, 'modules.analytics.props.enabled');\n const checkoutAttemptId = useAnalytics ? getProp(this.props, 'modules.analytics.checkoutAttemptId') : 'do-not-track';\n const order = this.state.order || this.props.order;\n\n const componentData = this.formatData();\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n } else {\n // Set up analytics, once\n if (this.props.modules && this.props.modules.analytics && !this.props.isDropin) {\n this.props.modules.analytics.send({\n containerWidth: this._node && this._node.offsetWidth,\n component: this.constructor['analyticsType'] ?? this.constructor['type'],\n flavor: 'components'\n });\n }\n }\n\n this._node = node;\n this._component = this.render();\n\n render(this._component, node);\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: P): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {};\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts an element and mounts it again on the same node i.e. allows mount w/o having to pass a node.\n * Should be \"private\" & undocumented (although being a public function is useful for testing).\n * Left in for legacy reasons\n */\n public remount(component?): this {\n if (!this._node) {\n throw new Error('Component is not mounted.');\n }\n\n const newComponent = component || this.render();\n\n render(newComponent, this._node, null);\n\n return this;\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this._parentInstance) {\n this._parentInstance.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n","/* global Bun -- Deno case */\nmodule.exports = typeof Bun == 'function' && Bun && typeof Bun.version == 'string';\n","'use strict';\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar isCallable = require('../internals/is-callable');\nvar ENGINE_IS_BUN = require('../internals/engine-is-bun');\nvar USER_AGENT = require('../internals/engine-user-agent');\nvar arraySlice = require('../internals/array-slice');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\n\nvar Function = global.Function;\n// dirty IE9- and Bun 0.3.0- checks\nvar WRAP = /MSIE .\\./.test(USER_AGENT) || ENGINE_IS_BUN && (function () {\n var version = global.Bun.version.split('.');\n return version.length < 3 || version[0] == 0 && (version[1] < 3 || version[1] == 3 && version[2] == 0);\n})();\n\n// IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers\n// https://github.com/oven-sh/bun/issues/1633\nmodule.exports = function (scheduler, hasTimeArg) {\n var firstParamIndex = hasTimeArg ? 2 : 1;\n return WRAP ? function (handler, timeout /* , ...arguments */) {\n var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;\n var fn = isCallable(handler) ? handler : Function(handler);\n var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];\n var callback = boundArgs ? function () {\n apply(fn, this, params);\n } : fn;\n return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);\n } : scheduler;\n};\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\nvar schedulersFix = require('../internals/schedulers-fix');\n\nvar setInterval = schedulersFix(global.setInterval, true);\n\n// Bun / IE9- setInterval additional parameters fix\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval\n$({ global: true, bind: true, forced: global.setInterval !== setInterval }, {\n setInterval: setInterval\n});\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\nvar schedulersFix = require('../internals/schedulers-fix');\n\nvar setTimeout = schedulersFix(global.setTimeout, true);\n\n// Bun / IE9- setTimeout additional parameters fix\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout\n$({ global: true, bind: true, forced: global.setTimeout !== setTimeout }, {\n setTimeout: setTimeout\n});\n","require('../modules/web.timers');\nvar path = require('../internals/path');\n\nmodule.exports = path.setTimeout;\n","module.exports = require(\"core-js-pure/stable/array/is-array\");","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import{options as n}from\"preact\";var t,r,u,i,o=0,f=[],c=[],e=n.__b,a=n.__r,v=n.diffed,l=n.__c,m=n.unmount;function d(t,u){n.__h&&n.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function h(n){return o=1,s(B,n)}function s(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function p(u,i){var o=d(t++,3);!n.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o))}function y(u,i){var o=d(t++,4);!n.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__h.push(o))}function _(n){return o=5,F(function(){return{current:n}},[])}function A(n,t,r){o=6,y(function(){return\"function\"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function F(n,r){var u=d(t++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function T(n,t){return o=8,F(function(){return n},t)}function q(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function x(t,r){n.useDebugValue&&n.useDebugValue(r?r(t):t)}function P(n){var u=d(t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function V(){var n=d(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[]}catch(r){t.__H.__h=[],n.__e(r,t.__v)}}n.__b=function(n){r=null,e&&e(n)},n.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[])),u=r},n.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===n.requestAnimationFrame||((i=n.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c})),u=r=null},n.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return!n.__||w(n)})}catch(u){r.some(function(n){n.__h&&(n.__h=[])}),r=[],n.__e(u,t.__v)}}),l&&l(t,r)},n.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n)}catch(n){r=n}}),u.__H=void 0,r&&n.__e(r,u.__v))};var g=\"function\"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r))}function k(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function w(n){var t=r;n.__c=n.__(),r=t}function z(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B(n,t){return\"function\"==typeof t?t(n):t}export{T as useCallback,q as useContext,x as useDebugValue,p as useEffect,P as useErrorBoundary,V as useId,A as useImperativeHandle,y as useLayoutEffect,F as useMemo,s as useReducer,_ as useRef,h as useState};\n//# sourceMappingURL=hooks.module.js.map\n","import { h } from 'preact';\nimport './Spinner.scss';\n\ninterface SpinnerProps {\n /**\n * Whether the spinner should be rendered inline\n */\n inline?: boolean;\n\n /**\n * size of the spinner (small/medium/large)\n */\n size?: string;\n}\n\n/**\n * Default Loading Spinner\n * @param props -\n */\nconst Spinner = ({ inline = false, size = 'large' }: SpinnerProps) => (\n \n);\n\nexport default Spinner;\n","export const FALLBACK_CONTEXT = 'https://checkoutshopper-live.adyen.com/checkoutshopper/';\nexport const resolveEnvironment = (env = '', environmentUrl?: string): string => {\n if (environmentUrl) {\n return environmentUrl;\n }\n\n const environments = {\n test: 'https://checkoutshopper-test.adyen.com/checkoutshopper/',\n live: 'https://checkoutshopper-live.adyen.com/checkoutshopper/',\n 'live-us': 'https://checkoutshopper-live-us.adyen.com/checkoutshopper/',\n 'live-au': 'https://checkoutshopper-live-au.adyen.com/checkoutshopper/',\n 'live-apse': 'https://checkoutshopper-live-apse.adyen.com/checkoutshopper/',\n 'live-in': 'https://checkoutshopper-live-in.adyen.com/checkoutshopper/'\n };\n\n return environments[env.toLowerCase()] || FALLBACK_CONTEXT;\n};\n\nexport const FALLBACK_CDN_CONTEXT = 'https://checkoutshopper-live.adyen.com/checkoutshopper/';\nexport const resolveCDNEnvironment = (env = '', environmentUrl?: string) => {\n if (environmentUrl) {\n return environmentUrl;\n }\n\n const environments = {\n beta: 'https://cdf6519016.cdn.adyen.com/checkoutshopper/',\n test: 'https://checkoutshopper-test.adyen.com/checkoutshopper/',\n live: 'https://checkoutshopper-live.adyen.com/checkoutshopper/',\n 'live-us': 'https://checkoutshopper-live-us.adyen.com/checkoutshopper/',\n 'live-au': 'https://checkoutshopper-live-au.adyen.com/checkoutshopper/',\n 'live-apse': 'https://checkoutshopper-live-apse.adyen.com/checkoutshopper/',\n 'live-in': 'https://checkoutshopper-live-in.adyen.com/checkoutshopper/'\n };\n\n return environments[env.toLowerCase()] || FALLBACK_CDN_CONTEXT;\n};\n","import { FALLBACK_CDN_CONTEXT } from '../Environment/Environment';\n\nexport interface ImageOptions {\n extension?: string;\n imageFolder?: string;\n resourceContext?: string;\n name?: string;\n parentFolder?: string;\n size?: string;\n subFolder?: string;\n svgOptions?: string;\n type?: string;\n}\n\nexport type GetImageFnType = (name) => string;\n\nexport class Resources {\n private readonly resourceContext: string;\n\n constructor(cdnContext: string = FALLBACK_CDN_CONTEXT) {\n this.resourceContext = cdnContext;\n }\n\n private returnImage = ({\n name,\n resourceContext,\n imageFolder = '',\n parentFolder = '',\n extension,\n size = '',\n subFolder = ''\n }: ImageOptions): string => `${resourceContext}images/${imageFolder}${subFolder}${parentFolder}${name}${size}.${extension}`;\n\n private getImageUrl =\n ({ resourceContext = FALLBACK_CDN_CONTEXT, extension = 'svg', ...options }: ImageOptions): GetImageFnType =>\n (name: string): string => {\n const imageOptions: ImageOptions = {\n extension,\n resourceContext,\n imageFolder: 'logos/',\n parentFolder: '',\n name,\n ...options\n };\n\n return this.returnImage(imageOptions);\n };\n\n public getImage(props = {} as ImageOptions) {\n return this.getImageUrl({ ...props, resourceContext: this.resourceContext });\n }\n}\n","import { createContext } from 'preact';\nimport { CommonPropsTypes } from './CoreProvider';\nimport Language from '../../language/Language';\nimport { Resources } from './Resources';\n\nexport const CoreContext = createContext({\n i18n: new Language(),\n loadingContext: '',\n commonProps: {} as CommonPropsTypes,\n resources: new Resources()\n});\n","import { useContext } from 'preact/hooks';\nimport { CoreContext } from './CoreContext';\n\nfunction useCoreContext() {\n return useContext(CoreContext);\n}\n\nexport default useCoreContext;\n","import { Component, h } from 'preact';\nimport classNames from 'classnames';\nimport Spinner from '../Spinner';\nimport useCoreContext from '../../../core/Context/useCoreContext';\nimport './Button.scss';\nimport { ButtonProps, ButtonState } from './types';\n\nclass Button extends Component {\n public static defaultProps = {\n status: 'default',\n variant: 'primary',\n disabled: false,\n label: '',\n inline: false,\n target: '_self',\n onClick: () => {}\n };\n\n public onClick = e => {\n e.preventDefault();\n\n if (!this.props.disabled) {\n this.props.onClick(e, { complete: this.complete });\n }\n };\n\n public complete = (delay = 1000) => {\n this.setState({ completed: true });\n setTimeout(() => {\n this.setState({ completed: false });\n }, delay);\n };\n\n render({ classNameModifiers = [], disabled, href, icon, inline, label, status, variant }, { completed }) {\n const { i18n } = useCoreContext();\n\n const buttonIcon = icon ?
: '';\n\n const modifiers = [\n ...classNameModifiers,\n ...(variant !== 'primary' ? [variant] : []),\n ...(inline ? ['inline'] : []),\n ...(completed ? ['completed'] : []),\n ...(status === 'loading' || status === 'redirect' ? ['loading'] : [])\n ];\n\n const buttonClasses = classNames(['adyen-checkout__button', ...modifiers.map(m => `adyen-checkout__button--${m}`)]);\n\n const buttonStates = {\n loading: ,\n redirect: (\n \n \n {i18n.get('payButton.redirecting')}\n \n ),\n default: (\n \n {buttonIcon}\n {label}\n \n )\n };\n\n const buttonText = buttonStates[status] || buttonStates.default;\n\n if (href) {\n return (\n \n {buttonText}\n \n );\n }\n\n return (\n \n );\n }\n}\n\nexport default Button;\n","import Language from '../../../language';\nimport { PaymentAmountExtended } from '../../../types';\n\nexport const PAY_BTN_DIVIDER = '/ ';\n\nconst amountLabel = (i18n, amount: PaymentAmountExtended) =>\n !!amount?.value && !!amount?.currency ? i18n.amount(amount.value, amount.currency, { currencyDisplay: amount.currencyDisplay || 'symbol' }) : '';\n\nconst payAmountLabel = (i18n: Language, amount: PaymentAmountExtended) => `${i18n.get('payButton')} ${amountLabel(i18n, amount)}`;\n\nconst secondaryAmountLabel = (i18n: Language, secondaryAmount: PaymentAmountExtended) => {\n const convertedSecondaryAmount =\n secondaryAmount && !!secondaryAmount?.value && !!secondaryAmount?.currency\n ? i18n.amount(secondaryAmount.value, secondaryAmount.currency, { currencyDisplay: secondaryAmount.currencyDisplay || 'symbol' })\n : '';\n\n const divider = convertedSecondaryAmount.length ? PAY_BTN_DIVIDER : '';\n\n return `${divider}${convertedSecondaryAmount}`;\n};\n\nexport { payAmountLabel, amountLabel, secondaryAmountLabel };\n","import { h } from 'preact';\nimport './SecondaryButtonLabel.scss';\n\nconst SecondaryButtonLabel = ({ label }) => {\n return {label};\n};\n\nexport default SecondaryButtonLabel;\n","import { h } from 'preact';\nimport Button from '../Button';\nimport useCoreContext from '../../../core/Context/useCoreContext';\nimport { ButtonProps } from '../Button/types';\nimport { payAmountLabel, secondaryAmountLabel } from './utils';\nimport { PaymentAmountExtended } from '../../../types';\nimport SecondaryButtonLabel from './components/SecondaryButtonLabel';\n\nexport interface PayButtonProps extends ButtonProps {\n /**\n * Class name modifiers will be used as: `adyen-checkout__image--${modifier}`\n */\n classNameModifiers?: string[];\n label?: string;\n amount: PaymentAmountExtended;\n secondaryAmount?: PaymentAmountExtended;\n status?: string;\n disabled?: boolean;\n icon?: string;\n onClick?(): void;\n}\n\nconst PayButton = ({ amount, secondaryAmount, classNameModifiers = [], label, ...props }: PayButtonProps) => {\n const { i18n } = useCoreContext();\n const isZeroAuth = amount && {}.hasOwnProperty.call(amount, 'value') && amount.value === 0;\n const defaultLabel = isZeroAuth ? i18n.get('confirmPreauthorization') : payAmountLabel(i18n, amount);\n\n /**\n * Show the secondaryLabel if:\n * - it's not zero auth, and\n * - we don't have a predefined label (i.e. redirect, qrcode, await based comps...), and\n * - we do have an amount object (merchant might not be passing this in order to not show the amount on the button), and\n * - we have a secondaryAmount object with some properties\n */\n const secondaryLabel =\n !isZeroAuth && !label && amount && secondaryAmount && Object.keys(secondaryAmount).length\n ? secondaryAmountLabel(i18n, secondaryAmount)\n : null;\n\n return (\n \n );\n};\n\nexport default PayButton;\nexport { payAmountLabel };\n","import { PaymentResponse, RawPaymentResponse, UIElementStatus } from './types';\n\nconst ALLOWED_PROPERTIES = ['action', 'resultCode', 'sessionData', 'order', 'sessionResult'];\n\nexport function getSanitizedResponse(response: RawPaymentResponse): PaymentResponse {\n const removedProperties = [];\n\n const sanitizedObject = Object.keys(response).reduce((acc, cur) => {\n if (!ALLOWED_PROPERTIES.includes(cur)) {\n removedProperties.push(cur);\n } else {\n acc[cur] = response[cur];\n }\n return acc;\n }, {});\n\n if (removedProperties.length) console.warn(`The following properties should not be passed to the client: ${removedProperties.join(', ')}`);\n\n return sanitizedObject as PaymentResponse;\n}\n\nexport function resolveFinalResult(result: PaymentResponse): [status: UIElementStatus, statusProps?: any] {\n switch (result.resultCode) {\n case 'Authorised':\n case 'Received':\n return ['success'];\n case 'Pending':\n return ['success'];\n case 'Cancelled':\n case 'Error':\n case 'Refused':\n return ['error'];\n default:\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar InternalMetadataModule = require('../internals/internal-metadata');\nvar fails = require('../internals/fails');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar iterate = require('../internals/iterate');\nvar anInstance = require('../internals/an-instance');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar defineProperty = require('../internals/object-define-property').f;\nvar forEach = require('../internals/array-iteration').forEach;\nvar DESCRIPTORS = require('../internals/descriptors');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = function (CONSTRUCTOR_NAME, wrapper, common) {\n var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;\n var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;\n var ADDER = IS_MAP ? 'set' : 'add';\n var NativeConstructor = global[CONSTRUCTOR_NAME];\n var NativePrototype = NativeConstructor && NativeConstructor.prototype;\n var exported = {};\n var Constructor;\n\n if (!DESCRIPTORS || !isCallable(NativeConstructor)\n || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))\n ) {\n // create collection constructor\n Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);\n InternalMetadataModule.enable();\n } else {\n Constructor = wrapper(function (target, iterable) {\n setInternalState(anInstance(target, Prototype), {\n type: CONSTRUCTOR_NAME,\n collection: new NativeConstructor()\n });\n if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });\n });\n\n var Prototype = Constructor.prototype;\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {\n var IS_ADDER = KEY == 'add' || KEY == 'set';\n if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {\n createNonEnumerableProperty(Prototype, KEY, function (a, b) {\n var collection = getInternalState(this).collection;\n if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;\n var result = collection[KEY](a === 0 ? 0 : a, b);\n return IS_ADDER ? this : result;\n });\n }\n });\n\n IS_WEAK || defineProperty(Prototype, 'size', {\n configurable: true,\n get: function () {\n return getInternalState(this).collection.size;\n }\n });\n }\n\n setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);\n\n exported[CONSTRUCTOR_NAME] = Constructor;\n $({ global: true, forced: true }, exported);\n\n if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);\n\n return Constructor;\n};\n","var defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) {\n if (options && options.unsafe && target[key]) target[key] = src[key];\n else defineBuiltIn(target, key, src[key], options);\n } return target;\n};\n","'use strict';\nvar create = require('../internals/object-create');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar defineBuiltIns = require('../internals/define-built-ins');\nvar bind = require('../internals/function-bind-context');\nvar anInstance = require('../internals/an-instance');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar iterate = require('../internals/iterate');\nvar defineIterator = require('../internals/iterator-define');\nvar createIterResultObject = require('../internals/create-iter-result-object');\nvar setSpecies = require('../internals/set-species');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fastKey = require('../internals/internal-metadata').fastKey;\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var Constructor = wrapper(function (that, iterable) {\n anInstance(that, Prototype);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n index: create(null),\n first: undefined,\n last: undefined,\n size: 0\n });\n if (!DESCRIPTORS) that.size = 0;\n if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });\n });\n\n var Prototype = Constructor.prototype;\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n var previous, index;\n // change existing entry\n if (entry) {\n entry.value = value;\n // create new entry\n } else {\n state.last = entry = {\n index: index = fastKey(key, true),\n key: key,\n value: value,\n previous: previous = state.last,\n next: undefined,\n removed: false\n };\n if (!state.first) state.first = entry;\n if (previous) previous.next = entry;\n if (DESCRIPTORS) state.size++;\n else that.size++;\n // add to index\n if (index !== 'F') state.index[index] = entry;\n } return that;\n };\n\n var getEntry = function (that, key) {\n var state = getInternalState(that);\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return state.index[index];\n // frozen object case\n for (entry = state.first; entry; entry = entry.next) {\n if (entry.key == key) return entry;\n }\n };\n\n defineBuiltIns(Prototype, {\n // `{ Map, Set }.prototype.clear()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.clear\n // https://tc39.es/ecma262/#sec-set.prototype.clear\n clear: function clear() {\n var that = this;\n var state = getInternalState(that);\n var data = state.index;\n var entry = state.first;\n while (entry) {\n entry.removed = true;\n if (entry.previous) entry.previous = entry.previous.next = undefined;\n delete data[entry.index];\n entry = entry.next;\n }\n state.first = state.last = undefined;\n if (DESCRIPTORS) state.size = 0;\n else that.size = 0;\n },\n // `{ Map, Set }.prototype.delete(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.delete\n // https://tc39.es/ecma262/#sec-set.prototype.delete\n 'delete': function (key) {\n var that = this;\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.next;\n var prev = entry.previous;\n delete state.index[entry.index];\n entry.removed = true;\n if (prev) prev.next = next;\n if (next) next.previous = prev;\n if (state.first == entry) state.first = next;\n if (state.last == entry) state.last = prev;\n if (DESCRIPTORS) state.size--;\n else that.size--;\n } return !!entry;\n },\n // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.foreach\n // https://tc39.es/ecma262/#sec-set.prototype.foreach\n forEach: function forEach(callbackfn /* , that = undefined */) {\n var state = getInternalState(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var entry;\n while (entry = entry ? entry.next : state.first) {\n boundFunction(entry.value, entry.key, this);\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n }\n },\n // `{ Map, Set}.prototype.has(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.has\n // https://tc39.es/ecma262/#sec-set.prototype.has\n has: function has(key) {\n return !!getEntry(this, key);\n }\n });\n\n defineBuiltIns(Prototype, IS_MAP ? {\n // `Map.prototype.get(key)` method\n // https://tc39.es/ecma262/#sec-map.prototype.get\n get: function get(key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n },\n // `Map.prototype.set(key, value)` method\n // https://tc39.es/ecma262/#sec-map.prototype.set\n set: function set(key, value) {\n return define(this, key === 0 ? 0 : key, value);\n }\n } : {\n // `Set.prototype.add(value)` method\n // https://tc39.es/ecma262/#sec-set.prototype.add\n add: function add(value) {\n return define(this, value = value === 0 ? 0 : value, value);\n }\n });\n if (DESCRIPTORS) defineBuiltInAccessor(Prototype, 'size', {\n configurable: true,\n get: function () {\n return getInternalState(this).size;\n }\n });\n return Constructor;\n },\n setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {\n var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';\n var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);\n var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);\n // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.entries\n // https://tc39.es/ecma262/#sec-map.prototype.keys\n // https://tc39.es/ecma262/#sec-map.prototype.values\n // https://tc39.es/ecma262/#sec-map.prototype-@@iterator\n // https://tc39.es/ecma262/#sec-set.prototype.entries\n // https://tc39.es/ecma262/#sec-set.prototype.keys\n // https://tc39.es/ecma262/#sec-set.prototype.values\n // https://tc39.es/ecma262/#sec-set.prototype-@@iterator\n defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {\n setInternalState(this, {\n type: ITERATOR_NAME,\n target: iterated,\n state: getInternalCollectionState(iterated),\n kind: kind,\n last: undefined\n });\n }, function () {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var entry = state.last;\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n // get next entry\n if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {\n // or finish the iteration\n state.target = undefined;\n return createIterResultObject(undefined, true);\n }\n // return step by kind\n if (kind == 'keys') return createIterResultObject(entry.key, false);\n if (kind == 'values') return createIterResultObject(entry.value, false);\n return createIterResultObject([entry.key, entry.value], false);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // `{ Map, Set }.prototype[@@species]` accessors\n // https://tc39.es/ecma262/#sec-get-map-@@species\n // https://tc39.es/ecma262/#sec-get-set-@@species\n setSpecies(CONSTRUCTOR_NAME);\n }\n};\n","'use strict';\nvar collection = require('../internals/collection');\nvar collectionStrong = require('../internals/collection-strong');\n\n// `Map` constructor\n// https://tc39.es/ecma262/#sec-map-objects\ncollection('Map', function (init) {\n return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };\n}, collectionStrong);\n","require('../../modules/es.array.iterator');\nrequire('../../modules/es.map');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Map;\n","var parent = require('../../stable/map');\n\nmodule.exports = parent;\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar aConstructor = require('../internals/a-constructor');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar iterate = require('../internals/iterate');\n\nvar push = [].push;\n\nmodule.exports = function from(source /* , mapFn, thisArg */) {\n var length = arguments.length;\n var mapFn = length > 1 ? arguments[1] : undefined;\n var mapping, array, n, boundFunction;\n aConstructor(this);\n mapping = mapFn !== undefined;\n if (mapping) aCallable(mapFn);\n if (isNullOrUndefined(source)) return new this();\n array = [];\n if (mapping) {\n n = 0;\n boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined);\n iterate(source, function (nextItem) {\n call(push, array, boundFunction(nextItem, n++));\n });\n } else {\n iterate(source, push, { that: array });\n }\n return new this(array);\n};\n","var $ = require('../internals/export');\nvar from = require('../internals/collection-from');\n\n// `Map.from` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\n$({ target: 'Map', stat: true, forced: true }, {\n from: from\n});\n","'use strict';\nvar arraySlice = require('../internals/array-slice');\n\n// https://tc39.github.io/proposal-setmap-offrom/\nmodule.exports = function of() {\n return new this(arraySlice(arguments));\n};\n","var $ = require('../internals/export');\nvar of = require('../internals/collection-of');\n\n// `Map.of` method\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\n$({ target: 'Map', stat: true, forced: true }, {\n of: of\n});\n","var tryToString = require('../internals/try-to-string');\n\n// Perform ? RequireInternalSlot(M, [[MapData]])\nmodule.exports = function (it) {\n if (typeof it == 'object' && 'size' in it && 'has' in it && 'get' in it && 'set' in it && 'delete' in it && 'entries' in it) return it;\n throw TypeError(tryToString(it) + ' is not a map');\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar caller = require('../internals/caller');\n\nvar Map = getBuiltIn('Map');\n\nmodule.exports = {\n Map: Map,\n set: caller('set', 2),\n get: caller('get', 1),\n has: caller('has', 1),\n remove: caller('delete', 1),\n proto: Map.prototype\n};\n","module.exports = function (methodName, numArgs) {\n return numArgs == 1 ? function (object, arg) {\n return object[methodName](arg);\n } : function (object, arg1, arg2) {\n return object[methodName](arg1, arg2);\n };\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar aMap = require('../internals/a-map');\nvar remove = require('../internals/map-helpers').remove;\n\n// `Map.prototype.deleteAll` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n deleteAll: function deleteAll(/* ...elements */) {\n var collection = aMap(this);\n var allDeleted = true;\n var wasDeleted;\n for (var k = 0, len = arguments.length; k < len; k++) {\n wasDeleted = remove(collection, arguments[k]);\n allDeleted = allDeleted && wasDeleted;\n } return !!allDeleted;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aMap = require('../internals/a-map');\nvar MapHelpers = require('../internals/map-helpers');\n\nvar get = MapHelpers.get;\nvar has = MapHelpers.has;\nvar set = MapHelpers.set;\n\n// `Map.prototype.emplace` method\n// https://github.com/tc39/proposal-upsert\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n emplace: function emplace(key, handler) {\n var map = aMap(this);\n var value, inserted;\n if (has(map, key)) {\n value = get(map, key);\n if ('update' in handler) {\n value = handler.update(value, key, map);\n set(map, key, value);\n } return value;\n }\n inserted = handler.insert(key, map);\n set(map, key, inserted);\n return inserted;\n }\n});\n","var call = require('../internals/function-call');\n\nmodule.exports = function (iterator, fn, $next) {\n var next = $next || iterator.next;\n var step, result;\n while (!(step = call(next, iterator)).done) {\n result = fn(step.value);\n if (result !== undefined) return result;\n }\n};\n","var iterateSimple = require('../internals/iterate-simple');\n\nmodule.exports = function (map, fn, interruptible) {\n return interruptible ? iterateSimple(map.entries(), function (entry) {\n return fn(entry[1], entry[0]);\n }) : map.forEach(fn);\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar bind = require('../internals/function-bind-context');\nvar aMap = require('../internals/a-map');\nvar iterate = require('../internals/map-iterate');\n\n// `Map.prototype.every` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n every: function every(callbackfn /* , thisArg */) {\n var map = aMap(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(map, function (value, key) {\n if (!boundFunction(value, key, map)) return false;\n }, true) !== false;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar bind = require('../internals/function-bind-context');\nvar aMap = require('../internals/a-map');\nvar MapHelpers = require('../internals/map-helpers');\nvar iterate = require('../internals/map-iterate');\n\nvar Map = MapHelpers.Map;\nvar set = MapHelpers.set;\n\n// `Map.prototype.filter` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n filter: function filter(callbackfn /* , thisArg */) {\n var map = aMap(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newMap = new Map();\n iterate(map, function (value, key) {\n if (boundFunction(value, key, map)) set(newMap, key, value);\n });\n return newMap;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar bind = require('../internals/function-bind-context');\nvar aMap = require('../internals/a-map');\nvar iterate = require('../internals/map-iterate');\n\n// `Map.prototype.find` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n find: function find(callbackfn /* , thisArg */) {\n var map = aMap(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var result = iterate(map, function (value, key) {\n if (boundFunction(value, key, map)) return { value: value };\n }, true);\n return result && result.value;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar bind = require('../internals/function-bind-context');\nvar aMap = require('../internals/a-map');\nvar iterate = require('../internals/map-iterate');\n\n// `Map.prototype.findKey` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n findKey: function findKey(callbackfn /* , thisArg */) {\n var map = aMap(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var result = iterate(map, function (value, key) {\n if (boundFunction(value, key, map)) return { key: key };\n }, true);\n return result && result.key;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar aCallable = require('../internals/a-callable');\nvar iterate = require('../internals/iterate');\nvar Map = require('../internals/map-helpers').Map;\n\nvar push = uncurryThis([].push);\n\n// `Map.groupBy` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', stat: true, forced: true }, {\n groupBy: function groupBy(iterable, keyDerivative) {\n var C = isCallable(this) ? this : Map;\n var newMap = new C();\n aCallable(keyDerivative);\n var has = aCallable(newMap.has);\n var get = aCallable(newMap.get);\n var set = aCallable(newMap.set);\n iterate(iterable, function (element) {\n var derivedKey = keyDerivative(element);\n if (!call(has, newMap, derivedKey)) call(set, newMap, derivedKey, [element]);\n else push(call(get, newMap, derivedKey), element);\n });\n return newMap;\n }\n});\n","// `SameValueZero` abstract operation\n// https://tc39.es/ecma262/#sec-samevaluezero\nmodule.exports = function (x, y) {\n // eslint-disable-next-line no-self-compare -- NaN check\n return x === y || x != x && y != y;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar sameValueZero = require('../internals/same-value-zero');\nvar aMap = require('../internals/a-map');\nvar iterate = require('../internals/map-iterate');\n\n// `Map.prototype.includes` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n includes: function includes(searchElement) {\n return iterate(aMap(this), function (value) {\n if (sameValueZero(value, searchElement)) return true;\n }, true) === true;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar iterate = require('../internals/iterate');\nvar isCallable = require('../internals/is-callable');\nvar aCallable = require('../internals/a-callable');\nvar Map = require('../internals/map-helpers').Map;\n\n// `Map.keyBy` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', stat: true, forced: true }, {\n keyBy: function keyBy(iterable, keyDerivative) {\n var C = isCallable(this) ? this : Map;\n var newMap = new C();\n aCallable(keyDerivative);\n var setter = aCallable(newMap.set);\n iterate(iterable, function (element) {\n call(setter, newMap, keyDerivative(element), element);\n });\n return newMap;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aMap = require('../internals/a-map');\nvar iterate = require('../internals/map-iterate');\n\n// `Map.prototype.keyOf` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n keyOf: function keyOf(searchElement) {\n var result = iterate(aMap(this), function (value, key) {\n if (value === searchElement) return { key: key };\n }, true);\n return result && result.key;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar bind = require('../internals/function-bind-context');\nvar aMap = require('../internals/a-map');\nvar MapHelpers = require('../internals/map-helpers');\nvar iterate = require('../internals/map-iterate');\n\nvar Map = MapHelpers.Map;\nvar set = MapHelpers.set;\n\n// `Map.prototype.mapKeys` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n mapKeys: function mapKeys(callbackfn /* , thisArg */) {\n var map = aMap(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newMap = new Map();\n iterate(map, function (value, key) {\n set(newMap, boundFunction(value, key, map), value);\n });\n return newMap;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar bind = require('../internals/function-bind-context');\nvar aMap = require('../internals/a-map');\nvar MapHelpers = require('../internals/map-helpers');\nvar iterate = require('../internals/map-iterate');\n\nvar Map = MapHelpers.Map;\nvar set = MapHelpers.set;\n\n// `Map.prototype.mapValues` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n mapValues: function mapValues(callbackfn /* , thisArg */) {\n var map = aMap(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var newMap = new Map();\n iterate(map, function (value, key) {\n set(newMap, key, boundFunction(value, key, map));\n });\n return newMap;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aMap = require('../internals/a-map');\nvar iterate = require('../internals/iterate');\nvar set = require('../internals/map-helpers').set;\n\n// `Map.prototype.merge` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n merge: function merge(iterable /* ...iterables */) {\n var map = aMap(this);\n var argumentsLength = arguments.length;\n var i = 0;\n while (i < argumentsLength) {\n iterate(arguments[i++], function (key, value) {\n set(map, key, value);\n }, { AS_ENTRIES: true });\n }\n return map;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aCallable = require('../internals/a-callable');\nvar aMap = require('../internals/a-map');\nvar iterate = require('../internals/map-iterate');\n\nvar $TypeError = TypeError;\n\n// `Map.prototype.reduce` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n reduce: function reduce(callbackfn /* , initialValue */) {\n var map = aMap(this);\n var noInitial = arguments.length < 2;\n var accumulator = noInitial ? undefined : arguments[1];\n aCallable(callbackfn);\n iterate(map, function (value, key) {\n if (noInitial) {\n noInitial = false;\n accumulator = value;\n } else {\n accumulator = callbackfn(accumulator, value, key, map);\n }\n });\n if (noInitial) throw $TypeError('Reduce of empty map with no initial value');\n return accumulator;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar bind = require('../internals/function-bind-context');\nvar aMap = require('../internals/a-map');\nvar iterate = require('../internals/map-iterate');\n\n// `Map.prototype.some` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n some: function some(callbackfn /* , thisArg */) {\n var map = aMap(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return iterate(map, function (value, key) {\n if (boundFunction(value, key, map)) return true;\n }, true) === true;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aCallable = require('../internals/a-callable');\nvar aMap = require('../internals/a-map');\nvar MapHelpers = require('../internals/map-helpers');\n\nvar $TypeError = TypeError;\nvar get = MapHelpers.get;\nvar has = MapHelpers.has;\nvar set = MapHelpers.set;\n\n// `Map.prototype.update` method\n// https://github.com/tc39/proposal-collection-methods\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n update: function update(key, callback /* , thunk */) {\n var map = aMap(this);\n var length = arguments.length;\n aCallable(callback);\n var isPresentInMap = has(map, key);\n if (!isPresentInMap && length < 3) {\n throw $TypeError('Updating absent value');\n }\n var value = isPresentInMap ? get(map, key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map);\n set(map, key, callback(value, key, map));\n return map;\n }\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar isCallable = require('../internals/is-callable');\nvar anObject = require('../internals/an-object');\n\nvar $TypeError = TypeError;\n\n// `Map.prototype.upsert` method\n// https://github.com/tc39/proposal-upsert\nmodule.exports = function upsert(key, updateFn /* , insertFn */) {\n var map = anObject(this);\n var get = aCallable(map.get);\n var has = aCallable(map.has);\n var set = aCallable(map.set);\n var insertFn = arguments.length > 2 ? arguments[2] : undefined;\n var value;\n if (!isCallable(updateFn) && !isCallable(insertFn)) {\n throw $TypeError('At least one callback required');\n }\n if (call(has, map, key)) {\n value = call(get, map, key);\n if (isCallable(updateFn)) {\n value = updateFn(value);\n call(set, map, key, value);\n }\n } else if (isCallable(insertFn)) {\n value = insertFn();\n call(set, map, key, value);\n } return value;\n};\n","'use strict';\n// TODO: remove from `core-js@4`\nvar $ = require('../internals/export');\nvar upsert = require('../internals/map-upsert');\n\n// `Map.prototype.upsert` method (replaced by `Map.prototype.emplace`)\n// https://github.com/thumbsupep/proposal-upsert\n$({ target: 'Map', proto: true, real: true, forced: true }, {\n upsert: upsert\n});\n","'use strict';\n// TODO: remove from `core-js@4`\nvar $ = require('../internals/export');\nvar upsert = require('../internals/map-upsert');\n\n// `Map.prototype.updateOrInsert` method (replaced by `Map.prototype.emplace`)\n// https://github.com/thumbsupep/proposal-upsert\n$({ target: 'Map', proto: true, real: true, name: 'upsert', forced: true }, {\n updateOrInsert: upsert\n});\n","var parent = require('../../actual/map');\nrequire('../../modules/esnext.map.from');\nrequire('../../modules/esnext.map.of');\nrequire('../../modules/esnext.map.delete-all');\nrequire('../../modules/esnext.map.emplace');\nrequire('../../modules/esnext.map.every');\nrequire('../../modules/esnext.map.filter');\nrequire('../../modules/esnext.map.find');\nrequire('../../modules/esnext.map.find-key');\nrequire('../../modules/esnext.map.group-by');\nrequire('../../modules/esnext.map.includes');\nrequire('../../modules/esnext.map.key-by');\nrequire('../../modules/esnext.map.key-of');\nrequire('../../modules/esnext.map.map-keys');\nrequire('../../modules/esnext.map.map-values');\nrequire('../../modules/esnext.map.merge');\nrequire('../../modules/esnext.map.reduce');\nrequire('../../modules/esnext.map.some');\nrequire('../../modules/esnext.map.update');\n// TODO: remove from `core-js@4`\nrequire('../../modules/esnext.map.upsert');\n// TODO: remove from `core-js@4`\nrequire('../../modules/esnext.map.update-or-insert');\n\nmodule.exports = parent;\n","var parent = require('../../stable/reflect/construct');\n\nmodule.exports = parent;\n","import _bindInstanceProperty from \"@babel/runtime-corejs3/core-js/instance/bind\";\nimport _Reflect$construct from \"@babel/runtime-corejs3/core-js/reflect/construct\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n var _context;\n _construct = _bindInstanceProperty(_context = _Reflect$construct).call(_context);\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = _bindInstanceProperty(Function).apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n return _construct.apply(null, arguments);\n}","import _Reflect$construct from \"@babel/runtime-corejs3/core-js/reflect/construct\";\nexport default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false;\n if (_Reflect$construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","import _Map from \"@babel/runtime-corejs3/core-js/map\";\nimport _Object$create from \"@babel/runtime-corejs3/core-js/object/create\";\nimport getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof _Map === \"function\" ? new _Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = _Object$create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\n}","import _indexOfInstanceProperty from \"@babel/runtime-corejs3/core-js/instance/index-of\";\nexport default function _isNativeFunction(fn) {\n var _context;\n return _indexOfInstanceProperty(_context = Function.toString.call(fn)).call(_context, \"[native code]\") !== -1;\n}","interface CheckoutErrorOptions {\n cause: any;\n}\n\nclass AdyenCheckoutError extends Error {\n protected static errorTypes = {\n /** Network error. */\n NETWORK_ERROR: 'NETWORK_ERROR',\n\n /** Shopper canceled the current transaction. */\n CANCEL: 'CANCEL',\n\n /** Implementation error. The method or parameter are incorrect or are not supported. */\n IMPLEMENTATION_ERROR: 'IMPLEMENTATION_ERROR',\n\n /** Generic error. */\n ERROR: 'ERROR'\n };\n\n public cause: unknown;\n\n constructor(type: keyof typeof AdyenCheckoutError.errorTypes, message?: string, options?: CheckoutErrorOptions) {\n super(message);\n\n this.name = AdyenCheckoutError.errorTypes[type];\n\n this.cause = options?.cause;\n }\n}\n\nexport default AdyenCheckoutError;\n","export function hasOwnProperty(obj = {}, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n","import { h } from 'preact';\nimport BaseElement from './BaseElement';\nimport { PaymentAction } from '../types';\nimport { PaymentResponse } from './types';\nimport PayButton from './internal/PayButton';\nimport { IUIElement, PayButtonFunctionProps, RawPaymentResponse, UIElementProps } from './types';\nimport { getSanitizedResponse, resolveFinalResult } from './utils';\nimport AdyenCheckoutError from '../core/Errors/AdyenCheckoutError';\nimport { UIElementStatus } from './types';\nimport { hasOwnProperty } from '../utils/hasOwnProperty';\nimport DropinElement from './Dropin';\nimport { CoreOptions } from '../core/types';\nimport Core from '../core';\n\nexport class UIElement extends BaseElement
implements IUIElement {\n protected componentRef: any;\n public elementRef: UIElement;\n\n constructor(props: P) {\n super(props);\n this.submit = this.submit.bind(this);\n this.setState = this.setState.bind(this);\n this.onValid = this.onValid.bind(this);\n this.onComplete = this.onComplete.bind(this);\n this.onSubmit = this.onSubmit.bind(this);\n this.handleAction = this.handleAction.bind(this);\n this.handleOrder = this.handleOrder.bind(this);\n this.handleResponse = this.handleResponse.bind(this);\n this.setElementStatus = this.setElementStatus.bind(this);\n\n this.elementRef = (props && props.elementRef) || this;\n }\n\n public setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n this.onChange();\n }\n\n protected onChange(): object {\n const isValid = this.isValid;\n const state = { data: this.data, errors: this.state.errors, valid: this.state.valid, isValid };\n if (this.props.onChange) this.props.onChange(state, this.elementRef);\n if (isValid) this.onValid();\n\n return state;\n }\n\n private onSubmit(): void {\n //TODO: refactor this, instant payment methods are part of Dropin logic not UIElement\n if (this.props.isInstantPayment) {\n const dropinElementRef = this.elementRef as DropinElement;\n dropinElementRef.closeActivePaymentMethod();\n }\n\n if (this.props.setStatusAutomatically) {\n this.setElementStatus('loading');\n }\n\n if (this.props.onSubmit) {\n // Classic flow\n this.props.onSubmit({ data: this.data, isValid: this.isValid }, this.elementRef);\n } else if (this._parentInstance.session) {\n // Session flow\n // wrap beforeSubmit callback in a promise\n const beforeSubmitEvent = this.props.beforeSubmit\n ? new Promise((resolve, reject) =>\n this.props.beforeSubmit(this.data, this.elementRef, {\n resolve,\n reject\n })\n )\n : Promise.resolve(this.data);\n\n beforeSubmitEvent\n .then(data => this.submitPayment(data))\n .catch(() => {\n // set state as ready to submit if the merchant cancels the action\n this.elementRef.setStatus('ready');\n });\n } else {\n this.handleError(new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'Could not submit the payment'));\n }\n }\n\n private onValid() {\n const state = { data: this.data };\n if (this.props.onValid) this.props.onValid(state, this.elementRef);\n return state;\n }\n\n onComplete(state): void {\n if (this.props.onComplete) this.props.onComplete(state, this.elementRef);\n }\n\n /**\n * Submit payment method data. If the form is not valid, it will trigger validation.\n */\n public submit(): void {\n if (!this.isValid) {\n this.showValidation();\n return;\n }\n\n this.onSubmit();\n }\n\n public showValidation(): this {\n if (this.componentRef && this.componentRef.showValidation) this.componentRef.showValidation();\n return this;\n }\n\n public setElementStatus(status: UIElementStatus, props?: any): this {\n this.elementRef?.setStatus(status, props);\n return this;\n }\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n return this;\n }\n\n private submitPayment(data): Promise {\n return this._parentInstance.session\n .submitPayment(data)\n .then(this.handleResponse)\n .catch(error => this.handleError(error));\n }\n\n private submitAdditionalDetails(data): Promise {\n return this._parentInstance.session.submitDetails(data).then(this.handleResponse).catch(this.handleError);\n }\n\n protected handleError = (error: AdyenCheckoutError): void => {\n /**\n * Set status using elementRef, which:\n * - If Drop-in, will set status for Dropin component, and then it will propagate the new status for the active payment method component\n * - If Component, it will set its own status\n */\n this.setElementStatus('ready');\n\n if (this.props.onError) {\n this.props.onError(error, this.elementRef);\n }\n };\n\n protected handleAdditionalDetails = state => {\n if (this.props.onAdditionalDetails) {\n this.props.onAdditionalDetails(state, this.elementRef);\n } else if (this.props.session) {\n this.submitAdditionalDetails(state.data);\n }\n\n return state;\n };\n\n public handleAction(action: PaymentAction, props = {}): UIElement | null {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'handleAction::Invalid Action - the passed action object itself has an \"action\" property and ' +\n 'a \"resultCode\": have you passed in the whole response object by mistake?'\n );\n }\n throw new Error('handleAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n const paymentAction = this._parentInstance.createFromAction(action, {\n ...this.elementRef.props,\n ...props,\n onAdditionalDetails: this.handleAdditionalDetails\n });\n\n if (paymentAction) {\n this.unmount();\n return paymentAction.mount(this._node);\n }\n\n return null;\n }\n\n protected handleOrder = (response: PaymentResponse): void => {\n this.updateParent({ order: response.order });\n // in case we receive an order in any other component then a GiftCard trigger handleFinalResult\n if (this.props.onPaymentCompleted) this.props.onPaymentCompleted(response, this.elementRef);\n };\n\n protected handleFinalResult = (result: PaymentResponse) => {\n if (this.props.setStatusAutomatically) {\n const [status, statusProps] = resolveFinalResult(result);\n if (status) this.setElementStatus(status, statusProps);\n }\n\n if (this.props.onPaymentCompleted) this.props.onPaymentCompleted(result, this.elementRef);\n return result;\n };\n\n /**\n * Handles a session /payments or /payments/details response.\n * The component will handle automatically actions, orders, and final results.\n * @param rawResponse -\n */\n protected handleResponse(rawResponse: RawPaymentResponse): void {\n const response = getSanitizedResponse(rawResponse);\n\n if (response.action) {\n this.elementRef.handleAction(response.action);\n } else if (response.order?.remainingAmount?.value > 0) {\n // we don't want to call elementRef here, use the component handler\n // we do this way so the logic on handlingOrder is associated with payment method\n this.handleOrder(response);\n } else {\n this.elementRef.handleFinalResult(response);\n }\n }\n\n /**\n * Call update on parent instance\n * This function exist to make safe access to the protect _parentInstance\n * @param options - CoreOptions\n */\n public updateParent(options: CoreOptions = {}): Promise {\n return this.elementRef._parentInstance.update(options);\n }\n\n public setComponentRef = ref => {\n this.componentRef = ref;\n };\n\n /**\n * Get the current validation status of the element\n */\n get isValid(): boolean {\n return false;\n }\n\n /**\n * Get the element icon URL for the current environment\n */\n get icon(): string {\n return this.props.icon ?? this.resources.getImage()(this.constructor['type']);\n }\n\n /**\n * Get the element's displayable name\n */\n get displayName(): string {\n return this.props.name || this.constructor['type'];\n }\n\n /**\n * Get the element accessible name, used in the aria-label of the button that controls selected payment method\n */\n get accessibleName(): string {\n return this.displayName;\n }\n\n /**\n * Return the type of an element\n */\n get type(): string {\n return this.props.type || this.constructor['type'];\n }\n\n /**\n * Get the payButton component for the current element\n */\n protected payButton = (props: PayButtonFunctionProps) => {\n return ;\n };\n}\n\nexport default UIElement;\n","import { Component, h } from 'preact';\nimport classNames from 'classnames';\n\ninterface IframeProps {\n width?: string;\n height?: string;\n minWidth?: string;\n minHeight?: string;\n border?: string;\n src?: string;\n allow?: string;\n name?: string;\n title?: string;\n classNameModifiers?: string[];\n callback?: (contentWindow) => void;\n}\n\nclass Iframe extends Component {\n public static defaultProps = {\n width: '0',\n height: '0',\n minWidth: '0',\n minHeight: '0',\n src: null,\n allow: null,\n title: 'components iframe',\n classNameModifiers: []\n };\n\n private iframeEl;\n\n iframeOnLoad() {\n if (this.props.callback && typeof this.props.callback === 'function') {\n this.props.callback(this.iframeEl.contentWindow);\n }\n }\n\n componentDidMount() {\n if (this.iframeEl.addEventListener) {\n this.iframeEl.addEventListener('load', this.iframeOnLoad.bind(this), false);\n } else if (this.iframeEl.attachEvent) {\n // IE fallback\n this.iframeEl.attachEvent('onload', this.iframeOnLoad.bind(this));\n } else {\n this.iframeEl.onload = this.iframeOnLoad.bind(this);\n }\n }\n\n componentWillUnmount() {\n if (this.iframeEl.removeEventListener) {\n this.iframeEl.removeEventListener('load', this.iframeOnLoad.bind(this), false);\n } else if (this.iframeEl.detachEvent) {\n // IE fallback\n this.iframeEl.detachEvent('onload', this.iframeOnLoad.bind(this));\n } else {\n this.iframeEl.onload = null;\n }\n }\n\n render({ name, src, width, height, minWidth, minHeight, allow, title, classNameModifiers }: IframeProps) {\n const validClassNameModifiers = classNameModifiers.filter(m => !!m);\n\n return (\n