{"version":3,"file":"fraction.js-DAzIW6xb.js","sources":["../../node_modules/fraction.js/fraction.cjs"],"sourcesContent":["/**\n * @license Fraction.js v4.3.7 31/08/2023\n * https://www.xarg.org/2014/03/rational-numbers-in-javascript/\n *\n * Copyright (c) 2023, Robert Eisele (robert@raw.org)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n **/\n\n\n/**\n *\n * This class offers the possibility to calculate fractions.\n * You can pass a fraction in different formats. Either as array, as double, as string or as an integer.\n *\n * Array/Object form\n * [ 0 => , 1 => ]\n * [ n => , d => ]\n *\n * Integer form\n * - Single integer value\n *\n * Double form\n * - Single double value\n *\n * String form\n * 123.456 - a simple double\n * 123/456 - a string fraction\n * 123.'456' - a double with repeating decimal places\n * 123.(456) - synonym\n * 123.45'6' - a double with repeating last place\n * 123.45(6) - synonym\n *\n * Example:\n *\n * var f = new Fraction(\"9.4'31'\");\n * f.mul([-4, 3]).div(4.9);\n *\n */\n\n(function(root) {\n\n \"use strict\";\n\n // Maximum search depth for cyclic rational numbers. 2000 should be more than enough.\n // Example: 1/7 = 0.(142857) has 6 repeating decimal places.\n // If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits\n var MAX_CYCLE_LEN = 2000;\n\n // Parsed data to avoid calling \"new\" all the time\n var P = {\n \"s\": 1,\n \"n\": 0,\n \"d\": 1\n };\n\n function assign(n, s) {\n\n if (isNaN(n = parseInt(n, 10))) {\n throw InvalidParameter();\n }\n return n * s;\n }\n\n // Creates a new Fraction internally without the need of the bulky constructor\n function newFraction(n, d) {\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n var f = Object.create(Fraction.prototype);\n f[\"s\"] = n < 0 ? -1 : 1;\n\n n = n < 0 ? -n : n;\n\n var a = gcd(n, d);\n\n f[\"n\"] = n / a;\n f[\"d\"] = d / a;\n return f;\n }\n\n function factorize(num) {\n\n var factors = {};\n\n var n = num;\n var i = 2;\n var s = 4;\n\n while (s <= n) {\n\n while (n % i === 0) {\n n/= i;\n factors[i] = (factors[i] || 0) + 1;\n }\n s+= 1 + 2 * i++;\n }\n\n if (n !== num) {\n if (n > 1)\n factors[n] = (factors[n] || 0) + 1;\n } else {\n factors[num] = (factors[num] || 0) + 1;\n }\n return factors;\n }\n\n var parse = function(p1, p2) {\n\n var n = 0, d = 1, s = 1;\n var v = 0, w = 0, x = 0, y = 1, z = 1;\n\n var A = 0, B = 1;\n var C = 1, D = 1;\n\n var N = 10000000;\n var M;\n\n if (p1 === undefined || p1 === null) {\n /* void */\n } else if (p2 !== undefined) {\n n = p1;\n d = p2;\n s = n * d;\n\n if (n % 1 !== 0 || d % 1 !== 0) {\n throw NonIntegerParameter();\n }\n\n } else\n switch (typeof p1) {\n\n case \"object\":\n {\n if (\"d\" in p1 && \"n\" in p1) {\n n = p1[\"n\"];\n d = p1[\"d\"];\n if (\"s\" in p1)\n n*= p1[\"s\"];\n } else if (0 in p1) {\n n = p1[0];\n if (1 in p1)\n d = p1[1];\n } else {\n throw InvalidParameter();\n }\n s = n * d;\n break;\n }\n case \"number\":\n {\n if (p1 < 0) {\n s = p1;\n p1 = -p1;\n }\n\n if (p1 % 1 === 0) {\n n = p1;\n } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow\n\n if (p1 >= 1) {\n z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10));\n p1/= z;\n }\n\n // Using Farey Sequences\n // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/\n\n while (B <= N && D <= N) {\n M = (A + C) / (B + D);\n\n if (p1 === M) {\n if (B + D <= N) {\n n = A + C;\n d = B + D;\n } else if (D > B) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n break;\n\n } else {\n\n if (p1 > M) {\n A+= C;\n B+= D;\n } else {\n C+= A;\n D+= B;\n }\n\n if (B > N) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n }\n }\n n*= z;\n } else if (isNaN(p1) || isNaN(p2)) {\n d = n = NaN;\n }\n break;\n }\n case \"string\":\n {\n B = p1.match(/\\d+|./g);\n\n if (B === null)\n throw InvalidParameter();\n\n if (B[A] === '-') {// Check for minus sign at the beginning\n s = -1;\n A++;\n } else if (B[A] === '+') {// Check for plus sign at the beginning\n A++;\n }\n\n if (B.length === A + 1) { // Check if it's just a simple number \"1234\"\n w = assign(B[A++], s);\n } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number\n\n if (B[A] !== '.') { // Handle 0.5 and .5\n v = assign(B[A++], s);\n }\n A++;\n\n // Check for decimal places\n if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === \"'\" && B[A + 3] === \"'\") {\n w = assign(B[A], s);\n y = Math.pow(10, B[A].length);\n A++;\n }\n\n // Check for repeating places\n if (B[A] === '(' && B[A + 2] === ')' || B[A] === \"'\" && B[A + 2] === \"'\") {\n x = assign(B[A + 1], s);\n z = Math.pow(10, B[A + 1].length) - 1;\n A+= 3;\n }\n\n } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction \"123/456\" or \"123:456\"\n w = assign(B[A], s);\n y = assign(B[A + 2], 1);\n A+= 3;\n } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction \"123 1/2\"\n v = assign(B[A], s);\n w = assign(B[A + 2], s);\n y = assign(B[A + 4], 1);\n A+= 5;\n }\n\n if (B.length <= A) { // Check for more tokens on the stack\n d = y * z;\n s = /* void */\n n = x + d * v + z * w;\n break;\n }\n\n /* Fall through on error */\n }\n default:\n throw InvalidParameter();\n }\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n P[\"s\"] = s < 0 ? -1 : 1;\n P[\"n\"] = Math.abs(n);\n P[\"d\"] = Math.abs(d);\n };\n\n function modpow(b, e, m) {\n\n var r = 1;\n for (; e > 0; b = (b * b) % m, e >>= 1) {\n\n if (e & 1) {\n r = (r * b) % m;\n }\n }\n return r;\n }\n\n\n function cycleLen(n, d) {\n\n for (; d % 2 === 0;\n d/= 2) {\n }\n\n for (; d % 5 === 0;\n d/= 5) {\n }\n\n if (d === 1) // Catch non-cyclic numbers\n return 0;\n\n // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem:\n // 10^(d-1) % d == 1\n // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone,\n // as we want to translate the numbers to strings.\n\n var rem = 10 % d;\n var t = 1;\n\n for (; rem !== 1; t++) {\n rem = rem * 10 % d;\n\n if (t > MAX_CYCLE_LEN)\n return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1`\n }\n return t;\n }\n\n\n function cycleStart(n, d, len) {\n\n var rem1 = 1;\n var rem2 = modpow(10, len, d);\n\n for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE)\n // Solve 10^s == 10^(s+t) (mod d)\n\n if (rem1 === rem2)\n return t;\n\n rem1 = rem1 * 10 % d;\n rem2 = rem2 * 10 % d;\n }\n return 0;\n }\n\n function gcd(a, b) {\n\n if (!a)\n return b;\n if (!b)\n return a;\n\n while (1) {\n a%= b;\n if (!a)\n return b;\n b%= a;\n if (!b)\n return a;\n }\n };\n\n /**\n * Module constructor\n *\n * @constructor\n * @param {number|Fraction=} a\n * @param {number=} b\n */\n function Fraction(a, b) {\n\n parse(a, b);\n\n if (this instanceof Fraction) {\n a = gcd(P[\"d\"], P[\"n\"]); // Abuse variable a\n this[\"s\"] = P[\"s\"];\n this[\"n\"] = P[\"n\"] / a;\n this[\"d\"] = P[\"d\"] / a;\n } else {\n return newFraction(P['s'] * P['n'], P['d']);\n }\n }\n\n var DivisionByZero = function() { return new Error(\"Division by Zero\"); };\n var InvalidParameter = function() { return new Error(\"Invalid argument\"); };\n var NonIntegerParameter = function() { return new Error(\"Parameters must be integer\"); };\n\n Fraction.prototype = {\n\n \"s\": 1,\n \"n\": 0,\n \"d\": 1,\n\n /**\n * Calculates the absolute value\n *\n * Ex: new Fraction(-4).abs() => 4\n **/\n \"abs\": function() {\n\n return newFraction(this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Inverts the sign of the current fraction\n *\n * Ex: new Fraction(-4).neg() => 4\n **/\n \"neg\": function() {\n\n return newFraction(-this[\"s\"] * this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Adds two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => 467 / 30\n **/\n \"add\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] + P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Subtracts two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => -427 / 30\n **/\n \"sub\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Multiplies two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").mul(3) => 5776 / 111\n **/\n \"mul\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Divides two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").inverse().div(3)\n **/\n \"div\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"d\"],\n this[\"d\"] * P[\"n\"]\n );\n },\n\n /**\n * Clones the actual object\n *\n * Ex: new Fraction(\"-17.(345)\").clone()\n **/\n \"clone\": function() {\n return newFraction(this['s'] * this['n'], this['d']);\n },\n\n /**\n * Calculates the modulo of two rational numbers - a more precise fmod\n *\n * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6)\n **/\n \"mod\": function(a, b) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return new Fraction(NaN);\n }\n\n if (a === undefined) {\n return newFraction(this[\"s\"] * this[\"n\"] % this[\"d\"], 1);\n }\n\n parse(a, b);\n if (0 === P[\"n\"] && 0 === this[\"d\"]) {\n throw DivisionByZero();\n }\n\n /*\n * First silly attempt, kinda slow\n *\n return that[\"sub\"]({\n \"n\": num[\"n\"] * Math.floor((this.n / this.d) / (num.n / num.d)),\n \"d\": num[\"d\"],\n \"s\": this[\"s\"]\n });*/\n\n /*\n * New attempt: a1 / b1 = a2 / b2 * q + r\n * => b2 * a1 = a2 * b1 * q + b1 * b2 * r\n * => (b2 * a1 % a2 * b1) / (b1 * b2)\n */\n return newFraction(\n this[\"s\"] * (P[\"d\"] * this[\"n\"]) % (P[\"n\"] * this[\"d\"]),\n P[\"d\"] * this[\"d\"]\n );\n },\n\n /**\n * Calculates the fractional gcd of two rational numbers\n *\n * Ex: new Fraction(5,8).gcd(3,7) => 1/56\n */\n \"gcd\": function(a, b) {\n\n parse(a, b);\n\n // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d)\n\n return newFraction(gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]), P[\"d\"] * this[\"d\"]);\n },\n\n /**\n * Calculates the fractional lcm of two rational numbers\n *\n * Ex: new Fraction(5,8).lcm(3,7) => 15\n */\n \"lcm\": function(a, b) {\n\n parse(a, b);\n\n // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d)\n\n if (P[\"n\"] === 0 && this[\"n\"] === 0) {\n return newFraction(0, 1);\n }\n return newFraction(P[\"n\"] * this[\"n\"], gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]));\n },\n\n /**\n * Calculates the ceil of a rational number\n *\n * Ex: new Fraction('4.(3)').ceil() => (5 / 1)\n **/\n \"ceil\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.ceil(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Calculates the floor of a rational number\n *\n * Ex: new Fraction('4.(3)').floor() => (4 / 1)\n **/\n \"floor\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.floor(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational numbers\n *\n * Ex: new Fraction('4.(3)').round() => (4 / 1)\n **/\n \"round\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.round(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number to a multiple of another rational number\n *\n * Ex: new Fraction('0.9').roundTo(\"1/8\") => 7 / 8\n **/\n \"roundTo\": function(a, b) {\n\n /*\n k * x/y ≤ a/b < (k+1) * x/y\n ⇔ k ≤ a/b / (x/y) < (k+1)\n ⇔ k = floor(a/b * y/x)\n */\n\n parse(a, b);\n\n return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']);\n },\n\n /**\n * Gets the inverse of the fraction, means numerator and denominator are exchanged\n *\n * Ex: new Fraction([-3, 4]).inverse() => -4 / 3\n **/\n \"inverse\": function() {\n\n return newFraction(this[\"s\"] * this[\"d\"], this[\"n\"]);\n },\n\n /**\n * Calculates the fraction to some rational exponent, if possible\n *\n * Ex: new Fraction(-1,2).pow(-3) => -8\n */\n \"pow\": function(a, b) {\n\n parse(a, b);\n\n // Trivial case when exp is an integer\n\n if (P['d'] === 1) {\n\n if (P['s'] < 0) {\n return newFraction(Math.pow(this['s'] * this[\"d\"], P['n']), Math.pow(this[\"n\"], P['n']));\n } else {\n return newFraction(Math.pow(this['s'] * this[\"n\"], P['n']), Math.pow(this[\"d\"], P['n']));\n }\n }\n\n // Negative roots become complex\n // (-a/b)^(c/d) = x\n // <=> (-1)^(c/d) * (a/b)^(c/d) = x\n // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180°\n // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index )\n // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case.\n if (this['s'] < 0) return null;\n\n // Now prime factor n and d\n var N = factorize(this['n']);\n var D = factorize(this['d']);\n\n // Exponentiate and take root for n and d individually\n var n = 1;\n var d = 1;\n for (var k in N) {\n if (k === '1') continue;\n if (k === '0') {\n n = 0;\n break;\n }\n N[k]*= P['n'];\n\n if (N[k] % P['d'] === 0) {\n N[k]/= P['d'];\n } else return null;\n n*= Math.pow(k, N[k]);\n }\n\n for (var k in D) {\n if (k === '1') continue;\n D[k]*= P['n'];\n\n if (D[k] % P['d'] === 0) {\n D[k]/= P['d'];\n } else return null;\n d*= Math.pow(k, D[k]);\n }\n\n if (P['s'] < 0) {\n return newFraction(d, n);\n }\n return newFraction(n, d);\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"equals\": function(a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] === P[\"s\"] * P[\"n\"] * this[\"d\"]; // Same as compare() === 0\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"compare\": function(a, b) {\n\n parse(a, b);\n var t = (this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * P[\"n\"] * this[\"d\"]);\n return (0 < t) - (t < 0);\n },\n\n \"simplify\": function(eps) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return this;\n }\n\n eps = eps || 0.001;\n\n var thisABS = this['abs']();\n var cont = thisABS['toContinued']();\n\n for (var i = 1; i < cont.length; i++) {\n\n var s = newFraction(cont[i - 1], 1);\n for (var k = i - 2; k >= 0; k--) {\n s = s['inverse']()['add'](cont[k]);\n }\n\n if (Math.abs(s['sub'](thisABS).valueOf()) < eps) {\n return s['mul'](this['s']);\n }\n }\n return this;\n },\n\n /**\n * Check if two rational numbers are divisible\n *\n * Ex: new Fraction(19.6).divisible(1.5);\n */\n \"divisible\": function(a, b) {\n\n parse(a, b);\n return !(!(P[\"n\"] * this[\"d\"]) || ((this[\"n\"] * P[\"d\"]) % (P[\"n\"] * this[\"d\"])));\n },\n\n /**\n * Returns a decimal representation of the fraction\n *\n * Ex: new Fraction(\"100.'91823'\").valueOf() => 100.91823918239183\n **/\n 'valueOf': function() {\n\n return this[\"s\"] * this[\"n\"] / this[\"d\"];\n },\n\n /**\n * Returns a string-fraction representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toFraction(true) => \"4 1/3\"\n **/\n 'toFraction': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n str+= \" \";\n n%= d;\n }\n\n str+= n;\n str+= '/';\n str+= d;\n }\n return str;\n },\n\n /**\n * Returns a latex representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toLatex() => \"\\frac{4}{3}\"\n **/\n 'toLatex': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n n%= d;\n }\n\n str+= \"\\\\frac{\";\n str+= n;\n str+= '}{';\n str+= d;\n str+= '}';\n }\n return str;\n },\n\n /**\n * Returns an array of continued fraction elements\n *\n * Ex: new Fraction(\"7/8\").toContinued() => [0,1,7]\n */\n 'toContinued': function() {\n\n var t;\n var a = this['n'];\n var b = this['d'];\n var res = [];\n\n if (isNaN(a) || isNaN(b)) {\n return res;\n }\n\n do {\n res.push(Math.floor(a / b));\n t = a % b;\n a = b;\n b = t;\n } while (a !== 1);\n\n return res;\n },\n\n /**\n * Creates a string representation of a fraction with all digits\n *\n * Ex: new Fraction(\"100.'91823'\").toString() => \"100.(91823)\"\n **/\n 'toString': function(dec) {\n\n var N = this[\"n\"];\n var D = this[\"d\"];\n\n if (isNaN(N) || isNaN(D)) {\n return \"NaN\";\n }\n\n dec = dec || 15; // 15 = decimal places when no repetation\n\n var cycLen = cycleLen(N, D); // Cycle length\n var cycOff = cycleStart(N, D, cycLen); // Cycle start\n\n var str = this['s'] < 0 ? \"-\" : \"\";\n\n str+= N / D | 0;\n\n N%= D;\n N*= 10;\n\n if (N)\n str+= \".\";\n\n if (cycLen) {\n\n for (var i = cycOff; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \"(\";\n for (var i = cycLen; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \")\";\n } else {\n for (var i = dec; N && i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n }\n return str;\n }\n };\n\n if (typeof exports === \"object\") {\n Object.defineProperty(exports, \"__esModule\", { 'value': true });\n exports['default'] = Fraction;\n module['exports'] = Fraction;\n } else {\n root['Fraction'] = Fraction;\n }\n\n})(this);\n"],"names":["root","MAX_CYCLE_LEN","P","assign","n","s","InvalidParameter","newFraction","d","DivisionByZero","f","Fraction","a","gcd","factorize","num","factors","i","parse","p1","p2","v","w","x","y","z","A","B","C","D","N","M","NonIntegerParameter","modpow","b","e","m","cycleLen","rem","t","cycleStart","len","rem1","rem2","places","k","eps","thisABS","cont","excludeWhole","whole","str","res","dec","cycLen","cycOff","exports","module"],"mappings":";;;;;;qDAuCC,SAASA,EAAM,CAOd,IAAIC,EAAgB,IAGhBC,EAAI,CACN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