UNPKG

solidity-audit

Version:
1,658 lines (1,587 loc) 8.38 MB
<html lang="en-US"> <head> <meta charset="UTF-8" /> <meta name="description" content="ConsenSys Diligence - Solidity Metrics Report" /> <meta name="author" content="tintinweb.solidity-metrics" /> <meta name="url" content="https://marketplace.visualstudio.com/items?itemName=tintinweb.solidity-metrics" /> <meta name="robots" content="noindex" /> <title>Solidity Metrics</title> <script> function toggleVisibility(id, anchor) { if (document.getElementById(id).style.display == "none") { document.getElementById(id).style.display = "block"; anchor.text = "[➖]"; } else { document.getElementById(id).style.display = "none"; anchor.text = "[➕]"; } } </script> <style> /* Copyright (c) 2017 Chris Patuzzo https://twitter.com/chrispatuzzo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ body { font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 1.3; padding-top: 10px; padding-bottom: 10px; background-color: white; padding: 30px; color: #333; } body > *:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } a { color: #4183c4; text-decoration: none; } a.absent { color: #cc0000; } a.anchor { display: block; padding-left: 30px; margin-left: -30px; cursor: pointer; position: absolute; top: 0; left: 0; bottom: 0; } h1, h2, h3, h4, h5, h6 { margin: 20px 0 10px; padding: 0; font-weight: bold; -webkit-font-smoothing: antialiased; cursor: text; position: relative; } h2:first-child, h1:first-child, h1:first-child + h2, h3:first-child, h4:first-child, h5:first-child, h6:first-child { margin-top: 0; padding-top: 0; } h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; } h1 tt, h1 code { font-size: inherit; } h2 tt, h2 code { font-size: inherit; } h3 tt, h3 code { font-size: inherit; } h4 tt, h4 code { font-size: inherit; } h5 tt, h5 code { font-size: inherit; } h6 tt, h6 code { font-size: inherit; } h1 { font-size: 28px; color: black; } h2 { font-size: 24px; border-bottom: 1px solid #cccccc; color: black; } h3 { font-size: 18px; } h4 { font-size: 16px; } h5 { font-size: 14px; } h6 { color: #777777; font-size: 14px; } p, blockquote, ul, ol, dl, li, table, pre { margin: 15px 0; } hr { border: 1px solid; color: #cccccc; padding: 0; } body > h2:first-child { margin-top: 0; padding-top: 0; } body > h1:first-child { margin-top: 0; padding-top: 0; } body > h1:first-child + h2 { margin-top: 0; padding-top: 0; } body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child { margin-top: 0; padding-top: 0; } a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0; padding-top: 0; } h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { margin-top: 0; } li p.first { display: inline-block; } ul, ol { padding-left: 30px; } ul :first-child, ol :first-child { margin-top: 0; } ul :last-child, ol :last-child { margin-bottom: 0; } dl { padding: 0; } dl dt { font-size: 14px; font-weight: bold; font-style: italic; padding: 0; margin: 15px 0 5px; } dl dt:first-child { padding: 0; } dl dt > :first-child { margin-top: 0; } dl dt > :last-child { margin-bottom: 0; } dl dd { margin: 0 0 15px; padding: 0 15px; } dl dd > :first-child { margin-top: 0; } dl dd > :last-child { margin-bottom: 0; } blockquote { border-left: 4px solid #dddddd; padding: 0 15px; color: #777777; } blockquote > :first-child { margin-top: 0; } blockquote > :last-child { margin-bottom: 0; } table { padding: 0; } table tr { border-top: 1px solid #cccccc; background-color: white; margin: 0; padding: 0; } table tr:nth-child(2n) { background-color: #f8f8f8; } table tr th { font-weight: bold; border: 1px solid #cccccc; text-align: left; margin: 0; padding: 6px 13px; } table tr td { border: 1px solid #cccccc; text-align: left; margin: 0; padding: 6px 13px; } table tr th :first-child, table tr td :first-child { margin-top: 0; } table tr th :last-child, table tr td :last-child { margin-bottom: 0; } img { max-width: 100%; } span.frame { display: block; overflow: hidden; } span.frame > span { border: 1px solid #dddddd; display: block; float: left; overflow: hidden; margin: 13px 0 0; padding: 7px; width: auto; } span.frame span img { display: block; float: left; } span.frame span span { clear: both; color: #333333; display: block; padding: 5px 0 0; } span.align-center { display: block; overflow: hidden; clear: both; } span.align-center > span { display: block; overflow: hidden; margin: 13px auto 0; text-align: center; } span.align-center span img { margin: 0 auto; text-align: center; } span.align-right { display: block; overflow: hidden; clear: both; } span.align-right > span { display: block; overflow: hidden; margin: 13px 0 0; text-align: right; } span.align-right span img { margin: 0; text-align: right; } span.float-left { display: block; margin-right: 13px; overflow: hidden; float: left; } span.float-left span { margin: 13px 0 0; } span.float-right { display: block; margin-left: 13px; overflow: hidden; float: right; } span.float-right > span { display: block; overflow: hidden; margin: 13px auto 0; text-align: right; } code, tt { margin: 0 2px; padding: 0 5px; white-space: nowrap; border: 1px solid #eaeaea; background-color: #f8f8f8; border-radius: 3px; } pre code { margin: 0; padding: 0; white-space: pre; border: none; background: transparent; } .highlight pre { background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-radius: 3px; } pre { background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-radius: 3px; } pre code, pre tt { background-color: transparent; border: none; } </style> <script> /*! * Chart.js v2.8.0 * https://www.chartjs.org * (c) 2019 Chart.js Contributors * Released under the MIT License */ !(function (t, e) { "object" == typeof exports && "undefined" != typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define(e) : (t.Chart = e()); })(this, function () { "use strict"; var t = { rgb2hsl: e, rgb2hsv: i, rgb2hwb: n, rgb2cmyk: a, rgb2keyword: o, rgb2xyz: s, rgb2lab: l, rgb2lch: function (t) { return v(l(t)); }, hsl2rgb: u, hsl2hsv: function (t) { var e = t[0], i = t[1] / 100, n = t[2] / 100; if (0 === n) return [0, 0, 0]; return [ e, 100 * ((2 * (i *= (n *= 2) <= 1 ? n : 2 - n)) / (n + i)), 100 * ((n + i) / 2), ]; }, hsl2hwb: function (t) { return n(u(t)); }, hsl2cmyk: function (t) { return a(u(t)); }, hsl2keyword: function (t) { return o(u(t)); }, hsv2rgb: d, hsv2hsl: function (t) { var e, i, n = t[0], a = t[1] / 100, r = t[2] / 100; return ( (e = a * r), [ n, 100 * (e = (e /= (i = (2 - a) * r) <= 1 ? i : 2 - i) || 0), 100 * (i /= 2), ] ); }, hsv2hwb: function (t) { return n(d(t)); }, hsv2cmyk: function (t) { return a(d(t)); }, hsv2keyword: function (t) { return o(d(t)); }, hwb2rgb: h, hwb2hsl: function (t) { return e(h(t)); }, hwb2hsv: function (t) { return i(h(t)); }, hwb2cmyk: function (t) { return a(h(t)); }, hwb2keyword: function (t) { return o(h(t)); }, cmyk2rgb: c, cmyk2hsl: function (t) { return e(c(t)); }, cmyk2hsv: function (t) { return i(c(t)); }, cmyk2hwb: function (t) { return n(c(t)); }, cmyk2keyword: function (t) { return o(c(t)); }, keyword2rgb: _, keyword2hsl: function (t) { return e(_(t)); }, keyword2hsv: function (t) { return i(_(t)); }, keyword2hwb: function (t) { return n(_(t)); }, keyword2cmyk: function (t) { return a(_(t)); }, keyword2lab: function (t) { return l(_(t)); }, keyword2xyz: function (t) { return s(_(t)); }, xyz2rgb: f, xyz2lab: m, xyz2lch: function (t) { return v(m(t)); }, lab2xyz: p, lab2rgb: y, lab2lch: v, lch2lab: x, lch2xyz: function (t) { return p(x(t)); }, lch2rgb: function (t) { return y(x(t)); }, }; function e(t) { var e, i, n = t[0] / 255, a = t[1] / 255, r = t[2] / 255, o = Math.min(n, a, r), s = Math.max(n, a, r), l = s - o; return ( s == o ? (e = 0) : n == s ? (e = (a - r) / l) : a == s ? (e = 2 + (r - n) / l) : r == s && (e = 4 + (n - a) / l), (e = Math.min(60 * e, 360)) < 0 && (e += 360), (i = (o + s) / 2), [ e, 100 * (s == o ? 0 : i <= 0.5 ? l / (s + o) : l / (2 - s - o)), 100 * i, ] ); } function i(t) { var e, i, n = t[0], a = t[1], r = t[2], o = Math.min(n, a, r), s = Math.max(n, a, r), l = s - o; return ( (i = 0 == s ? 0 : ((l / s) * 1e3) / 10), s == o ? (e = 0) : n == s ? (e = (a - r) / l) : a == s ? (e = 2 + (r - n) / l) : r == s && (e = 4 + (n - a) / l), (e = Math.min(60 * e, 360)) < 0 && (e += 360), [e, i, ((s / 255) * 1e3) / 10] ); } function n(t) { var i = t[0], n = t[1], a = t[2]; return [ e(t)[0], 100 * ((1 / 255) * Math.min(i, Math.min(n, a))), 100 * (a = 1 - (1 / 255) * Math.max(i, Math.max(n, a))), ]; } function a(t) { var e, i = t[0] / 255, n = t[1] / 255, a = t[2] / 255; return [ 100 * ((1 - i - (e = Math.min(1 - i, 1 - n, 1 - a))) / (1 - e) || 0), 100 * ((1 - n - e) / (1 - e) || 0), 100 * ((1 - a - e) / (1 - e) || 0), 100 * e, ]; } function o(t) { return w[JSON.stringify(t)]; } function s(t) { var e = t[0] / 255, i = t[1] / 255, n = t[2] / 255; return [ 100 * (0.4124 * (e = e > 0.04045 ? Math.pow((e + 0.055) / 1.055, 2.4) : e / 12.92) + 0.3576 * (i = i > 0.04045 ? Math.pow((i + 0.055) / 1.055, 2.4) : i / 12.92) + 0.1805 * (n = n > 0.04045 ? Math.pow((n + 0.055) / 1.055, 2.4) : n / 12.92)), 100 * (0.2126 * e + 0.7152 * i + 0.0722 * n), 100 * (0.0193 * e + 0.1192 * i + 0.9505 * n), ]; } function l(t) { var e = s(t), i = e[0], n = e[1], a = e[2]; return ( (n /= 100), (a /= 108.883), (i = (i /= 95.047) > 0.008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116), [ 116 * (n = n > 0.008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116) - 16, 500 * (i - n), 200 * (n - (a = a > 0.008856 ? Math.pow(a, 1 / 3) : 7.787 * a + 16 / 116)), ] ); } function u(t) { var e, i, n, a, r, o = t[0] / 360, s = t[1] / 100, l = t[2] / 100; if (0 == s) return [(r = 255 * l), r, r]; (e = 2 * l - (i = l < 0.5 ? l * (1 + s) : l + s - l * s)), (a = [0, 0, 0]); for (var u = 0; u < 3; u++) (n = o + (1 / 3) * -(u - 1)) < 0 && n++, n > 1 && n--, (r = 6 * n < 1 ? e + 6 * (i - e) * n : 2 * n < 1 ? i : 3 * n < 2 ? e + (i - e) * (2 / 3 - n) * 6 : e), (a[u] = 255 * r); return a; } function d(t) { var e = t[0] / 60, i = t[1] / 100, n = t[2] / 100, a = Math.floor(e) % 6, r = e - Math.floor(e), o = 255 * n * (1 - i), s = 255 * n * (1 - i * r), l = 255 * n * (1 - i * (1 - r)); n *= 255; switch (a) { case 0: return [n, l, o]; case 1: return [s, n, o]; case 2: return [o, n, l]; case 3: return [o, s, n]; case 4: return [l, o, n]; case 5: return [n, o, s]; } } function h(t) { var e, i, n, a, o = t[0] / 360, s = t[1] / 100, l = t[2] / 100, u = s + l; switch ( (u > 1 && ((s /= u), (l /= u)), (n = 6 * o - (e = Math.floor(6 * o))), 0 != (1 & e) && (n = 1 - n), (a = s + n * ((i = 1 - l) - s)), e) ) { default: case 6: case 0: (r = i), (g = a), (b = s); break; case 1: (r = a), (g = i), (b = s); break; case 2: (r = s), (g = i), (b = a); break; case 3: (r = s), (g = a), (b = i); break; case 4: (r = a), (g = s), (b = i); break; case 5: (r = i), (g = s), (b = a); } return [255 * r, 255 * g, 255 * b]; } function c(t) { var e = t[0] / 100, i = t[1] / 100, n = t[2] / 100, a = t[3] / 100; return [ 255 * (1 - Math.min(1, e * (1 - a) + a)), 255 * (1 - Math.min(1, i * (1 - a) + a)), 255 * (1 - Math.min(1, n * (1 - a) + a)), ]; } function f(t) { var e, i, n, a = t[0] / 100, r = t[1] / 100, o = t[2] / 100; return ( (i = -0.9689 * a + 1.8758 * r + 0.0415 * o), (n = 0.0557 * a + -0.204 * r + 1.057 * o), (e = (e = 3.2406 * a + -1.5372 * r + -0.4986 * o) > 0.0031308 ? 1.055 * Math.pow(e, 1 / 2.4) - 0.055 : (e *= 12.92)), (i = i > 0.0031308 ? 1.055 * Math.pow(i, 1 / 2.4) - 0.055 : (i *= 12.92)), (n = n > 0.0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - 0.055 : (n *= 12.92)), [ 255 * (e = Math.min(Math.max(0, e), 1)), 255 * (i = Math.min(Math.max(0, i), 1)), 255 * (n = Math.min(Math.max(0, n), 1)), ] ); } function m(t) { var e = t[0], i = t[1], n = t[2]; return ( (i /= 100), (n /= 108.883), (e = (e /= 95.047) > 0.008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116), [ 116 * (i = i > 0.008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116) - 16, 500 * (e - i), 200 * (i - (n = n > 0.008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116)), ] ); } function p(t) { var e, i, n, a, r = t[0], o = t[1], s = t[2]; return ( r <= 8 ? (a = ((i = (100 * r) / 903.3) / 100) * 7.787 + 16 / 116) : ((i = 100 * Math.pow((r + 16) / 116, 3)), (a = Math.pow(i / 100, 1 / 3))), [ (e = e / 95.047 <= 0.008856 ? (e = (95.047 * (o / 500 + a - 16 / 116)) / 7.787) : 95.047 * Math.pow(o / 500 + a, 3)), i, (n = n / 108.883 <= 0.008859 ? (n = (108.883 * (a - s / 200 - 16 / 116)) / 7.787) : 108.883 * Math.pow(a - s / 200, 3)), ] ); } function v(t) { var e, i = t[0], n = t[1], a = t[2]; return ( (e = (360 * Math.atan2(a, n)) / 2 / Math.PI) < 0 && (e += 360), [i, Math.sqrt(n * n + a * a), e] ); } function y(t) { return f(p(t)); } function x(t) { var e, i = t[0], n = t[1]; return ( (e = (t[2] / 360) * 2 * Math.PI), [i, n * Math.cos(e), n * Math.sin(e)] ); } function _(t) { return k[t]; } var k = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50], }, w = {}; for (var M in k) w[JSON.stringify(k[M])] = M; var S = function () { return new O(); }; for (var D in t) { S[D + "Raw"] = (function (e) { return function (i) { return ( "number" == typeof i && (i = Array.prototype.slice.call(arguments)), t[e](i) ); }; })(D); var C = /(\w+)2(\w+)/.exec(D), P = C[1], T = C[2]; (S[P] = S[P] || {})[T] = S[D] = (function (e) { return function (i) { "number" == typeof i && (i = Array.prototype.slice.call(arguments)); var n = t[e](i); if ("string" == typeof n || void 0 === n) return n; for (var a = 0; a < n.length; a++) n[a] = Math.round(n[a]); return n; }; })(D); } var O = function () { this.convs = {}; }; (O.prototype.routeSpace = function (t, e) { var i = e[0]; return void 0 === i ? this.getValues(t) : ("number" == typeof i && (i = Array.prototype.slice.call(e)), this.setValues(t, i)); }), (O.prototype.setValues = function (t, e) { return ( (this.space = t), (this.convs = {}), (this.convs[t] = e), this ); }), (O.prototype.getValues = function (t) { var e = this.convs[t]; if (!e) { var i = this.space, n = this.convs[i]; (e = S[i][t](n)), (this.convs[t] = e); } return e; }), ["rgb", "hsl", "hsv", "cmyk", "keyword"].forEach(function (t) { O.prototype[t] = function (e) { return this.routeSpace(t, arguments); }; }); var I = S, A = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50], }, F = { getRgba: R, getHsla: L, getRgb: function (t) { var e = R(t); return e && e.slice(0, 3); }, getHsl: function (t) { var e = L(t); return e && e.slice(0, 3); }, getHwb: W, getAlpha: function (t) { var e = R(t); if (e) return e[3]; if ((e = L(t))) return e[3]; if ((e = W(t))) return e[3]; }, hexString: function (t, e) { var e = void 0 !== e && 3 === t.length ? e : t[3]; return ( "#" + H(t[0]) + H(t[1]) + H(t[2]) + (e >= 0 && e < 1 ? H(Math.round(255 * e)) : "") ); }, rgbString: function (t, e) { if (e < 1 || (t[3] && t[3] < 1)) return Y(t, e); return "rgb(" + t[0] + ", " + t[1] + ", " + t[2] + ")"; }, rgbaString: Y, percentString: function (t, e) { if (e < 1 || (t[3] && t[3] < 1)) return N(t, e); var i = Math.round((t[0] / 255) * 100), n = Math.round((t[1] / 255) * 100), a = Math.round((t[2] / 255) * 100); return "rgb(" + i + "%, " + n + "%, " + a + "%)"; }, percentaString: N, hslString: function (t, e) { if (e < 1 || (t[3] && t[3] < 1)) return z(t, e); return "hsl(" + t[0] + ", " + t[1] + "%, " + t[2] + "%)"; }, hslaString: z, hwbString: function (t, e) { void 0 === e && (e = void 0 !== t[3] ? t[3] : 1); return ( "hwb(" + t[0] + ", " + t[1] + "%, " + t[2] + "%" + (void 0 !== e && 1 !== e ? ", " + e : "") + ")" ); }, keyword: function (t) { return E[t.slice(0, 3)]; }, }; function R(t) { if (t) { var e = [0, 0, 0], i = 1, n = t.match(/^#([a-fA-F0-9]{3,4})$/i), a = ""; if (n) { a = (n = n[1])[3]; for (var r = 0; r < e.length; r++) e[r] = parseInt(n[r] + n[r], 16); a && (i = Math.round((parseInt(a + a, 16) / 255) * 100) / 100); } else if ((n = t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i))) { (a = n[2]), (n = n[1]); for (r = 0; r < e.length; r++) e[r] = parseInt(n.slice(2 * r, 2 * r + 2), 16); a && (i = Math.round((parseInt(a, 16) / 255) * 100) / 100); } else if ( (n = t.match( /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i )) ) { for (r = 0; r < e.length; r++) e[r] = parseInt(n[r + 1]); i = parseFloat(n[4]); } else if ( (n = t.match( /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i )) ) { for (r = 0; r < e.length; r++) e[r] = Math.round(2.55 * parseFloat(n[r + 1])); i = parseFloat(n[4]); } else if ((n = t.match(/(\w+)/))) { if ("transparent" == n[1]) return [0, 0, 0, 0]; if (!(e = A[n[1]])) return; } for (r = 0; r < e.length; r++) e[r] = V(e[r], 0, 255); return (i = i || 0 == i ? V(i, 0, 1) : 1), (e[3] = i), e; } } function L(t) { if (t) { var e = t.match( /^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/ ); if (e) { var i = parseFloat(e[4]); return [ V(parseInt(e[1]), 0, 360), V(parseFloat(e[2]), 0, 100), V(parseFloat(e[3]), 0, 100), V(isNaN(i) ? 1 : i, 0, 1), ]; } } } function W(t) { if (t) { var e = t.match( /^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/ ); if (e) { var i = parseFloat(e[4]); return [ V(parseInt(e[1]), 0, 360), V(parseFloat(e[2]), 0, 100), V(parseFloat(e[3]), 0, 100), V(isNaN(i) ? 1 : i, 0, 1), ]; } } } function Y(t, e) { return ( void 0 === e && (e = void 0 !== t[3] ? t[3] : 1), "rgba(" + t[0] + ", " + t[1] + ", " + t[2] + ", " + e + ")" ); } function N(t, e) { return ( "rgba(" + Math.round((t[0] / 255) * 100) + "%, " + Math.round((t[1] / 255) * 100) + "%, " + Math.round((t[2] / 255) * 100) + "%, " + (e || t[3] || 1) + ")" ); } function z(t, e) { return ( void 0 === e && (e = void 0 !== t[3] ? t[3] : 1), "hsla(" + t[0] + ", " + t[1] + "%, " + t[2] + "%, " + e + ")" ); } function V(t, e, i) { return Math.min(Math.max(e, t), i); } function H(t) { var e = t.toString(16).toUpperCase(); return e.length < 2 ? "0" + e : e; } var E = {}; for (var B in A) E[A[B]] = B; var j = function (t) { return t instanceof j ? t : this instanceof j ? ((this.valid = !1), (this.values = { rgb: [0, 0, 0], hsl: [0, 0, 0], hsv: [0, 0, 0], hwb: [0, 0, 0], cmyk: [0, 0, 0, 0], alpha: 1, }), void ("string" == typeof t ? (e = F.getRgba(t)) ? this.setValues("rgb", e) : (e = F.getHsla(t)) ? this.setValues("hsl", e) : (e = F.getHwb(t)) && this.setValues("hwb", e) : "object" == typeof t && (void 0 !== (e = t).r || void 0 !== e.red ? this.setValues("rgb", e) : void 0 !== e.l || void 0 !== e.lightness ? this.setValues("hsl", e) : void 0 !== e.v || void 0 !== e.value ? this.setValues("hsv", e) : void 0 !== e.w || void 0 !== e.whiteness ? this.setValues("hwb", e) : (void 0 === e.c && void 0 === e.cyan) || this.setValues("cmyk", e)))) : new j(t); var e; }; (j.prototype = { isValid: function () { return this.valid; }, rgb: function () { return this.setSpace("rgb", arguments); }, hsl: function () { return this.setSpace("hsl", arguments); }, hsv: function () { return this.setSpace("hsv", arguments); }, hwb: function () { return this.setSpace("hwb", arguments); }, cmyk: function () { return this.setSpace("cmyk", arguments); }, rgbArray: function () { return this.values.rgb; }, hslArray: function () { return this.values.hsl; }, hsvArray: function () { return this.values.hsv; }, hwbArray: function () { var t = this.values; return 1 !== t.alpha ? t.hwb.concat([t.alpha]) : t.hwb; }, cmykArray: function () { return this.values.cmyk; }, rgbaArray: function () { var t = this.values; return t.rgb.concat([t.alpha]); }, hslaArray: function () { var t = this.values; return t.hsl.concat([t.alpha]); }, alpha: function (t) { return void 0 === t ? this.values.alpha : (this.setValues("alpha", t), this); }, red: function (t) { return this.setChannel("rgb", 0, t); }, green: function (t) { return this.setChannel("rgb", 1, t); }, blue: function (t) { return this.setChannel("rgb", 2, t); }, hue: function (t) { return ( t && (t = (t %= 360) < 0 ? 360 + t : t), this.setChannel("hsl", 0, t) ); }, saturation: function (t) { return this.setChannel("hsl", 1, t); }, lightness: function (t) { return this.setChannel("hsl", 2, t); }, saturationv: function (t) { return this.setChannel("hsv", 1, t); }, whiteness: function (t) { return this.setChannel("hwb", 1, t); }, blackness: function (t) { return this.setChannel("hwb", 2, t); }, value: function (t) { return this.setChannel("hsv", 2, t); }, cyan: function (t) { return this.setChannel("cmyk", 0, t); }, magenta: function (t) { return this.setChannel("cmyk", 1, t); }, yellow: function (t) { return this.setChannel("cmyk", 2, t); }, black: function (t) { return this.setChannel("cmyk", 3, t); }, hexString: function () { return F.hexString(this.values.rgb); }, rgbString: function () { return F.rgbString(this.values.rgb, this.values.alpha); }, rgbaString: function () { return F.rgbaString(this.values.rgb, this.values.alpha); }, percentString: function () { return F.percentString(this.values.rgb, this.values.alpha); }, hslString: function () { return F.hslString(this.values.hsl, this.values.alpha); }, hslaString: function () { return F.hslaString(this.values.hsl, this.values.alpha); }, hwbString: function () { return F.hwbString(this.values.hwb, this.values.alpha); }, keyword: function () { return F.keyword(this.values.rgb, this.values.alpha); }, rgbNumber: function () { var t = this.values.rgb; return (t[0] << 16) | (t[1] << 8) | t[2]; }, luminosity: function () { for (var t = this.values.rgb, e = [], i = 0; i < t.length; i++) { var n = t[i] / 255; e[i] = n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4); } return 0.2126 * e[0] + 0.7152 * e[1] + 0.0722 * e[2]; }, contrast: function (t) { var e = this.luminosity(), i = t.luminosity(); return e > i ? (e + 0.05) / (i + 0.05) : (i + 0.05) / (e + 0.05); }, level: function (t) { var e = this.contrast(t); return e >= 7.1 ? "AAA" : e >= 4.5 ? "AA" : ""; }, dark: function () { var t = this.values.rgb; return (299 * t[0] + 587 * t[1] + 114 * t[2]) / 1e3 < 128; }, light: function () { return !this.dark(); }, negate: function () { for (var t = [], e = 0; e < 3; e++) t[e] = 255 - this.values.rgb[e]; return this.setValues("rgb", t), this; }, lighten: function (t) { var e = this.values.hsl; return (e[2] += e[2] * t), this.setValues("hsl", e), this; }, darken: function (t) { var e = this.values.hsl; return (e[2] -= e[2]