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AAiB,GAC/C,CAeA,oBAAO,IAAiB,GACpB,MAAM,EAAe,KAAK,OAAO,EAAK,MAAM,EAAG,IACzC,EAAO,IAAI,YAAY,GAU7B,OAToB,KAAhB,EAAK,QACL,EAAK,eAAe,EAAK,OAET,IAAhB,EAAK,QACL,EAAK,eAAe,EAAK,OAET,IAAhB,EAAK,QACL,EAAK,gBAAgB,EAAK,OAEvB,EAAK,mBAChB,EAYJ,SAAS,aAAa,GAClB,IAAI,EAAS,IACb,EAAO,EAAK,QAAQ,UAAW,CAAC,EAAI,KAChC,EAAS,EACF,SAEX,MAAM,EAAQ,OAAO,SAAS,EAAQ,KAChC,EAAO,IAAI,YAAY,GAE7B,OADA,EAAK,eAAe,GACb,CACX,CASA,SAAS,YAAW,QAAE,EAAU,EAAC,MAAE,EAAQ,IAMvC,MALgC,mBAArB,EAAQ,WACf,EAAU,EAAQ,YAIf,CAAE,QAFT,EAAU,OAAO,GAEC,MADlB,EAAQ,OAAO,GAEnB,CAUA,SAAS,WAAW,GAChB,MAAwB,iBAAT,GAAsC,iBAAT,GAAqB,QAAQ,KAAK,EAClF,CASA,SAAS,SAAS,GACd,MAAyB,iBAAT,QACY,IAAjB,EAAK,SACU,iBAAf,EAAK,KACpB,CASA,SAAS,gBAAgB,GACrB,MAAuB,iBAAT,GAAqB,aAAa,KAAK,EACzD,CAUA,SAAS,QAAQ,EAAG,GAEhB,MAAO,GADS,WAAW,EAAG,KACV,GACxB,CAUA,SAAS,SAAS,EAAG,GAEjB,MAAO,GAAG,IADM,WAAW,EAAG,IAElC,CAUA,SAAS,WAAW,EAAG,GACnB,MAAM,EAAO,KAAK,IAAI,EAAM,EAAE,WAAW,OAAQ,GACjD,MAAO,IAAI,OAAO,EACtB,CA/GA,QAAQ,YAAc","file":"/npm/@google-cloud/precise-date@5.0.1/build/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/@google-cloud/precise-date@5.0.1/build/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n/*!\n * Copyright 2019 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PreciseDate = void 0;\nconst FULL_ISO_REG = /\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d{4,12}Z/;\nconst NO_BIG_INT = 'BigInt only available in Node >= v10.7. Consider using getFullTimeString instead.';\nvar Sign;\n(function (Sign) {\n    Sign[Sign[\"NEGATIVE\"] = -1] = \"NEGATIVE\";\n    Sign[Sign[\"POSITIVE\"] = 1] = \"POSITIVE\";\n    Sign[Sign[\"ZERO\"] = 0] = \"ZERO\";\n})(Sign || (Sign = {}));\n/**\n * The native Date object.\n * @external Date\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date}\n */\n/**\n * @typedef {array} DateTuple\n * @property {number} 0 Represents seconds of UTC time since Unix epoch\n *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n *     9999-12-31T23:59:59Z inclusive.\n * @property {number} 1 Non-negative fractions of a second at nanosecond\n *     resolution. Negative second values with fractions must still have\n *     non-negative nanos values that count forward in time. Must be from 0 to\n *     999,999,999 inclusive.\n */\n/**\n * @typedef {object} DateStruct\n * @property {number} seconds Represents seconds of UTC time since Unix epoch\n *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n *     9999-12-31T23:59:59Z inclusive.\n * @property {number} nanos Non-negative fractions of a second at nanosecond\n *     resolution. Negative second values with fractions must still have\n *     non-negative nanos values that count forward in time. Must be from 0 to\n *     999,999,999 inclusive.\n */\n/**\n * Date object with nanosecond precision. Supports all standard Date arguments\n * in addition to several custom types as noted below.\n *\n * @class\n * @extends external:Date\n *\n * @param {number|string|bigint|Date|DateTuple|DateStruct} [time] The time\n *     value.\n * @param {...number} [dateFields] Additional date fields (month, date, hours,\n *     minutes, seconds, milliseconds, microseconds, nanoseconds).\n *\n * @example <caption>With a RFC 3339 formatted string.</caption>\n * const date = new PreciseDate('2019-02-08T10:34:29.481145231Z');\n *\n * @example <caption>With a nanosecond timestamp string.</caption>\n * const date = new PreciseDate('1549622069481320032');\n *\n * @example <caption>With a BigInt (requires Node >= v10.7)</caption>\n * const date = new PreciseDate(1549622069481320032n);\n *\n * @example <caption>With a tuple containing seconds and nanoseconds.</caption>\n * const date = new PreciseDate([1549622069, 481320032]);\n *\n * @example <caption>With an object containing `seconds` and `nanos`</caption>\n * const date = new PreciseDate({seconds: 1549622069, nanos: 481320032});\n *\n * @example <caption>Specifiying date fields</caption>\n * const date = new PreciseDate(2018, 5, 14, 41, 11, 34, 123, 874, 321);\n */\nclass PreciseDate extends Date {\n    _micros = 0;\n    _nanos = 0;\n    _picos = 0;\n    constructor(time) {\n        super();\n        if (time && typeof time !== 'number' && !(time instanceof Date)) {\n            if (typeof time === 'string' && isFullISOString(time)) {\n                const pd = parseFullISO(time);\n                this.setFullTime(pd.getFullTimeString());\n                this.setPicoseconds(pd.getPicoseconds());\n                return;\n            }\n            this.setFullTime(PreciseDate.parseFull(time));\n            return;\n        }\n        // eslint-disable-next-line prefer-rest-params\n        const args = Array.from(arguments);\n        const dateFields = args.slice(0, 7);\n        const date = new Date(...dateFields);\n        const picos = args.length === 10 ? args.pop() : 0;\n        const nanos = args.length === 9 ? args.pop() : 0;\n        const micros = args.length === 8 ? args.pop() : 0;\n        this.setTime(date.getTime());\n        this.setMicroseconds(micros);\n        this.setNanoseconds(nanos);\n        if (picos !== 0) {\n            this.setPicoseconds(picos);\n        }\n    }\n    /**\n     * Returns the specified date represented in nanoseconds according to\n     * universal time.\n     *\n     * **NOTE:** Because this method returns a `BigInt` it requires Node >= v10.7.\n     * Use {@link PreciseDate#getFullTimeString} to get the time as a string.\n     *\n     * @see {@link https://github.com/tc39/proposal-bigint|BigInt}\n     *\n     * @throws {error} If `BigInt` is unavailable.\n     * @returns {bigint}\n     *\n     * @example\n     * const date = new PreciseDate('2019-02-08T10:34:29.481145231Z');\n     *\n     * console.log(date.getFullTime());\n     * // expected output: 1549622069481145231n\n     */\n    getFullTime() {\n        if (typeof BigInt !== 'function') {\n            throw new Error(NO_BIG_INT);\n        }\n        return BigInt(this.getFullTimeString());\n    }\n    /**\n     * Returns a string of the specified date represented in nanoseconds according\n     * to universal time.\n     *\n     * @returns {string}\n     *\n     * @example\n     * const date = new PreciseDate('2019-02-08T10:34:29.481145231Z');\n     *\n     * console.log(date.getFullTimeString());\n     * // expected output: \"1549622069481145231\"\n     */\n    getFullTimeString() {\n        const seconds = this._getSeconds();\n        let nanos = this._getNanos();\n        if (nanos && Math.sign(seconds) === Sign.NEGATIVE) {\n            nanos = 1e9 - nanos;\n        }\n        return `${seconds}${padLeft(nanos, 9)}`;\n    }\n    /**\n     * Returns the microseconds in the specified date according to universal time.\n     *\n     * @returns {number}\n     *\n     * @example\n     * const date = new PreciseDate('2019-02-08T10:34:29.481145Z');\n     *\n     * console.log(date.getMicroseconds());\n     * // expected output: 145\n     */\n    getMicroseconds() {\n        return this._micros;\n    }\n    /**\n     * Returns the nanoseconds in the specified date according to universal time.\n     *\n     * @returns {number}\n     *\n     * @example\n     * const date = new PreciseDate('2019-02-08T10:34:29.481145231Z');\n     *\n     * console.log(date.getNanoseconds());\n     * // expected output: 231\n     */\n    getNanoseconds() {\n        return this._nanos;\n    }\n    /**\n     * Returns the picoseconds in the specified date according to universal time.\n     *\n     * @returns {number}\n     *\n     * @example\n     * const date = new PreciseDate('2019-02-08T10:34:29.481145231123Z');\n     *\n     * console.log(date.getPicoseconds());\n     * // expected output: 123\n     */\n    getPicoseconds() {\n        return this._picos;\n    }\n    /**\n     * Sets the microseconds for a specified date according to universal time.\n     *\n     * @param {number} microseconds A number representing the microseconds.\n     * @returns {string} Returns a string representing the nanoseconds in the\n     *     specified date according to universal time.\n     *\n     * @example\n     * const date = new PreciseDate();\n     *\n     * date.setMicroseconds(149);\n     *\n     * console.log(date.getMicroseconds());\n     * // expected output: 149\n     */\n    setMicroseconds(micros) {\n        const abs = Math.abs(micros);\n        let millis = this.getUTCMilliseconds();\n        if (abs >= 1000) {\n            millis += Math.floor(abs / 1000) * Math.sign(micros);\n            micros %= 1000;\n        }\n        if (Math.sign(micros) === Sign.NEGATIVE) {\n            millis -= 1;\n            micros += 1000;\n        }\n        this._micros = micros;\n        this.setUTCMilliseconds(millis);\n        return this.getFullTimeString();\n    }\n    /**\n     * Sets the nanoseconds for a specified date according to universal time.\n     *\n     * @param {number} nanoseconds A number representing the nanoseconds.\n     * @returns {string} Returns a string representing the nanoseconds in the\n     *     specified date according to universal time.\n     *\n     * @example\n     * const date = new PreciseDate();\n     *\n     * date.setNanoseconds(231);\n     *\n     * console.log(date.getNanoseconds());\n     * // expected output: 231\n     */\n    setNanoseconds(nanos) {\n        const abs = Math.abs(nanos);\n        let micros = this._micros;\n        if (abs >= 1000) {\n            micros += Math.floor(abs / 1000) * Math.sign(nanos);\n            nanos %= 1000;\n        }\n        if (Math.sign(nanos) === Sign.NEGATIVE) {\n            micros -= 1;\n            nanos += 1000;\n        }\n        this._nanos = nanos;\n        return this.setMicroseconds(micros);\n    }\n    /**\n     * Sets the picoseconds for a specified date according to universal time.\n     *\n     * @param {number} picoseconds A number representing the picoseconds.\n     * @returns {string} Returns a string representing the nanoseconds in the\n     *     specified date according to universal time.\n     *\n     * @example\n     * const date = new PreciseDate();\n     *\n     * date.setPicoseconds(123);\n     *\n     * console.log(date.getPicoseconds());\n     * // expected output: 123\n     */\n    setPicoseconds(picos) {\n        const abs = Math.abs(picos);\n        let nanos = this._nanos;\n        if (abs >= 1000) {\n            nanos += Math.floor(abs / 1000) * Math.sign(picos);\n            picos %= 1000;\n        }\n        if (Math.sign(picos) === Sign.NEGATIVE) {\n            nanos -= 1;\n            picos += 1000;\n        }\n        this._picos = picos;\n        return this.setNanoseconds(nanos);\n    }\n    /**\n     * Sets the PreciseDate object to the time represented by a number of\n     * nanoseconds since January 1, 1970, 00:00:00 UTC.\n     *\n     * @param {bigint|number|string} time Value representing the number of\n     *     nanoseconds since January 1, 1970, 00:00:00 UTC.\n     * @returns {string} Returns a string representing the nanoseconds in the\n     *     specified date according to universal time (effectively, the value of\n     *     the argument).\n     *\n     * @see {@link https://github.com/tc39/proposal-bigint|BigInt}\n     *\n     * @example <caption>With a nanosecond string.</caption>\n     * const date = new PreciseDate();\n     * date.setFullTime('1549622069481145231');\n     *\n     * @example <caption>With a BigInt</caption>\n     * date.setFullTime(1549622069481145231n);\n     */\n    setFullTime(time) {\n        if (typeof time !== 'string') {\n            time = time.toString();\n        }\n        const sign = Math.sign(Number(time));\n        time = time.replace(/^-/, '');\n        const seconds = Number(time.substr(0, time.length - 9)) * sign;\n        const nanos = Number(time.substr(-9)) * sign;\n        this.setTime(seconds * 1000);\n        return this.setNanoseconds(nanos);\n    }\n    /**\n     * Sets the PreciseDate object to the time represented by a number of\n     * milliseconds since January 1, 1970, 00:00:00 UTC. Calling this method will\n     * reset both the microseconds and nanoseconds to 0.\n     *\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime|Date#setTime}\n     *\n     * @param {number} time Value representing the number of milliseconds since\n     *     January 1, 1970, 00:00:00 UTC.\n     * @returns {string} The number of milliseconds between January 1, 1970,\n     *     00:00:00 UTC and the updated date (effectively, the value of the\n     *     argument).\n     */\n    setTime(time) {\n        this._micros = 0;\n        this._nanos = 0;\n        this._picos = 0;\n        return super.setTime(time);\n    }\n    /**\n     * Returns a string in RFC 3339 format. Unlike the native `Date#toISOString`,\n     * this will return 9 digits to represent sub-second precision.\n     *\n     * @see {@link https://tools.ietf.org/html/rfc3339|RFC 3339}\n     *\n     * @returns {string}\n     *\n     * @example\n     * const date = new PreciseDate(1549622069481145231n);\n     *\n     * console.log(date.toISOString());\n     * // expected output: \"2019-02-08T10:34:29.481145231Z\"\n     */\n    toISOString() {\n        const micros = padLeft(this._micros, 3);\n        const nanos = padLeft(this._nanos, 3);\n        let picos = '';\n        if (this._picos > 0) {\n            // only include picoseconds if they are non-zero to avoid\n            // breaking existing consumers of this method.\n            picos = padLeft(this._picos, 3);\n        }\n        return super.toISOString().replace(/z$/i, `${micros}${nanos}${picos}Z`);\n    }\n    /**\n     * Returns an object representing the specified date according to universal\n     * time.\n     *\n     * @see {@link https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp|google.protobuf.Timestamp}\n     *\n     * @returns {DateStruct}\n     *\n     * @example\n     * const date = new PreciseDate('2019-02-08T10:34:29.481145231Z');\n     *\n     * console.log(date.toStruct());\n     * // expected output: {seconds: 1549622069, nanos: 481145231}\n     */\n    toStruct() {\n        let seconds = this._getSeconds();\n        const nanos = this._getNanos();\n        const sign = Math.sign(seconds);\n        // These objects are essentially a mirror of protobuf timestamps.\n        // `nanos` must always count forward in time, even if the date is <= Unix\n        // epoch. To do this we just need to count backwards 1 second and return the\n        // nanoseconds as is.\n        if (sign === Sign.NEGATIVE && nanos) {\n            seconds -= 1;\n        }\n        return { seconds, nanos };\n    }\n    /**\n     * Returns a tuple representing the specified date according to universal\n     * time.\n     *\n     * @returns {DateTuple}\n     *\n     * @example\n     * const date = new PreciseDate('2019-02-08T10:34:29.481145231Z');\n     *\n     * console.log(date.toTuple());\n     * // expected output: [1549622069, 481145231]\n     */\n    toTuple() {\n        const { seconds, nanos } = this.toStruct();\n        return [seconds, nanos];\n    }\n    /**\n     * Returns the total number of seconds in the specified date since Unix epoch.\n     * Numbers representing < epoch will be negative.\n     *\n     * @private\n     *\n     * @returns {number}\n     */\n    _getSeconds() {\n        const time = this.getTime();\n        const sign = Math.sign(time);\n        return Math.floor(Math.abs(time) / 1000) * sign;\n    }\n    /**\n     * Returns the sub-second precision of the specified date. This will always be\n     * a positive number.\n     *\n     * @private\n     *\n     * @returns {number}\n     */\n    _getNanos() {\n        const msInNanos = this.getUTCMilliseconds() * 1e6;\n        const microsInNanos = this._micros * 1000;\n        return this._nanos + msInNanos + microsInNanos;\n    }\n    /**\n     * Parses a precise time.\n     *\n     * @static\n     *\n     * @param {string|bigint|DateTuple|DateStruct} time The precise time value.\n     * @returns {string} Returns a string representing the nanoseconds in the\n     *     specified date according to universal time.\n     *\n     * @example <caption>From a RFC 3339 formatted string.</caption>\n     * const time = PreciseDate.parseFull('2019-02-08T10:34:29.481145231Z');\n     * console.log(time); // expected output: \"1549622069481145231\"\n     *\n     * @example <caption>From a nanosecond timestamp string.</caption>\n     * const time = PreciseDate.parseFull('1549622069481145231');\n     * console.log(time); // expected output: \"1549622069481145231\"\n     *\n     * @example <caption>From a BigInt (requires Node >= v10.7)</caption>\n     * const time = PreciseDate.parseFull(1549622069481145231n);\n     * console.log(time); // expected output: \"1549622069481145231\"\n     *\n     * @example <caption>From a tuple.</caption>\n     * const time = PreciseDate.parseFull([1549622069, 481145231]);\n     * console.log(time); // expected output: \"1549622069481145231\"\n     *\n     * @example <caption>From an object.</caption>\n     * const struct = {seconds: 1549622069, nanos: 481145231};\n     * const time = PreciseDate.parseFull(struct);\n     * console.log(time); // expected output: \"1549622069481145231\"\n     */\n    static parseFull(time) {\n        const date = new PreciseDate();\n        if (Array.isArray(time)) {\n            const [seconds, nanos] = time;\n            time = { seconds, nanos };\n        }\n        if (isFullTime(time)) {\n            date.setFullTime(time);\n        }\n        else if (isStruct(time)) {\n            const { seconds, nanos } = parseProto(time);\n            date.setTime(seconds * 1000);\n            date.setNanoseconds(nanos);\n        }\n        else if (isFullISOString(time)) {\n            const pd = parseFullISO(time);\n            date.setFullTime(pd.getFullTimeString());\n            date.setPicoseconds(pd.getPicoseconds());\n        }\n        else {\n            date.setTime(new Date(time).getTime());\n        }\n        return date.getFullTimeString();\n    }\n    /**\n     * Accepts the same number parameters as the PreciseDate constructor, but\n     * treats them as UTC. It returns a string that represents the number of\n     * nanoseconds since January 1, 1970, 00:00:00 UTC.\n     *\n     * **NOTE:** Because this method returns a `BigInt` it requires Node >= v10.7.\n     *\n     * @see {@link https://github.com/tc39/proposal-bigint|BigInt}\n     *\n     * @static\n     *\n     * @throws {error} If `BigInt` is unavailable.\n     *\n     * @param {...number} [dateFields] The date fields.\n     * @returns {bigint}\n     *\n     * @example\n     * const time = PreciseDate.fullUTC(2019, 1, 8, 10, 34, 29, 481, 145, 231);\n     * console.log(time); // expected output: 1549622069481145231n\n     */\n    static fullUTC(...args) {\n        if (typeof BigInt !== 'function') {\n            throw new Error(NO_BIG_INT);\n        }\n        return BigInt(PreciseDate.fullUTCString(...args));\n    }\n    /**\n     * Accepts the same number parameters as the PreciseDate constructor, but\n     * treats them as UTC. It returns a string that represents the number of\n     * nanoseconds since January 1, 1970, 00:00:00 UTC.\n     *\n     * @static\n     *\n     * @param {...number} [dateFields] The date fields.\n     * @returns {string}\n     *\n     * @example\n     * const time = PreciseDate.fullUTCString(2019, 1, 8, 10, 34, 29, 481, 145,\n     * 231); console.log(time); // expected output: '1549622069481145231'\n     */\n    static fullUTCString(...args) {\n        const milliseconds = Date.UTC(...args.slice(0, 7));\n        const date = new PreciseDate(milliseconds);\n        if (args.length === 10) {\n            date.setPicoseconds(args.pop());\n        }\n        if (args.length === 9) {\n            date.setNanoseconds(args.pop());\n        }\n        if (args.length === 8) {\n            date.setMicroseconds(args.pop());\n        }\n        return date.getFullTimeString();\n    }\n}\nexports.PreciseDate = PreciseDate;\n/**\n * Parses a RFC 3339 formatted string representation of the date, and returns\n * a {@link PreciseDate} object.\n *\n * @private\n *\n * @param {string} time The RFC 3339 formatted string.\n * @returns {PreciseDate}\n */\nfunction parseFullISO(time) {\n    let digits = '0';\n    time = time.replace(/\\.(\\d+)/, ($0, $1) => {\n        digits = $1;\n        return '.000';\n    });\n    const picos = Number(padRight(digits, 12));\n    const date = new PreciseDate(time);\n    date.setPicoseconds(picos);\n    return date;\n}\n/**\n * Normalizes a {@link google.protobuf.Timestamp} object.\n *\n * @private\n *\n * @param {google.protobuf.Timestamp} timestamp The timestamp object.\n * @returns {DateStruct}\n */\nfunction parseProto({ seconds = 0, nanos = 0 }) {\n    if (typeof seconds.toNumber === 'function') {\n        seconds = seconds.toNumber();\n    }\n    seconds = Number(seconds);\n    nanos = Number(nanos);\n    return { seconds, nanos };\n}\n/**\n * Checks to see if time value is specified in nanoseconds. We assume that all\n * BigInt and string timestamps represent nanoseconds.\n *\n * @private\n *\n * @param {*} time The time to check.\n * @returns {boolean}\n */\nfunction isFullTime(time) {\n    return (typeof time === 'bigint' || (typeof time === 'string' && /^\\d+$/.test(time)));\n}\n/**\n * Checks to see if time value is a {@link DateStruct}.\n *\n * @private\n *\n * @param {*} time The time to check.\n * @returns {boolean}\n */\nfunction isStruct(time) {\n    return ((typeof time === 'object' &&\n        typeof time.seconds !== 'undefined') ||\n        typeof time.nanos === 'number');\n}\n/**\n * Checks to see if the time value is a RFC 3339 formatted string.\n *\n * @private\n *\n * @param {*} time The time to check.\n * @returns {boolean}\n */\nfunction isFullISOString(time) {\n    return typeof time === 'string' && FULL_ISO_REG.test(time);\n}\n/**\n * Pads a number/string with \"0\" to the left.\n *\n * @private\n *\n * @param {string|number} n The number/string to pad.\n * @param {number} min The min size of the padded string.\n * @returns {string}\n */\nfunction padLeft(n, min) {\n    const padding = getPadding(n, min);\n    return `${padding}${n}`;\n}\n/**\n * Pads a number/string with \"0\" to the right.\n *\n * @private\n *\n * @param {string|number} n The number/string to pad.\n * @param {number} min The min size of the padded string.\n * @returns {string}\n */\nfunction padRight(n, min) {\n    const padding = getPadding(n, min);\n    return `${n}${padding}`;\n}\n/**\n * Creates padding based on current size and min size needed.\n *\n * @private\n *\n * @param {string|number} n The number/string to pad.\n * @param {number} [min=3] The min size of the padded string.\n * @returns {string}\n */\nfunction getPadding(n, min) {\n    const size = Math.max(min - n.toString().length, 0);\n    return '0'.repeat(size);\n}\n"]}