Benjamin Beganović 414cfca1af New payment flow: Various fixes (#89)
* assets builds

* authorize: use simple-card from asset

* forte: use simple-card from asset

* remove @invoiceninja/simple-card from package

* update usages

* stripe: ach fix

* stripe: alipay fix

* stripe: bacs fix

* stripe: acss fix

* stripe: giropay fix

* assets build
2024-09-04 18:34:59 +02:00

5 lines
19 KiB
JavaScript
Vendored
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var SimpleCard=function(p){"use strict";var Y=p=>{throw TypeError(p)};var je=(p,g,b)=>g.has(p)||Y("Cannot "+b);var X=(p,g,b)=>g.has(p)?Y("Cannot add the same private member more than once"):g instanceof WeakSet?g.add(p):g.set(p,b);var J=(p,g,b)=>(je(p,g,"access private method"),b);var L,Q;const g={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"};class b{constructor(){this.now=null,this.past=[],this.future=[]}undo(){const e=this.past.pop();e&&this.now&&(this.future.push(this.now),this.updateElement(e,"historyUndo"))}redo(){const e=this.future.pop();e&&this.now&&(this.past.push(this.now),this.updateElement(e,"historyRedo"))}updateHistory(e){if(!this.now){this.now=e;return}const s=this.now.value!==e.value,t=this.now.selection.some((i,r)=>i!==e.selection[r]);!s&&!t||(s&&(this.past.push(this.now),this.future=[]),this.now=e)}updateElement(e,s){this.now=e,this.updateElementState(e,{inputType:s,data:null})}}function ee(n,...e){return e.every(({value:s})=>s===n.value)}function te(n,...e){return e.every(({value:s,selection:t})=>s===n.value&&t[0]===n.selection[0]&&t[1]===n.selection[1])}function ne({value:n,selection:e},s,t){const[i,r]=e,l=typeof t=="function"?t({value:n,selection:e}):t;return{value:n,selection:l==="replace"?[i,i+s.length]:[i,r]}}function T(n){return typeof n=="string"}function $(n,e,s,t){let i="";for(let r=e.length;r<n.length;r++){const l=n[r],a=(t==null?void 0:t.value[r])===l;if(!T(l)||l===s&&!a)return i;i+=l}return i}function j(n,e){return Array.isArray(e)?n.length===e.length&&Array.from(n).every((s,t)=>{const i=e[t];return T(i)?s===i:s.match(i)}):e.test(n)}function se(n,e,s){let t=null,i=null;const r=Array.from(n.value).reduce((a,o,c)=>{const u=$(e,a,o,s),d=a+u,h=e[d.length];return T(h)?d+h:o.match(h)?(t===null&&c>=n.selection[0]&&(t=d.length),i===null&&c>=n.selection[1]&&(i=d.length),d+o):d},""),l=$(e,r,"",s);return{value:j(r+l,e)?r+l:r,selection:[t??r.length,i??r.length]}}function ie({value:n,selection:e},s){const[t,i]=e;let r=t,l=i;return{value:Array.from(n).reduce((o,c,u)=>{const d=o+c;return t===u&&(r=o.length),i===u&&(l=o.length),d.match(s)?d:o},""),selection:[r,l]}}function C(n,e,s=null){if(j(n.value,e))return n;const{value:t,selection:i}=Array.isArray(e)?se(n,e,s):ie(n,e);return{selection:i,value:Array.isArray(e)?t.slice(0,e.length):t}}function H(n,e){if(!Array.isArray(e))return n;const[s,t]=n.selection,i=[],r=Array.from(n.value).reduce((l,a,o)=>{const c=e[o];return o===s&&i.push(l.length),o===t&&i.push(l.length),T(c)&&c===a?l:l+a},"");return i.length<2&&i.push(...new Array(2-i.length).fill(r.length)),{value:r,selection:[i[0],i[1]]}}class R{constructor(e,s){this.initialElementState=e,this.maskOptions=s,this.value="",this.selection=[0,0];const{value:t,selection:i}=C(this.initialElementState,this.getMaskExpression(this.initialElementState));this.value=t,this.selection=i}addCharacters([e,s],t){const{value:i}=this,r=this.getMaskExpression({value:i.slice(0,e)+t+i.slice(s),selection:[e+t.length,e+t.length]}),l={value:i,selection:[e,s]},a=H(l,r),[o,c]=ne(a,t,this.maskOptions.overwriteMode).selection,u=a.value.slice(0,o)+t,d=u.length,h=C({value:u+a.value.slice(c),selection:[d,d]},r,l);if(i.slice(0,o)===C({value:u,selection:[d,d]},r,l).value||te(this,h))throw new Error("Invalid mask value");this.value=h.value,this.selection=h.selection}deleteCharacters([e,s]){if(e===s||!s)return;const{value:t}=this,i=this.getMaskExpression({value:t.slice(0,e)+t.slice(s),selection:[e,e]}),r={value:t,selection:[e,s]},l=H(r,i),[a,o]=l.selection,c=l.value.slice(0,a)+l.value.slice(o),u=C({value:c,selection:[a,a]},i,r);this.value=u.value,this.selection=u.selection}getMaskExpression(e){const{mask:s}=this.maskOptions;return typeof s=="function"?s(e):s}}class re{constructor(e){this.element=e,this.listeners=[]}listen(e,s,t){const i=s;this.element.addEventListener(e,i,t),this.listeners.push(()=>this.element.removeEventListener(e,i))}destroy(){this.listeners.forEach(e=>e())}}const v={CTRL:1,ALT:2,SHIFT:4,META:8},D={Y:89,Z:90};function A(n,e,s){return n.ctrlKey===!!(e&v.CTRL)&&n.altKey===!!(e&v.ALT)&&n.shiftKey===!!(e&v.SHIFT)&&n.metaKey===!!(e&v.META)&&n.keyCode===s}function le(n){return A(n,v.CTRL,D.Y)||A(n,v.CTRL|v.SHIFT,D.Z)||A(n,v.META|v.SHIFT,D.Z)}function oe(n){return A(n,v.CTRL,D.Z)||A(n,v.META,D.Z)}function ae({value:n,selection:e},s){const[t,i]=e;if(t!==i)return[t,i];const r=s?n.slice(t).indexOf(`
`)+1||n.length:n.slice(0,i).lastIndexOf(`
`)+1;return[s?t:r,s?r:i]}function ce({value:n,selection:e},s){const[t,i]=e;return t!==i?[t,i]:(s?[t,i+1]:[t-1,i]).map(l=>Math.min(Math.max(l,0),n.length))}const ue=/\s+$/g,de=/^\s+/g,V=/\s/;function he({value:n,selection:e},s){const[t,i]=e;if(t!==i)return[t,i];if(s){const o=n.slice(t),[c]=o.match(de)||[""],u=o.trimStart().search(V);return[t,u!==-1?t+c.length+u:n.length]}const r=n.slice(0,i),[l]=r.match(ue)||[""],a=r.trimEnd().split("").reverse().findIndex(o=>o.match(V));return[a!==-1?i-l.length-a:0,i]}function k(n=[]){return(e,...s)=>n.reduce((t,i)=>Object.assign(Object.assign({},t),i(t,...s)),e)}function me(n,e){const s=Object.assign(Object.assign({},g),e),t=k(s.preprocessors),i=k(s.postprocessors),r=typeof n=="string"?{value:n,selection:[0,0]}:n,{elementState:l}=t({elementState:r,data:""},"validation"),a=new R(l,s),{value:o,selection:c}=i(a,r);return typeof n=="string"?o:{value:o,selection:c}}class M extends b{constructor(e,s){super(),this.element=e,this.maskitoOptions=s,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new re(this.element),this.options=Object.assign(Object.assign({},g),this.maskitoOptions),this.preprocessor=k(this.options.preprocessors),this.postprocessor=k(this.options.postprocessors),this.teardowns=this.options.plugins.map(t=>t(this.element,this.options)),this.updateHistory(this.elementState),this.eventListener.listen("keydown",t=>{if(le(t))return t.preventDefault(),this.redo();if(oe(t))return t.preventDefault(),this.undo()}),this.eventListener.listen("beforeinput",t=>{var i;const r=t.inputType.includes("Forward");switch(this.updateHistory(this.elementState),t.inputType){case"historyUndo":return t.preventDefault(),this.undo();case"historyRedo":return t.preventDefault(),this.redo();case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.handleDelete({event:t,isForward:r,selection:ce(this.elementState,r)});case"deleteWordForward":case"deleteWordBackward":return this.handleDelete({event:t,isForward:r,selection:he(this.elementState,r),force:!0});case"deleteSoftLineBackward":case"deleteSoftLineForward":case"deleteHardLineBackward":case"deleteHardLineForward":return this.handleDelete({event:t,isForward:r,selection:ae(this.elementState,r),force:!0});case"insertCompositionText":return;case"insertReplacementText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(t);case"insertFromPaste":case"insertText":case"insertFromDrop":default:return this.handleInsert(t,t.data||((i=t.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain"))||"")}}),this.eventListener.listen("input",({inputType:t})=>{t!=="insertCompositionText"&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}get elementState(){const{value:e,selectionStart:s,selectionEnd:t}=this.element;return{value:e,selection:[s||0,t||0]}}get maxLength(){const{maxLength:e}=this.element;return e===-1?1/0:e}destroy(){this.eventListener.destroy(),this.teardowns.forEach(e=>e==null?void 0:e())}updateElementState({value:e,selection:s},t={inputType:"insertText",data:null}){const i=this.elementState.value;this.updateValue(e),this.updateSelectionRange(s),i!==e&&this.dispatchInputEvent(t)}updateSelectionRange([e,s]){var t;const{element:i}=this;i.matches(":focus")&&(i.selectionStart!==e||i.selectionEnd!==s)&&((t=i.setSelectionRange)===null||t===void 0||t.call(i,e,s))}updateValue(e){this.element.value=e}ensureValueFitsMask(){this.updateElementState(me(this.elementState,this.options))}dispatchInputEvent(e={inputType:"insertText",data:null}){globalThis.InputEvent&&this.element.dispatchEvent(new InputEvent("input",Object.assign(Object.assign({},e),{bubbles:!0,cancelable:!1})))}handleDelete({event:e,selection:s,isForward:t,force:i=!1}){const r={value:this.elementState.value,selection:s},[l,a]=r.selection,{elementState:o}=this.preprocessor({elementState:r,data:""},t?"deleteForward":"deleteBackward"),c=new R(o,this.options),[u,d]=o.selection;c.deleteCharacters([u,d]);const h=this.postprocessor(c,r);if(!(r.value.slice(0,l)+r.value.slice(a)===h.value&&!i&&!this.element.isContentEditable)){if(e.preventDefault(),ee(r,o,c,h))return this.updateSelectionRange(t?[d,d]:[u,u]);this.updateElementState(h,{inputType:e.inputType,data:null}),this.updateHistory(h)}}handleInsert(e,s){const t=this.elementState,{elementState:i,data:r=s}=this.preprocessor({data:s,elementState:t},"insert"),l=new R(i,this.options);try{l.addCharacters(i.selection,r)}catch{return e.preventDefault()}const[a,o]=i.selection,c=t.value.slice(0,a)+s+t.value.slice(o),u=this.postprocessor(l,t);if(u.value.length>this.maxLength)return e.preventDefault();(c!==u.value||this.element.isContentEditable)&&(e.preventDefault(),this.updateElementState(u,{data:s,inputType:e.inputType}),this.updateHistory(u))}handleEnter(e){(this.isTextArea||this.element.isContentEditable)&&this.handleInsert(e,`
`)}}function pe(n,e,s){const t=Math.min(Number(s),Math.max(Number(e),Number(n)));return n instanceof Date?new Date(t):t}function fe(n){return n.replaceAll(/\W/g,"").length}const N=n=>{var e,s,t;return{day:((e=n.match(/d/g))===null||e===void 0?void 0:e.length)||0,month:((s=n.match(/m/g))===null||s===void 0?void 0:s.length)||0,year:((t=n.match(/y/g))===null||t===void 0?void 0:t.length)||0}};function ge(n){return{day:String(n.getDate()).padStart(2,"0"),month:String(n.getMonth()+1).padStart(2,"0"),year:String(n.getFullYear()).padStart(4,"0"),hours:String(n.getHours()).padStart(2,"0"),minutes:String(n.getMinutes()).padStart(2,"0"),seconds:String(n.getSeconds()).padStart(2,"0"),milliseconds:String(n.getMilliseconds()).padStart(3,"0")}}function ve(n,e){return n.length<e.length?!1:n.split(/\D/).every(s=>!s.match(/^0+$/))}function P(n,e,s){const t=fe(e);return n.replace(s,"").match(new RegExp(`(\\D*\\d[^\\d\\s]*){1,${t}}`,"g"))||[]}function I(n,e){const s=e.replaceAll(/[^dmy]/g,""),t=n.replaceAll(/\D+/g,""),i={day:t.slice(s.indexOf("d"),s.lastIndexOf("d")+1),month:t.slice(s.indexOf("m"),s.lastIndexOf("m")+1),year:t.slice(s.indexOf("y"),s.lastIndexOf("y")+1)};return Object.fromEntries(Object.entries(i).filter(([r,l])=>!!l).sort(([r],[l])=>e.toLowerCase().indexOf(r[0])>e.toLowerCase().indexOf(l[0])?1:-1))}function Se(n,e){var s,t,i,r,l,a,o;const c=((s=n.year)===null||s===void 0?void 0:s.length)===2?`20${n.year}`:n.year,u=new Date(Number(c??"0"),Number((t=n.month)!==null&&t!==void 0?t:"1")-1,Number((i=n.day)!==null&&i!==void 0?i:"1"),Number((r=void 0)!==null&&r!==void 0?r:"0"),Number((l=void 0)!==null&&l!==void 0?l:"0"),Number((a=void 0)!==null&&a!==void 0?a:"0"),Number((o=void 0)!==null&&o!==void 0?o:"0"));return u.setFullYear(Number(c??"0")),u}const B=", ";function x({day:n,month:e,year:s,hours:t,minutes:i,seconds:r,milliseconds:l},{dateMode:a,dateTimeSeparator:o=B,timeMode:c}){var u;const d=((u=a.match(/y/g))===null||u===void 0?void 0:u.length)===2?s==null?void 0:s.slice(-2):s;return(a+(c?o+c:"")).replaceAll(/d+/g,n??"").replaceAll(/m+/g,e??"").replaceAll(/y+/g,d??"").replaceAll(/H+/g,t??"").replaceAll("MSS",l??"").replaceAll(/M+/g,i??"").replaceAll(/S+/g,r??"").replaceAll(/^\D+/g,"").replaceAll(/\D+$/g,"")}const W={day:31,month:12,year:9999},Ee=new Date("0001-01-01"),ye=new Date("9999-12-31"),be=[":","."];function we({dateString:n,dateModeTemplate:e,dateSegmentsSeparator:s,offset:t,selection:[i,r]}){const l=I(n,e),a=Object.entries(l),o={};for(const[d,h]of a){const f=x(o,{dateMode:e}),w=W[d],E=f.length&&s.length,S=t+f.length+E+N(e)[d],y=S>=i&&S===r;if(y&&Number(h)>Number(w))return{validatedDateString:"",updatedSelection:[i,r]};if(y&&Number(h)<1)return{validatedDateString:"",updatedSelection:[i,r]};o[d]=h}const c=x(o,{dateMode:e}),u=c.length-n.length;return{validatedDateString:c,updatedSelection:[i+u,r+u]}}const U=/[\\^$.*+?()[\]{}|]/g,De=new RegExp(U.source);function G(n){return n&&De.test(n)?n.replaceAll(U,"\\$&"):n}function O(n,e,s=0){return Number(n.padEnd(e.length,"0"))<=Number(e)?{validatedSegmentValue:n,prefixedZeroesCount:s}:n.endsWith("0")?O(`0${n.slice(0,e.length-1)}`,e,s+1):O(`${n.slice(0,e.length-1)}0`,e,s)}function Z(n){return n.replaceAll(/[-]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function Ae({dateModeTemplate:n,dateSegmentSeparator:e,splitFn:s,uniteFn:t}){return({value:i,selection:r})=>{var l;const[a,o]=r,{dateStrings:c,restPart:u=""}=s(i),d=[];let h=0;c.forEach(w=>{const E=I(w,n),y=Object.entries(E).reduce((_,[K,Fe])=>{const{validatedSegmentValue:_e,prefixedZeroesCount:$e}=O(Fe,`${W[K]}`);return h+=$e,Object.assign(Object.assign({},_),{[K]:_e})},{});d.push(x(y,{dateMode:n}))});const f=t(d,i)+(!((l=c[c.length-1])===null||l===void 0)&&l.endsWith(e)?e:"")+u;return h&&f.slice(o+h,o+h+e.length)===e&&(h+=e.length),{selection:[a+h,o+h],value:f}}}function xe(){return({elementState:n,data:e})=>{const{value:s,selection:t}=n;return{elementState:{selection:t,value:Z(s)},data:Z(e)}}}function Te(n,e){const s=N(e);return Object.fromEntries(Object.entries(n).map(([t,i])=>{const r=s[t];return[t,i.length===r&&i.match(/^0+$/)?"1".padStart(r,"0"):i]}))}function Ce({dateModeTemplate:n,min:e=Ee,max:s=ye,rangeSeparator:t="",dateSegmentSeparator:i="."}){return({value:r,selection:l})=>{const a=t&&r.endsWith(t),o=P(r,n,t);let c="";for(const u of o){c+=c?t:"";const d=I(u,n);if(!ve(u,n)){const w=Te(d,n),E=x(w,{dateMode:n}),S=u.endsWith(i)?i:"";c+=E+S;continue}const h=Se(d),f=pe(h,e,s);c+=x(ge(f),{dateMode:n})}return{selection:l,value:c+(a?t:"")}}}function ke({dateModeTemplate:n,dateSegmentsSeparator:e,rangeSeparator:s="",dateTimeSeparator:t=B}){return({elementState:i,data:r})=>{const l=s?new RegExp(`${s}|-`):t,a=r.split(l),o=r.includes(t)?[a[0]]:a;if(o.every(c=>c.trim().split(/\D/).filter(Boolean).length===n.split(e).length)){const c=o.map(u=>Le(u,n,e)).join(s);return{elementState:i,data:`${c}${r.includes(t)&&t+a[1]||""}`}}return{elementState:i,data:r}}}function Le(n,e,s){const t=n.split(/\D/).filter(Boolean),i=e.split(s);return t.map((l,a)=>a===i.length-1?l:l.padStart(i[a].length,"0")).join(s)}function Re({dateModeTemplate:n,dateSegmentsSeparator:e,rangeSeparator:s=""}){return({elementState:t,data:i})=>{const{value:r,selection:l}=t;if(i===e)return{elementState:t,data:l[0]===r.length?i:""};const a=i.replaceAll(new RegExp(`[^\\d${G(e)}${s}]`,"g"),"");if(!a)return{elementState:t,data:""};const[o,c]=l;let u=c+i.length;const d=r.slice(0,o)+a+r.slice(u),h=P(d,n,s);let f="";const w=!!s&&d.includes(s);for(const S of h){const{validatedDateString:y,updatedSelection:_}=we({dateString:S,dateModeTemplate:n,dateSegmentsSeparator:e,offset:f.length,selection:[o,u]});if(S&&!y)return{elementState:t,data:""};u=_[1],f+=w&&!f?y+s:y}const E=f.slice(o,u);return{elementState:{selection:l,value:f.slice(0,o)+E.split(e).map(S=>"0".repeat(S.length)).join(e)+f.slice(u)},data:E}}}function Me(){return({elementState:n},e)=>{const{value:s,selection:t}=n;if(!s||Ie(s,t))return{elementState:n};const[i,r]=t,l=s.slice(i,r).replaceAll(/\d/g,"0"),a=s.slice(0,i)+l+s.slice(r);return e==="validation"||e==="insert"&&i===r?{elementState:{selection:t,value:a}}:{elementState:{selection:e==="deleteBackward"||e==="insert"?[i,i]:[r,r],value:a}}}}function Ie(n,[e,s]){return s===n.length}function Oe({mode:n,separator:e=".",max:s,min:t}){const i=n.split("/").join(e);return Object.assign(Object.assign({},g),{mask:Array.from(i).map(r=>e.includes(r)?r:/\d/),overwriteMode:"replace",preprocessors:[xe(),Me(),ke({dateModeTemplate:i,dateSegmentsSeparator:e}),Re({dateModeTemplate:i,dateSegmentsSeparator:e})],postprocessors:[Ae({dateModeTemplate:i,dateSegmentSeparator:e,splitFn:r=>({dateStrings:[r]}),uniteFn:([r])=>r}),Ce({min:t,max:s,dateModeTemplate:i,dateSegmentSeparator:e})]})}new RegExp(`[${be.map(G).join("")}]$`);const q=/^(?:\d{4}[ -]?){0,3}\d{0,4}$/,m={visa:{final:/^4(?:\d{3}[- ]?){3}\d{3,4}$/,start:/^4/,length:/^4\d{0,15}$/},mastercard:{final:/^5[1-5]\d{3}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/,start:/^5[1-5]/,length:/^5[1-5]\d{0,15}$/},amex:{final:/^3[47]\d{2}[- ]?\d{6}[- ]?\d{5}$/,start:/^3[47]/,length:/^3[47]\d{0,15}$/},discover:{final:/^(6011|65|64[4-9])\d{4}[- ]?\d{4}[- ]?\d{4}$/,start:/^(6011|65|64[4-9])/,length:/^(6011|65|64[4-9])\d{0,15}$/},diners:{final:/^(30[0-5]|36|38|39)\d{4}[- ]?\d{4}[- ]?\d{4}$/,start:/^(30[0-5]|36|38|39)/,length:/^(30[0-5]|36|38|39)\d{0,14}$/},jcb:{final:/^(2131|1800|35[0-9]{3})\d{4}[- ]?\d{4}[- ]?\d{4}$/,start:/^(2131|1800|35[0-9]{3})/,length:/^(2131|1800|35[0-9]{3})\d{0,15}$/}};class F{constructor(e){X(this,L);this.options=e}mount(){return this.number=this.options.fields.card.number instanceof HTMLInputElement?this.options.fields.card.number:document.querySelector(this.options.fields.card.number),this.date=this.options.fields.card.date instanceof HTMLInputElement?this.options.fields.card.date:document.querySelector(this.options.fields.card.date),this.cvv=this.options.fields.card.cvv instanceof HTMLInputElement?this.options.fields.card.cvv:document.querySelector(this.options.fields.card.cvv),J(this,L,Q).call(this),this}check(){const e=m.visa.final.test(this.number.value)||m.mastercard.final.test(this.number.value)||m.amex.final.test(this.number.value)||m.discover.final.test(this.number.value)||m.diners.final.test(this.number.value)||m.jcb.final.test(this.number.value),s=new RegExp("^(0[1-9]|1[0-2])/(?:\\d{2})$").test(this.date.value),t=new RegExp("^\\d{3}$").test(this.cvv.value);return{valid:e&&s&&t,number:{valid:e,value:this.number.value},date:{valid:s,value:this.date.value},cvv:{valid:t,value:this.cvv.value}}}type(){return m.visa.start.test(this.number.value)?"visa":m.mastercard.start.test(this.number.value)?"mastercard":m.amex.start.test(this.number.value)?"amex":m.discover.start.test(this.number.value)?"discover":m.diners.start.test(this.number.value)?"diners":m.jcb.start.test(this.number.value)?"jcb":"unknown"}value(e){if(e==="number")return this.number.value;if(e==="date")return this.date.value;if(e==="year"){const[,s]=this.date.value.split("/");return s}if(e==="month"){const[s]=this.date.value.split("/");return s}return e==="cvv"?this.cvv.value:null}}L=new WeakSet,Q=function(){new M(this.number,{mask:e=>m.visa.start.test(e.value)?new RegExp(m.visa.length):m.mastercard.start.test(e.value)?new RegExp(m.mastercard.length):m.amex.start.test(e.value)?new RegExp(m.amex.length):m.discover.start.test(e.value)?new RegExp(m.discover.length):m.diners.start.test(e.value)?new RegExp(m.diners.length):m.jcb.start.test(e.value)?new RegExp(m.jcb.length):new RegExp(q)}),new M(this.date,Oe({mode:"mm/yy",separator:"/"})),new M(this.cvv,{mask:[/\d/,/\d/,/\d/]})},window.SimpleCard=F,window.createSimpleCard=z;function z(n){return new F(n)}return p.SimpleCard=F,p.createSimpleCard=z,p.masks=m,p.numbers=q,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});