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M,KAAK,QAAQ,EAAG,EAAM,OAAS,GAChD,EAMA,EAAO,UAAU,YAAc,WAE3B,OADA,KAAK,cACE,KAAK,OAAS,EACzB,EAQA,EAAO,UAAU,KAAO,SAAU,GAE9B,SADmB,IAAf,IAAyB,EAAa,GACnC,KAAe,GAClB,KAAK,aAEb,EAcA,EAAO,UAAU,MAAQ,WACrB,KAAK,OAAS,KAAK,KACvB,EAGA,EAAO,UAAU,YAAc,WAC3B,KAAK,OAAS,KAAK,SAAS,KAAK,OACrC,EACA,EAAO,UAAU,SAAW,SAAU,GAMlC,OAHA,GAAS,GAAS,GAClB,GAAS,GAAS,GAClB,GAAS,GAAS,CAEtB,EACA,EAAO,UAAU,IAAM,SAAU,EAAK,EAAS,EAAS,EAAO,GAC3D,OAAS,EAAM,IAAY,EAAU,IAAa,EAAQ,GAAS,CACvE,EACA,EAAO,UAAU,SAAW,SAAU,GAClC,IAAI,EAAO,EACX,GAAI,EAEA,IADA,IAAI,EAAI,EAAI,OACH,EAAI,EAAG,EAAI,EAAG,IACnB,GAAQ,GAAQ,GAAK,EAAO,EAAI,WAAW,GAC3C,GAAQ,EACR,EAAO,KAAK,SAAS,GAG7B,OAAO,KAAK,YAAY,EAC5B,EACA,EAAO,UAAU,YAAc,SAAU,GACrC,OAAa,IAAT,EACO,EACJ,CACX,EACA,EAAO,KAAO,WACd,EAAO,IAAM,WACN,CACX,CA1K2B,EA8K9B,IACD,OAAO,QAAQ,QAAU,OAAO","file":"/npm/prando@6.0.0/dist/Prando.umd.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/prando@6.0.0/dist/Prando.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n    typeof define === 'function' && define.amd ? define(factory) :\n    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Prando = factory());\n}(this, (function () { 'use strict';\n\n    var Prando = /** @class */ (function () {\n        // ================================================================================================================\n        // CONSTRUCTOR ----------------------------------------------------------------------------------------------------\n        /**\n         * Generate a new Prando pseudo-random number generator.\n         *\n         * @param seed - A number or string seed that determines which pseudo-random number sequence will be created. Defaults to a random seed based on `Math.random()`.\n         */\n        function Prando(seed) {\n            this._value = NaN;\n            if (typeof seed === \"string\") {\n                // String seed\n                this._seed = this.hashCode(seed);\n            }\n            else if (typeof seed === \"number\") {\n                // Numeric seed\n                this._seed = this.getSafeSeed(seed);\n            }\n            else {\n                // Pseudo-random seed\n                this._seed = this.getSafeSeed(Prando.MIN + Math.floor((Prando.MAX - Prando.MIN) * Math.random()));\n            }\n            this.reset();\n        }\n        // ================================================================================================================\n        // PUBLIC INTERFACE -----------------------------------------------------------------------------------------------\n        /**\n         * Generates a pseudo-random number between a lower (inclusive) and a higher (exclusive) bounds.\n         *\n         * @param min - The minimum number that can be randomly generated.\n         * @param pseudoMax - The maximum number that can be randomly generated (exclusive).\n         * @return The generated pseudo-random number.\n         */\n        Prando.prototype.next = function (min, pseudoMax) {\n            if (min === void 0) { min = 0; }\n            if (pseudoMax === void 0) { pseudoMax = 1; }\n            this.recalculate();\n            return this.map(this._value, Prando.MIN, Prando.MAX, min, pseudoMax);\n        };\n        /**\n         * Generates a pseudo-random integer number in a range (inclusive).\n         *\n         * @param min - The minimum number that can be randomly generated.\n         * @param max - The maximum number that can be randomly generated.\n         * @return The generated pseudo-random number.\n         */\n        Prando.prototype.nextInt = function (min, max) {\n            if (min === void 0) { min = 10; }\n            if (max === void 0) { max = 100; }\n            this.recalculate();\n            return Math.floor(this.map(this._value, Prando.MIN, Prando.MAX, min, max + 1));\n        };\n        /**\n         * Generates a pseudo-random string sequence of a particular length from a specific character range.\n         *\n         * Note: keep in mind that creating a random string sequence does not guarantee uniqueness; there is always a\n         * 1 in (char_length^string_length) chance of collision. For real unique string ids, always check for\n         * pre-existing ids, or employ a robust GUID/UUID generator.\n         *\n         * @param length - Length of the string to be generated.\n         * @param chars - Characters that are used when creating the random string. Defaults to all alphanumeric chars (A-Z, a-z, 0-9).\n         * @return The generated string sequence.\n         */\n        Prando.prototype.nextString = function (length, chars) {\n            if (length === void 0) { length = 16; }\n            if (chars === void 0) { chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"; }\n            var str = \"\";\n            while (str.length < length) {\n                str += this.nextChar(chars);\n            }\n            return str;\n        };\n        /**\n         * Generates a pseudo-random string of 1 character specific character range.\n         *\n         * @param chars - Characters that are used when creating the random string. Defaults to all alphanumeric chars (A-Z, a-z, 0-9).\n         * @return The generated character.\n         */\n        Prando.prototype.nextChar = function (chars) {\n            if (chars === void 0) { chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"; }\n            return chars.substr(this.nextInt(0, chars.length - 1), 1);\n        };\n        /**\n         * Picks a pseudo-random item from an array. The array is left unmodified.\n         *\n         * Note: keep in mind that while the returned item will be random enough, picking one item from the array at a time\n         * does not guarantee nor imply that a sequence of random non-repeating items will be picked. If you want to\n         * *pick items in a random order* from an array, instead of *pick one random item from an array*, it's best to\n         * apply a *shuffle* transformation to the array instead, then read it linearly.\n         *\n         * @param array - Array of any type containing one or more candidates for random picking.\n         * @return An item from the array.\n         */\n        Prando.prototype.nextArrayItem = function (array) {\n            return array[this.nextInt(0, array.length - 1)];\n        };\n        /**\n         * Generates a pseudo-random boolean.\n         *\n         * @return A value of true or false.\n         */\n        Prando.prototype.nextBoolean = function () {\n            this.recalculate();\n            return this._value > 0.5;\n        };\n        /**\n         * Skips ahead in the sequence of numbers that are being generated. This is equivalent to\n         * calling next() a specified number of times, but faster since it doesn't need to map the\n         * new random numbers to a range and return it.\n         *\n         * @param iterations - The number of items to skip ahead.\n         */\n        Prando.prototype.skip = function (iterations) {\n            if (iterations === void 0) { iterations = 1; }\n            while (iterations-- > 0) {\n                this.recalculate();\n            }\n        };\n        /**\n         * Reset the pseudo-random number sequence back to its starting seed. Further calls to next()\n         * will then produce the same sequence of numbers it had produced before. This is equivalent to\n         * creating a new Prando instance with the same seed as another Prando instance.\n         *\n         * Example:\n         * let rng = new Prando(12345678);\n         * console.log(rng.next()); // 0.6177754114889017\n         * console.log(rng.next()); // 0.5784605181725837\n         * rng.reset();\n         * console.log(rng.next()); // 0.6177754114889017 again\n         * console.log(rng.next()); // 0.5784605181725837 again\n         */\n        Prando.prototype.reset = function () {\n            this._value = this._seed;\n        };\n        // ================================================================================================================\n        // PRIVATE INTERFACE ----------------------------------------------------------------------------------------------\n        Prando.prototype.recalculate = function () {\n            this._value = this.xorshift(this._value);\n        };\n        Prando.prototype.xorshift = function (value) {\n            // Xorshift*32\n            // Based on George Marsaglia's work: http://www.jstatsoft.org/v08/i14/paper\n            value ^= value << 13;\n            value ^= value >> 17;\n            value ^= value << 5;\n            return value;\n        };\n        Prando.prototype.map = function (val, minFrom, maxFrom, minTo, maxTo) {\n            return ((val - minFrom) / (maxFrom - minFrom)) * (maxTo - minTo) + minTo;\n        };\n        Prando.prototype.hashCode = function (str) {\n            var hash = 0;\n            if (str) {\n                var l = str.length;\n                for (var i = 0; i < l; i++) {\n                    hash = (hash << 5) - hash + str.charCodeAt(i);\n                    hash |= 0;\n                    hash = this.xorshift(hash);\n                }\n            }\n            return this.getSafeSeed(hash);\n        };\n        Prando.prototype.getSafeSeed = function (seed) {\n            if (seed === 0)\n                return 1;\n            return seed;\n        };\n        Prando.MIN = -2147483648; // Int32 min\n        Prando.MAX = 2147483647; // Int32 max\n        return Prando;\n    }());\n\n    return Prando;\n\n})));\nmodule.exports.default = module.exports; // Terrible injection just so it works regardless of how it's required\n"]}