mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
5 lines
19 KiB
JavaScript
Vendored
5 lines
19 KiB
JavaScript
Vendored
var SimpleCard=function(m){"use strict";var Y=m=>{throw TypeError(m)};var $e=(m,v,w)=>v.has(m)||Y("Cannot "+w);var X=(m,v,w)=>v.has(m)?Y("Cannot add the same private member more than once"):v instanceof WeakSet?v.add(m):v.set(m,w);var J=(m,v,w)=>($e(m,v,"access private method"),w);var L,Q;const v={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"};class w{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 j(n,e,s,t){let i="";for(let r=e.length;r<n.length;r++){const l=n[r],o=(t==null?void 0:t.value[r])===l;if(!T(l)||l===s&&!o)return i;i+=l}return i}function $(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((o,a,c)=>{const u=j(e,o,a,s),d=o+u,h=e[d.length];return T(h)?d+h:a.match(h)?(t===null&&c>=n.selection[0]&&(t=d.length),i===null&&c>=n.selection[1]&&(i=d.length),d+a):d},""),l=j(e,r,"",s);return{value:$(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((a,c,u)=>{const d=a+c;return t===u&&(r=a.length),i===u&&(l=a.length),d.match(s)?d:a},""),selection:[r,l]}}function C(n,e,s=null){if($(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,o,a)=>{const c=e[a];return a===s&&i.push(l.length),a===t&&i.push(l.length),T(c)&&c===o?l:l+o},"");return i.length<2&&i.push(...new Array(2-i.length).fill(r.length)),{value:r,selection:[i[0],i[1]]}}class M{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]},o=H(l,r),[a,c]=ne(o,t,this.maskOptions.overwriteMode).selection,u=o.value.slice(0,a)+t,d=u.length,h=C({value:u+o.value.slice(c),selection:[d,d]},r,l);if(i.slice(0,a)===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),[o,a]=l.selection,c=l.value.slice(0,o)+l.value.slice(a),u=C({value:c,selection:[o,o]},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 g={CTRL:1,ALT:2,SHIFT:4,META:8},b={Y:89,Z:90};function D(n,e,s){return n.ctrlKey===!!(e&g.CTRL)&&n.altKey===!!(e&g.ALT)&&n.shiftKey===!!(e&g.SHIFT)&&n.metaKey===!!(e&g.META)&&n.keyCode===s}function le(n){return D(n,g.CTRL,b.Y)||D(n,g.CTRL|g.SHIFT,b.Z)||D(n,g.META|g.SHIFT,b.Z)}function ae(n){return D(n,g.CTRL,b.Z)||D(n,g.META,b.Z)}function oe({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 a=n.slice(t),[c]=a.match(de)||[""],u=a.trimStart().search(V);return[t,u!==-1?t+c.length+u:n.length]}const r=n.slice(0,i),[l]=r.match(ue)||[""],o=r.trimEnd().split("").reverse().findIndex(a=>a.match(V));return[o!==-1?i-l.length-o:0,i]}function x(n=[]){return(e,...s)=>n.reduce((t,i)=>Object.assign(Object.assign({},t),i(t,...s)),e)}function fe(n,e){const s=Object.assign(Object.assign({},v),e),t=x(s.preprocessors),i=x(s.postprocessors),r=typeof n=="string"?{value:n,selection:[0,0]}:n,{elementState:l}=t({elementState:r,data:""},"validation"),o=new M(l,s),{value:a,selection:c}=i(o,r);return typeof n=="string"?a:{value:a,selection:c}}class I extends w{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({},v),this.maskitoOptions),this.preprocessor=x(this.options.preprocessors),this.postprocessor=x(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(ae(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:oe(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(fe(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,o]=r.selection,{elementState:a}=this.preprocessor({elementState:r,data:""},t?"deleteForward":"deleteBackward"),c=new M(a,this.options),[u,d]=a.selection;c.deleteCharacters([u,d]);const h=this.postprocessor(c,r);if(!(r.value.slice(0,l)+r.value.slice(o)===h.value&&!i&&!this.element.isContentEditable)){if(e.preventDefault(),ee(r,a,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 M(i,this.options);try{l.addCharacters(i.selection,r)}catch{return e.preventDefault()}const[o,a]=i.selection,c=t.value.slice(0,o)+s+t.value.slice(a),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 me(n,e,s){const t=Math.min(Number(s),Math.max(Number(e),Number(n)));return n instanceof Date?new Date(t):t}function pe(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 ve(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 ge(n,e){return n.length<e.length?!1:n.split(/\D/).every(s=>!s.match(/^0+$/))}function P(n,e,s){const t=pe(e);return n.replace(s,"").match(new RegExp(`(\\D*\\d[^\\d\\s]*){1,${t}}`,"g"))||[]}function O(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 ye(n,e){var s,t,i,r,l,o,a;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((o=void 0)!==null&&o!==void 0?o:"0"),Number((a=void 0)!==null&&a!==void 0?a:"0"));return u.setFullYear(Number(c??"0")),u}const B=", ";function k({day:n,month:e,year:s,hours:t,minutes:i,seconds:r,milliseconds:l},{dateMode:o,dateTimeSeparator:a=B,timeMode:c}){var u;const d=((u=o.match(/y/g))===null||u===void 0?void 0:u.length)===2?s==null?void 0:s.slice(-2):s;return(o+(c?a+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},Se=new Date("0001-01-01"),Ee=new Date("9999-12-31"),we=[":","."];function Ae({dateString:n,dateModeTemplate:e,dateSegmentsSeparator:s,offset:t,selection:[i,r]}){const l=O(n,e),o=Object.entries(l),a={};for(const[d,h]of o){const p=k(a,{dateMode:e}),A=W[d],S=p.length&&s.length,y=t+p.length+S+N(e)[d],E=y>=i&&y===r;if(E&&Number(h)>Number(A))return{validatedDateString:"",updatedSelection:[i,r]};if(E&&Number(h)<1)return{validatedDateString:"",updatedSelection:[i,r]};a[d]=h}const c=k(a,{dateMode:e}),u=c.length-n.length;return{validatedDateString:c,updatedSelection:[i+u,r+u]}}const U=/[\\^$.*+?()[\]{}|]/g,be=new RegExp(U.source);function G(n){return n&&be.test(n)?n.replaceAll(U,"\\$&"):n}function R(n,e,s=0){return Number(n.padEnd(e.length,"0"))<=Number(e)?{validatedSegmentValue:n,prefixedZeroesCount:s}:n.endsWith("0")?R(`0${n.slice(0,e.length-1)}`,e,s+1):R(`${n.slice(0,e.length-1)}0`,e,s)}function Z(n){return n.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function De({dateModeTemplate:n,dateSegmentSeparator:e,splitFn:s,uniteFn:t}){return({value:i,selection:r})=>{var l;const[o,a]=r,{dateStrings:c,restPart:u=""}=s(i),d=[];let h=0;c.forEach(A=>{const S=O(A,n),E=Object.entries(S).reduce((_,[K,Fe])=>{const{validatedSegmentValue:_e,prefixedZeroesCount:je}=R(Fe,`${W[K]}`);return h+=je,Object.assign(Object.assign({},_),{[K]:_e})},{});d.push(k(E,{dateMode:n}))});const p=t(d,i)+(!((l=c[c.length-1])===null||l===void 0)&&l.endsWith(e)?e:"")+u;return h&&p.slice(a+h,a+h+e.length)===e&&(h+=e.length),{selection:[o+h,a+h],value:p}}}function ke(){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=Se,max:s=Ee,rangeSeparator:t="",dateSegmentSeparator:i="."}){return({value:r,selection:l})=>{const o=t&&r.endsWith(t),a=P(r,n,t);let c="";for(const u of a){c+=c?t:"";const d=O(u,n);if(!ge(u,n)){const A=Te(d,n),S=k(A,{dateMode:n}),y=u.endsWith(i)?i:"";c+=S+y;continue}const h=ye(d),p=me(h,e,s);c+=k(ve(p),{dateMode:n})}return{selection:l,value:c+(o?t:"")}}}function xe({dateModeTemplate:n,dateSegmentsSeparator:e,rangeSeparator:s="",dateTimeSeparator:t=B}){return({elementState:i,data:r})=>{const l=s?new RegExp(`${s}|-`):t,o=r.split(l),a=r.includes(t)?[o[0]]:o;if(a.every(c=>c.trim().split(/\D/).filter(Boolean).length===n.split(e).length)){const c=a.map(u=>Le(u,n,e)).join(s);return{elementState:i,data:`${c}${r.includes(t)&&t+o[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,o)=>o===i.length-1?l:l.padStart(i[o].length,"0")).join(s)}function Me({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 o=i.replaceAll(new RegExp(`[^\\d${G(e)}${s}]`,"g"),"");if(!o)return{elementState:t,data:""};const[a,c]=l;let u=c+i.length;const d=r.slice(0,a)+o+r.slice(u),h=P(d,n,s);let p="";const A=!!s&&d.includes(s);for(const y of h){const{validatedDateString:E,updatedSelection:_}=Ae({dateString:y,dateModeTemplate:n,dateSegmentsSeparator:e,offset:p.length,selection:[a,u]});if(y&&!E)return{elementState:t,data:""};u=_[1],p+=A&&!p?E+s:E}const S=p.slice(a,u);return{elementState:{selection:l,value:p.slice(0,a)+S.split(e).map(y=>"0".repeat(y.length)).join(e)+p.slice(u)},data:S}}}function Ie(){return({elementState:n},e)=>{const{value:s,selection:t}=n;if(!s||Oe(s,t))return{elementState:n};const[i,r]=t,l=s.slice(i,r).replaceAll(/\d/g,"0"),o=s.slice(0,i)+l+s.slice(r);return e==="validation"||e==="insert"&&i===r?{elementState:{selection:t,value:o}}:{elementState:{selection:e==="deleteBackward"||e==="insert"?[i,i]:[r,r],value:o}}}}function Oe(n,[e,s]){return s===n.length}function Re({mode:n,separator:e=".",max:s,min:t}){const i=n.split("/").join(e);return Object.assign(Object.assign({},v),{mask:Array.from(i).map(r=>e.includes(r)?r:/\d/),overwriteMode:"replace",preprocessors:[ke(),Ie(),xe({dateModeTemplate:i,dateSegmentsSeparator:e}),Me({dateModeTemplate:i,dateSegmentsSeparator:e})],postprocessors:[De({dateModeTemplate:i,dateSegmentSeparator:e,splitFn:r=>({dateStrings:[r]}),uniteFn:([r])=>r}),Ce({min:t,max:s,dateModeTemplate:i,dateSegmentSeparator:e})]})}new RegExp(`[${we.map(G).join("")}]$`);const q=/^(?:\d{4}[ -]?){0,3}\d{0,4}$/,f={visa:{final:/^4[0-9]{12}(?:[0-9]{3})?$/,start:/^4/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(3).fill(/\d/)]},mastercard:{final:/^5[1-5][0-9]{14}$/,start:/^5[1-5]/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)]},amex:{final:/^3[47][0-9]{13}$/,start:/^3[47]/,mask:[...new Array(4).fill(/\d/)," ",...new Array(6).fill(/\d/)," ",...new Array(5).fill(/\d/)]},discover:{final:/^6(?:011|5[0-9]{2})[0-9]{12}$/,start:/^(6011|65|64[4-9])/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)]},diners:{final:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,start:/^(30[0-5]|36|38|39)/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)]},jcb:{final:/^(?:2131|1800|35\d{3})\d{11}$/,start:/^(2131|1800|35[0-9]{3})/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(3).fill(/\d/)]}};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=f.visa.final.test(this.value("number"))||f.mastercard.final.test(this.value("number"))||f.amex.final.test(this.value("number"))||f.discover.final.test(this.value("number"))||f.diners.final.test(this.value("number"))||f.jcb.final.test(this.value("number")),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 f.visa.start.test(this.number.value)?"visa":f.mastercard.start.test(this.number.value)?"mastercard":f.amex.start.test(this.number.value)?"amex":f.discover.start.test(this.number.value)?"discover":f.diners.start.test(this.number.value)?"diners":f.jcb.start.test(this.number.value)?"jcb":"unknown"}value(e){if(e==="number")return this.number.value.replace(/\s+/g,"");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 I(this.number,{mask:e=>f.visa.start.test(e.value)?f.visa.mask:f.mastercard.start.test(e.value)?f.mastercard.mask:f.amex.start.test(e.value)?f.amex.mask:f.discover.start.test(e.value)?f.discover.mask:f.diners.start.test(e.value)?f.diners.mask:f.jcb.start.test(e.value)?f.jcb.mask:new RegExp(q)}),new I(this.date,Re({mode:"mm/yy",separator:"/"})),new I(this.cvv,{mask:[/\d/,/\d/,/\d/]})},window.SimpleCard=F,window.createSimpleCard=z;function z(n){return new F(n)}return m.SimpleCard=F,m.createSimpleCard=z,m.masks=f,m.numbers=q,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m}({});
|