!function(r,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t=e();for(var n in t)("object"==typeof exports?exports:r)[n]=t[n]}}(this,(()=>(()=>{"use strict";var r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},e={};r.r(e),r.d(e,{cnpjIsValid:()=>a,cpfIsValid:()=>n,default:()=>br,getOnlyEmail:()=>f,identifyFlagCard:()=>P,isAscii:()=>L,isBase64:()=>Z,isCEP:()=>g,isCreditCardValid:()=>S,isDate:()=>z,isDecimal:()=>C,isEmail:()=>c,isEmpty:()=>N,isMACAddress:()=>I,isMD5:()=>U,isNumber:()=>$,isPort:()=>D,isPostalCode:()=>j,isTime:()=>F,isValidAudio:()=>gr,isValidImage:()=>ur,isValidPdf:()=>cr,isValidTxt:()=>wr,isValidVideo:()=>vr,passwordStrengthTester:()=>J,validateBRPhoneNumber:()=>q,validateEmail:()=>p,validateName:()=>X,validatePassportNumber:()=>k,validatePassword:()=>b,validatePhoneNumber:()=>W,validateSurname:()=>K,validateTextarea:()=>tr,validateUSPhoneNumber:()=>R,validateUsername:()=>x});var t=["CPF invalid","CPF must have 11 numerical digits","CPF is not valid","Unknown error"];const n=function(r,e){if(void 0===e&&(e=t),"string"!=typeof r)throw new TypeError("The input should be a string.");if(e){if(!Array.isArray(e))throw new TypeError("Must be an Array");for(var n=0;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=function(r,e){var t="function"==typeof Symbol&&r[Symbol.iterator];if(!t)return r;var n,i,a=t.call(r),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(r){i={error:r}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(i)throw i.error}}return o},u=function(r,e,t){if(t||2===arguments.length)for(var n,i=0,a=e.length;i10)return!1;var e=r.replace(/\D/g,"");return 8===e.length&&!Number.isNaN(e)}catch(r){return!1}},c=function(r){if("string"!=typeof r)throw new TypeError("Invalid input, must be a string");if(!r)throw new Error("Value cannot be null or empty");if(/^[^a-zA-Z0-9]/.test(r))return!1;if(Number(r[0]))return!1;if(!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(r))return!1;var e=r.indexOf("@"),t=r.indexOf("@")+1,n=r.lastIndexOf(".");if(Number(r[t]))return!1;if(Number(r[n]))return!1;if(r.substring(0,e).includes(".."))return!1;if(r.substring(0,e).endsWith("."))return!1;var i=r.split(".");if(i.length>2&&i[i.length-2]===i[i.length-3])return!1;if(r.split("@").length-1>1)return!1;if(r.substring(t).includes(".."))return!1;var a=r.split("@")[1].split("."),o=Array.from(new Set(a));return a.length===o.length};var h=["Email cannot be empty","This e-mail is not valid","Email too big, try again","This email is not valid in the country","Email domain is not allowed.","Unknown error"],m=["@gmail.com","@outlook.com","@yahoo.com","@icloud.com","@hotmail.com","@mail.ru","@yandex.ru","@gmx.com","@zoho.com","@protonmail.com","@protonmail.ch"],y={maxLength:void 0,country:"",errorMsg:h,validDomains:!1};const p=function(r,e){var t=void 0===e?y:e,n=t.maxLength,i=t.country,a=t.errorMsg,o=t.validDomains;if("string"!=typeof r)throw new TypeError("The input should be a string.");var s=/(?:)/;if(Array.isArray(o)&&o.length>0){var u=o.map((function(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));s=new RegExp("".concat(u.join("|"),"$"),"i")}else o&&(s=new RegExp("".concat(m.join("|"),"$"),"i"));if(a){if(!Array.isArray(a))throw new Error("errorMsg must be an Array or null");for(var l=0;ld?{isValid:!1,errorMsg:f(2)}:i&&!r.endsWith(".".concat(i))?{isValid:!1,errorMsg:f(3)}:{isValid:!0,errorMsg:null}:{isValid:!1,errorMsg:f(1)}:{isValid:!1,errorMsg:f(4)}}catch(r){return{isValid:!1,errorMsg:f(5)}}};var v=["This password is too long","password too short","Password requires at least one capital letter","Password requires at least one special character","Password requires at least one number","Password requires at least one letter","Unknown error"],w={minLength:void 0,maxLength:void 0,options:{requireUppercase:!1,requireSpecialChar:!1,requireNumber:!1,requireString:!1},errorMsg:v};const b=function(r,e){var t=void 0===e?w:e,n=t.minLength,i=t.maxLength,a=t.options,o=t.errorMsg;if("string"!=typeof r)throw new TypeError("The input should be a string.");if(o){if(!Array.isArray(o))throw new Error("errorMsg must be an Array or null");for(var s=0;sl)throw new Error("the minimum size cannot be larger than the maximum");if(u<1||l<1)throw new Error("No size can be smaller than 1");try{return r.length>l?{isValid:!1,errorMsg:d(0)}:r.length]/.test(r)?{isValid:!1,errorMsg:d(3)}:(null==a?void 0:a.requireNumber)&&!/\d/.test(r)?{isValid:!1,errorMsg:d(4)}:(null==a?void 0:a.requireString)&&!/[a-zA-Z]/.test(r)?{isValid:!1,errorMsg:d(5)}:{isValid:!0,errorMsg:null}}catch(r){return{isValid:!1,errorMsg:d(6)}}};var M=/\s/,A=/^\d+$/,E=/^\d/,V=["Username cannot be empty","username too short","This username is too long","Username cannot contain spaces","Cannot start with a number","Cannot contain only numbers","Unknown error"],T={minLength:void 0,maxLength:void 0,errorMsg:V};const x=function(r,e){var t,n,i=void 0===e?T:e,a=i.minLength,o=i.maxLength,s=i.errorMsg;if("string"!=typeof r)throw new TypeError("The input should be a string.");if(s){if(!Array.isArray(s))throw new Error("errorMsg must be an Array or null");for(var u=0;ud)throw new Error("Minimum cannot be greater than maximum");if(l<1||d<1)throw new Error("Size parameters cannot be less than one");try{if(M.test(r))return{isValid:!1,errorMsg:f(3)};if(A.test(r))return{isValid:!1,errorMsg:f(5)};if(E.test(r))return{isValid:!1,errorMsg:f(4)};if(r.lengthd)return{isValid:!1,errorMsg:f(2)};var g=["!","@","#","$","%","^","&","*","(",")","-","_","=","+","[","]","{","}","|","\\",";",":","'",'"',",",".","<",">","/","?"],c={};try{for(var h=function(r){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&"number"==typeof r.length)return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),m=h.next();!m.done;m=h.next()){var y=m.value;if(g.includes(y)&&(c[y]=(c[y]||0)+1,c[y]>2))return{isValid:!1,errorMsg:"Username cannot contain multiple special characters"}}}catch(r){t={error:r}}finally{try{m&&!m.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}return{isValid:!0,errorMsg:null}}catch(r){return{isValid:!1,errorMsg:f(6)}}},N=function(r){if("string"!=typeof r)throw new TypeError("Input value must be a string.");return 0===r.trim().length},$=function(r){return null!=r&&"boolean"!=typeof r&&("string"==typeof r?!Number.isNaN(parseFloat(r))&&Number.isFinite(parseFloat(r)):"number"==typeof r&&Number.isFinite(r))},S=function(r){if("string"!=typeof r)throw new TypeError("The input should be a string.");var e=r.replace(/\D/g,"");if(N(e)||!$(e))return!1;for(var t=r.replace(/\D+/g,"").split("").map(Number),n=0,i=!1,a=t.length-1;a>=0;a-=1){var o=t[a];i&&(o*=2)>9&&(o-=9),n+=o,i=!i}return n%10==0},P=function(r){if("string"!=typeof r)throw new TypeError("The input should be a string.");var e=[{name:"Visa",interval:/^4/},{name:"Mastercard",interval:/^5[1-5]/},{name:"American Express",interval:/^3[47]/},{name:"Discover",interval:/^6(?:011|5)/},{name:"JCB",interval:/^(?:2131|1800|35\d{3})/},{name:"Diners Club",interval:/^3(?:0[0-5]|[68])/},{name:"Maestro",interval:/^(?:5[0678]\d\d|6304|6390|67\d\d)/},{name:"UnionPay",interval:/^(62|88)/},{name:"Elo",interval:/^63[789]/},{name:"Hipercard",interval:/^(3841|60)/}].find((function(e){return e.interval.test(r)}));return e?e.name:"Unknown"},I=function(r){if("string"!=typeof r)throw new TypeError("The input should be a string.");var e=r.replace(/[^0-9A-Fa-f]/g,"");return 12===e.length&&/^([0-9A-Fa-f]{2}){6}$/.test(e)},L=function(r){if("string"!=typeof r)throw new TypeError("The input should be a string.");if(0===r.trim().length)throw new Error("Input value must not be an empty string.");for(var e=0;e127)return!1}return!0},Z=function(r){if("string"!=typeof r)throw new TypeError("Input value must be a string.");if(0===r.trim().length)throw new Error("Input value must not be an empty string.");return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r)},z=function(r){if("string"!=typeof r)throw new TypeError("Input value must be a string.");if(0===r.trim().length)throw new Error("Input value must not be an empty string.");var e=new Date(r);if(Number.isNaN(e)||!(e instanceof Date))return!1;if(!/^(?:\d{4}[-/]\d{2}[-/]\d{2}|\d{2}[-/]\d{2}[-/]\d{4}|[A-Za-z]+\s\d{1,2}, \d{4})$/.test(r))return!1;var t=e.getFullYear(),n=e.getMonth()+1,i=e.getDate();return!(t<1e3||t>9999||n<1||n>12||i<1||i>31)},C=function(r){var e=r;if("number"==typeof e&&Number.isNaN(e))throw new TypeError("Input value must not be NaN.");if("number"==typeof e&&!isFinite(e))throw new TypeError("Input value must not be Infinity, -Infinity or NaN.");if("string"!=typeof e){if("number"!=typeof e)throw new TypeError("Input value must be a string or a number.");if(Number.isInteger(e))return!1;e=e.toString()}if(0===e.trim().length)throw new Error("Input value must not be an empty string.");if(/^\d+$/.test(e))return!1;if(!/^[-+]?(?:\d+(?:[,.]\d*)?|\d*[,.]\d+)$/.test(e))return!1;var t=e.includes(".")?".":",",n="."===t?",":".";return!(e.includes(t)&&e.includes(n)||e.startsWith("-")&&e.lastIndexOf("-")>0)},U=function(r){if("string"!=typeof r)throw new TypeError("Input value must be a string.");var e=r.trim();return 32===e.length&&!!/^[a-fA-F0-9]{32}$/.test(e)&&!/^0{32}$/.test(e)&&!["d41d8cd98f00b204e9800998ecf8427e"].includes(e)};const k=function(r){var e,t;if("string"!=typeof r)throw new TypeError("The input should be a string.");var n=r.replace(/\s/g,"");try{for(var i=function(r){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&"number"==typeof r.length)return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}([{country:"United States",regex:/^[0-9]{9}$/},{country:"United Kingdom",regex:/^[A-Z]{2}[0-9]{6}$/},{country:"Germany",regex:/^[A-Z]{2}[0-9]{8}$/},{country:"Canada",regex:/^[A-Z][0-9]{7}$/},{country:"Australia",regex:/^[A-Z][0-9]{7}$/},{country:"Brazil",regex:/^[0-9]{9}$/},{country:"France",regex:/^[A-Z]{2}[0-9]{7}$/},{country:"Italy",regex:/^[A-Z][0-9]{7}$/},{country:"India",regex:/^[A-Z][0-9]{7}$/},{country:"China",regex:/^[A-Z][0-9]{8}$/}]),a=i.next();!a.done;a=i.next()){var o=a.value;if(o.regex.test(n))return{isValid:!0,country:o.country}}}catch(r){e={error:r}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return{isValid:!1,country:null}},D=function(r){if("string"!=typeof r&&"number"!=typeof r)throw new TypeError("Input value must be a string or a number.");var e=parseInt(String(r),10);return Number.isInteger(e)&&e>=1&&e<=65535},j=function(r){if("string"!=typeof r)throw new TypeError("Input value must be a string.");return/^\d{5}(-\d{4})?$/.test(r)||/^[A-Za-z]\d[A-Za-z] \d[A-Za-z]\d$/.test(r)||/^[A-Za-z]{1,2}\d[A-Za-z\d]?\s\d[A-Za-z]{2}$/.test(r)||/^\d{5}$/.test(r)||/^\d{4}$/.test(r)||/^\d{3}-\d{4}$/.test(r)||/^\d{5}$/.test(r)||/^\d{4}$/.test(r)||/^\d{5}$/.test(r)||/^\d{4}$/.test(r)||/^\d{5}-\d{3}$/.test(r)||/^\d{5}$/.test(r)||/^\d{5}$/.test(r)},F=function(r){if("string"!=typeof r)throw new TypeError("Input value must be a string.");return/^(?:2[0-3]|1\d|0?[0-9]):[0-5]\d(?::[0-5]\d)?(?: [APap][Mm])?$/.test(r)};var O=["Field phone number cannot be empty","Invalid phone number","Unknown error"];const q=function(r,e){if(void 0===e&&(e=O),"string"!=typeof r)throw new TypeError("The input should be a string.");if(e){if(!Array.isArray(e))throw new Error("errorMsg must be an Array");for(var t=0;t=6&&/^[a-zA-Z0-9]+$/.test(r)&&e<=7||e<10&&/(.)\1{3,}/.test(r)||e>=5&&e<=8&&/^\d+$/.test(r):t="weak";break;case/(.)\1{5,}/.test(r)&&e>10:t="regular";break;case e>16||r.length>=8&&/[A-Z]/.test(r)&&/[a-z]/.test(r)&&/[0-9]/.test(r)&&/[\W_]/.test(r):t="veryStrong";break;case e>=13&&e<=16||r.length>=8&&/[A-Z]/.test(r)&&/[a-z]/.test(r)&&/[0-9]/.test(r):t="strong";break;case e>=9&&e<=12||r.length>=6&&r.length<=8&&/[0-9]/.test(r)&&/[a-zA-Z]/.test(r):t="regular"}return t};var G=["Surname cannot be empty","Surname cannot contain numbers","Surname cannot contain special characters","This surname is not valid","Surname too big, try again","Unknown error"],H={minLength:void 0,maxLength:void 0,errorMsg:G};const K=function(r,e){var t=void 0===e?H:e,n=t.minLength,i=t.maxLength,a=t.errorMsg;if("string"!=typeof r)throw new TypeError("The input should be a string.");if(a){if(!Array.isArray(a))throw new Error("errorMsg must be an Array or null");for(var o=0;ol)throw new Error("minLength cannot be greater than maxLength");if(!r)return{isValid:!1,errorMsg:s(0)};try{return r.length>l?{isValid:!1,errorMsg:s(4)}:r.lengthl)throw new Error("minLength cannot be greater than maxLength");if(!r)return{isValid:!1,errorMsg:s(0)};try{return r.length>l?{isValid:!1,errorMsg:s(4)}:r.lengths?{isValid:!1,errorMsg:u(0)}:{isValid:!0,errorMsg:null}}catch(r){return{isValid:!1,errorMsg:u(2)}}};function nr(r){return 71==r[0]&&73==r[1]&&70==r[2]&&56==r[3]}function ir(r){return 0===r[0]&&0===r[1]&&1===r[2]}function ar(r){return 255===r[0]&&216===r[1]&&255===r[2]}function or(r){return 137===r[0]&&80===r[1]&&78===r[2]&&71===r[3]}var sr={exclude:[]};function ur(r,e){void 0===e&&(e=sr);var t=e.exclude;if(0===t.length)return function(r){var e=nr(r),t=ir(r),n=ar(r),i=or(r);return e||t||n||i}(r);var n=["gif","ico","jpeg","png"].filter((function(r){return!t.includes(r)}));if(0===n.length)return!1;var i=n.includes("gif")&&nr(r),a=n.includes("ico")&&ir(r),o=n.includes("jpeg")&&ar(r),s=n.includes("png")&&or(r);return i||a||o||s}function lr(r){return 73===r[0]&&68===r[1]&&51===r[2]}function dr(r){return 82===r[0]&&73===r[1]&&70===r[2]&&70===r[3]}var fr={exclude:[]};const gr=function(r,e){void 0===e&&(e=fr);var t=e.exclude;if(0===t.length)return function(r){var e=lr(r),t=dr(r);return e||t}(r);var n=["mp3","wav"].filter((function(r){return!t.includes(r)}));if(0===n.length)return!1;var i=n.includes("mp3")&&lr(r),a=n.includes("wav")&&dr(r);return i||a},cr=function(r){return 37===r[0]&&80===r[1]&&68===r[2]&&70===r[3]};function hr(r){return 26===r[0]&&69===r[1]&&223===r[2]&&163===r[3]}function mr(r){return 0===r[0]&&0===r[1]&&0===r[2]&&20===r[3]&&102===r[4]&&116===r[5]&&121===r[6]&&112===r[7]&&113===r[8]&&116===r[9]&&32===r[10]&&32===r[11]}function yr(r){return 0===r[0]&&0===r[1]&&0===r[2]&&32===r[3]&&102===r[4]&&116===r[5]&&121===r[6]&&112===r[7]&&109===r[8]&&112===r[9]&&52===r[10]&&50===r[11]||0===r[0]&&0===r[1]&&0===r[2]&&24===r[3]&&102===r[4]&&116===r[5]&&121===r[6]&&112===r[7]||0===r[0]&&0===r[1]&&0===r[2]&&28===r[3]&&102===r[4]&&116===r[5]&&121===r[6]&&112===r[7]&&105===r[8]&&115===r[9]&&111===r[10]&&109===r[11]}var pr={exclude:[]};const vr=function(r,e){void 0===e&&(e=pr);var t=e.exclude;if(0===t.length)return function(r){var e=yr(r),t=mr(r),n=hr(r);return e||t||n}(r);var n=["mkv","mov","mp4"].filter((function(r){return!t.includes(r)}));if(0===n.length)return!1;var i=n.includes("mkv")&&hr(r),a=n.includes("mov")&&mr(r),o=n.includes("mp4")&&yr(r);return i||a||o};function wr(r){if(0===r.length)return!1;for(var e=0;e126)&&10!==r[e]&&13!==r[e])return!1;return!0}const br={cpfIsValid:n,cnpjIsValid:a,isEmail:c,validateEmail:p,isCEP:g,validateUsername:x,validatePassword:b,getOnlyEmail:f,isCreditCardValid:S,identifyFlagCard:P,isMACAddress:I,isAscii:L,isBase64:Z,isDate:z,isDecimal:C,isEmpty:N,isMD5:U,isPort:D,isPostalCode:j,isTime:F,validatePassportNumber:k,validateBRPhoneNumber:q,validateUSPhoneNumber:R,validatePhoneNumber:W,isNumber:$,passwordStrengthTester:J,validateName:X,validateSurname:K,validateTextarea:tr,isValidImage:ur,isValidAudio:gr,isValidPdf:cr,isValidVideo:vr,isValidTxt:wr};return e})()));