UNPKG

@workingscorpion/class-faker

Version:

Class based Faker Object Generator for testing node.js inspired by Fakingoose

1 lines 262 kB
var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hasRequired_Reflect,_Reflect={};function require_Reflect(){var P;return hasRequired_Reflect||(hasRequired_Reflect=1,P={},function(){var s,o,l,c,i,e,r,m,t,a="object"==typeof commonjsGlobal?commonjsGlobal:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),n=I(P);function f(e,a,n){var i=t.get(e);if(p(i)){if(!n)return;i=new r,t.set(e,i)}e=i.get(a);if(p(e)){if(!n)return;e=new r,i.set(a,e)}return e}function d(e,a,n){a=f(a,n,!1);return!p(a)&&!!a.has(e)}function u(e,a,n){a=f(a,n,!1);if(!p(a))return a.get(e)}function x(e,a,n,i){f(n,i,!0).set(e,a)}function h(e,a){var n=[],e=f(e,a,!1);if(p(e))return n;for(var i,r,o=(e=>{var a=B(e,l);if(v(a)){a=a.call(e);if(C(a))return a}throw new TypeError})(e.keys()),t=0;;){var s=(e=>!(e=e.next()).done&&e)(o);if(!s)return n.length=t,n;s=s.value;try{n[t]=s}catch(e){try{r=void 0,(r=(i=o).return)&&r.call(i)}finally{throw e}}t++}}function b(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function p(e){return void 0===e}function g(e){return null===e}function C(e){return"object"==typeof e?null!==e:"function"==typeof e}function y(e){switch(b(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var a=B(e,o);if(void 0===a){var n,i=e,r=i.toString;if(v(r))if(!C(n=r.call(i)))return n;if(v(r=i.valueOf)&&!C(n=r.call(i)))return n;throw new TypeError}r=a.call(e,"string");if(C(r))throw new TypeError;return r}function A(e){e=y(e);return"symbol"==typeof e?e:""+e}function S(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function v(e){return"function"==typeof e}function M(e){return"function"==typeof e}function B(e,a){e=e[a];if(null!=e){if(v(e))return e;throw new TypeError}}function k(e){var a,n=Object.getPrototypeOf(e);return"function"!=typeof e||e===i||n!==i||null==(a=(a=e.prototype)&&Object.getPrototypeOf(a))||a===Object.prototype||"function"!=typeof(a=a.constructor)||a===e?n:a}function T(e){return e.__=void 0,delete e.__,e}function I(n,i){return function(e,a){"function"!=typeof n[e]&&Object.defineProperty(n,e,{configurable:!0,writable:!0,value:a}),i&&i(e,a)}}void 0===a.Reflect?a.Reflect=P:n=I(a.Reflect,n),a=n,s=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",l=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",n="function"==typeof Object.create,e={__proto__:[]}instanceof Array,c={create:n?function(){return T(Object.create(null))}:e?function(){return T({__proto__:null})}:function(){return T({})},has:(n=!n&&!e)?function(e,a){return s.call(e,a)}:function(e,a){return a in e},get:n?function(e,a){return s.call(e,a)?e[a]:void 0}:function(e,a){return e[a]}},i=Object.getPrototypeOf(Function),e="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,r=e||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?(()=>{var r={},n=[],e=(()=>{function e(e,a,n){this._index=0,this._keys=e,this._values=a,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[l]=function(){return this},e.prototype.next=function(){var e,a=this._index;return 0<=a&&a<this._keys.length?(e=this._selector(this._keys[a],this._values[a]),a+1>=this._keys.length?(this._index=-1,this._keys=n,this._values=n):this._index++,{value:e,done:!1}):{value:void 0,done:!0}},e.prototype.throw=function(e){throw 0<=this._index&&(this._index=-1,this._keys=n,this._values=n),e},e.prototype.return=function(e){return 0<=this._index&&(this._index=-1,this._keys=n,this._values=n),{value:e,done:!0}},e})();function a(){this._keys=[],this._values=[],this._cacheKey=r,this._cacheIndex=-2}return Object.defineProperty(a.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),a.prototype.has=function(e){return 0<=this._find(e,!1)},a.prototype.get=function(e){e=this._find(e,!1);return 0<=e?this._values[e]:void 0},a.prototype.set=function(e,a){e=this._find(e,!0);return this._values[e]=a,this},a.prototype.delete=function(e){var a=this._find(e,!1);if(0<=a){for(var n=this._keys.length,i=a+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=r,this._cacheIndex=-2),!0}return!1},a.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=r,this._cacheIndex=-2},a.prototype.keys=function(){return new e(this._keys,this._values,i)},a.prototype.values=function(){return new e(this._keys,this._values,o)},a.prototype.entries=function(){return new e(this._keys,this._values,t)},a.prototype["@@iterator"]=function(){return this.entries()},a.prototype[l]=function(){return this.entries()},a.prototype._find=function(e,a){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&a&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},a;function i(e,a){return e}function o(e,a){return a}function t(e,a){return[e,a]}})():Map,m=e||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?(()=>{function e(){this._map=new r}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[l]=function(){return this.keys()},e})():Set,t=new(e||"function"!=typeof WeakMap?(()=>{var r=16,a=c.create(),n=i();function e(){this._key=i()}return e.prototype.has=function(e){e=o(e,!1);return void 0!==e&&c.has(e,this._key)},e.prototype.get=function(e){e=o(e,!1);return void 0!==e?c.get(e,this._key):void 0},e.prototype.set=function(e,a){return o(e,!0)[this._key]=a,this},e.prototype.delete=function(e){e=o(e,!1);return void 0!==e&&delete e[this._key]},e.prototype.clear=function(){this._key=i()},e;function i(){for(var e;e="@@WeakMap@@"+(()=>{for(var e=(e=>"function"!=typeof Uint8Array?t(new Array(e),e):"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):t(new Uint8Array(e),e))(r),a=(e[6]=79&e[6]|64,e[8]=191&e[8]|128,""),n=0;n<r;++n){var i=e[n];4!==n&&6!==n&&8!==n||(a+="-"),i<16&&(a+="0"),a+=i.toString(16).toLowerCase()}return a})(),c.has(a,e););return a[e]=!0,e}function o(e,a){if(!s.call(e,n)){if(!a)return;Object.defineProperty(e,n,{value:c.create()})}return e[n]}function t(e,a){for(var n=0;n<a;++n)e[n]=255*Math.random()|0;return e}})():WeakMap),a("decorate",function(e,a,n,i){{if(p(n)){if(S(e)&&M(a))return((e,a)=>{for(var n=e.length-1;0<=n;--n){var i=(0,e[n])(a);if(!p(i)&&!g(i)){if(!M(i))throw new TypeError;a=i}}return a})(e,a)}else if(S(e)&&C(a)&&(C(i)||p(i)||g(i)))return g(i)&&(i=void 0),n=A(n),((e,a,n,i)=>{for(var r=e.length-1;0<=r;--r){var o=(0,e[r])(a,n,i);if(!p(o)&&!g(o)){if(!C(o))throw new TypeError;i=o}}return i})(e,a,n,i);throw new TypeError}}),a("metadata",function(n,i){return function(e,a){if(!C(e))throw new TypeError;if(!p(a)&&!(e=>{switch(b(e)){case 3:case 4:return 1;default:return}})(a))throw new TypeError;x(n,i,e,a)}}),a("defineMetadata",function(e,a,n,i){if(!C(n))throw new TypeError;p(i)||(i=A(i));return x(e,a,n,i)}),a("hasMetadata",function(e,a,n){if(!C(a))throw new TypeError;p(n)||(n=A(n));return function e(a,n,i){var r=d(a,n,i);if(r)return!0;r=k(n);if(!g(r))return e(a,r,i);return!1}(e,a,n)}),a("hasOwnMetadata",function(e,a,n){if(!C(a))throw new TypeError;p(n)||(n=A(n));return d(e,a,n)}),a("getMetadata",function(e,a,n){if(!C(a))throw new TypeError;p(n)||(n=A(n));return function e(a,n,i){var r=d(a,n,i);if(r)return u(a,n,i);r=k(n);if(!g(r))return e(a,r,i);return}(e,a,n)}),a("getOwnMetadata",function(e,a,n){if(!C(a))throw new TypeError;p(n)||(n=A(n));return u(e,a,n)}),a("getMetadataKeys",function(e,a){if(!C(e))throw new TypeError;p(a)||(a=A(a));return function e(a,n){var i=h(a,n);a=k(a);if(null===a)return i;a=e(a,n);if(a.length<=0)return i;if(i.length<=0)return a;var r=new m;var o=[];for(var t=0,s=i;t<s.length;t++){var l=s[t];r.has(l)||(r.add(l),o.push(l))}for(var c=0,f=a;c<f.length;c++){l=f[c];r.has(l)||(r.add(l),o.push(l))}return o}(e,a)}),a("getOwnMetadataKeys",function(e,a){if(!C(e))throw new TypeError;p(a)||(a=A(a));return h(e,a)}),a("deleteMetadata",function(e,a,n){if(!C(a))throw new TypeError;p(n)||(n=A(n));var i=f(a,n,!1);return!p(i)&&!!i.delete(e)&&(0<i.size||((e=t.get(a)).delete(n),0<e.size)||t.delete(a),!0)})}()),_Reflect}require_Reflect();var fieldMetadataKey=Symbol("fieldMetadata");function FakerField(r,o){return function(e,a){var n=Reflect.getMetadata(fieldMetadataKey,e.constructor)||[],i=Reflect.getMetadata("design:type",e,a);n.push({name:a,type:i,arrayElementType:o,nestedObjectType:r}),Reflect.defineMetadata(fieldMetadataKey,n,e.constructor)}}function getFieldMetadata(e){return Reflect.getMetadata(fieldMetadataKey,e)||[]}var hasRequiredChance,chance$1={exports:{}};function requireChance(){var e,a,o,r,t,s,n,c,i,l,f,u,m,d;return hasRequiredChance||(hasRequiredChance=1,a=(e=chance$1).exports,o=9007199254740992,r="0123456789",s=(t="abcdefghijklmnopqrstuvwxyz").toUpperCase(),n=r+"abcdef",(x.prototype=new Error).constructor=x,c=Array.prototype.slice,h.prototype.VERSION="1.1.12",i=function(){throw new Error("No Base64 encoder available.")},"function"==typeof btoa?i=btoa:"function"==typeof Buffer&&(i=function(e){return new Buffer(e).toString("base64")}),h.prototype.bool=function(e){return p((e=b(e,{likelihood:50})).likelihood<0||100<e.likelihood,"Chance: Likelihood accepts values from 0 to 100."),100*this.random()<e.likelihood},h.prototype.falsy=function(e){e=(e=b(e,{pool:[!1,null,0,NaN,"",void 0]})).pool;return e[this.integer({min:0,max:e.length-1})]},h.prototype.animal=function(e){return void 0!==(e=b(e)).type?(p(!this.get("animals")[e.type.toLowerCase()],"Please pick from desert, ocean, grassland, forest, zoo, pets, farm."),this.pick(this.get("animals")[e.type.toLowerCase()])):this.pick(this.get("animals")[this.pick(["desert","forest","ocean","zoo","farm","pet","grassland"])])},h.prototype.character=function(e){var a="!@#$%^&*()[]",n="lower"===(e=b(e)).casing?t:"upper"===e.casing?s:t+s,i=e.pool||(i="",e.alpha&&(i+=n),e.numeric&&(i+=r),e.symbols&&(i+=a),i)||n+r+a;return i.charAt(this.natural({max:i.length-1}))},h.prototype.floating=function(e){p((e=b(e,{fixed:4})).fixed&&e.precision,"Chance: Cannot specify both fixed and precision.");var a=Math.pow(10,e.fixed),n=o/a,i=-n,i=(p(e.min&&e.fixed&&e.min<i,"Chance: Min specified is out of range with fixed. Min should be, at least, "+i),p(e.max&&e.fixed&&e.max>n,"Chance: Max specified is out of range with fixed. Max should be, at most, "+n),e=b(e,{min:i,max:n}),(this.integer({min:e.min*a,max:e.max*a})/a).toFixed(e.fixed));return parseFloat(i)},h.prototype.integer=function(e){return p((e=b(e,{min:-9007199254740992,max:o})).min>e.max,"Chance: Min cannot be greater than Max."),Math.floor(this.random()*(e.max-e.min+1)+e.min)},h.prototype.natural=function(e){if("number"==typeof(e=b(e,{min:0,max:o})).numerals&&(p(e.numerals<1,"Chance: Numerals cannot be less than one."),e.min=Math.pow(10,e.numerals-1),e.max=Math.pow(10,e.numerals)-1),p(e.min<0,"Chance: Min cannot be less than zero."),e.exclude){for(var a in p(!Array.isArray(e.exclude),"Chance: exclude must be an array."),e.exclude)p(!Number.isInteger(e.exclude[a]),"Chance: exclude must be numbers.");var n,i=e.min+this.natural({max:e.max-e.min-e.exclude.length}),r=e.exclude.sort();for(n in r){if(i<r[n])break;i++}return i}return this.integer(e)},h.prototype.prime=function(a){p((a=b(a,{min:0,max:1e4})).min<0,"Chance: Min cannot be less than zero."),p(a.max<a.min,"Chance: Min cannot be greater than Max.");var e=l.primes[l.primes.length-1];if(e<a.max)for(var n=e+2;n<=a.max;++n)this.is_prime(n)&&l.primes.push(n);e=l.primes.filter(function(e){return e>=a.min&&e<=a.max});return this.pick(e)},h.prototype.is_prime=function(e){if(e%1||e<2)return!1;if(e%2==0)return 2===e;if(e%3==0)return 3===e;for(var a=Math.sqrt(e),n=5;n<=a;n+=6)if(e%n==0||e%(n+2)==0)return!1;return!0},h.prototype.hex=function(e){p((e=b(e,{min:0,max:o,casing:"lower"})).min<0,"Chance: Min cannot be less than zero.");var a=this.natural({min:e.min,max:e.max});return"upper"===e.casing?a.toString(16).toUpperCase():a.toString(16)},h.prototype.letter=function(e){e=b(e,{casing:"lower"});var a=this.character({pool:"abcdefghijklmnopqrstuvwxyz"});return a="upper"===e.casing?a.toUpperCase():a},h.prototype.string=function(e){return 0===(e=b(e,{min:5,max:20})).length||e.length||(e.length=this.natural({min:e.min,max:e.max})),p(e.length<0,"Chance: Length cannot be less than zero."),this.n(this.character,e.length,e).join("")},g.prototype={substitute:function(){return this.c}},C.prototype={substitute:function(){if(/[{}\\]/.test(this.c))return this.c;throw new Error('Invalid escape sequence: "\\'+this.c+'".')}},y.prototype={replacers:{"#":function(e){return e.character({pool:r})},A:function(e){return e.character({pool:s})},a:function(e){return e.character({pool:t})}},substitute:function(e){var a=this.replacers[this.c];if(a)return a(e);throw new Error('Invalid replacement character: "'+this.c+'".')}},h.prototype.template=function(e){var a;if(e)return a=this,(e=>{for(var a=[],n="identity",i=0;i<e.length;i++){var r=e[i];switch(n){case"escape":a.push(new C(r)),n="identity";break;case"identity":"{"===r?n="replace":"\\"===r?n="escape":a.push(new g(r));break;case"replace":"}"===r?n="identity":a.push(new y(r))}}return a})(e).map(function(e){return e.substitute(a)}).join("");throw new Error("Template string is required")},h.prototype.buffer=function(e){if("undefined"==typeof Buffer)throw new x("Sorry, the buffer() function is not supported on your platform");p((e=b(e,{length:this.natural({min:5,max:20})})).length<0,"Chance: Length cannot be less than zero.");e=this.n(this.character,e.length,e);return Buffer.from(e)},h.prototype.capitalize=function(e){return e.charAt(0).toUpperCase()+e.substr(1)},h.prototype.mixin=function(e){for(var a in e)this[a]=e[a];return this},h.prototype.unique=function(e,a,n){p("function"!=typeof e,"Chance: The first argument must be a function.");for(var i=function(e,a){return-1!==e.indexOf(a)},r=(n&&(i=n.comparator||i),[]),o=0,t=50*a,s=c.call(arguments,2);r.length<a;){var l=JSON.parse(JSON.stringify(s));if(i(r,l=e.apply(this,l))||(r.push(l),o=0),++o>t)throw new RangeError("Chance: num is likely too large for sample set")}return r},h.prototype.n=function(e,a){p("function"!=typeof e,"Chance: The first argument must be a function.");for(var n=a=void 0===a?1:a,i=[],r=c.call(arguments,2),n=Math.max(0,n);n--;)i.push(e.apply(this,r));return i},h.prototype.pad=function(e,a,n){return n=n||"0",(e+="").length>=a?e:new Array(a-e.length+1).join(n)+e},h.prototype.pick=function(e,a){if(0===e.length)throw new RangeError("Chance: Cannot pick() from an empty array");return a&&1!==a?this.shuffle(e).slice(0,a):e[this.natural({max:e.length-1})]},h.prototype.pickone=function(e){if(0===e.length)throw new RangeError("Chance: Cannot pickone() from an empty array");return e[this.natural({max:e.length-1})]},h.prototype.pickset=function(e,a){if(0===a)return[];if(0===e.length)throw new RangeError("Chance: Cannot pickset() from an empty array");if(a<0)throw new RangeError("Chance: Count must be a positive number");var n,i;return a&&1!==a?(n=e.slice(0),i=n.length,this.n(function(){var e=this.natural({max:--i}),a=n[e];return n[e]=n[i],a},Math.min(i,a))):[this.pickone(e)]},h.prototype.shuffle=function(e){for(var a,n,i=[],r=Number(e.length),o=Array.apply(null,Array(r)).map(function(e,a){return a}),t=r-1,s=0;s<r;s++)a=o[n=this.natural({max:t})],i[s]=e[a],o[n]=o[t],--t;return i},h.prototype.weighted=function(e,a,n){if(e.length!==a.length)throw new RangeError("Chance: Length of array and weights must match");for(var i,r=0,o=0;o<a.length;++o){if(i=a[o],isNaN(i))throw new RangeError("Chance: All weights must be numbers");0<i&&(r+=i)}if(0===r)throw new RangeError("Chance: No valid entries in array weights");for(var t,s=this.random()*r,l=0,c=-1,o=0;o<a.length;++o){if(l+=i=a[o],0<i){if(s<=l){t=o;break}c=o}o===a.length-1&&(t=c)}var f=e[t];return(n=void 0!==n&&n)&&(e.splice(t,1),a.splice(t,1)),f},h.prototype.paragraph=function(e){var a=(e=b(e)).sentences||this.natural({min:3,max:7}),a=this.n(this.sentence,a),e=!0===e.linebreak?"\n":" ";return a.join(e)},h.prototype.sentence=function(e){var a=(e=b(e)).words||this.natural({min:12,max:18}),e=e.punctuation,a=this.n(this.word,a).join(" ");return a=this.capitalize(a),(e=!1===e||/^[.?;!:]$/.test(e)?e:".")&&(a+=e),a},h.prototype.syllable=function(e){for(var a,n=(e=b(e)).length||this.natural({min:2,max:3}),i="bcdfghjklmnprstvwz",r="",o=0;o<n;o++)r+=a=0===o?this.character({pool:"bcdfghjklmnprstvwzaeiou"}):-1===i.indexOf(a)?this.character({pool:i}):this.character({pool:"aeiou"});return r=e.capitalize?this.capitalize(r):r},h.prototype.word=function(e){p((e=b(e)).syllables&&e.length,"Chance: Cannot specify both syllables AND length.");var a=e.syllables||this.natural({min:1,max:3}),n="";if(e.length){for(;(n+=this.syllable()).length<e.length;);n=n.substring(0,e.length)}else for(var i=0;i<a;i++)n+=this.syllable();return n=e.capitalize?this.capitalize(n):n},h.prototype.emoji=function(e){p((e=b(e,{category:"all",length:1})).length<1||BigInt(e.length)>BigInt(o),"Chance: length must be between 1 and "+String(o));var a=this.get("emojis"),a=("all"===e.category&&(e.category=this.pickone(Object.keys(a))),a[e.category]);return p(void 0===a,"Chance: Unrecognised emoji category: ["+e.category+"]."),this.pickset(a,e.length).map(function(e){return String.fromCodePoint(e)}).join("")},h.prototype.age=function(e){var a;switch((e=b(e)).type){case"child":a={min:0,max:12};break;case"teen":a={min:13,max:19};break;case"adult":a={min:18,max:65};break;case"senior":a={min:65,max:100};break;case"all":a={min:0,max:100};break;default:a={min:18,max:65}}return this.natural(a)},h.prototype.birthday=function(e){var a,n,i=this.age(e),r=new Date,o=r.getFullYear();return e=e&&e.type?(a=new Date,n=new Date,a.setFullYear(o-i-1),n.setFullYear(o-i),b(e,{min:a,max:n})):!e||void 0===e.minAge&&void 0===e.maxAge?b(e,{year:o-i}):(p(e.minAge<0,"Chance: MinAge cannot be less than zero."),p(e.minAge>e.maxAge,"Chance: MinAge cannot be greater than MaxAge."),a=void 0!==e.minAge?e.minAge:0,n=void 0!==e.maxAge?e.maxAge:100,i=new Date(o-n-1,r.getMonth(),r.getDate()),n=new Date(o-a,r.getMonth(),r.getDate()),i.setDate(i.getDate()+1),n.setDate(n.getDate()+1),n.setMilliseconds(n.getMilliseconds()-1),b(e,{min:i,max:n})),this.date(e)},h.prototype.cpf=function(e){e=b(e,{formatted:!0});var a=this.n(this.natural,9,{max:9}),n=2*a[8]+3*a[7]+4*a[6]+5*a[5]+6*a[4]+7*a[3]+8*a[2]+9*a[1]+10*a[0],i=11-(i=2*(n=10<=(n=11-n%11)?0:n)+3*a[8]+4*a[7]+5*a[6]+6*a[5]+7*a[4]+8*a[3]+9*a[2]+10*a[1]+11*a[0])%11,a=""+a[0]+a[1]+a[2]+"."+a[3]+a[4]+a[5]+"."+a[6]+a[7]+a[8]+"-"+n+(i=10<=i?0:i);return e.formatted?a:a.replace(/\D/g,"")},h.prototype.cnpj=function(e){e=b(e,{formatted:!0});var a=this.n(this.natural,12,{max:12}),n=2*a[11]+3*a[10]+4*a[9]+5*a[8]+6*a[7]+7*a[6]+8*a[5]+9*a[4]+2*a[3]+3*a[2]+4*a[1]+5*a[0],i=11-(i=2*(n=(n=11-n%11)<2?0:n)+3*a[11]+4*a[10]+5*a[9]+6*a[8]+7*a[7]+8*a[6]+9*a[5]+2*a[4]+3*a[3]+4*a[2]+5*a[1]+6*a[0])%11,a=""+a[0]+a[1]+"."+a[2]+a[3]+a[4]+"."+a[5]+a[6]+a[7]+"/"+a[8]+a[9]+a[10]+a[11]+"-"+n+(i=i<2?0:i);return e.formatted?a:a.replace(/\D/g,"")},h.prototype.first=function(e){return e=b(e,{gender:this.gender(),nationality:"en"}),this.pick(this.get("firstNames")[e.gender.toLowerCase()][e.nationality.toLowerCase()])},h.prototype.profession=function(e){return(e=b(e)).rank?this.pick(["Apprentice ","Junior ","Senior ","Lead "])+this.pick(this.get("profession")):this.pick(this.get("profession"))},h.prototype.company=function(){return this.pick(this.get("company"))},h.prototype.gender=function(e){return e=b(e,{extraGenders:[]}),this.pick(["Male","Female"].concat(e.extraGenders))},h.prototype.last=function(e){var a,n;return"*"===(e=b(e,{nationality:"*"})).nationality?(a=[],n=this.get("lastNames"),Object.keys(n).forEach(function(e){a=a.concat(n[e])}),this.pick(a)):this.pick(this.get("lastNames")[e.nationality.toLowerCase()])},h.prototype.israelId=function(){for(var e=this.string({pool:"0123456789",length:8}),a=0,n=0;n<e.length;n++){var i=e[n]*(n/2===parseInt(n/2)?1:2),i=this.pad(i,2).toString();a+=parseInt(i[0])+parseInt(i[1])}return e+=(10-parseInt(a.toString().slice(-1))).toString().slice(-1)},h.prototype.mrz=function(e){var a,n=function(e){var i="<ABCDEFGHIJKLMNOPQRSTUVWXYXZ".split(""),r=[7,3,1],o=0;return(e="string"!=typeof e?e.toString():e).split("").forEach(function(e,a){var n=i.indexOf(e);e=-1!==n?0===n?0:n+9:parseInt(e,10),o+=e*=r[a%r.length]}),o%10},i=this,i=e=b(e,{first:this.first(),last:this.last(),passportNumber:this.integer({min:1e8,max:999999999}),dob:[(a=i.birthday({type:"adult"})).getFullYear().toString().substr(2),i.pad(a.getMonth()+1,2),i.pad(a.getDate(),2)].join(""),expiry:[((a=new Date).getFullYear()+5).toString().substr(2),i.pad(a.getMonth()+1,2),i.pad(a.getDate(),2)].join(""),gender:"Female"===this.gender()?"F":"M",issuer:"GBR",nationality:"GBR"});function r(e){return new Array(e+1).join("<")}return(i=["P<",i.issuer,i.last.toUpperCase(),"<<",i.first.toUpperCase(),r(39-(i.last.length+i.first.length+2)),i.passportNumber,n(i.passportNumber),i.nationality,i.dob,n(i.dob),i.gender,i.expiry,n(i.expiry),r(14),n(r(14))].join(""))+n(i.substr(44,10)+i.substr(57,7)+i.substr(65,7))},h.prototype.name=function(e){e=b(e);var a=this.first(e),n=this.last(e),a=e.middle?a+" "+this.first(e)+" "+n:e.middle_initial?a+" "+this.character({alpha:!0,casing:"upper"})+". "+n:a+" "+n;return e.prefix&&(a=this.prefix(e)+" "+a),a=e.suffix?a+" "+this.suffix(e):a},h.prototype.name_prefixes=function(e){var a=[{name:"Doctor",abbreviation:"Dr."}];return"male"!==(e=(e=e||"all").toLowerCase())&&"all"!==e||a.push({name:"Mister",abbreviation:"Mr."}),"female"!==e&&"all"!==e||(a.push({name:"Miss",abbreviation:"Miss"}),a.push({name:"Misses",abbreviation:"Mrs."})),a},h.prototype.prefix=function(e){return this.name_prefix(e)},h.prototype.name_prefix=function(e){return(e=b(e,{gender:"all"})).full?this.pick(this.name_prefixes(e.gender)).name:this.pick(this.name_prefixes(e.gender)).abbreviation},h.prototype.HIDN=function(){var e="";return(e+=this.string({pool:"0123456789",length:6}))+this.string({pool:"ABCDEFGHIJKLMNOPQRSTUVWXYXZ",length:2})},h.prototype.ssn=function(e){var a="1234567890",n=(e=b(e,{ssnFour:!1,dashes:!0})).dashes?"-":"",e=e.ssnFour?this.string({pool:a,length:4}):this.string({pool:a,length:3})+n+this.string({pool:a,length:2})+n+this.string({pool:a,length:4});return e},h.prototype.aadhar=function(e){var a="1234567890",n=(e=b(e,{onlyLastFour:!1,separatedByWhiteSpace:!0})).separatedByWhiteSpace?" ":"",e=e.onlyLastFour?this.string({pool:a,length:4}):this.string({pool:a,length:4})+n+this.string({pool:a,length:4})+n+this.string({pool:a,length:4});return e},h.prototype.name_suffixes=function(){return[{name:"Doctor of Osteopathic Medicine",abbreviation:"D.O."},{name:"Doctor of Philosophy",abbreviation:"Ph.D."},{name:"Esquire",abbreviation:"Esq."},{name:"Junior",abbreviation:"Jr."},{name:"Juris Doctor",abbreviation:"J.D."},{name:"Master of Arts",abbreviation:"M.A."},{name:"Master of Business Administration",abbreviation:"M.B.A."},{name:"Master of Science",abbreviation:"M.S."},{name:"Medical Doctor",abbreviation:"M.D."},{name:"Senior",abbreviation:"Sr."},{name:"The Third",abbreviation:"III"},{name:"The Fourth",abbreviation:"IV"},{name:"Bachelor of Engineering",abbreviation:"B.E"},{name:"Bachelor of Technology",abbreviation:"B.TECH"}]},h.prototype.suffix=function(e){return this.name_suffix(e)},h.prototype.name_suffix=function(e){return(e=b(e)).full?this.pick(this.name_suffixes()).name:this.pick(this.name_suffixes()).abbreviation},h.prototype.nationalities=function(){return this.get("nationalities")},h.prototype.nationality=function(){return this.pick(this.nationalities()).name},h.prototype.zodiac=function(){return this.pickone(["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"])},h.prototype.android_id=function(){return"APA91"+this.string({pool:"0123456789abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_",length:178})},h.prototype.apple_token=function(){return this.string({pool:"abcdef1234567890",length:64})},h.prototype.wp8_anid2=function(){return i(this.hash({length:32}))},h.prototype.wp7_anid=function(){return"A="+this.guid().replace(/-/g,"").toUpperCase()+"&E="+this.hash({length:3})+"&W="+this.integer({min:0,max:9})},h.prototype.bb_pin=function(){return this.hash({length:8})},h.prototype.avatar=function(e){var a={protocol:null,email:null,fileExtension:null,size:null,fallback:null,rating:null};if(e)if("string"==typeof e)a.email=e,e={};else{if("object"!=typeof e)return null;if("Array"===e.constructor)return null}else a.email=this.email(),e={};return(a=b(e,a)).email||(a.email=this.email()),a.protocol={http:"http",https:"https"}[a.protocol]?a.protocol+":":"",a.size=parseInt(a.size,0)?a.size:"",a.rating={g:"g",pg:"pg",r:"r",x:"x"}[a.rating]?a.rating:"",a.fallback={404:"404",mm:"mm",identicon:"identicon",monsterid:"monsterid",wavatar:"wavatar",retro:"retro",blank:"blank"}[a.fallback]?a.fallback:"",a.fileExtension={bmp:"bmp",gif:"gif",jpg:"jpg",png:"png"}[a.fileExtension]?a.fileExtension:"",a.protocol+"//www.gravatar.com/avatar/"+this.bimd5.md5(a.email)+(a.fileExtension?"."+a.fileExtension:"")+(a.size||a.rating||a.fallback?"?":"")+(a.size?"&s="+a.size.toString():"")+(a.rating?"&r="+a.rating:"")+(a.fallback?"&d="+a.fallback:"")},h.prototype.color=function(r){function o(e,a){return[e,e,e].join(a||"")}function e(e){var a=e?"rgba":"rgb",e=e?","+this.floating({min:i,max:h}):"";return a+"("+(t?o(this.natural({min:s,max:l}),","):this.natural({min:m,max:d})+","+this.natural({min:u,max:x})+","+this.natural({max:255}))+e+")"}function a(e,a,n){var n=n?"#":"",i="";return t?(i=o(this.pad(this.hex({min:s,max:l}),2)),"shorthex"===r.format&&(i=o(this.hex({min:0,max:15})))):i="shorthex"===r.format?this.pad(this.hex({min:Math.floor(c/16),max:Math.floor(f/16)}),1)+this.pad(this.hex({min:Math.floor(m/16),max:Math.floor(d/16)}),1)+this.pad(this.hex({min:Math.floor(u/16),max:Math.floor(x/16)}),1):void 0!==c||void 0!==f||void 0!==m||void 0!==d||void 0!==u||void 0!==x?this.pad(this.hex({min:c,max:f}),2)+this.pad(this.hex({min:m,max:d}),2)+this.pad(this.hex({min:u,max:x}),2):this.pad(this.hex({min:s,max:l}),2)+this.pad(this.hex({min:s,max:l}),2)+this.pad(this.hex({min:s,max:l}),2),n+i}var n,t=(r=b(r,{format:this.pick(["hex","shorthex","rgb","rgba","0x","name"]),grayscale:!1,casing:"lower",min:0,max:255,min_red:void 0,max_red:void 0,min_green:void 0,max_green:void 0,min_blue:void 0,max_blue:void 0,min_alpha:0,max_alpha:1})).grayscale,s=r.min,l=r.max,c=r.min_red,f=r.max_red,m=r.min_green,d=r.max_green,u=r.min_blue,x=r.max_blue,i=r.min_alpha,h=r.max_alpha;if(void 0===r.min_red&&(c=s),void 0===r.max_red&&(f=l),void 0===r.min_green&&(m=s),void 0===r.max_green&&(d=l),void 0===r.min_blue&&(u=s),void 0===r.max_blue&&(x=l),void 0===r.min_alpha&&(i=0),void 0===r.max_alpha&&(h=1),t&&0===s&&255===l&&void 0!==c&&void 0!==f&&(s=(c+m+u)/3,l=(f+d+x)/3),"hex"===r.format)n=a.call(this,2,6,!0);else if("shorthex"===r.format)n=a.call(this,1,3,!0);else if("rgb"===r.format)n=e.call(this,!1);else if("rgba"===r.format)n=e.call(this,!0);else{if("0x"!==r.format){if("name"===r.format)return this.pick(this.get("colorNames"));throw new RangeError('Invalid format provided. Please provide one of "hex", "shorthex", "rgb", "rgba", "0x" or "name".')}n="0x"+a.call(this,2,6)}return n="upper"===r.casing?n.toUpperCase():n},h.prototype.domain=function(e){return e=b(e),this.word()+"."+(e.tld||this.tld())},h.prototype.email=function(e){return e=b(e),this.word({length:e.length})+"@"+(e.domain||this.domain())},h.prototype.fbid=function(){return"10000"+this.string({pool:"1234567890",length:11})},h.prototype.google_analytics=function(){return"UA-"+this.pad(this.natural({max:999999}),6)+"-"+this.pad(this.natural({max:99}),2)},h.prototype.hashtag=function(){return"#"+this.word()},h.prototype.ip=function(){return this.natural({min:1,max:254})+"."+this.natural({max:255})+"."+this.natural({max:255})+"."+this.natural({min:1,max:254})},h.prototype.ipv6=function(){return this.n(this.hash,8,{length:4}).join(":")},h.prototype.klout=function(){return this.natural({min:1,max:99})},h.prototype.mac=function(e){return e=b(e,{delimiter:":"}),this.pad(this.natural({max:255}).toString(16),2)+e.delimiter+this.pad(this.natural({max:255}).toString(16),2)+e.delimiter+this.pad(this.natural({max:255}).toString(16),2)+e.delimiter+this.pad(this.natural({max:255}).toString(16),2)+e.delimiter+this.pad(this.natural({max:255}).toString(16),2)+e.delimiter+this.pad(this.natural({max:255}).toString(16),2)},h.prototype.semver=function(e){e=b(e,{include_prerelease:!0});var a=this.pickone(["^","~","<",">","<=",">=","="]),n=(e.range&&(a=e.range),"");return e.include_prerelease&&(n=this.weighted(["","-dev","-beta","-alpha"],[50,10,5,1])),a+this.rpg("3d10").join(".")+n},h.prototype.tlds=function(){return["com","org","edu","gov","co.uk","net","io","ac","ad","ae","af","ag","ai","al","am","ao","aq","ar","as","at","au","aw","ax","az","ba","bb","bd","be","bf","bg","bh","bi","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","cr","cu","cv","cw","cx","cy","cz","de","dj","dk","dm","do","dz","ec","ee","eg","eh","er","es","et","eu","fi","fj","fk","fm","fo","fr","ga","gb","gd","ge","gf","gg","gh","gi","gl","gm","gn","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","im","in","io","iq","ir","is","it","je","jm","jo","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","me","mg","mh","mk","ml","mm","mn","mo","mp","mq","mr","ms","mt","mu","mv","mw","mx","my","mz","na","nc","ne","nf","ng","ni","nl","no","np","nr","nu","nz","om","pa","pe","pf","pg","ph","pk","pl","pm","pn","pr","ps","pt","pw","py","qa","re","ro","rs","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","ss","st","su","sv","sx","sy","sz","tc","td","tf","tg","th","tj","tk","tl","tm","tn","to","tr","tt","tv","tw","tz","ua","ug","uk","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","ye","yt","za","zm","zw"]},h.prototype.tld=function(){return this.pick(this.tlds())},h.prototype.twitter=function(){return"@"+this.word()},h.prototype.url=function(e){var a=0<(e=b(e,{protocol:"http",domain:this.domain(e),domain_prefix:"",path:this.word(),extensions:[]})).extensions.length?"."+this.pick(e.extensions):"",n=e.domain_prefix?e.domain_prefix+"."+e.domain:e.domain;return e.protocol+"://"+n+"/"+e.path+a},h.prototype.port=function(){return this.integer({min:0,max:65535})},h.prototype.locale=function(e){return(e=b(e)).region?this.pick(this.get("locale_regions")):this.pick(this.get("locale_languages"))},h.prototype.locales=function(e){return(e=b(e)).region?this.get("locale_regions"):this.get("locale_languages")},h.prototype.loremPicsum=function(e){return"https://picsum.photos/"+((e=b(e,{width:500,height:500,greyscale:!1,blurred:!1})).greyscale?"g/":"")+e.width+"/"+e.height+(e.blurred?"/?blur":"/?random")},h.prototype.address=function(e){return e=b(e),this.natural({min:5,max:2e3})+" "+this.street(e)},h.prototype.altitude=function(e){return e=b(e,{fixed:5,min:0,max:8848}),this.floating({min:e.min,max:e.max,fixed:e.fixed})},h.prototype.areacode=function(e){var a=(e=b(e,{parens:!0})).exampleNumber?"555":this.natural({min:2,max:9}).toString()+this.natural({min:0,max:8}).toString()+this.natural({min:0,max:9}).toString();return e.parens?"("+a+")":a},h.prototype.city=function(){return this.capitalize(this.word({syllables:3}))},h.prototype.coordinates=function(e){return this.latitude(e)+", "+this.longitude(e)},h.prototype.countries=function(){return this.get("countries")},h.prototype.country=function(e){e=b(e);var a=this.pick(this.countries());return e.raw?a:e.full?a.name:a.abbreviation},h.prototype.depth=function(e){return e=b(e,{fixed:5,min:-10994,max:0}),this.floating({min:e.min,max:e.max,fixed:e.fixed})},h.prototype.geohash=function(e){return e=b(e,{length:7}),this.string({length:e.length,pool:"0123456789bcdefghjkmnpqrstuvwxyz"})},h.prototype.geojson=function(e){return this.latitude(e)+", "+this.longitude(e)+", "+this.altitude(e)},h.prototype.latitude=function(e){var[a,n,i]=["ddm","dms","dd"],i=(e=b(e,e&&e.format&&[a,n].includes(e.format.toLowerCase())?{min:0,max:89,fixed:4}:{fixed:5,min:-90,max:90,format:i})).format.toLowerCase();switch(i!==a&&i!==n||(p(e.min<0||89<e.min,"Chance: Min specified is out of range. Should be between 0 - 89"),p(e.max<0||89<e.max,"Chance: Max specified is out of range. Should be between 0 - 89"),p(4<e.fixed,"Chance: Fixed specified should be below or equal to 4")),i){case a:return this.integer({min:e.min,max:e.max})+"°"+this.floating({min:0,max:59,fixed:e.fixed});case n:return this.integer({min:e.min,max:e.max})+"°"+this.integer({min:0,max:59})+"’"+this.floating({min:0,max:59,fixed:e.fixed})+"”";default:return this.floating({min:e.min,max:e.max,fixed:e.fixed})}},h.prototype.longitude=function(e){var[a,n,i]=["ddm","dms","dd"],i=(e=b(e,e&&e.format&&[a,n].includes(e.format.toLowerCase())?{min:0,max:179,fixed:4}:{fixed:5,min:-180,max:180,format:i})).format.toLowerCase();switch(i!==a&&i!==n||(p(e.min<0||179<e.min,"Chance: Min specified is out of range. Should be between 0 - 179"),p(e.max<0||179<e.max,"Chance: Max specified is out of range. Should be between 0 - 179"),p(4<e.fixed,"Chance: Fixed specified should be below or equal to 4")),i){case a:return this.integer({min:e.min,max:e.max})+"°"+this.floating({min:0,max:59.9999,fixed:e.fixed});case n:return this.integer({min:e.min,max:e.max})+"°"+this.integer({min:0,max:59})+"’"+this.floating({min:0,max:59.9999,fixed:e.fixed})+"”";default:return this.floating({min:e.min,max:e.max,fixed:e.fixed})}},h.prototype.phone=function(e){function a(e){var a=[];return e.sections.forEach(function(e){a.push(n.string({pool:"0123456789",length:e}))}),e.area+a.join(" ")}var n=this;switch((e=b(e,{formatted:!0,country:"us",mobile:!1,exampleNumber:!1})).formatted||(e.parens=!1),e.country){case"fr":t=(i=e.mobile?this.pick(["06","07"])+n.string({pool:"0123456789",length:8}):this.pick(["01"+this.pick(["30","34","39","40","41","42","43","44","45","46","47","48","49","53","55","56","58","60","64","69","70","72","73","74","75","76","77","78","79","80","81","82","83"])+n.string({pool:"0123456789",length:6}),"02"+this.pick(["14","18","22","23","28","29","30","31","32","33","34","35","36","37","38","40","41","43","44","45","46","47","48","49","50","51","52","53","54","56","57","61","62","69","72","76","77","78","85","90","96","97","98","99"])+n.string({pool:"0123456789",length:6}),"03"+this.pick(["10","20","21","22","23","24","25","26","27","28","29","39","44","45","51","52","54","55","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","80","81","82","83","84","85","86","87","88","89","90"])+n.string({pool:"0123456789",length:6}),"04"+this.pick(["11","13","15","20","22","26","27","30","32","34","37","42","43","44","50","56","57","63","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","88","89","90","91","92","93","94","95","97","98"])+n.string({pool:"0123456789",length:6}),"05"+this.pick(["08","16","17","19","24","31","32","33","34","35","40","45","46","47","49","53","55","56","57","58","59","61","62","63","64","65","67","79","81","82","86","87","90","94"])+n.string({pool:"0123456789",length:6}),"09"+n.string({pool:"0123456789",length:8})]),e.formatted?i.match(/../g).join(" "):i);break;case"uk":t=e.mobile?(i=this.pick([{area:"07"+this.pick(["4","5","7","8","9"]),sections:[2,6]},{area:"07624 ",sections:[6]}]),e.formatted?a(i):a(i).replace(" ","")):(i=this.pick([{area:"01"+this.character({pool:"234569"})+"1 ",sections:[3,4]},{area:"020 "+this.character({pool:"378"}),sections:[3,4]},{area:"023 "+this.character({pool:"89"}),sections:[3,4]},{area:"024 7",sections:[3,4]},{area:"028 "+this.pick(["25","28","37","71","82","90","92","95"]),sections:[2,4]},{area:"012"+this.pick(["04","08","54","76","97","98"])+" ",sections:[6]},{area:"013"+this.pick(["63","64","84","86"])+" ",sections:[6]},{area:"014"+this.pick(["04","20","60","61","80","88"])+" ",sections:[6]},{area:"015"+this.pick(["24","27","62","66"])+" ",sections:[6]},{area:"016"+this.pick(["06","29","35","47","59","95"])+" ",sections:[6]},{area:"017"+this.pick(["26","44","50","68"])+" ",sections:[6]},{area:"018"+this.pick(["27","37","84","97"])+" ",sections:[6]},{area:"019"+this.pick(["00","05","35","46","49","63","95"])+" ",sections:[6]}]),e.formatted?a(i):a(i).replace(" ","","g"));break;case"za":t=(i=e.mobile?this.pick(["060"+this.pick(["3","4","5","6","7","8","9"])+n.string({pool:"0123456789",length:6}),"061"+this.pick(["0","1","2","3","4","5","8"])+n.string({pool:"0123456789",length:6}),"06"+n.string({pool:"0123456789",length:7}),"071"+this.pick(["0","1","2","3","4","5","6","7","8","9"])+n.string({pool:"0123456789",length:6}),"07"+this.pick(["2","3","4","6","7","8","9"])+n.string({pool:"0123456789",length:7}),"08"+this.pick(["0","1","2","3","4","5"])+n.string({pool:"0123456789",length:7})]):this.pick(["01"+this.pick(["0","1","2","3","4","5","6","7","8"])+n.string({pool:"0123456789",length:7}),"02"+this.pick(["1","2","3","4","7","8"])+n.string({pool:"0123456789",length:7}),"03"+this.pick(["1","2","3","5","6","9"])+n.string({pool:"0123456789",length:7}),"04"+this.pick(["1","2","3","4","5","6","7","8","9"])+n.string({pool:"0123456789",length:7}),"05"+this.pick(["1","3","4","6","7","8"])+n.string({pool:"0123456789",length:7})]),e.formatted||i);break;case"us":var i=this.areacode(e).toString(),r=this.natural({min:2,max:9}).toString()+this.natural({min:0,max:9}).toString()+this.natural({min:0,max:9}).toString(),o=this.natural({min:1e3,max:9999}).toString(),t=e.formatted?i+" "+r+"-"+o:i+r+o;break;case"br":i=this.pick(["11","12","13","14","15","16","17","18","19","21","22","24","27","28","31","32","33","34","35","37","38","41","42","43","44","45","46","47","48","49","51","53","54","55","61","62","63","64","65","66","67","68","69","71","73","74","75","77","79","81","82","83","84","85","86","87","88","89","91","92","93","94","95","96","97","98","99"]),r=e.mobile?"9"+n.string({pool:"0123456789",length:4}):this.natural({min:2e3,max:5999}).toString(),o=n.string({pool:"0123456789",length:4});t=e.formatted?"("+i+") "+r+"-"+o:i+r+o}return t},h.prototype.postal=function(){return this.character({pool:"XVTSRPNKLMHJGECBA"})+this.natural({max:9})+this.character({alpha:!0,casing:"upper"})+" "+(this.natural({max:9})+this.character({alpha:!0,casing:"upper"})+this.natural({max:9}))},h.prototype.postcode=function(){return this.pick(this.get("postcodeAreas")).code+this.natural({max:9})+(this.bool()?this.character({alpha:!0,casing:"upper"}):"")+" "+(this.natural({max:9})+(this.character({alpha:!0,casing:"upper"})+this.character({alpha:!0,casing:"upper"})))},h.prototype.counties=function(e){return e=b(e,{country:"uk"}),this.get("counties")[e.country.toLowerCase()]},h.prototype.county=function(e){return this.pick(this.counties(e)).name},h.prototype.provinces=function(e){return e=b(e,{country:"ca"}),this.get("provinces")[e.country.toLowerCase()]},h.prototype.province=function(e){return e&&e.full?this.pick(this.provinces(e)).name:this.pick(this.provinces(e)).abbreviation},h.prototype.state=function(e){return e&&e.full?this.pick(this.states(e)).name:this.pick(this.states(e)).abbreviation},h.prototype.states=function(e){switch((e=b(e,{country:"us",us_states_and_dc:!0})).country.toLowerCase()){case"us":var a=this.get("us_states_and_dc"),n=this.get("territories"),i=this.get("armed_forces"),r=[];e.us_states_and_dc&&(r=r.concat(a)),e.territories&&(r=r.concat(n)),e.armed_forces&&(r=r.concat(i));break;case"it":case"mx":r=this.get("country_regions")[e.country.toLowerCase()];break;case"uk":r=this.get("counties")[e.country.toLowerCase()]}return r},h.prototype.street=function(e){var a;switch((e=b(e,{country:"us",syllables:2})).country.toLowerCase()){case"us":a=this.word({syllables:e.syllables}),a=this.capitalize(a),a=(a+=" ")+(e.short_suffix?this.street_suffix(e).abbreviation:this.street_suffix(e).name);break;case"it":a=this.word({syllables:e.syllables}),a=this.capitalize(a),a=(e.short_suffix?this.street_suffix(e).abbreviation:this.street_suffix(e).name)+" "+a}return a},h.prototype.street_suffix=function(e){return e=b(e,{country:"us"}),this.pick(this.street_suffixes(e))},h.prototype.street_suffixes=function(e){return e=b(e,{country:"us"}),this.get("street_suffixes")[e.country.toLowerCase()]},h.prototype.zip=function(e){var a=this.n(this.natural,5,{max:9});return e&&!0===e.plusfour&&(a.push("-"),a=a.concat(this.n(this.natural,4,{max:9}))),a.join("")},h.prototype.ampm=function(){return this.bool()?"am":"pm"},h.prototype.date=function(e){var a,n;return a=e&&(e.min||e.max)?(a=void 0!==(e=b(e,{american:!0,string:!1})).min?e.min.getTime():1,n=void 0!==e.max?e.max.getTime():864e13,new Date(this.integer({min:a,max:n}))):(n=(a=this.month({raw:!0})).days,e&&e.month&&(n=this.get("months")[(e.month%12+12)%12].days),e=b(e,{year:parseInt(this.year(),10),month:a.numeric-1,day:this.natural({min:1,max:n}),hour:this.hour({twentyfour:!0}),minute:this.minute(),second:this.second(),millisecond:this.millisecond(),american:!0,string:!1}),new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)),n=e.american?a.getMonth()+1+"/"+a.getDate()+"/"+a.getFullYear():a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear(),e.string?n:a},h.prototype.hammertime=function(e){return this.date(e).getTime()},h.prototype.hour=function(e){return p((e=b(e,{min:e&&e.twentyfour?0:1,max:e&&e.twentyfour?23:12})).min<0,"Chance: Min cannot be less than 0."),p(e.twentyfour&&23<e.max,"Chance: Max cannot be greater than 23 for twentyfour option."),p(!e.twentyfour&&12<e.max,"Chance: Max cannot be greater than 12."),p(e.max<e.min,"Chance: Min cannot be greater than Max."),this.natural({min:e.min,max:e.max})},h.prototype.millisecond=function(){return this.natural({max:999})},h.prototype.minute=h.prototype.second=function(e){return p((e=b(e,{min:0,max:59})).min<0,"Chance: Min cannot be less than 0."),p(59<e.max,"Chance: Max cannot be greater than 59."),p(e.max<e.min,"Chance: Min cannot be greater than Max."),this.natural({min:e.min,max:e.max})},h.prototype.month=function(e){p((e=b(e,{min:1,max:12})).min<1,"Chance: Min cannot be less than 1."),p(12<e.max,"Chance: Max cannot be greater than 12."),p(e.max<e.min,"Chance: Min cannot be greater than Max.");var a=this.pick(this.months().slice(e.min-1,e.max));return e.raw?a:a.name},h.prototype.months=function(){return this.get("months")},h.prototype.second=function(){return this.natural({max:59})},h.prototype.timestamp=function(){return this.natural({min:1,max:parseInt((new Date).getTime()/1e3,10)})},h.prototype.weekday=function(e){var a=["Monday","Tuesday","Wednesday","Thursday","Friday"];return(e=b(e,{weekday_only:!1})).weekday_only||(a.push("Saturday"),a.push("Sunday")),this.pickone(a)},h.prototype.year=function(e){return(e=b(e,{min:(new Date).getFullYear()})).max=void 0!==e.max?e.max:e.min+100,this.natural(e).toString()},h.prototype.cc=function(e){var a=(e=(e=b(e)).type?this.cc_type({name:e.type,raw:!0}):this.cc_type({raw:!0})).prefix.split(""),e=e.length-e.prefix.length-1;return(a=a.concat(this.n(this.integer,e,{min:0,max:9}))).push(this.luhn_calculate(a.join(""))),a.join("")},h.prototype.cc_types=function(){return this.get("cc_types")},h.prototype.cc_type=function(e){e=b(e);var a=this.cc_types(),n=null;if(e.name){for(var i=0;i<a.length;i++)if(a[i].name===e.name||a[i].short_name===e.name){n=a[i];break}if(null===n)throw new RangeError("Chance: Credit card type '"+e.name+"' is not supported")}else n=this.pick(a);return e.raw?n:n.name},h.prototype.currency_types=function(){return this.get("currency_types")},h.prototype.currency=function(){return this.pick(this.currency_types())},h.prototype.timezones=function(){return this.get("timezones")},h.prototype.timezone=function(){return this.pick(this.timezones())},h.prototype.currency_pair=function(e){var a=this.unique(this.currency,2,{comparator:function(e,n){return e.reduce(function(e,a){return e||a.code===n.code},!1)}});return e?a[0].code+"/"+a[1].code:a},h.prototype.dollar=function(e){e=b(e,{max:1e4,min:0});var e=this.floating({min:e.min,max:e.max,fixed:2}).toString(),a=e.split(".")[1];return void 0===a?e+=".00":a.length<2&&(e+="0"),e<0?"-$"+e.replace("-",""):"$"+e},h.prototype.euro=function(e){return Number(this.dollar(e).replace("$","")).toLocaleString()+"€"},h.prototype.exp=function(e){e=b(e);var a={};return a.year=this.exp_year(),a.year===(new Date).getFullYear().toString()?a.month=this.exp_month({future:!0}):a.month=this.exp_month(),e.raw?a:a.month+"/"+a.year},h.prototype.exp_month=function(e){e=b(e);var a,n=(new Date).getMonth()+1;if(e.future&&12!==n)for(;a=this.month({raw:!0}).numeric,parseInt(a,10)<=n;);else a=this.month({raw:!0}).numeric;return a},h.prototype.exp_year=function(){var e=(new Date).getMonth()+1,a=(new Date).getFullYear();return this.year({min:12===e?a+1:a,max:a+10})},h.prototype.vat=function(e){if("it"===(e=b(e,{country:"it"})).country.toLowerCase())return this.it_vat()},h.prototype.iban=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ";return this.string({length:2,pool:e})+this.pad(this.integer({min:0,max:99}),2)+this.string({length:4,pool:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"})+this.pad(this.natural(),this.natural({min:6,max:26}))},h.prototype.it_vat=function(){var e=this.natural({min:1,max:18e5});return(e=this.pad(e,7)+this.pad(this.pick(this.provinces({country:"it"})).code,3))+this.luhn_calculate(e)},h.prototype.cf=function(e){function a(e,a){var n,i=[];return e.length<3?i=e.split("").concat("XXX".split("")).splice(0,3):((n=3<(n=e.toUpperCase().split("").map(function(e){return-1!=="BCDFGHJKLMNPRSTVWZ".indexOf(e)?e:void 0}).join("")).length?a?n.substr(0,3):n[0]+n.substr(2,2):n).length<3&&(i=n,n=e.toUpperCase().split("").map(function(e){return-1!=="AEIOU".indexOf(e)?e:void 0}).join("").substr(0,3-i.length)),i+=n),i}var n=(e=e||{}).gender||this.gender(),i=e.first||this.first({gender:n,nationality:"it"}),r=e.last||this.last({nationality:"it"}),o=e.birthday||this.birthday(),e=e.city||this.pickone(["A","B","C","D","E","F","G","H","I","L","M","Z"])+this.pad(this.natural({max:999}),3),t=(t=[]).concat(a(r,!0),a(i),(r=n,i=this,(n=o).getFullYear().toString().substr(2)+["A","B","C","D","E","H","L","M","P","R","S","T"][n.getMonth()]+i.pad(n.getDate()+("female"===r.toLowerCase()?40:0),2)),e.toUpperCase().split("")).join("");return(t+=(e=>{for(var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n="ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ",i="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r=0,o=0;o<15;o++)r+=(o%2!=0?i:"BAKPLCQDREVOSFTGUHMINJWZYX").indexOf(n[a.indexOf(e[o])]);return i[r%26]})(t.toUpperCase())).toUpperCase()},h.prototype.pl_pesel=function(){for(var e=this.natural({min:1,max:9999999999}),a=this.pad(e,10).split(""),n=0;n<a.length;n++)a[n]=parseInt(a[n]);e=(+a[0]+3*a[1]+7*a[2]+9*a[3]+ +a[4]+3*a[5]+7*a[6]+9*a[7]+ +a[8]+3*a[9])%10;return 0!==e&&(e=10-e),a.join("")+e},h.prototype.pl_nip=function(){for(var e=this.natural({min:1,max:999999999}),a=this.pad(e,9).split(""),n=0;n<a.length;n++)a[n]=parseInt(a[n]);e=(6*a[0]+5*a[1]+7*a[2]+2*a[3]+3*a[4]+4*a[5]+5*a[6]+6*a[7]+7*a[8])%11;return 10==e?this.pl_nip():a.join("")+e},h.prototype.pl_regon=function(){for(var e=this.natural({min:1,max:99999999}),a=this.pad(e,8).split(""),n=0;n<a.length;n++)a[n]=parseInt(a[n]);e=(8*a[0]+9*a[1]+2*a[2]+3*a[3]+4*a[4]+5*a[5]+6*a[6]+7*a[7])%11;return 10===e&&(e=0),a.join("")+e},h.prototype.music_genre=function(e="general"){var a;if(e.toLowerCase()in l.music_genres)return(a=l.music_genres[e.toLowerCase()])[this.integer({min:0,max:a.length-1})];throw new Error("Unsupported genre: "+e)},h.prototype.note=function(e){e=b(e,{notes:"flatKey"});var a={naturals:["C","D","E","F","G","A","B"],flats:["D♭","E♭","G♭","A♭","B♭"],sharps:["C♯","D♯","F♯","G♯","A♯"]};return a.all=a.naturals.concat(a.flats.concat(a.sharps)),a.flatKey=a.naturals.concat(a.flats),a.sharpKey=a.naturals.concat(a.sharps),this.pickone(a[e.notes])},h.prototype.midi_note=function(e){return e=b(e,{min:0,max:127}),this.integer({min:e.min,max:e.max})},h.prototype.chord_quality=function(e){var a=["maj","min","aug","dim"];return(e=b(e,{jazz:!0})).jazz&&(a=["maj7","min7","7","sus","dim","ø"]),this.pickone(a)},h.prototype.chord=function(e){return e=b(e),this.note(e)+this.chord_quality(e)},h.prototype.tempo=function(e){return e=b(e,{min:40,max:320}),this.integer({min:e.min,max:e.max})},h.prototype.coin=function(){return this.bool()?"heads":"tails"},h.prototype.d4=A({min:1,max:4}),h.prototype.d6=A({min:1,max:6}),h.prototype.d8=A({min:1,max:8}),h.prototype.d10=A({min:1,max:10}),h.prototype.d12=A({min:1,max:12}),h.prototype.d20=A({min:1,max:20}),h.prototype.d30=A({min:1,max:30}),h.prototype.d100=A({min:1,max:100}),h.prototype.rpg=function(e,a){if(a=b(a)