UNPKG

@adyen/adyen-web

Version:

[![npm](https://img.shields.io/npm/v/@adyen/adyen-web.svg)](https://www.npmjs.com/package/@adyen/adyen-web)

1 lines 642 kB
"use strict";var e,t,n,r,o,i,s,a,c,l,u,d={},p=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function m(e,t){for(var n in t)e[n]=t[n];return e}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function b(t,n,r){var o,i,s,a={};for(s in n)"key"==s?o=n[s]:"ref"==s?i=n[s]:a[s]=n[s];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return g(t,a,o,i,null)}function g(e,r,o,i,s){var a={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++n:s,__i:-1,__u:0};return null==s&&null!=t.vnode&&t.vnode(a),a}function O(e){return e.children}function v(e,t){this.props=e,this.context=t}function P(e,t){if(null==t)return e.__?P(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?P(e):null}function _(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return _(e)}}function w(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!C.__r++||o!==t.debounceRendering)&&((o=t.debounceRendering)||i)(C)}function C(){var e,n,o,i,a,c,l,u;for(r.sort(s);e=r.shift();)e.__d&&(n=r.length,i=void 0,c=(a=(o=e).__v).__e,l=[],u=[],o.__P&&((i=m({},a)).__v=a.__v+1,t.vnode&&t.vnode(i),R(o.__P,i,a,o.__n,o.__P.namespaceURI,32&a.__u?[c]:null,l,null==c?P(a):c,!!(32&a.__u),u),i.__v=a.__v,i.__.__k[i.__i]=i,I(l,i,u),i.__e!=c&&_(i)),r.length>n&&r.sort(s));C.__r=0}function j(e,t,n,r,o,i,s,a,c,l,u){var h,y,m,f,b,g=r&&r.__k||p,O=t.length;for(n.__d=c,S(n,t,g),c=n.__d,h=0;h<O;h++)null!=(m=n.__k[h])&&"boolean"!=typeof m&&"function"!=typeof m&&(y=-1===m.__i?d:g[m.__i]||d,m.__i=h,R(e,m,y,o,i,s,a,c,l,u),f=m.__e,m.ref&&y.ref!=m.ref&&(y.ref&&T(y.ref,null,m),u.push(m.ref,m.__c||f,m)),null==b&&null!=f&&(b=f),65536&m.__u||y.__k===m.__k?(c&&"string"==typeof m.type&&!e.contains(c)&&(c=P(y)),c=k(m,c,e)):"function"==typeof m.type&&void 0!==m.__d?c=m.__d:f&&(c=f.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=c,n.__e=b}function S(e,t,n){var r,o,i,s,a,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)s=r+d,null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?g(null,o,null,null,null):y(o)?g(O,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?g(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=D(o,n,s,u),o.__i=a,i=null,-1!==a&&(u--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&d--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a==s-1?d=a-s:a==s+1?d++:a>s?u>c-s?d+=a-s:d--:a<s&&d++,a!==r+d&&(o.__u|=65536))):(i=n[s])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=P(i)),F(i,i,!1),n[s]=null,u--);if(u)for(r=0;r<l;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=P(i)),F(i,i))}function k(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=k(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function N(e,t){return t=t||[],null==e||"boolean"==typeof e||(y(e)?e.some((function(e){N(e,t)})):t.push(e)),t}function D(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,c=t[n];if(null===c||c&&o==c.key&&i===c.type&&!(131072&c.__u))return n;if(r>(null==c||131072&c.__u?0:1))for(;s>=0||a<t.length;){if(s>=0){if((c=t[s])&&!(131072&c.__u)&&o==c.key&&i===c.type)return s;s--}if(a<t.length){if((c=t[a])&&!(131072&c.__u)&&o==c.key&&i===c.type)return a;a++}}return-1}function E(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function A(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||E(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||E(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=a,e.addEventListener(t,i?l:c,i)):e.removeEventListener(t,i?l:c,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function x(e){return function(n){if(this.l){var r=this.l[n.type+e];if(null==n.t)n.t=a++;else if(n.t<r.u)return;return r(t.event?t.event(n):n)}}}function R(e,n,r,o,i,s,a,c,l,u){var d,p,h,f,b,g,P,_,w,C,S,k,N,D,E,A,x=n.type;if(void 0!==n.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[c=n.__e=r.__e]),(d=t.__b)&&d(n);e:if("function"==typeof x)try{if(_=n.props,w="prototype"in x&&x.prototype.render,C=(d=x.contextType)&&o[d.__c],S=d?C?C.props.value:d.__:o,r.__c?P=(p=n.__c=r.__c).__=p.__E:(w?n.__c=p=new x(_,S):(n.__c=p=new v(_,S),p.constructor=x,p.render=B),C&&C.sub(p),p.props=_,p.state||(p.state={}),p.context=S,p.__n=o,h=p.__d=!0,p.__h=[],p._sb=[]),w&&null==p.__s&&(p.__s=p.state),w&&null!=x.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=m({},p.__s)),m(p.__s,x.getDerivedStateFromProps(_,p.__s))),f=p.props,b=p.state,p.__v=n,h)w&&null==x.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),w&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(w&&null==x.getDerivedStateFromProps&&_!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(_,S),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(_,p.__s,S)||n.__v===r.__v)){for(n.__v!==r.__v&&(p.props=_,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(e){e&&(e.__=n)})),k=0;k<p._sb.length;k++)p.__h.push(p._sb[k]);p._sb=[],p.__h.length&&a.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(_,p.__s,S),w&&null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(f,b,g)}))}if(p.context=S,p.props=_,p.__P=e,p.__e=!1,N=t.__r,D=0,w){for(p.state=p.__s,p.__d=!1,N&&N(n),d=p.render(p.props,p.state,p.context),E=0;E<p._sb.length;E++)p.__h.push(p._sb[E]);p._sb=[]}else do{p.__d=!1,N&&N(n),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++D<25);p.state=p.__s,null!=p.getChildContext&&(o=m(m({},o),p.getChildContext())),w&&!h&&null!=p.getSnapshotBeforeUpdate&&(g=p.getSnapshotBeforeUpdate(f,b)),j(e,y(A=null!=d&&d.type===O&&null==d.key?d.props.children:d)?A:[A],n,r,o,i,s,a,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&a.push(p),P&&(p.__E=p.__=null)}catch(e){n.__v=null,l||null!=s?(n.__e=c,n.__u|=l?160:32,s[s.indexOf(c)]=null):(n.__e=r.__e,n.__k=r.__k),t.__e(e,n,r)}else null==s&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=M(r.__e,n,r,o,i,s,a,l,u);(d=t.diffed)&&d(n)}function I(e,n,r){n.__d=void 0;for(var o=0;o<r.length;o++)T(r[o],r[++o],r[++o]);t.__c&&t.__c(n,e),e.some((function(n){try{e=n.__h,n.__h=[],e.some((function(e){e.call(n)}))}catch(e){t.__e(e,n.__v)}}))}function M(t,n,r,o,i,s,a,c,l){var u,p,h,m,b,g,O,v=r.props,_=n.props,w=n.type;if("svg"===w?i="http://www.w3.org/2000/svg":"math"===w?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;u<s.length;u++)if((b=s[u])&&"setAttribute"in b==!!w&&(w?b.localName===w:3===b.nodeType)){t=b,s[u]=null;break}if(null==t){if(null===w)return document.createTextNode(_);t=document.createElementNS(i,w,_.is&&_),s=null,c=!1}if(null===w)v===_||c&&t.data===_||(t.data=_);else{if(s=s&&e.call(t.childNodes),v=r.props||d,!c&&null!=s)for(v={},u=0;u<t.attributes.length;u++)v[(b=t.attributes[u]).name]=b.value;for(u in v)if(b=v[u],"children"==u);else if("dangerouslySetInnerHTML"==u)h=b;else if("key"!==u&&!(u in _)){if("value"==u&&"defaultValue"in _||"checked"==u&&"defaultChecked"in _)continue;A(t,u,null,b,i)}for(u in _)b=_[u],"children"==u?m=b:"dangerouslySetInnerHTML"==u?p=b:"value"==u?g=b:"checked"==u?O=b:"key"===u||c&&"function"!=typeof b||v[u]===b||A(t,u,b,v[u],i);if(p)c||h&&(p.__html===h.__html||p.__html===t.innerHTML)||(t.innerHTML=p.__html),n.__k=[];else if(h&&(t.innerHTML=""),j(t,y(m)?m:[m],n,r,o,"foreignObject"===w?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:r.__k&&P(r,0),c,l),null!=s)for(u=s.length;u--;)null!=s[u]&&f(s[u]);c||(u="value",void 0!==g&&(g!==t[u]||"progress"===w&&!g||"option"===w&&g!==v[u])&&A(t,u,g,v[u],i),u="checked",void 0!==O&&O!==t[u]&&A(t,u,O,v[u],i))}return t}function T(e,n,r){try{"function"==typeof e?e(n):e.current=n}catch(e){t.__e(e,r)}}function F(e,n,r){var o,i;if(t.unmount&&t.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||T(o,null,n)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){t.__e(e,n)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&F(o[i],n,r||"function"!=typeof e.type);r||null==e.__e||f(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function B(e,t,n){return this.constructor(e,n)}function L(n,r,o){var i,s,a,c;t.__&&t.__(n,r),s=(i="function"==typeof o)?null:r.__k,a=[],c=[],R(r,n=r.__k=b(O,null,[n]),s||d,d,r.namespaceURI,s?null:r.firstChild?e.call(r.childNodes):null,a,s?s.__e:r.firstChild,i,c),I(a,n,c)}function V(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,w(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}e=p.slice,t={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},n=0,v.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},n),this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),w(this))},v.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),w(this))},v.prototype.render=O,r=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(e,t){return e.__v.__b-t.__v.__b},C.__r=0,a=0,c=x(!1),l=x(!0),u=0;var $,U,K,q,H=0,z=[],G=t,W=G.__b,Y=G.__r,Z=G.diffed,J=G.__c,Q=G.unmount,X=G.__;function ee(e,t){G.__h&&G.__h(U,e,H||t),H=0;var n=U.__H||(U.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function te(e){return H=1,ne(me,e)}function ne(e,t,n){var r=ee($++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):me(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=U,!U.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return!!e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};U.u=!0;var i=U.shouldComponentUpdate,s=U.componentWillUpdate;U.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}s&&s.call(this,e,t,n)},U.shouldComponentUpdate=o}return r.__N||r.__}function re(e,t){var n=ee($++,3);!G.__s&&ye(n.__H,t)&&(n.__=e,n.i=t,U.__H.__h.push(n))}function oe(e,t){var n=ee($++,4);!G.__s&&ye(n.__H,t)&&(n.__=e,n.i=t,U.__h.push(n))}function ie(e){return H=5,se((function(){return{current:e}}),[])}function se(e,t){var n=ee($++,7);return ye(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ae(e,t){return H=8,se((function(){return e}),t)}function ce(e){var t=U.context[e.__c],n=ee($++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(U)),t.props.value):e.__}function le(){for(var e;e=z.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(pe),e.__H.__h.forEach(he),e.__H.__h=[]}catch(t){e.__H.__h=[],G.__e(t,e.__v)}}G.__b=function(e){U=null,W&&W(e)},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),X&&X(e,t)},G.__r=function(e){Y&&Y(e),$=0;var t=(U=e.__c).__H;t&&(K===U?(t.__h=[],U.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(pe),t.__h.forEach(he),t.__h=[],$=0)),K=U},G.diffed=function(e){Z&&Z(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==z.push(t)&&q===G.requestAnimationFrame||((q=G.requestAnimationFrame)||de)(le)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),K=U=null},G.__c=function(e,t){t.some((function(e){try{e.__h.forEach(pe),e.__h=e.__h.filter((function(e){return!e.__||he(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],G.__e(n,e.__v)}})),J&&J(e,t)},G.unmount=function(e){Q&&Q(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{pe(e)}catch(e){t=e}})),n.__H=void 0,t&&G.__e(t,n.__v))};var ue="function"==typeof requestAnimationFrame;function de(e){var t,n=function(){clearTimeout(r),ue&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ue&&(t=requestAnimationFrame(n))}function pe(e){var t=U,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),U=t}function he(e){var t=U;e.__c=e.__(),U=t}function ye(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function me(e,t){return"function"==typeof t?t(e):t}const fe="encryptedCardNumber",be="encryptedExpiryDate",ge="encryptedExpiryMonth",Oe="encryptedExpiryYear",ve="encryptedSecurityCode",Pe="encryptedPassword",_e="encryptedBankAccountNumber",we="encryptedBankLocationId",Ce="encryptedSecurityCode3digits",je="encryptedSecurityCode4digits",Se="giftcard",ke=["amex","mc","visa"],Ne=["ach",Se],De=[fe,be,ge,Oe,ve,Pe],Ee=[_e,we],Ae=De.concat(Ee),xe=["bcmc"],Re="required",Ie="optional",Me="hidden",Te=Re,Fe=Ie,Be=Me,Le=Re,Ve=Ie,$e=Me,Ue="data-cse",Ke="data-info",qe="data-uid",He=["accel","pulse","star","nyce"],ze={visa:"VISA",mc:"MasterCard",amex:"American Express",discover:"Discover",cup:"China Union Pay",jcb:"JCB",diners:"Diners Club",maestro:"Maestro",bcmc:"Bancontact card",bijcard:"de Bijenkorf Card"},Ge={[fe]:"cardNumber",[be]:"expiryDate",[ve]:"securityCode",[ge]:"expiryMonth",[Oe]:"expiryYear",[Pe]:"password",[_e]:"bankAccountNumber",[we]:"bankLocationId",[Ce]:"securityCodeThreeDigits",[je]:"securityCodeFourDigits"},We=(e,t)=>t.split(".").reduce(((e,t)=>e&&e[t]?e[t]:void 0),e),Ye="-ariaError",Ze="-ariaContext",Je="focusField",Qe="notValidating:blurScenario",Xe="field.error.required",et="field.error.invalid",tt="invalid.format.expects",nt="creditCard.holderName.invalid",rt="creditCard.taxNumber.invalid",ot="boleto.socialSecurityNumber.invalid";var it=function(e){return e.CC_NUM="cc.num",e.CC_DAT="cc.dat",e.CC_MTH="cc.mth",e.CC_YR="cc.yr",e.CC_CVC="cc.cvc",e.KCP_PWD="kcp.pwd",e.ACH_NUM="ach.num",e.ACH_LOC="ach.loc",e}({}),st=function(e){return e.ERROR_MSG_INCOMPLETE_FIELD="err.gen.9100",e.ERROR_MSG_INVALID_FIELD="err.gen.9101",e.ERROR_MSG_LUHN_CHECK_FAILED="cc.num.902",e.ERROR_MSG_EMPTY_PAN="cc.num.900",e.ERROR_MSG_UNSUPPORTED_CARD_ENTERED="cc.num.903",e.ERROR_MSG_INCORRECTLY_FILLED_PAN="cc.num.901",e.ERROR_MSG_CARD_TOO_OLD="cc.dat.912",e.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE="cc.dat.913",e.ERROR_MSG_CARD_EXPIRES_TOO_SOON="cc.dat.914",e.ERROR_MSG_EMPTY_DATE="cc.dat.910",e.ERROR_MSG_INCORRECTLY_FILLED__DATE="cc.dat.911",e.ERROR_MSG_EMPTY_YEAR="cc.yr.917",e.ERROR_MSG_INCORRECTLY_FILLED_YEAR="cc.yr.918",e.ERROR_MSG_EMPTY_MONTH="cc.mth.915",e.ERROR_MSG_EMPTY_CVC="cc.cvc.920",e.ERROR_MSG_INCORRECTLY_FILLED_CVC="cc.cvc.921",e.ERROR_MSG_EMPTY_KCP_PWD="kcp.pwd.940",e.ERROR_MSG_INCORRECTLY_FILLED_KCP_PWD="kcp.pwd.941",e.ERROR_MSG_EMPTY_ACH_ACCOUNT_NUMBER="ach.num.945",e.ERROR_MSG_INCORRECTLY_FILLED_ACH_ACCOUNT_NUMBER="ach.num.946",e.ERROR_MSG_EMPTY_ACH_BANK_LOCATION_ID="ach.loc.947",e.ERROR_MSG_INCORRECTLY_FILLED_ACH_BANK_LOCATION_ID="ach.loc.948",e}({});const at={[fe]:"cc.num.900",[be]:"cc.dat.910",[ge]:"cc.mth.915",[Oe]:"cc.yr.917",[ve]:"cc.cvc.920",[Pe]:"kcp.pwd.940",[_e]:"ach.num.945",[we]:"ach.loc.947"},ct=(e,t)=>(t===be?(e[ge]=!1,e[Oe]=!1):e[t]=!1,e),lt=(e,t)=>(n,r)=>{let o=!0!==t.valid[r]?((e,t)=>1!==t||e!==ge&&e!==Oe?e:be)(r,e):null;return o=((e,t,n)=>{const{isFieldOfType:r,fieldIsValid:o}=n.reduce(((n,r)=>(n.isFieldOfType||(n.isFieldOfType=e===r,n.fieldIsValid=!t.errors[r]),n)),{isFieldOfType:!1,fieldIsValid:!1}),i=e===ve?"cvcPolicy":"expiryDatePolicy",s="cvcPolicy"===i?Fe:Ve,a="cvcPolicy"===i?Be:$e;return(t[i]===s||t[i]===a)&&o&&r?null:e})(o,t,[ve,be,ge,Oe]),o&&!n.includes(o)&&n.push(o),n};function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class dt{constructor(e){ut(this,"callbacks",void 0),ut(this,"config",void 0),ut(this,"props",void 0),ut(this,"state",void 0),ut(this,"validateForm",void 0),ut(this,"handleBrandFromBinLookup",void 0),ut(this,"callbacksHandler",void 0),ut(this,"configHandler",void 0),ut(this,"createCardSecuredFields",void 0),ut(this,"createNonCardSecuredFields",void 0),ut(this,"createSecuredFields",void 0),ut(this,"destroySecuredFields",void 0),ut(this,"handleIOSTouchEvents",void 0),ut(this,"destroyTouchendListener",void 0),ut(this,"destroyTouchstartListener",void 0),ut(this,"handleBinValue",void 0),ut(this,"handleEncryption",void 0),ut(this,"handleFocus",void 0),ut(this,"handleIframeConfigFeedback",void 0),ut(this,"handleValidation",void 0),ut(this,"handleSFShiftTab",void 0),ut(this,"handleShiftTab",void 0),ut(this,"isConfigured",void 0),ut(this,"postMessageToAllIframes",void 0),ut(this,"processAutoComplete",void 0),ut(this,"processBrand",void 0),ut(this,"sendBrandToCardSF",void 0),ut(this,"sendExpiryDatePolicyToSF",void 0),ut(this,"setFocusOnFrame",void 0),ut(this,"setupSecuredField",void 0),ut(this,"touchendListener",void 0),ut(this,"touchstartListener",void 0),ut(this,"hasGenuineTouchEvents",void 0),ut(this,"encryptedAttrName",void 0),ut(this,"hasRedundantCVCField",void 0),ut(this,"isSingleBrandedCard",void 0),ut(this,"securityCode",void 0),this.props=e,this.state={},this.config={},this.callbacks={}}}function pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ht=Object.prototype.toString;function yt(e){return"object"==typeof e&&null!==e&&"[object Array]"===Object.prototype.toString.call(e)}function mt(e){return null!=e}function ft(e){return!1!==e&&mt(e)}function bt(e){return!!e&&"object"==typeof e}function gt(e){return!ft(e)||(!(!("number"==typeof(t=e)||bt(t)&&"[object Number]"===ht.call(t))||0!==e&&!Number.isNaN(e))||(!(!yt(e)&&!function(e){return"string"==typeof e||bt(e)&&"[object String]"===ht.call(e)}(e)||0!==e.length)||!(!bt(e)||0!==Object.keys(e).length)));var t}function Ot(e){return!gt(e)}function vt(...e){const t=yt(e[0])?e[0]:e;return{from:e=>t.map((t=>t in e?{[t]:e[t]}:{})).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){pt(e,t,n[t])}))}return e}({},e,t)),{})}}function Pt(...e){const t=yt(e[0])?e[0]:e;return{from:e=>{const n=Object.keys(e).filter((e=>!t.includes(e)));return vt(...n).from(e)}}}let _t="undefined"!=typeof window&&window.console&&window.console.error&&window.console.error.bind(window.console);"undefined"!=typeof window&&window.console&&window.console.info&&window.console.info.bind(window.console);let wt="undefined"!=typeof window&&window.console&&window.console.log&&window.console.log.bind(window.console),Ct="undefined"!=typeof window&&window.console&&window.console.warn&&window.console.warn.bind(window.console);function jt(e){var t;this.config.cardGroupTypes=yt(t=e.cardGroupTypes)&&t.length?t:ke;const n=e.loadingContext;if(!n)return void Ct("WARNING Config :: no loadingContext has been specified!");var r,o;this.config.loadingContext="/"===(r=n).charAt(r.length-1)?n:`${n}/`,this.config.isCreditCardType=!1===Ne.includes(e.type),this.config.iframeUIConfig=null!==(o=e.iframeUIConfig)&&void 0!==o?o:{},this.config.autoFocus=!(!1===e.autoFocus||"false"===e.autoFocus),this.config.showWarnings=!0===e.showWarnings||"true"===e.showWarnings,this.config.trimTrailingSeparator=!(!1===e.trimTrailingSeparator||"false"===e.trimTrailingSeparator),this.config.keypadFix=!(!1===e.keypadFix||"false"===e.keypadFix),this.config.legacyInputMode=e.legacyInputMode||null,this.config.minimumExpiryDate=e.minimumExpiryDate||null,this.config.sfLogAtStart=!0===window._b$dl;let i=this.config.isCreditCardType?"card":e.type;i.indexOf("sepa")>-1&&(i="iban");const s=btoa(window.location.origin),a=`${i}${!!e.forceCompat||!("function"==typeof window.TextEncoder)?"Compat":""}`;this.config.iframeSrc=`${this.config.loadingContext}securedfields/${e.clientKey}/5.5.1/securedFields.html?type=${a}&d=${s}`}const St=()=>{};function kt(e={}){this.callbacks.onLoad=e.onLoad?e.onLoad:St,this.callbacks.onConfigSuccess=e.onConfigSuccess?e.onConfigSuccess:St,this.callbacks.onFieldValid=e.onFieldValid?e.onFieldValid:St,this.callbacks.onAllValid=e.onAllValid?e.onAllValid:St,this.callbacks.onBrand=e.onBrand?e.onBrand:St,this.callbacks.onError=e.onError?e.onError:St,this.callbacks.onFocus=e.onFocus?e.onFocus:St,this.callbacks.onBinValue=e.onBinValue?e.onBinValue:St,this.callbacks.onAutoComplete=e.onAutoComplete?e.onAutoComplete:St,this.callbacks.onAdditionalSFConfig=e.onAdditionalSFConfig?e.onAdditionalSFConfig:St,this.callbacks.onAdditionalSFRemoved=e.onAdditionalSFRemoved?e.onAdditionalSFRemoved:St,this.callbacks.onTouchstartIOS=e.onTouchstartIOS?e.onTouchstartIOS:St,this.callbacks.onKeyPressed=e.onKeyPressed?e.onKeyPressed:St}const Nt=({fieldType:e,encryptedFieldName:t,uuid:n,isValid:r,txVariant:o,rootNode:i})=>({fieldType:e,encryptedFieldName:t,uid:n,valid:r,type:o,rootNode:i});function Dt(e={},t){return Object.prototype.hasOwnProperty.call(e,t)}const Et=(e,t,n,r,o)=>{if(!Dt(e,"error"))return null;const i=t,s={rootNode:r,fieldType:e.fieldType,error:null,type:null},a=""!==e.error;return a||i.hasError?(s.error=a?e.error:"",s.type=n,i.hasError=a,i.errorType=s.error,o(s),s):null};function At(e){let t;const n=e.fieldType;if("card"===this.state.type&&Dt(e,"cvcPolicy")&&mt(e.cvcPolicy)&&Dt(this.state.securedFields,ve)&&(this.state.securedFields[ve].cvcPolicy=e.cvcPolicy),Et(e,this.state.securedFields[n],this.state.type,this.props.rootNode,this.callbacks.onError),this.state.securedFields[n].isEncrypted){t=(({fieldType:e,txVariant:t,rootNode:n})=>{const r=e===be,o=[],i=["encryptedExpiryMonth","encryptedExpiryYear"];let s,a,c,l;const u=r?2:1;for(s=0;s<u;s+=1){c=r?i[s]:e,a=`${t}-encrypted-${c}`,l=r?c:e;const u=Nt({fieldType:e,encryptedFieldName:l,uuid:a,isValid:!1,txVariant:t,rootNode:n});o.push(u)}return o})({fieldType:n,txVariant:this.state.type,rootNode:this.props.rootNode}),n===fe&&(t[0].endDigits="");for(let e=0,n=t.length;e<n;e+=1)this.callbacks.onFieldValid(t[e]);this.state.securedFields[n].isEncrypted=!1}this.validateForm(),Dt(e,"brand")&&this.processBrand(e)}const xt=(e,t,n)=>{if(t){const r=JSON.stringify(e);t.postMessage(r,n)}};function Rt(e,t){var n;return(null===(n=e.securedFields[t])||void 0===n?void 0:n.iframeContentWindow)||null}function It(e){const t=e.fieldType;let n,r;this.config.autoFocus&&("year"!==e.type&&t!==Oe||this.setFocusOnFrame(ve),t===ge&&this.setFocusOnFrame(Oe));const o=e[t];this.state.securedFields[t].isEncrypted=!0,Et({error:"",fieldType:t},this.state.securedFields[t],this.state.type,this.props.rootNode,this.callbacks.onError);const i=(({fieldType:e,txVariant:t,rootNode:n,encryptedObjArr:r})=>{let o,i,s,a,c;const l=[];for(o=0;o<r.length;o+=1){s=r[o],a=s.encryptedFieldName,i=`${t}-encrypted-${a}`,c=s.blob;const u=Nt({fieldType:e,encryptedFieldName:a,uuid:i,isValid:!0,txVariant:t,rootNode:n});u.blob=c,l.push(u)}return l})({fieldType:t,txVariant:this.state.type,rootNode:this.props.rootNode,encryptedObjArr:o});if(t===ge&&Dt(this.state.securedFields,Oe)){const t={txVariant:this.state.type,code:e.code,blob:o[0].blob,fieldType:Oe,numKey:this.state.securedFields[Oe].numKey};xt(t,Rt(this.state,Oe),this.config.loadingContext)}for(t===fe&&ft(e.endDigits)&&(i[0].endDigits=e.endDigits),t===fe&&ft(e.issuerBin)&&(i[0].issuerBin=+e.issuerBin),t===be&&ft(e.expiryDate)&&(i[1].expiryDate=e.expiryDate),n=0,r=i.length;n<r;n+=1)this.callbacks.onFieldValid(i[n]);this.validateForm()}const Mt=(e,t)=>{let n=[];return e&&"function"==typeof e.querySelectorAll&&(n=[].slice.call(e.querySelectorAll(t))),n},Tt=(e,t)=>{if(e)return e.querySelector(t)},Ft=(e,t)=>{if(e)return e.getAttribute(t)};const Bt={__NO_BRAND:"noBrand",cards:[]};Bt.cards.push({cardType:"mc",startingRules:[51,52,53,54,55,22,23,24,25,26,27],permittedLengths:[16],pattern:/^(5[1-5][0-9]{0,14}|2[2-7][0-9]{0,14})$/,securityCode:"CVC"}),Bt.cards.push({cardType:"visadankort",startingRules:[4571],permittedLengths:[16],pattern:/^(4571)[0-9]{0,12}$/}),Bt.cards.push({cardType:"visa",startingRules:[4],permittedLengths:[13,16,19],pattern:/^4[0-9]{0,18}$/,securityCode:"CVV"}),Bt.cards.push({cardType:"amex",startingRules:[34,37],permittedLengths:[15],pattern:/^3[47][0-9]{0,13}$/,securityCode:"CID"}),Bt.cards.push({cardType:"diners",startingRules:[36],permittedLengths:[14,15,16,17,18,19],pattern:/^(36)[0-9]{0,12}$/}),Bt.cards.push({cardType:"maestrouk",startingRules:[6759],permittedLengths:[16,18,19],pattern:/^(6759)[0-9]{0,15}$/}),Bt.cards.push({cardType:"solo",startingRules:[6767],permittedLengths:[16,18,19],pattern:/^(6767)[0-9]{0,15}$/}),Bt.cards.push({cardType:"laser",startingRules:[6304,6706,677117,677120],permittedLengths:[16,17,18,19],pattern:/^(6304|6706|6709|6771)[0-9]{0,15}$/,cvcPolicy:"optional"}),Bt.cards.push({cardType:"discover",startingRules:[6011,644,645,646,647,648,649,65],permittedLengths:[16,17,18,19],pattern:/^(6011[0-9]{0,12}|(644|645|646|647|648|649)[0-9]{0,13}|65[0-9]{0,14})$/}),Bt.cards.push({cardType:"jcb",startingRules:[3528,3529,353,354,355,356,357,358],permittedLengths:[16,19],pattern:/^(352[8,9]{1}[0-9]{0,15}|35[4-8]{1}[0-9]{0,16})$/,securityCode:"CAV"}),Bt.cards.push({cardType:"bcmc",startingRules:[6703,479658,606005],permittedLengths:[16,17,18,19],pattern:/^((6703)[0-9]{0,15}|(479658|606005)[0-9]{0,13})$/,cvcPolicy:"hidden"}),Bt.cards.push({cardType:"bijcard",startingRules:[5100081],permittedLengths:[16],pattern:/^(5100081)[0-9]{0,9}$/}),Bt.cards.push({cardType:"dankort",startingRules:[5019],permittedLengths:[16],pattern:/^(5019)[0-9]{0,12}$/}),Bt.cards.push({cardType:"hipercard",startingRules:[606282],permittedLengths:[16],pattern:/^(606282)[0-9]{0,10}$/}),Bt.cards.push({cardType:"cup",startingRules:[62,81],permittedLengths:[14,15,16,17,18,19],pattern:/^(62|81)[0-9]{0,17}$/}),Bt.cards.push({cardType:"maestro",startingRules:[50,56,57,58,6],permittedLengths:[16,17,18,19],pattern:/^(5[0|6-8][0-9]{0,17}|6[0-9]{0,18})$/,cvcPolicy:"optional"}),Bt.cards.push({cardType:"elo",startingRules:[506699,50670,50671,50672,50673,50674,50675,50676,506770,506771,506772,506773,506774,506775,506776,506777,506778,401178,438935,451416,457631,457632,504175,627780,636297,636368],permittedLengths:[16],pattern:/^((((506699)|(506770)|(506771)|(506772)|(506773)|(506774)|(506775)|(506776)|(506777)|(506778)|(401178)|(438935)|(451416)|(457631)|(457632)|(504175)|(627780)|(636368)|(636297))[0-9]{0,10})|((50676)|(50675)|(50674)|(50673)|(50672)|(50671)|(50670))[0-9]{0,11})$/}),Bt.cards.push({cardType:"uatp",startingRules:[1],permittedLengths:[15],pattern:/^1[0-9]{0,14}$/,cvcPolicy:"optional"}),Bt.cards.push({cardType:"cartebancaire",startingRules:[4,5,6],permittedLengths:[16],pattern:/^[4-6][0-9]{0,15}$/}),Bt.cards.push({cardType:"visaalphabankbonus",startingRules:[450903],permittedLengths:[16],pattern:/^(450903)[0-9]{0,10}$/}),Bt.cards.push({cardType:"mcalphabankbonus",startingRules:[510099],permittedLengths:[16],pattern:/^(510099)[0-9]{0,10}$/}),Bt.cards.push({cardType:"hiper",startingRules:[637095,637568,637599,637609,637612],permittedLengths:[16],pattern:/^(637095|637568|637599|637609|637612)[0-9]{0,10}$/}),Bt.cards.push({cardType:"oasis",startingRules:[982616],permittedLengths:[16],pattern:/^(982616)[0-9]{0,10}$/,cvcPolicy:"optional"}),Bt.cards.push({cardType:"karenmillen",startingRules:[98261465],permittedLengths:[16],pattern:/^(98261465)[0-9]{0,8}$/,cvcPolicy:"optional"}),Bt.cards.push({cardType:"warehouse",startingRules:[982633],permittedLengths:[16],pattern:/^(982633)[0-9]{0,10}$/,cvcPolicy:"optional"}),Bt.cards.push({cardType:"mir",startingRules:[220],permittedLengths:[16,17,18,19],pattern:/^(220)[0-9]{0,16}$/}),Bt.cards.push({cardType:"codensa",startingRules:[590712],permittedLengths:[16],pattern:/^(590712)[0-9]{0,10}$/}),Bt.cards.push({cardType:"naranja",startingRules:[377798,377799,402917,402918,527571,527572,589562],permittedLengths:[16,17,18,19],pattern:/^(37|40|5[28])([279])\d*$/}),Bt.cards.push({cardType:"cabal",startingRules:[589657,600691,603522,6042,6043,636908],permittedLengths:[16,17,18,19],pattern:/^(58|6[03])([03469])\d*$/}),Bt.cards.push({cardType:"shopping",startingRules:[2799,589407,603488],permittedLengths:[16,17,18,19],pattern:/^(27|58|60)([39])\d*$/}),Bt.cards.push({cardType:"argencard",startingRules:[501],permittedLengths:[16,17,18,19],pattern:/^(50)(1)\d*$/}),Bt.cards.push({cardType:"troy",startingRules:[9792],permittedLengths:[16],pattern:/^(97)(9)\d*$/}),Bt.cards.push({cardType:"forbrugsforeningen",startingRules:[600722],permittedLengths:[16],pattern:/^(60)(0)\d*$/}),Bt.cards.push({cardType:"vpay",startingRules:[401,408,413,434,435,437,439,441,442,443,444,446,447,455,458,460,461,463,466,471,479,482,483,487],permittedLengths:[13,14,15,16,17,18,19],pattern:/^(40[1,8]|413|43[4,5]|44[1,2,3,4,6,7]|45[5,8]|46[0,1,3,6]|47[1,9]|48[2,3,7])[0-9]{0,16}$/}),Bt.cards.push({cardType:"rupay",startingRules:[508528],permittedLengths:[16],pattern:/^(100003|508(2|[5-9])|60(69|[7-8])|652(1[5-9]|[2-5][0-9]|8[5-9])|65300[3-4]|8172([0-1]|[3-5]|7|9)|817(3[3-8]|40[6-9]|410)|35380([0-2]|[5-6]|9))[0-9]{0,12}$/}),Bt.cards.push({cardType:"ticket",expiryDatePolicy:"hidden"});var Lt=e=>Bt.cards.filter((t=>t.cardType===e))[0],Vt=e=>{if(!e)throw new Error("Error: isGenericCardType: type param has not been specified");return"card"===e||"scheme"===e};Bt.__NO_BRAND,Bt.cards;const $t=(e,t,n,r=!1)=>!(!e||"function"!=typeof e.addEventListener)&&(e.addEventListener(t,n,r),!0),Ut=(e,t,n,r=!1)=>!(!e||"function"!=typeof e.removeEventListener)&&(e.removeEventListener(t,n,r),!0);function Kt(e,t){const n=typeof e;return e&&t&&"object"===n&&n===typeof t?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every((n=>Kt(e[n],t[n]))):e===t}function qt(...e){const t=e,n=t.shift();return function(...e){return n.apply(this,t.concat(e))}}function Ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class zt{constructor(){Ht(this,"sfConfig",void 0),Ht(this,"loadingContext",void 0),Ht(this,"holderEl",void 0),Ht(this,"iframeRef",void 0),Ht(this,"loadToConfigTimeout",void 0),Ht(this,"_isValid",void 0),Ht(this,"_iframeContentWindow",void 0),Ht(this,"_numKey",void 0),Ht(this,"_isEncrypted",void 0),Ht(this,"_hasError",void 0),Ht(this,"_errorType",void 0),Ht(this,"_cvcPolicy",void 0),Ht(this,"_expiryDatePolicy",void 0),Ht(this,"_iframeOnLoadListener",void 0),Ht(this,"_postMessageListener",void 0),Ht(this,"onIframeLoadedCallback",void 0),Ht(this,"onConfigCallback",void 0),Ht(this,"onEncryptionCallback",void 0),Ht(this,"onValidationCallback",void 0),Ht(this,"onFocusCallback",void 0),Ht(this,"onBinValueCallback",void 0),Ht(this,"onTouchstartCallback",void 0),Ht(this,"onShiftTabCallback",void 0),Ht(this,"onAutoCompleteCallback",void 0),Ht(this,"onKeyPressedCallback",void 0),this.sfConfig={}}}function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wt=(e,t,n)=>{const r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Gt(e,t,n[t])}))}return e}({},e),o=Zt(n);return r.error=((e,t)=>Object.values(st).reduce(((n,r)=>(r.includes(t)&&(n[r]=e.get(r)),n)),{}))(t,o),r},Yt=(e,t)=>{let n=e;for(const[r,o]of Object.entries(t))if(o===e){n=r;break}return null==n?void 0:n.toLowerCase().replace(/[_.\s]/g,"-")},Zt=e=>{let t;switch(e){case fe:t=it.CC_NUM;break;case be:t=it.CC_DAT;break;case ge:t=it.CC_MTH;break;case Oe:t=it.CC_YR;break;case ve:t=it.CC_CVC;break;case Pe:t=it.KCP_PWD;break;case _e:t=it.ACH_NUM;break;case we:t=it.ACH_LOC}return t},Jt=({i18n:e,fieldTypeMappingFn:t,SRPanelRef:n},{errors:r,isValidating:o,layout:i,countrySpecificLabels:s})=>{const a=(({errors:e,i18n:t,layout:n,countrySpecificLabels:r,fieldTypeMappingFn:o})=>{const i=Object.entries(e).reduce(((i,[s,a])=>{if(a){const a=e[s],c="errorI18n"in a&&"rootNode"in a,l="object"==typeof a.errorMessage;let u,d;if(u=c?a.error:l?a.errorMessage.translationKey:a.errorMessage,c&&"errorI18n"in a)d=a.errorI18n+"";else{const e=o?o(s,t,r):"";if(l){const n=a.errorMessage.translationKey,r=a.errorMessage.translationObject.values.format;d=`${t.get(n,{values:{label:e,format:r}})}`}else d=t.get(a.errorMessage,{values:{label:e}})+""}i.push({field:s,errorMessage:d,errorCode:u}),n&&i.sort(((e,t)=>n.indexOf(e.field)-n.indexOf(t.field)))}return i}),[]);return i})({errors:r,i18n:e,fieldTypeMappingFn:t,countrySpecificLabels:s,layout:i});if(a.length){if(o){const e=a.map((e=>e.errorMessage));n.setMessages(e);const t=a.map((e=>e.field));return{currentErrorsSortedByLayout:a,action:Je,fieldToFocus:t[0]}}return null==n||n.setMessages(null),{currentErrorsSortedByLayout:a,action:Qe}}return null==n||n.setMessages(null),{currentErrorsSortedByLayout:a,action:"none"}},Qt=(e,t)=>{if(!e)return null;return Object.entries(e).reduce(((e,[n,r])=>{if(r){e[`${t}${n}`]=r}return e}),{})};function Xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var en=(e,t,n,r)=>{const o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Xt(e,t,n[t])}))}return e}({},e),i={};switch(n){case"ach":case Se:break;default:if(r===ve)i[Ce]=t.get("creditCard.securityCode.contextualText.3digits"),i[je]=t.get("creditCard.securityCode.contextualText.4digits");else{const e=`creditCard.${Ge[r]}.contextualText`,n=t.get(e);n!==e&&(i[r]=n)}}return Object.keys(i).length&&(o.contextualTexts=i),o};function tn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nn(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function rn(e,t,n,r){const o=["ach","giftcard"].includes(e)?e:"creditCard",i=n.get(`${o}.${t}.aria.iframeTitle`),s=n.get(`${o}.${Ge[t]}.label`),a=n.locale;let c=Wt({iframeTitle:i,label:s},n,t);return r&&(c=en(c,n,e,t)),nn(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){tn(e,t,n[t])}))}return e}({},a&&{lang:a}),{[t]:c})}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){on(e,t,n[t])}))}return e}function an(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}class cn extends zt{init(e,t,n,r){const o=rn(this.sfConfig.txVariant,this.sfConfig.fieldType,e,r);this.sfConfig.iframeUIConfig.ariaConfig=o,this.sfConfig.iframeUIConfig.placeholders=function(e,t,n){switch(e){case"ach":var r;return{[t]:null!==(r=n[Ge[t]])&&void 0!==r?r:""};case Se:var o;return{[t]:null!==(o=n[Ge[t]])&&void 0!==o?o:""};default:var i,s,a;return t===ve?{[Ce]:null!==(i=n.securityCodeThreeDigits)&&void 0!==i?i:"",[je]:null!==(s=n.securityCodeFourDigits)&&void 0!==s?s:""}:{[t]:null!==(a=n[Ge[t]])&&void 0!==a?a:""}}}(this.sfConfig.txVariant,this.sfConfig.fieldType,n);const i=function({src:e,title:t="iframe element",policy:n="origin"}){const r=document.createElement("iframe");r.setAttribute("src",e),r.classList.add("js-iframe"),""===t||0===t.trim().length||"none"===t?r.setAttribute("role","presentation"):r.setAttribute("title",t),r.setAttribute("allowtransparency","true"),r.setAttribute("referrerpolicy",n);const o=document.createTextNode("<p>Your browser does not support iframes.</p>");return r.appendChild(o),r}({src:t,title:o[this.sfConfig.fieldType].iframeTitle,policy:"origin"});this.holderEl.appendChild(i);const s=Tt(this.holderEl,".js-iframe");return s&&(this.iframeContentWindow=s.contentWindow,this.iframeOnLoadListener=this.iframeOnLoadListenerFn,$t(s,"load",this.iframeOnLoadListener,!1)),this.iframeRef=s,this}iframeOnLoadListenerFn(){this.postMessageListener=this.postMessageListenerFn,$t(window,"message",this.postMessageListener,!1);const e=an(sn({},this.sfConfig),{numKey:this.numKey});window._b$dl&&console.log("### SecuredField:::: onIframeLoaded:: created configObj=",e),xt(e,this.iframeContentWindow,this.loadingContext),this.onIframeLoadedCallback()}postMessageListenerFn(e){if(!((e,t,n)=>{const r=e.origin,o=t.indexOf("/checkoutshopper/");let i=o>-1?t.substring(0,o):t;const s=i.length-1;return"/"===i.charAt(s)&&(i=i.substring(0,s)),r===i||(n&&Ct("WARNING postMessageValidation: postMessage listener for iframe::origin mismatch!\n Received message with origin:",r,"but the only allowed origin for messages to CSF is",i,"### event.data=",e.data),!1)})(e,this.loadingContext,this.sfConfig.showWarnings))return;let t;try{t=JSON.parse(e.data)}catch(t){return(e=>e.data&&e.data.type&&"string"==typeof e.data.type&&e.data.type.indexOf("webpack")>-1)(e)?void(this.sfConfig.showWarnings&&wt("### SecuredField::postMessageListenerFn:: PARSE FAIL - WEBPACK")):(e=>e.data&&"string"==typeof e.data&&e.data.indexOf("cvox")>-1)(e)?void(this.sfConfig.showWarnings&&wt("### SecuredField::postMessageListenerFn:: PARSE FAIL - CHROMEVOX")):void(this.sfConfig.showWarnings&&wt("### SecuredField::postMessageListenerFn:: PARSE FAIL - UNKNOWN REASON: event.data=",e.data))}if(Dt(t,"action")&&Dt(t,"numKey"))if(this.numKey===t.numKey)switch(t.action){case"encryption":this.isValid=!0,this.onEncryptionCallback(t);break;case"config":window._b$dl&&console.log("### SecuredField::postMessageListenerFn:: configured - calling onConfigCallback",t.fieldType),this.onConfigCallback(t);break;case"focus":this.onFocusCallback(t);break;case"binValue":this.onBinValueCallback(t);break;case"touch":this.onTouchstartCallback(t);break;case"shifttab":this.onShiftTabCallback(t);break;case"autoComplete":this.onAutoCompleteCallback(t);break;case"enterKeyPressed":this.onKeyPressedCallback(t);break;default:this.isValid=!1,this.onValidationCallback(t)}else this.sfConfig.showWarnings&&Ct("WARNING SecuredField :: postMessage listener for iframe :: data mismatch! (Probably a message from an unrelated securedField)");else this.sfConfig.showWarnings&&Ct("WARNING SecuredField :: postMessage listener for iframe :: data mismatch!")}destroy(){Ut(window,"message",this.postMessageListener,!1),Ut(this.iframeRef,"load",this.iframeOnLoadListener,!1),this.iframeContentWindow=null,(e=>{for(;e.firstChild;)e.removeChild(e.firstChild)})(this.holderEl)}isOptionalOrHidden(){if(this.sfConfig.fieldType===be||this.sfConfig.fieldType===ge||this.sfConfig.fieldType===Oe)switch(this.expiryDatePolicy){case $e:return!0;case Ve:return!this.hasError;default:return!1}if(this.sfConfig.fieldType===ve)switch(this.cvcPolicy){case Be:return!0;case Fe:return!this.hasError;default:return!1}return!1}onIframeLoaded(e){return this.onIframeLoadedCallback=e,this}onEncryption(e){return this.onEncryptionCallback=e,this}onValidation(e){return this.onValidationCallback=e,this}onConfig(e){return this.onConfigCallback=e,this}onFocus(e){return this.onFocusCallback=e,this}onBinValue(e){return this.onBinValueCallback=e,this}onTouchstart(e){return this.onTouchstartCallback=e,this}onShiftTab(e){return this.onShiftTabCallback=e,this}onAutoComplete(e){return this.onAutoCompleteCallback=e,this}onKeyPressed(e){return this.onKeyPressedCallback=e,this}get errorType(){return this._errorType}set errorType(e){this._errorType=e}get hasError(){return this._hasError}set hasError(e){this._hasError=e}get isValid(){if(this.sfConfig.fieldType===ve)switch(this.cvcPolicy){case Be:return!0;case Fe:return!this.hasError;default:return this._isValid}if(this.sfConfig.fieldType===be||this.sfConfig.fieldType===ge||this.sfConfig.fieldType===Oe)switch(this.expiryDatePolicy){case $e:return!0;case Ve:return!this.hasError;default:return this._isValid}return this._isValid}set isValid(e){this._isValid=e}get cvcPolicy(){return this._cvcPolicy}set cvcPolicy(e){this.sfConfig.fieldType===ve&&e!==this.cvcPolicy&&(this._cvcPolicy=e,this.hasError&&"isValidated"===this.errorType&&(this.hasError=!1))}get expiryDatePolicy(){return this._expiryDatePolicy}set expiryDatePolicy(e){this.sfConfig.fieldType!==be&&this.sfConfig.fieldType!==ge&&this.sfConfig.fieldType!==Oe||e!==this.expiryDatePolicy&&(this._expiryDatePolicy=e,this.hasError&&"isValidated"===this.errorType&&(this.hasError=!1))}get iframeContentWindow(){return this._iframeContentWindow}set iframeContentWindow(e){this._iframeContentWindow=e}get isEncrypted(){return this._isEncrypted}set isEncrypted(e){this._isEncrypted=e}get numKey(){return this._numKey}set numKey(e){this._numKey=e}get iframeOnLoadListener(){return this._iframeOnLoadListener}set iframeOnLoadListener(e){this._iframeOnLoadListener=e.bind(this)}get postMessageListener(){return this._postMessageListener}set postMessageListener(e){this._postMessageListener=e.bind(this)}constructor(e,t){super();const n=Pt(["loadingContext","holderEl","iframeSrc","showContextualElement","placeholders"]).from(e);this.sfConfig=an(sn({},n),{iframeUIConfig:sn({},n.iframeUIConfig)});const{iframeSrc:r,placeholders:o,showContextualElement:i}=e;return this.loadingContext=e.loadingContext,this.holderEl=e.holderEl,this.isValid=!1,this.iframeContentWindow=null,this.numKey=function(){if(!window.crypto)return 4294967296*Math.random()|0;const e=new Uint32Array(1);return window.crypto.getRandomValues(e),e[0]}(),this.isEncrypted=!1,this.hasError=!1,this.errorType="",this.cvcPolicy=e.cvcPolicy,this.expiryDatePolicy=e.expiryDatePolicy,this.init(t,r,o,i)}}function ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const un="NETWORK_ERROR",dn="IMPLEMENTATION_ERROR",pn="API_ERROR",hn="ERROR",yn="SDK_ERROR";class mn extends Error{constructor(e,t,n){super(t),ln(this,"cause",void 0),ln(this,"options",void 0),this.name=mn.errorTypes[e],this.options=n||{},this.cause=this.options.cause}}function fn(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function bn(){this.encryptedAttrName=Ue;const e=Mt(this.props.rootNode,`[${this.encryptedAttrName}]`).filter((e=>{const t=Ft(e,this.encryptedAttrName),n=Ae.includes(t);return n||console.warn(`WARNING: '${t}' is not a valid type for the '${this.encryptedAttrName}' attribute. A SecuredField will not be created for this element.`),n})),t=Te,n=Le;return this.config.isCreditCardType?(this.isSingleBrandedCard=!1,this.securityCode="",this.createCardSecuredFields(e,t,n),e.length):(this.createNonCardSecuredFields(e),e.length)}async function gn(e){for(let t=0;t<e.length;t++){const n=e[t];await this.setupSecuredField(n).catch((e=>{window._b$dl&&console.log("Secured fields setup failure. e=",e)}))}}async function On(e,t,n){let r=this.state.type;if("card"===r&&1===this.config.cardGroupTypes.length&&(r=this.config.cardGroupTypes[0],this.state.type=r),this.isSingleBrandedCard="card"!==r,this.isSingleBrandedCard){const e=Lt(r);mt(e)?(t=e.cvcPolicy||Te,n=e.expiryDatePolicy||Le,this.securityCode=e.securityCode):this.state.type="unrecognised-single-brand"}for(let r=0;r<e.length;r++){const o=e[r];window._b$dl&&console.log("\nAbout to set up securedField:",o),await this.setupSecuredField(o,t,n).catch((e=>{window._b$dl&&console.log("Secured fields setup failure. e=",e)})),window._b$dl&&console.log("Finished setting up securedField:",o)}if(window._b$dl&&console.log("Finished setting up all securedFields"),this.isSingleBrandedCard){const e={type:this.state.type,rootNode:this.props.rootNode,brand:r,cvcPolicy:t,expiryDatePolicy:n,cvcText:this.securityCode};setTimeout((()=>{this.callbacks.onBrand(e)}),0)}}function vn(e,t,n){return new Promise(((r,o)=>{const i=Ft(e,this.encryptedAttrName);i===Oe&&(this.state.hasSeparateDateFields=!0);const s={fieldType:i,extraFieldData:Ft(e,Ke),uid:Ft(e,qe),cvcPolicy:t,holderEl:e,expiryDatePolicy:n,txVariant:this.state.type,cardGroupTypes:this.config.cardGroupTypes,iframeUIConfig:this.config.iframeUIConfig,sfLogAtStart:this.config.sfLogAtStart,trimTrailingSeparator:this.config.trimTrailingSeparator,isCreditCardType:this.config.isCreditCardType,iframeSrc:this.config.iframeSrc,loadingContext:this.config.loadingContext,showWarnings:this.config.showWarnings,legacyInputMode:this.config.legacyInputMode,minimumExpiryDate:this.config.minimumExpiryDate,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,disableIOSArrowKeys:this.props.shouldDisableIOSArrowKeys,implementationType:this.props.implementationType,showContextualElement:this.props.showContextualElement,placeholders:this.props.placeholders},a=new cn(s,this.props.i18n).onIframeLoaded((()=>{if(this.state.iframeCount+=1,window._b$dl&&console.log("### createSecuredFields::onIframeLoaded:: this.state.iframeCount=",this.state.iframeCount),this.state.iframeCount>this.state.numIframes)throw this.destroySecuredFields(),new mn("ERROR",`One or more securedFields has just loaded new content. This should never happen. securedFields have been removed.\n iframe load count=${this.state.iframeCount}. Expected count:${this.state.numIframes}`);if(a.loadToConfigTimeout=setTimeout((()=>{o({type:s.fieldType,failReason:"sf took too long to config"})}),6e3),this.state.iframeCount===this.state.originalNumIframes){const e={iframesLoaded:!0};this.callbacks.onLoad(e)}})).onConfig((e=>{this.handleIframeConfigFeedback(e),clearTimeout(a.loadToConfigTimeout),a.loadToConfigTimeout=null,r(e)})).onFocus((e=>{this.handleFocus(e)})).onBinValue((e=>{this.handleBinValue(e)})).onTouchstart((e=>{this.props.shouldDisableIOSArrowKeys&&(this.hasGenuineTouchEvents||e.hasGenuineTouchEvents)&&this.callbacks.onTouchstartIOS({fieldType:e.fieldType}),(e.hasGenuineTouchEvents||this.hasGenuineTouchEvents)&&this.postMessageToAllIframes({fieldType:e.fieldType,fieldClick:!0})})).onShiftTab((e=>{this.handleSFShiftTab(e.fieldType)})).onEncryption((e=>{this.handleEncryption(e)})).onValidation((e=>{this.handleValidation(e)})).onAutoComplete((e=>{this.processAutoComplete(e)})).onKeyPressed((e=>{const t=fn(e,["numKey"]);this.callbacks.onKeyPressed(t)}));this.state.securedFields[i]=a}))}ln(mn,"errorTypes",{NETWORK_ERROR:un,CANCEL:"CANCEL",IMPLEMENTATION_ERROR:dn,API_ERROR:pn,ERROR:hn,SCRIPT_ERROR:"SCRIPT_ERROR",SDK_ERROR:yn});let Pn="undefined"!=typeof navigator&&/(android)/i.test(navigator.userAgent),_n="undefined"!=typeof navigator&&function(){const e=navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){const t=e.indexOf("rv:");return parseInt(e.substring(t+3,e.indexOf(".",t)),10)}const n=e.indexOf("Edge/");return n>0&&parseInt(e.substring(n+5,e.indexOf(".",n)),10)}();var wn={__IS_ANDROID:Pn,__IS_IE:_n,__IS_IOS:"undefined"!=typeof navigator&&/iphone|ipod|ipad/i.test(navigator.userAgent),__IS_FIREFOX:"undefined"!=typeof navigator&&/(firefox)/i.test(navigator.userAgent),__IS_SAFARI:"undefined"!=typeof navigator&&/(safari)/i.test(navigator.userAgent)&&!/(chrome)/i.test(navigator.userAgent)};var Cn={touchendListener:function(e){const t=e.target;if(t instanceof HTMLInputElement||HTMLTextAreaElement&&t instanceof HTMLTextAreaElement){const r=t.value;let o="selectionStart"in(