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AK,GACT,EAAI,EACV,OAAI,gBAAgB,GAAc,cAAc,EAAM,EAAG,GACrD,gBAAgB,GAAc,cAAc,EAAG,GAC/C,gBAAgB,GAAc,cAAc,EAAG,GAC5C,cAAc,EAAG,EAC5B,CAQI,MAAM,QAAU,CAAC,EAAa,IAC1B,gBAAgB,GAAqB,UAAU,EAAa,GAC5D,gBAAgB,GAAqB,UAAU,EAAa,GAC5D,gBAAgB,GAAqB,UAAU,EAAa,GACzD,UAAU,EAAa,GASxB,YAAc,CAAC,EAAa,IAC9B,gBAAgB,GAAqB,cAAc,EAAa,GAChE,gBAAgB,GAAqB,cAAc,EAAa,GAChE,gBAAgB,GAAqB,cAAc,EAAa,GAC7D,cAAc,EAAa,GAQlC,SAAS,MAAM,GACf,OAAI,gBAAgB,GAAqB,QAAQ,GAC7C,gBAAgB,GAAqB,QAAQ,GAC1C,QAAQ,EACnB,CAEA,QAAQ,UAAY,MACpB,QAAQ,cAAgB,cACxB,QAAQ,YAAc,YACtB,QAAQ,OAAS,QACjB,QAAQ,OAAS,QACjB,QAAQ,QAAU,QAClB,QAAQ,YAAc,YACtB,QAAQ,MAAQ,QAChB,QAAQ,KAAO,KACf,QAAQ,MAAQ","file":"/npm/@adam-rocska/units-and-measurement@1.0.0/dist/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@adam-rocska/units-and-measurement@1.0.0/dist/cjs/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","Object.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Type predicate that checks if a string is a valid measurement.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param candidate The value to check.\n * @param unit The unit of the measurement.\n * @param value The value of the measurement.\n * @returns The result of the check.\n */ const isMeasurement$4 = (candidate, unit, value)=>{\n    if (typeof candidate !== \"string\") return false;\n    const valueCandidate = parseFloat(candidate);\n    if (Number.isNaN(valueCandidate)) return false;\n    const unitCandidate = candidate.replace(valueCandidate.toString(), \"\").trim();\n    if (!unitCandidate) return false;\n    if (unit !== undefined && unitCandidate !== unit) return false;\n    if (value !== undefined && valueCandidate !== value) return false;\n    if (`${valueCandidate}${unitCandidate}` !== candidate) return false;\n    return true;\n};\n\n/**\n * The string representation of a measurement.\n */ /**\n * Create a new measurement string.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param value The value of the measurement.\n * @param unit The unit of the measurement.\n * @returns A new measurement string.\n */ const measurement$4 = (value, unit)=>`${value}${unit}`;\n\n/**\n * Returns the value of a measurement.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param measurement The measurement to get the value of.\n * @returns The value of the measurement.\n */ const value$3 = (measurement)=>parseFloat(measurement);\n\n/**\n * Returns the unit of a measurement.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param measurement The measurement to get the unit of.\n * @returns The unit of the measurement.\n */ const unit$3 = (measurement)=>{\n    return measurement.slice(parseFloat(measurement).toString().length);\n};\n\n/**\n * Returns the value of a measurement with a fixed number of decimal places.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param measurement The measurement to get the value of.\n * @param fractionDigits The number of decimal places to return.\n * @returns The value of the measurement with a fixed number of decimal places.\n */ const toFixed$4 = (measurement, fractionDigits)=>{\n    const v = value$3(measurement).toFixed(fractionDigits);\n    const m = unit$3(measurement);\n    return `${v}${m}`;\n};\n\n/**\n * Returns the value of a measurement with a fixed number of decimal places.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param measurement The measurement to get the value of.\n * @param fractionDigits The number of decimal places to return.\n * @returns The value of the measurement with a fixed number of decimal places.\n */ const toPrecision$4 = (measurement, precision)=>{\n    const v = value$3(measurement).toPrecision(precision);\n    const m = unit$3(measurement);\n    return `${v}${m}`;\n};\n\nvar index$3 = {\n  __proto__: null,\n  isMeasurement: isMeasurement$4,\n  measurement: measurement$4,\n  toFixed: toFixed$4,\n  toPrecision: toPrecision$4,\n  unit: unit$3,\n  value: value$3\n};\n\n/**\n * Type predicate that checks if a value is a measurement tuple.\n *\n * @param candidate The value to check.\n * @param unit The expected unit of the measurement.\n * @param value The expected value of the measurement.\n * @returns The candidate is a measurement tuple.\n */ const isMeasurement$3 = (candidate, unit, value)=>{\n    if (!Array.isArray(candidate)) return false;\n    if (candidate.length !== 2) return false;\n    const [valueCandidate, unitCandidate] = candidate;\n    if (typeof valueCandidate !== \"number\") return false;\n    if (typeof unitCandidate !== \"string\") return false;\n    if (unit !== undefined && unitCandidate !== unit) return false;\n    if (value !== undefined && valueCandidate !== value) return false;\n    return true;\n};\n\n/**\n * The tuple representation of a measurement.\n */ /**\n * Creates a new measurement tuple.\n *\n * @param value The value of the measurement.\n * @param unit The unit of the measurement.\n * @returns A new measurement tuple.\n */ const measurement$3 = (value, unit)=>[\n        value,\n        unit\n    ];\n\n/**\n * Rounds the value of a measurement tuple to the specified number of decimal places.\n *\n * @param measurement The measurement tuple.\n * @param fractionDigits The number of decimal places.\n * @returns A new measurement tuple with the rounded value.\n */ const toFixed$3 = ([value, unit], fractionDigits)=>[\n        parseFloat(value.toFixed(fractionDigits)),\n        unit\n    ];\n\n/**\n * Rounds the value of a measurement tuple to the specified precision.\n *\n * @param measurement The measurement tuple.\n * @param precision The number of significant digits.\n * @returns A new measurement tuple with the rounded value.\n */ const toPrecision$3 = ([value, unit], precision)=>[\n        parseFloat(value.toPrecision(precision)),\n        unit\n    ];\n\n/**\n * Extracts the unit from a measurement tuple.\n *\n * @param measurement The measurement tuple.\n * @returns The unit of the measurement.\n */ const unit$2 = (measurement)=>measurement[1];\n\n/**\n * Extracts the value from a measurement tuple.\n *\n * @param measurement The measurement tuple.\n * @returns The value of the measurement.\n */ const value$2 = (measurement)=>measurement[0];\n\nvar index$2 = {\n  __proto__: null,\n  isMeasurement: isMeasurement$3,\n  measurement: measurement$3,\n  toFixed: toFixed$3,\n  toPrecision: toPrecision$3,\n  unit: unit$2,\n  value: value$2\n};\n\n/**\n * Type predicate that checks if a value is a measurement object.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param candidate The value to check.\n * @param unit The unit of the measurement.\n * @param value The value of the measurement.\n * @returns true if the candidate is a measurement object, false otherwise.\n */ const isMeasurement$2 = (candidate, unit, value)=>{\n    if (typeof candidate !== \"object\") return false;\n    if (candidate === null) return false;\n    if (!(\"unit\" in candidate)) return false;\n    if (!(\"value\" in candidate)) return false;\n    const { value: valueCandidate, unit: unitCandidate } = candidate;\n    if (typeof valueCandidate !== \"number\") return false;\n    if (typeof unitCandidate !== \"string\") return false;\n    if (unit !== undefined && unitCandidate !== unit) return false;\n    if (value !== undefined && valueCandidate !== value) return false;\n    return true;\n};\n\n/**\n * The object representation of a measurement.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n */ /**\n * Create a new measurement object.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param value The value of the measurement.\n * @param unit The unit of the measurement.\n * @returns A new measurement object.\n */ const measurement$2 = (value, unit)=>Object.freeze(Object.create(null, {\n        ...Object.getOwnPropertyDescriptors(value),\n        value: {\n            value\n        },\n        unit: {\n            value: unit\n        }\n    }));\n\n/**\n * Returns the value of a measurement object, fixed to a\n * number of decimal places.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param measurement The measurement object.\n * @returns The value of the measurement object.\n */ const toFixed$2 = ({ value, unit }, fractionDigits)=>measurement$2(parseFloat(value.toFixed(fractionDigits)), unit);\n\n/**\n * Returns the value of a measurement object, rounded to\n * the specified precision.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param measurement The measurement object.\n * @returns The value of the measurement object.\n */ const toPrecision$2 = ({ value, unit }, precision)=>measurement$2(parseFloat(value.toPrecision(precision)), unit);\n\n/**\n * Returns the unit of a measurement object.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param measurement The measurement object.\n * @returns The value of the measurement object.\n */ const unit$1 = (measurement)=>measurement.unit;\n\n/**\n * Returns the value of a measurement object.\n *\n * @template Unit The type of the unit of measurement.\n * @template Value The type of the value of the measurement.\n * @param measurement The measurement object.\n * @returns The value of the measurement object.\n */ const value$1 = (measurement)=>measurement.value;\n\nvar index$1 = {\n  __proto__: null,\n  isMeasurement: isMeasurement$2,\n  measurement: measurement$2,\n  toFixed: toFixed$2,\n  toPrecision: toPrecision$2,\n  unit: unit$1,\n  value: value$1\n};\n\n/**\n * A tuple of conversion functions to and from a base unit.\n */ /**\n * Creates a linear conversion tuple, where:\n * - `base = value * coefficient + constant`\n * - `value = (base - constant) / coefficient`\n */ const linearConversion = (coefficient, constant = 0)=>[\n        (value)=>value * coefficient + constant,\n        (value)=>(value - constant) / coefficient\n    ];\n\nclass CommonProxyHandler {\n    constructor(conversions){\n        this.conversions = conversions;\n    }\n    has(target, propertyKey) {\n        if (propertyKey in target) return true;\n        return this.isUnit(propertyKey);\n    }\n    ownKeys(target) {\n        return Reflect.ownKeys(target).concat(this.units);\n    }\n    set(_, p, v, r) {\n        return false;\n    }\n    deleteProperty(_, p) {\n        return false;\n    }\n    setPrototypeOf(target, v) {\n        return false;\n    }\n    getPrototypeOf() {\n        return null;\n    }\n    get(target, p, receiver) {\n        return Reflect.get(target, p, receiver);\n    }\n    getOwnPropertyDescriptor(target, p) {\n        if (p in target) return Reflect.getOwnPropertyDescriptor(target, p);\n        if (this.isUnit(p)) return {\n            enumerable: true,\n            configurable: true,\n            get: this.get.bind(this, target, p, undefined)\n        };\n        return undefined;\n    }\n    get units() {\n        return Reflect.ownKeys(this.conversions);\n    }\n    isUnit(candidate) {\n        return candidate in this.conversions;\n    }\n}\n\nclass DimensionProxyHandler extends CommonProxyHandler {\n    constructor(conversions, createMeasurement){\n        super(conversions);\n        this.createMeasurement = createMeasurement;\n    }\n    get(target, propertyKey) {\n        if (propertyKey in target) return target[propertyKey];\n        if (!this.isUnit(propertyKey)) return undefined;\n        return (value)=>this.createMeasurement(this.conversions, value, propertyKey);\n    }\n}\n\n/// MARK: Property Descriptors\n/**\n * Generates property descriptors for the given conversions.\n *\n * @template Units - The type of units.\n * @param conversions - The conversions object.\n * @returns The property descriptors for the alternatives.\n */ function propertyDescriptors(conversions) {\n    const descriptors = Object.create(null);\n    for(const unit in conversions)descriptors[unit] = propertyDescriptor(conversions, unit);\n    return descriptors;\n}\n/**\n * Creates a property descriptor for a specific unit of measurement.\n *\n * @template Units - The type of units available.\n * @template Unit - The specific unit of measurement.\n *\n * @param conversions - The conversions object containing the unit conversions.\n * @param unit - The specific unit of measurement.\n *\n * @returns A property descriptor for the specified unit of measurement.\n */ const propertyDescriptor = (conversions, unit)=>({\n        enumerable: true,\n        get: alternativeGet(conversions, unit)\n    });\n/**\n * Retrieves an alternative measurement value based on the specified unit.\n *\n * @template Units - The string literal type representing all possible units.\n * @template Unit - The specific unit to retrieve the alternative value for.\n * @param conversions - The conversion functions for all units.\n * @param unit - The unit to retrieve the alternative value for.\n * @returns A function that retrieves the alternative measurement value.\n */ const alternativeGet = (conversions, unit)=>function() {\n        let value;\n        if (this.unit === unit) {\n            value = this.value;\n        } else {\n            const [toBase, fromBase] = [\n                conversions[this.unit][0],\n                conversions[unit][1]\n            ];\n            value = fromBase(toBase(this.value));\n        }\n        return Object.create(measurement$2(value, unit), propertyDescriptors(conversions));\n    };\n\n/**\n * Type predicate, determining if a candidate is a dimension measurement.\n * @param candidate - The candidate to check.\n * @param units - The units of the dimension.\n * @param unit - The unit of the measurement.\n * @returns The predicate result.\n */ const isMeasurement$1 = (candidate, units, unit)=>{\n    if (!isMeasurement$2(candidate, unit)) return false;\n    if (!units) units = Object.keys(candidate);\n    const candidateKeys = Object.keys(candidate);\n    if (!units.every((unit)=>candidateKeys.includes(unit))) return false;\n    if (!candidateKeys.every((key)=>units.includes(key))) return false;\n    if (candidateKeys.length === 0) return false;\n    if (Object.entries(candidate).some(([key, value])=>!isMeasurement$2(value, key))) return false;\n    return true;\n};\n\nfunction measurement$1(basis, value, unit) {\n    return Object.create(measurement$2(value, unit), isMeasurement$1(basis) ? Object.getOwnPropertyDescriptors(basis) : propertyDescriptors(basis));\n}\n\n/**\n * Creates a dimension from a set of conversions.\n * @param conversions - The conversions for the dimension.\n * @returns The dimension.\n * @template Units - The units of the dimension.\n */ const dimension = (conversions)=>new Proxy(Object.create(null), new DimensionProxyHandler(conversions, measurement$1));\n\n/**\n * Rounds the value of a measurement to a specified number of decimal places.\n *\n * @param measurement - The measurement to round.\n * @param fractionDigits - The number of decimal places to round to. If not provided, the default value is used.\n * @returns A new measurement with the rounded value.\n */ const toFixed$1 = (measurement, fractionDigits)=>Object.create(toFixed$2(measurement, fractionDigits), Object.getOwnPropertyDescriptors(measurement));\n\n/**\n * Returns a new measurement with the value rounded to the specified number of decimal places.\n *\n * @param measurement - The measurement to round.\n * @param fractionDigits - The number of decimal places to round to. If not provided, the default behavior is used.\n * @returns A new measurement with the rounded value.\n */ const toPrecision$1 = (measurement, fractionDigits)=>Object.create(toPrecision$2(measurement, fractionDigits), Object.getOwnPropertyDescriptors(measurement));\n\n/**\n * Retrieves the units of a given measurement.\n *\n * @param measurement - The measurement object.\n * @returns An array of units for the given measurement.\n */ const units = (measurement)=>Object.keys(measurement);\n\nvar index = {\n  __proto__: null,\n  dimension: dimension,\n  isMeasurement: isMeasurement$1,\n  linearConversion: linearConversion,\n  measurement: measurement$1,\n  toFixed: toFixed$1,\n  toPrecision: toPrecision$1,\n  units: units\n};\n\n/**\n * Type predicate, determining if a candidate is a measurement.\n *\n * @template Units - The type of units.\n * @template Unit - The specific unit type.\n * @param candidate - The value to be checked.\n * @param unit - The specific unit to be checked against.\n * @param units - Additional units to be checked against.\n * @returns A boolean indicating whether the candidate is a valid measurement.\n */ const isMeasurement = (candidate, unit, units)=>{\n    if (!unit) {\n        if (isMeasurement$1(candidate)) return true;\n        if (isMeasurement$4(candidate)) return true;\n        if (isMeasurement$3(candidate)) return true;\n        if (isMeasurement$2(candidate)) return true;\n    }\n    units = units ?? [];\n    if (isMeasurement$1(candidate, units, unit)) return true;\n    for (const u of units.concat(unit)){\n        if (isMeasurement$4(candidate, u)) return true;\n        if (isMeasurement$3(candidate, u)) return true;\n        if (isMeasurement$2(candidate, u)) return true;\n    }\n    return false;\n};\n\n/**\n * Returns the unit of measurement for the given measurement.\n *\n * @template Unit - The type of unit.\n * @param measurement - The measurement value.\n * @returns The unit of measurement.\n */ function unit(measurement) {\n    if (isMeasurement$4(measurement)) return unit$3(measurement);\n    if (isMeasurement$3(measurement)) return unit$2(measurement);\n    return unit$1(measurement);\n}\n\nfunction measurement(base, value) {\n    const u = unit(base);\n    const v = value;\n    if (isMeasurement$1(base)) return measurement$1(base, v, u);\n    if (isMeasurement$2(base)) return measurement$2(v, u);\n    if (isMeasurement$3(base)) return measurement$3(v, u);\n    return measurement$4(v, u);\n}\n\n/**\n * Converts a measurement value to a fixed number with a specified number of decimal places.\n *\n * @param measurement - The measurement value to convert.\n * @param fractionDigits - The number of decimal places to round to. If not provided, the default behavior is used.\n * @returns The converted measurement value with the specified number of decimal places.\n */ const toFixed = (measurement, fractionDigits)=>{\n    if (isMeasurement$1(measurement)) return toFixed$1(measurement, fractionDigits);\n    if (isMeasurement$4(measurement)) return toFixed$4(measurement, fractionDigits);\n    if (isMeasurement$3(measurement)) return toFixed$3(measurement, fractionDigits);\n    return toFixed$2(measurement, fractionDigits);\n};\n\n/**\n * Applies precision formatting to a measurement value.\n *\n * @param measurement - The measurement value to apply precision formatting to.\n * @param fractionDigits - The number of digits to appear after the decimal point.\n * @returns A new measurement value with precision formatting applied.\n */ const toPrecision = (measurement, fractionDigits)=>{\n    if (isMeasurement$1(measurement)) return toPrecision$1(measurement, fractionDigits);\n    if (isMeasurement$4(measurement)) return toPrecision$4(measurement, fractionDigits);\n    if (isMeasurement$3(measurement)) return toPrecision$3(measurement, fractionDigits);\n    return toPrecision$2(measurement, fractionDigits);\n};\n\n/**\n * Retrieves the value from a measurement object.\n *\n * @param measurement - The measurement object to retrieve the value from.\n * @returns The value of the measurement.\n */ function value(measurement) {\n    if (isMeasurement$4(measurement)) return value$3(measurement);\n    if (isMeasurement$3(measurement)) return value$2(measurement);\n    return value$1(measurement);\n}\n\nexports.dimension = index;\nexports.isMeasurement = isMeasurement;\nexports.measurement = measurement;\nexports.object = index$1;\nexports.string = index$3;\nexports.toFixed = toFixed;\nexports.toPrecision = toPrecision;\nexports.tuple = index$2;\nexports.unit = unit;\nexports.value = value;\n"]}