diff --git a/d3-legend.js b/d3-legend.js
index ca53531..05a71e1 100644
--- a/d3-legend.js
+++ b/d3-legend.js
@@ -464,11 +464,11 @@
}));
},{}],2:[function(require,module,exports){
-// https://d3js.org/d3-collection/ Version 1.0.2. Copyright 2016 Mike Bostock.
+// https://d3js.org/d3-collection/ Version 1.0.4. Copyright 2017 Mike Bostock.
(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- (factory((global.d3 = global.d3 || {})));
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
+ (factory((global.d3 = global.d3 || {})));
}(this, (function (exports) { 'use strict';
var prefix = "$";
@@ -553,10 +553,10 @@ var nest = function() {
nest;
function apply(array, depth, createResult, setResult) {
- if (depth >= keys.length) return rollup != null
- ? rollup(array) : (sortValues != null
- ? array.sort(sortValues)
- : array);
+ if (depth >= keys.length) {
+ if (sortValues != null) array.sort(sortValues);
+ return rollup != null ? rollup(array) : array;
+ }
var i = -1,
n = array.length,
@@ -683,11 +683,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
})));
},{}],3:[function(require,module,exports){
-// https://d3js.org/d3-color/ Version 1.0.2. Copyright 2016 Mike Bostock.
+// https://d3js.org/d3-color/ Version 1.0.3. Copyright 2017 Mike Bostock.
(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- (factory((global.d3 = global.d3 || {})));
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
+ (factory((global.d3 = global.d3 || {})));
}(this, (function (exports) { 'use strict';
var define = function(constructor, factory, prototype) {
@@ -1634,11 +1634,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
}));
},{}],6:[function(require,module,exports){
-// https://d3js.org/d3-interpolate/ Version 1.1.2. Copyright 2016 Mike Bostock.
+// https://d3js.org/d3-interpolate/ Version 1.1.5. Copyright 2017 Mike Bostock.
(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-color')) :
- typeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) :
- (factory((global.d3 = global.d3 || {}),global.d3));
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-color')) :
+ typeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) :
+ (factory((global.d3 = global.d3 || {}),global.d3));
}(this, (function (exports,d3Color) { 'use strict';
function basis(t1, v0, v1, v2, v3) {
@@ -1707,14 +1707,14 @@ function nogamma(a, b) {
return d ? linear(a, d) : constant(isNaN(a) ? b : a);
}
-var rgb$1 = (function rgbGamma(y) {
+var rgb$1 = ((function rgbGamma(y) {
var color$$1 = gamma(y);
function rgb$$1(start, end) {
var r = color$$1((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r),
g = color$$1(start.g, end.g),
b = color$$1(start.b, end.b),
- opacity = color$$1(start.opacity, end.opacity);
+ opacity = nogamma(start.opacity, end.opacity);
return function(t) {
start.r = r(t);
start.g = g(t);
@@ -1727,7 +1727,7 @@ var rgb$1 = (function rgbGamma(y) {
rgb$$1.gamma = rgbGamma;
return rgb$$1;
-})(1);
+}))(1);
function rgbSpline(spline) {
return function(colors) {
@@ -1880,7 +1880,7 @@ var value = function(a, b) {
: b instanceof d3Color.color ? rgb$1
: b instanceof Date ? date
: Array.isArray(b) ? array
- : isNaN(b) ? object
+ : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
: number)(a, b);
};
@@ -4058,11 +4058,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
}));
},{}],9:[function(require,module,exports){
-// https://d3js.org/d3-time-format/ Version 2.0.3. Copyright 2016 Mike Bostock.
+// https://d3js.org/d3-time-format/ Version 2.1.0. Copyright 2017 Mike Bostock.
(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-time')) :
- typeof define === 'function' && define.amd ? define(['exports', 'd3-time'], factory) :
- (factory((global.d3 = global.d3 || {}),global.d3));
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-time')) :
+ typeof define === 'function' && define.amd ? define(['exports', 'd3-time'], factory) :
+ (factory((global.d3 = global.d3 || {}),global.d3));
}(this, (function (exports,d3Time) { 'use strict';
function localDate(d) {
@@ -4116,6 +4116,7 @@ function formatLocale(locale) {
"c": null,
"d": formatDayOfMonth,
"e": formatDayOfMonth,
+ "f": formatMicroseconds,
"H": formatHour24,
"I": formatHour12,
"j": formatDayOfYear,
@@ -4123,9 +4124,13 @@ function formatLocale(locale) {
"m": formatMonthNumber,
"M": formatMinutes,
"p": formatPeriod,
+ "Q": formatUnixTimestamp,
+ "s": formatUnixTimestampSeconds,
"S": formatSeconds,
+ "u": formatWeekdayNumberMonday,
"U": formatWeekNumberSunday,
- "w": formatWeekdayNumber,
+ "V": formatWeekNumberISO,
+ "w": formatWeekdayNumberSunday,
"W": formatWeekNumberMonday,
"x": null,
"X": null,
@@ -4143,6 +4148,7 @@ function formatLocale(locale) {
"c": null,
"d": formatUTCDayOfMonth,
"e": formatUTCDayOfMonth,
+ "f": formatUTCMicroseconds,
"H": formatUTCHour24,
"I": formatUTCHour12,
"j": formatUTCDayOfYear,
@@ -4150,9 +4156,13 @@ function formatLocale(locale) {
"m": formatUTCMonthNumber,
"M": formatUTCMinutes,
"p": formatUTCPeriod,
+ "Q": formatUnixTimestamp,
+ "s": formatUnixTimestampSeconds,
"S": formatUTCSeconds,
+ "u": formatUTCWeekdayNumberMonday,
"U": formatUTCWeekNumberSunday,
- "w": formatUTCWeekdayNumber,
+ "V": formatUTCWeekNumberISO,
+ "w": formatUTCWeekdayNumberSunday,
"W": formatUTCWeekNumberMonday,
"x": null,
"X": null,
@@ -4170,6 +4180,7 @@ function formatLocale(locale) {
"c": parseLocaleDateTime,
"d": parseDayOfMonth,
"e": parseDayOfMonth,
+ "f": parseMicroseconds,
"H": parseHour24,
"I": parseHour24,
"j": parseDayOfYear,
@@ -4177,9 +4188,13 @@ function formatLocale(locale) {
"m": parseMonthNumber,
"M": parseMinutes,
"p": parsePeriod,
+ "Q": parseUnixTimestamp,
+ "s": parseUnixTimestampSeconds,
"S": parseSeconds,
+ "u": parseWeekdayNumberMonday,
"U": parseWeekNumberSunday,
- "w": parseWeekdayNumber,
+ "V": parseWeekNumberISO,
+ "w": parseWeekdayNumberSunday,
"W": parseWeekNumberMonday,
"x": parseLocaleDate,
"X": parseLocaleTime,
@@ -4228,16 +4243,38 @@ function formatLocale(locale) {
function newParse(specifier, newDate) {
return function(string) {
var d = newYear(1900),
- i = parseSpecifier(d, specifier, string += "", 0);
+ i = parseSpecifier(d, specifier, string += "", 0),
+ week, day;
if (i != string.length) return null;
+ // If a UNIX timestamp is specified, return it.
+ if ("Q" in d) return new Date(d.Q);
+
// The am-pm flag is 0 for AM, and 1 for PM.
if ("p" in d) d.H = d.H % 12 + d.p * 12;
// Convert day-of-week and week-of-year to day-of-year.
- if ("W" in d || "U" in d) {
- if (!("w" in d)) d.w = "W" in d ? 1 : 0;
- var day = "Z" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay();
+ if ("V" in d) {
+ if (d.V < 1 || d.V > 53) return null;
+ if (!("w" in d)) d.w = 1;
+ if ("Z" in d) {
+ week = utcDate(newYear(d.y)), day = week.getUTCDay();
+ week = day > 4 || day === 0 ? d3Time.utcMonday.ceil(week) : d3Time.utcMonday(week);
+ week = d3Time.utcDay.offset(week, (d.V - 1) * 7);
+ d.y = week.getUTCFullYear();
+ d.m = week.getUTCMonth();
+ d.d = week.getUTCDate() + (d.w + 6) % 7;
+ } else {
+ week = newDate(newYear(d.y)), day = week.getDay();
+ week = day > 4 || day === 0 ? d3Time.timeMonday.ceil(week) : d3Time.timeMonday(week);
+ week = d3Time.timeDay.offset(week, (d.V - 1) * 7);
+ d.y = week.getFullYear();
+ d.m = week.getMonth();
+ d.d = week.getDate() + (d.w + 6) % 7;
+ }
+ } else if ("W" in d || "U" in d) {
+ if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
+ day = "Z" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay();
d.m = 0;
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
}
@@ -4381,7 +4418,7 @@ function formatLocale(locale) {
var pads = {"-": "", "_": " ", "0": "0"};
var numberRe = /^\s*\d+/;
var percentRe = /^%/;
-var requoteRe = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
+var requoteRe = /[\\^$*+?|[\]().{}]/g;
function pad(value, fill, width) {
var sign = value < 0 ? "-" : "",
@@ -4404,18 +4441,28 @@ function formatLookup(names) {
return map;
}
-function parseWeekdayNumber(d, string, i) {
+function parseWeekdayNumberSunday(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 1));
return n ? (d.w = +n[0], i + n[0].length) : -1;
}
+function parseWeekdayNumberMonday(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 1));
+ return n ? (d.u = +n[0], i + n[0].length) : -1;
+}
+
function parseWeekNumberSunday(d, string, i) {
- var n = numberRe.exec(string.slice(i));
+ var n = numberRe.exec(string.slice(i, i + 2));
return n ? (d.U = +n[0], i + n[0].length) : -1;
}
+function parseWeekNumberISO(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.V = +n[0], i + n[0].length) : -1;
+}
+
function parseWeekNumberMonday(d, string, i) {
- var n = numberRe.exec(string.slice(i));
+ var n = numberRe.exec(string.slice(i, i + 2));
return n ? (d.W = +n[0], i + n[0].length) : -1;
}
@@ -4430,7 +4477,7 @@ function parseYear(d, string, i) {
}
function parseZone(d, string, i) {
- var n = /^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(string.slice(i, i + 6));
+ var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
}
@@ -4469,11 +4516,26 @@ function parseMilliseconds(d, string, i) {
return n ? (d.L = +n[0], i + n[0].length) : -1;
}
+function parseMicroseconds(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 6));
+ return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
+}
+
function parseLiteralPercent(d, string, i) {
var n = percentRe.exec(string.slice(i, i + 1));
return n ? i + n[0].length : -1;
}
+function parseUnixTimestamp(d, string, i) {
+ var n = numberRe.exec(string.slice(i));
+ return n ? (d.Q = +n[0], i + n[0].length) : -1;
+}
+
+function parseUnixTimestampSeconds(d, string, i) {
+ var n = numberRe.exec(string.slice(i));
+ return n ? (d.Q = (+n[0]) * 1000, i + n[0].length) : -1;
+}
+
function formatDayOfMonth(d, p) {
return pad(d.getDate(), p, 2);
}
@@ -4494,6 +4556,10 @@ function formatMilliseconds(d, p) {
return pad(d.getMilliseconds(), p, 3);
}
+function formatMicroseconds(d, p) {
+ return formatMilliseconds(d, p) + "000";
+}
+
function formatMonthNumber(d, p) {
return pad(d.getMonth() + 1, p, 2);
}
@@ -4506,11 +4572,22 @@ function formatSeconds(d, p) {
return pad(d.getSeconds(), p, 2);
}
+function formatWeekdayNumberMonday(d) {
+ var day = d.getDay();
+ return day === 0 ? 7 : day;
+}
+
function formatWeekNumberSunday(d, p) {
return pad(d3Time.timeSunday.count(d3Time.timeYear(d), d), p, 2);
}
-function formatWeekdayNumber(d) {
+function formatWeekNumberISO(d, p) {
+ var day = d.getDay();
+ d = (day >= 4 || day === 0) ? d3Time.timeThursday(d) : d3Time.timeThursday.ceil(d);
+ return pad(d3Time.timeThursday.count(d3Time.timeYear(d), d) + (d3Time.timeYear(d).getDay() === 4), p, 2);
+}
+
+function formatWeekdayNumberSunday(d) {
return d.getDay();
}
@@ -4553,6 +4630,10 @@ function formatUTCMilliseconds(d, p) {
return pad(d.getUTCMilliseconds(), p, 3);
}
+function formatUTCMicroseconds(d, p) {
+ return formatUTCMilliseconds(d, p) + "000";
+}
+
function formatUTCMonthNumber(d, p) {
return pad(d.getUTCMonth() + 1, p, 2);
}
@@ -4565,11 +4646,22 @@ function formatUTCSeconds(d, p) {
return pad(d.getUTCSeconds(), p, 2);
}
+function formatUTCWeekdayNumberMonday(d) {
+ var dow = d.getUTCDay();
+ return dow === 0 ? 7 : dow;
+}
+
function formatUTCWeekNumberSunday(d, p) {
return pad(d3Time.utcSunday.count(d3Time.utcYear(d), d), p, 2);
}
-function formatUTCWeekdayNumber(d) {
+function formatUTCWeekNumberISO(d, p) {
+ var day = d.getUTCDay();
+ d = (day >= 4 || day === 0) ? d3Time.utcThursday(d) : d3Time.utcThursday.ceil(d);
+ return pad(d3Time.utcThursday.count(d3Time.utcYear(d), d) + (d3Time.utcYear(d).getUTCDay() === 4), p, 2);
+}
+
+function formatUTCWeekdayNumberSunday(d) {
return d.getUTCDay();
}
@@ -4593,7 +4685,15 @@ function formatLiteralPercent() {
return "%";
}
-var locale$1;
+function formatUnixTimestamp(d) {
+ return +d;
+}
+
+function formatUnixTimestampSeconds(d) {
+ return Math.floor(+d / 1000);
+}
+
+var locale;
@@ -4611,12 +4711,12 @@ defaultLocale({
});
function defaultLocale(definition) {
- locale$1 = formatLocale(definition);
- exports.timeFormat = locale$1.format;
- exports.timeParse = locale$1.parse;
- exports.utcFormat = locale$1.utcFormat;
- exports.utcParse = locale$1.utcParse;
- return locale$1;
+ locale = formatLocale(definition);
+ exports.timeFormat = locale.format;
+ exports.timeParse = locale.parse;
+ exports.utcFormat = locale.utcFormat;
+ exports.utcParse = locale.utcParse;
+ return locale;
}
var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ";
@@ -4648,11 +4748,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
})));
},{"d3-time":10}],10:[function(require,module,exports){
-// https://d3js.org/d3-time/ Version 1.0.4. Copyright 2016 Mike Bostock.
+// https://d3js.org/d3-time/ Version 1.0.7. Copyright 2017 Mike Bostock.
(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- (factory((global.d3 = global.d3 || {})));
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
+ (factory((global.d3 = global.d3 || {})));
}(this, (function (exports) { 'use strict';
var t0 = new Date;
@@ -4693,7 +4793,13 @@ function newInterval(floori, offseti, count, field) {
return newInterval(function(date) {
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
}, function(date, step) {
- if (date >= date) while (--step >= 0) while (offseti(date, 1), !test(date)) {} // eslint-disable-line no-empty
+ if (date >= date) {
+ if (step < 0) while (++step <= 0) {
+ while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
+ } else while (--step >= 0) {
+ while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
+ }
+ }
});
};
@@ -5131,20 +5237,18 @@ function color() {
//positions cells and text
if (orient === "vertical") {
- (function () {
- var cellSize = textSize.map(function (d, i) {
- return Math.max(d.height, shapeSize[i].height);
- });
+ var cellSize = textSize.map(function (d, i) {
+ return Math.max(d.height, shapeSize[i].height);
+ });
- cellTrans = function cellTrans(d, i) {
- var height = (0, _d3Array.sum)(cellSize.slice(0, i));
- return 'translate(0, ' + (height + i * shapePadding) + ')';
- };
+ cellTrans = function cellTrans(d, i) {
+ var height = (0, _d3Array.sum)(cellSize.slice(0, i));
+ return 'translate(0, ' + (height + i * shapePadding) + ')';
+ };
- textTrans = function textTrans(d, i) {
- return 'translate( ' + (shapeSize[i].width + shapeSize[i].x + labelOffset) + ', ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')';
- };
- })();
+ textTrans = function textTrans(d, i) {
+ return 'translate( ' + (shapeSize[i].width + shapeSize[i].x + labelOffset) + ', ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')';
+ };
} else if (orient === "horizontal") {
cellTrans = function cellTrans(d, i) {
return 'translate(' + i * (shapeSize[i].width + shapePadding) + ',0)';
@@ -5678,21 +5782,19 @@ function size() {
//positions cells and text
if (orient === "vertical") {
- (function () {
- var cellSize = textSize.map(function (d, i) {
- return Math.max(d.height, shapeSize[i].height);
- });
- var y = shape == "circle" || shape == "line" ? shapeSize[0].height / 2 : 0;
- cellTrans = function cellTrans(d, i) {
- var height = (0, _d3Array.sum)(cellSize.slice(0, i));
+ var cellSize = textSize.map(function (d, i) {
+ return Math.max(d.height, shapeSize[i].height);
+ });
+ var y = shape == "circle" || shape == "line" ? shapeSize[0].height / 2 : 0;
+ cellTrans = function cellTrans(d, i) {
+ var height = (0, _d3Array.sum)(cellSize.slice(0, i));
- return 'translate(0, ' + (y + height + i * shapePadding) + ')';
- };
+ return 'translate(0, ' + (y + height + i * shapePadding) + ')';
+ };
- textTrans = function textTrans(d, i) {
- return 'translate( ' + (maxW + labelOffset) + ',\n ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')';
- };
- })();
+ textTrans = function textTrans(d, i) {
+ return 'translate( ' + (maxW + labelOffset) + ',\n ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')';
+ };
} else if (orient === "horizontal") {
cellTrans = function cellTrans(d, i) {
var width = (0, _d3Array.sum)(shapeSize.slice(0, i), function (d) {
@@ -5929,19 +6031,17 @@ function symbol() {
//positions cells and text
if (orient === "vertical") {
- (function () {
- var cellSize = textSize.map(function (d, i) {
- return Math.max(maxH, d.height);
- });
+ var cellSize = textSize.map(function (d, i) {
+ return Math.max(maxH, d.height);
+ });
- cellTrans = function cellTrans(d, i) {
- var height = (0, _d3Array.sum)(cellSize.slice(0, i));
- return 'translate(0, ' + (height + i * shapePadding) + ' )';
- };
- textTrans = function textTrans(d, i) {
- return 'translate( ' + (maxW + labelOffset) + ',\n ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')';
- };
- })();
+ cellTrans = function cellTrans(d, i) {
+ var height = (0, _d3Array.sum)(cellSize.slice(0, i));
+ return 'translate(0, ' + (height + i * shapePadding) + ' )';
+ };
+ textTrans = function textTrans(d, i) {
+ return 'translate( ' + (maxW + labelOffset) + ',\n ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')';
+ };
} else if (orient === "horizontal") {
cellTrans = function cellTrans(d, i) {
return 'translate( ' + i * (maxW + shapePadding) + ',0)';
@@ -6088,4 +6188,4 @@ d3.legendSymbol = _symbol2.default;
d3.legendHelpers = _helpers2.default;
},{"./color":11,"./helpers":12,"./size":14,"./symbol":15}]},{},[16])
-//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvZDMtYXJyYXkvYnVpbGQvZDMtYXJyYXkuanMiLCJub2RlX21vZHVsZXMvZDMtY29sbGVjdGlvbi9idWlsZC9kMy1jb2xsZWN0aW9uLmpzIiwibm9kZV9tb2R1bGVzL2QzLWNvbG9yL2J1aWxkL2QzLWNvbG9yLmpzIiwibm9kZV9tb2R1bGVzL2QzLWRpc3BhdGNoL2J1aWxkL2QzLWRpc3BhdGNoLmpzIiwibm9kZV9tb2R1bGVzL2QzLWZvcm1hdC9idWlsZC9kMy1mb3JtYXQuanMiLCJub2RlX21vZHVsZXMvZDMtaW50ZXJwb2xhdGUvYnVpbGQvZDMtaW50ZXJwb2xhdGUuanMiLCJub2RlX21vZHVsZXMvZDMtc2NhbGUvYnVpbGQvZDMtc2NhbGUuanMiLCJub2RlX21vZHVsZXMvZDMtc2VsZWN0aW9uL2J1aWxkL2QzLXNlbGVjdGlvbi5qcyIsIm5vZGVfbW9kdWxlcy9kMy10aW1lLWZvcm1hdC9idWlsZC9kMy10aW1lLWZvcm1hdC5qcyIsIm5vZGVfbW9kdWxlcy9kMy10aW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GFzY2VuZGluZ0Jpc2VjdC5sZWZ0O1xuXG4gIGZ1bmN0aW9uIGRlc2NlbmRpbmcoYSwgYikge1xuICAgIHJldHVybiBiIDwgYSA/IC0xIDogYiA+IGEgPyAxIDogYiA+PSBhID8gMCA6IE5hTjtcbiAgfVxuXG4gIGZ1bmN0aW9uIG51bWJlcih4KSB7XG4gICAgcmV0dXJuIHggPT09IG51bGwgPyBOYU4gOiAreDtcbiAgfVxuXG4gIGZ1bmN0aW9uIHZhcmlhbmNlKGFycmF5LCBmKSB7XG4gICAgdmFyIG4gPSBhcnJheS5sZW5ndGgsXG4gICAgICAgIG0gPSAwLFxuICAgICAgICBhLFxuICAgICAgICBkLFxuICAgICAgICBzID0gMCxcbiAgICAgICAgaSA9IC0xLFxuICAgICAgICBqID0gMDtcblxuICAgIGlmIChmID09IG51bGwpIHtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGlmICghaXNOYU4oYSA9IG51bWJlcihhcnJheVtpXSkpKSB7XG4gICAgICAgICAgZCA9IGEgLSBtO1xuICAgICAgICAgIG0gKz0gZCAvICsrajtcbiAgICAgICAgICBzICs9IGQgKiAoYSAtIG0pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgZWxzZSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBpZiAoIWlzTmFOKGEgPSBudW1iZXIoZihhcnJheVtpXSwgaSwgYXJyYXkpKSkpIHtcbiAgICAgICAgICBkID0gYSAtIG07XG4gICAgICAgICAgbSArPSBkIC8gKytqO1xuICAgICAgICAgIHMgKz0gZCAqIChhIC0gbSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoaiA+IDEpIHJldHVybiBzIC8gKGogLSAxKTtcbiAgfVxuXG4gIGZ1bmN0aW9uIGRldmlhdGlvbihhcnJheSwgZikge1xuICAgIHZhciB2ID0gdmFyaWFuY2UoYXJyYXksIGYpO1xuICAgIHJ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AgICBTO1xuXG4gIC8vIFNwZWNpYWwgY2FzZSBmb3IgdTAg4omFIHUxLlxuICBpZiAoZDIgPCBlcHNpbG9uMikge1xuICAgIFMgPSBNYXRoLmxvZyh3MSAvIHcwKSAvIHJobztcbiAgICBpID0gZnVuY3Rpb24odCkge1xuICAgICAgcmV0dXJuIFtcbiAgICAgICAgdXgwICsgdCAqIGR4LFxuICAgICAgICB1eTAgKyB0ICogZHksXG4gICAgICAgIHcwICogTWF0aC5leHAocmhvICogdCAqIFMpXG4gICAgICBdO1xuICAgIH07XG4gIH1cblxuICAvLyBHZW5lcmFsIGNhc2UuXG4gIGVsc2Uge1xuICAgIHZhciBkMSA9IE1hdGguc3FydChkMiksXG4gICAgICAgIGIwID0gKHcxICogdzEgLSB3MCAqIHcwICsgcmhvNCAqIGQyKSAvICgyICogdzAgKiByaG8yICogZDEpLFxuICAgICAgICBiMSA9ICh3MSAqIHcxIC0gdzAgKiB3MCAtIHJobzQgKiBkMikgLyAoMiAqIHcxICogcmhvMiAqIGQxKSxcbiAgICAgICAgcjAgPSBNYXRoLmxvZyhNYXRoLnNxcnQoYjAgKiBiMCArIDEpIC0gYjApLFxuICAgICAgICByMSA9IE1hdGgubG9nKE1hdGguc3FydChiMSAqIGIxICsgMSkgLSBiMSk7XG4gICAgUyA9IChyMSAtIHIwKSAvIHJobztcbiAgICBpID0gZnVuY3Rpb24odCkge1xuICAgICAgdmFyIHMgPSB0ICogUyxcbiAgICAgICAgICBjb3NocjAgPSBjb3NoKHIwKSxcbiAgICAgICAgICB1ID0gdzAgLyAocmhvMiAqIGQxKSAqIChjb3NocjAgKiB0YW5oKHJobyAqIHMgKyByMCkgLSBzaW5oKHIwKSk7XG4gICAgICByZXR1cm4gW1xuICAgICAgICB1eDAgKyB1ICogZHgsXG4gICAgICAgIHV5MCArIHUgKiBkeSxcbiAgICAgICAgdzAgKiBjb3NocjAgLyBjb3NoKHJobyAqIHMgKyByMClcbiAgICAgIF07XG4gICAgfTtcbiAgfV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lmICghaW5kZXguaGFzKGtleSA9IChkID0gX1tpXSkgKyBcIlwiKSkgaW5kZXguc2V0KGtleSwgZG9tYWluLnB1c2goZCkpO1xuICAgICAgcmV0dXJuIHNjYWxlO1xuICAgIH07XG5cbiAgICBzY2FsZS5yYW5nZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKHJhbmdlID0gc2xpY2UuY2FsbChfKSwgc2NhbGUpIDogcmFuZ2Uuc2xpY2UoKTtcbiAgICB9O1xuXG4gICAgc2NhbGUudW5rbm93biA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKHVua25vd24gPSBfLCBzY2FsZSkgOiB1bmtub3duO1xuICAgIH07XG5cbiAgICBzY2FsZS5jb3B5ID0gZnVuY3Rpb24oKSB7XG4gICAgICByZXR1cm4gb3JkaW5hbCgpXG4gICAgICAgICAgLmRvbWFpbihkb21haW4pXG4gICAgICAgICAgLnJhbmdlKHJhbmdlKVxuICAgICAgICAgIC51bmtub3duKHVua25vd24pO1xuICAgIH07XG5cbiAgICByZXR1cm4gc2NhbGU7XG4gIH1cblxuICBmdW5jdGlvbiBiYW5kKCkge1xuICAgIHZhciBzY2FsZSA9IG9yZGluYWwoKS51bmtub3duKHVuZGVmaW5lZCksXG4gICAgICAgIGRvbWFpbiA9IHNjYWxlLmRvbWFpbixcbiAgICAgICAgb3JkaW5hbFJhbmdlID0gc2NhbGUucmFuZ2UsXG4gICAgICAgIHJhbmdlID0gWzAsIDFdLFxuICAgICAgICBzdGVwLFxuICAgICAgICBiYW5kd2lkdGgsXG4gICAgICAgIHJvdW5kID0gZmFsc2UsXG4gICAgICAgIHBhZGRpbmdJbm5lciA9IDAsXG4gICAgICAgIHBhZGRpbmdPdXRlciA9IDAsXG4gICAgICAgIGFsaWduID0gMC41O1xuXG4gICAgZGVsZXRlIHNjYWxlLnVua25vd247XG5cbiAgICBmdW5jd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sIHYgPSBpO1xuXG4gICAgICB2YXIgaSA9IGxvZ3ModSksXG4gICAgICAgICAgaiA9IGxvZ3ModiksXG4gICAgICAgICAgcCxcbiAgICAgICAgICBrLFxuICAgICAgICAgIHQsXG4gICAgICAgICAgbiA9IGNvdW50ID09IG51bGwgPyAxMCA6ICtjb3VudCxcbiAgICAgICAgICB6ID0gW107XG5cbiAgICAgIGlmICghKGJhc2UgJSAxKSAmJiBqIC0gaSA8IG4pIHtcbiAgICAgICAgaSA9IE1hdGgucm91bmQoaSkgLSAxLCBqID0gTWF0aC5yb3VuZChqKSArIDE7XG4gICAgICAgIGlmICh1ID4gMCkgZm9yICg7IGkgPCBqOyArK2kpIHtcbiAgICAgICAgICBmb3IgKGsgPSAxLCBwID0gcG93cyhpKTsgayA8IGJhc2U7ICsraykge1xuICAgICAgICAgICAgdCA9IHAgKiBrO1xuICAgICAgICAgICAgaWYgKHQgPCB1KSBjb250aW51ZTtcbiAgICAgICAgICAgIGlmICh0ID4gdikgYnJlYWs7XG4gICAgICAgICAgICB6LnB1c2godCk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgZm9yICg7IGkgPCBqOyArK2kpIHtcbiAgICAgICAgICBmb3IgKGsgPSBiYXNlIC0gMSwgcCA9IHBvd3MoaSk7IGsgPj0gMTsgLS1rKSB7XG4gICAgICAgICAgICB0ID0gcCAqIGs7XG4gICAgICAgICAgICBpZiAodCA8IHUpIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKHQgPiB2KSBicmVhaztcbiAgICAgICAgICAgIHoucHVzaCh0KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHogPSBkM0FycmF5LnRpY2tzKGksIGosIE1hdGgubWluKGogLSBpLCBuKSkubWFwKHBvd3MpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gciA/IHoucmV2ZXJzZSgpIDogejtcbiAgICB9O1xuXG4gICAgc2NhbGUudGlja0Zvc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cHkoc2NhbGUsIGxvZygpLmJhc2UoYmFzZSkpO1xuICAgIH07XG5cbiAgICByZXR1cm4gc2NhbGU7XG4gIH1cblxuICBmdW5jdGlvbiByYWlzZSh4LCBleHBvbmVudCkge1xuICAgIHJldHVybiB4IDwgMCA/IC1NYXRoLnBvdygteCwgZXhwb25lbnQpIDogTWF0aC5wb3coeCwgZXhwb25lbnQpO1xuICB9XG5cbiAgZnVuY3Rpb24gcG93KCkge1xuICAgIHZhciBleHBvbmVudCA9IDEsXG4gICAgICAgIHNjYWxlID0gY29udGludW91cyhkZWludGVycG9sYXRlLCByZWludGVycG9sYXRlKSxcbiAgICAgICAgZG9tYWluID0gc2NhbGUuZG9tYWluO1xuXG4gICAgZnVuY3Rpb24gZGVpbnRlcnBvbGF0ZShhLCBiKSB7XG4gICAgICByZXR1cm4gKGIgPSByYWlzZShiLCBleHBvbmVudCkgLSAoYSA9IHJhaXNlKGEsIGV4cG9uZW50KSkpXG4gICAgICAgICAgPyBmdW5jdGlvbih4KSB7IHJldHVybiAocmFpc2UoeCwgZXhwb25lbnQpIC0gYSkgLyBiOyB9XG4gICAgICAgICAgOiBjb25zdGFudChiKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZWludGVycG9sYXRlKGEsIGIpIHtcbiAgICAgIGIgPSByYWlzZShiLCBleHBvbmVudCkgLSAoYSA9IHJhaXNlKGEsIGV4cG9uZW50KSk7XG4gICAgICByZXR1cm4gZnVuY3Rpb24odCkgeyByZXR1cm4gcmFpc2UoYSArIGIgKiB0LCAxIC8gZXhwb25lbnQpOyB9O1xuICAgIH1cblxuICAgIHNjYWxlLmV4cG9uZW50ID0gZnVuY3Rpb24oXykge1xuICAgICAgcmV0dXJuIGFyZ3VtZW50cy5sZW5ndGggPyAoZXhwb25lbnQgPSArXywgZG9tYWluKGRvbWFpbigpKSkgOiBleHBvbmVudDtcbiAgICB9O1xuXG4gICAgc2NhbGUuY29weSA9IGZ1bmN0aW9uKCkge1xuICAgICAgcmV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dFNpemUgPSB0ZXh0Lm5vZGVzKCkubWFwKCBkID0+IGQuZ2V0QkJveCgpKSxcbiAgICAgIHNoYXBlU2l6ZSA9IHNoYXBlcy5ub2RlcygpLm1hcChcbiAgICAgICAgICAoZCwgaSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgYmJveCA9IGQuZ2V0QkJveCgpXG4gICAgICAgICAgICBjb25zdCBzdHJva2UgPSBzY2FsZSh0eXBlLmRhdGFbaV0pO1xuXG4gICAgICAgICAgICBpZiAoc2hhcGUgPT09IFwibGluZVwiICYmIG9yaWVudCA9PT0gXCJob3Jpem9udGFsXCIpIHtcbiAgICAgICAgICAgICAgYmJveC5oZWlnaHQgPSBiYm94LmhlaWdodCArIHN0cm9rZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT09IFwibGluZVwiICYmIG9yaWVudCA9PT0gXCJ2ZXJ0aWNhbFwiKXtcbiAgICAgICAgICAgICAgYmJveC53aWR0aCA9IGJib3gud2lkdGg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYmJveDtcbiAgICAgICAgfSk7XG4gICAgICAvL2NvbnNvbGUubG9nKCdTSEFQRVNJWkUnKVxuICAgICAgY29uc3QgbWF4SCA9IG1heChzaGFwZVNpemUsIGQgPT4gZC5oZWlnaHQgKyBkLnkpLFxuICAgICAgbWF4VyA9IG1heChzaGFwZVNpemUsIGQgPT4gZC53aWR0aCArIGQueCk7XG5cbiAgICAgIGxldCBjZWxsVHJhbnMsXG4gICAgICB0ZXh0VHJhbnMsXG4gICAgICB0ZXh0QWxpZ24gPSAobGFiZWxBbGlnbiA9PSBcInN0YXJ0XCIpID8gMCA6IChsYWJlbEFsaWduID09IFwibWlkZGxlXCIpID8gMC41IDogMTtcblxuICAgICAgLy9wb3NpdGlvbnMgY2VsbHMgYW5kIHRleHRcbiAgICAgIGlmIChvcmllbnQgPT09IFwidmVydGljYWxcIil7XG4gICAgICAgIGNvbnN0IGNlbGxTaXpl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gIHMgKz0gZCAqIChhIC0gbSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBlbHNlIHtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGlmICghaXNOYU4oYSA9IG51bWJlcihmKGFycmF5W2ldLCBpLCBhcnJheSkpKSkge1xuICAgICAgICAgIGQgPSBhIC0gbTtcbiAgICAgICAgICBtICs9IGQgLyArK2o7XG4gICAgICAgICAgcyArPSBkICogKGEgLSBtKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChqID4gMSkgcmV0dXJuIHMgLyAoaiAtIDEpO1xuICB9XG5cbiAgZnVuY3Rpb24gZGV2aWF0aW9uKGFycmF5LCBmKSB7XG4gICAgdmFyIHYgPSB2YXJpYW5jZShhcnJheSwgZik7XG4gICAgcmV0dXJuIHYgPyBNYXRoLnNxcnQodikgOiB2O1xuICB9XG5cbiAgZnVuY3Rpb24gZXh0ZW50KGFycmF5LCBmKSB7XG4gICAgdmFyIGkgPSAtMSxcbiAgICAgICAgbiA9IGFycmF5Lmxlbmd0aCxcbiAgICAgICAgYSxcbiAgICAgICAgYixcbiAgICAgICAgYztcblxuICAgIGlmIChmID09IG51bGwpIHtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSBpZiAoKGIgPSBhcnJheVtpXSkgIT0gbnVsbCAmJiBiID49IGIpIHsgYSA9IGMgPSBiOyBicmVhazsgfVxuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGFycmF5W2ldKSAhPSBudWxsKSB7XG4gICAgICAgIGlmIChhID4gYikgYSA9IGI7XG4gICAgICAgIGlmIChjIDwgYikgYyA9IGI7XG4gICAgICB9XG4gICAgfVxuXG4gICAgZWxzZSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gZihhcnJheVtpXSwgaSwgYXJyYXkpKSAhPSBudWxsICYmIGIgPj0gYikgeyBhID0gYyA9IGI7IGJyZWFrO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SkgOiBiYXNlO1xuICAgIH07XG5cbiAgICBzY2FsZS5kb21haW4gPSBmdW5jdGlvbihfKSB7XG4gICAgICByZXR1cm4gYXJndW1lbnRzLmxlbmd0aCA/IChkb21haW4oXyksIHJlc2NhbGUoKSkgOiBkb21haW4oKTtcbiAgICB9O1xuXG4gICAgc2NhbGUudGlja3MgPSBmdW5jdGlvbihjb3VudCkge1xuICAgICAgdmFyIGQgPSBkb21haW4oKSxcbiAgICAgICAgICB1ID0gZFswXSxcbiAgICAgICAgICB2ID0gZFtkLmxlbmd0aCAtIDFdLFxuICAgICAgICAgIHI7XG5cbiAgICAgIGlmIChyID0gdiA8IHUpIGkgPSB1LCB1ID0gdiwgdiA9IGk7XG5cbiAgICAgIHZhciBpID0gbG9ncyh1KSxcbiAgICAgICAgICBqID0gbG9ncyh2KSxcbiAgICAgICAgICBwLFxuICAgICAgICAgIGssXG4gICAgICAgICAgdCxcbiAgICAgICAgICBuID0gY291bnQgPT0gbnVsbCA/IDEwIDogK2NvdW50LFxuICAgICAgICAgIHogPSBbXTtcblxuICAgICAgaWYgKCEoYmFzZSAlIDEpICYmIGogLSBpIDwgbikge1xuICAgICAgICBpID0gTWF0aC5yb3VuZChpKSAtIDEsIGogPSBNYXRoLnJvdW5kKGopICsgMTtcbiAgICAgICAgaWYgKHUgPiAwKSBmb3IgKDsgaSA8IGo7ICsraSkge1xuICAgICAgICAgIGZvciAoayA9IDEsIHAgPSBwb3dzKGkpOyBrIDwgYmFzZTsgKytrKSB7XG4gICAgICAgICAgICB0ID0gcCAqIGs7XG4gICAgICAgICAgICBpZiAodCA8IHUpIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKHQgPiB2KSBicmVhaztcbiAgICAgICAgICAgIHoucHVzaCh0KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBmb3IgKDsgaSA8IGo7ICsraSkge1xuICAgICAgICAgIGZvciAoayA9IGJhc2UgLSAxLCBwID0gcG93cyhpKTsgayA+PSAxOyAtLWspIHtcbiAgICAgICAgICAgIHQgPSBwICogaztcbiAgICAgICAgICAgIGlmICh0IDwgdSkgY29udGludWU7XG4gICAgICAgICAgICBpZiAodCA+IHYpIGJyZWFrO1xuICAgICAgICAgICAgei5wdXNoKHQpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgeiA9IGQzQXJyYXkudGlja3MoaSwgaiwgTWF0aC5taW4oaiAtIGksIG4pKS5tYXAocG93cyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiByID8gei5yZXZlcnNlKCkgOiB6O1xuICAgIH07XG5cbiAgICBzY2FsZS50aWNrRm9ybWF0ID0gZnVuY3Rpb24oY291bnQsIHNwZWNpZmllcikge1xuICAgICAgaWYgKHNwZWNpZmllciA9PSBudWxsKSBzcGVjaWZpZXIgPSBiYXNlID09PSAxMCA/IFwiLjBlXCIgOiBcIixcIjtcbiAgICAgIGlmICh0eXBlb2Ygc3BlY2lmaWVyICE9PSBcImZ1bmN0aW9uXCIpIHNwZWNpZmllciA9IGQzRm9ybWF0LmZvcm1hdChzcGVjaWZpZXIpO1xuICAgICAgaWYgKGNvdW50ID09PSBJbmZpbml0eSkgcmV0dXJuIHNwZWNpZmllcjtcbiAgICAgIGlmIChjb3VudCA9PSBudWxsKSBjb3VudCA9IDEwO1xuICAgICAgdmFyIGsgPSBNYXRoLm1heCgxLCBiYXNlICogY291bnQgLyBzY2FsZS50aWNrcygpLmxlbmd0aCk7IC8vIFRPRE8gZmFzdCBlc3RpbWF0ZT9cbiAgICAgIHJldHVybiBmdW5jdGlvbihkKSB7XG4gICAgICAgIHZhciBpID0gZCAvIHBvd3MoTWF0aC5yb3VuZChsb2dzKGQpKSk7XG4gICAgICAgIGlmIChpICogYmFzZSA8IGJhc2UgLSAwLjUpIGkgKj0gYmFzZTtcbiAgICAgICAgcmV0dXJuIGkgPD0gayA/IHNwZWNpZmllcihkKSA6IFwiXCI7XG4gICAgICB9O1xuICAg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xuICAgICAgWyAgaG91ciwgIDEsICAgICAgZHVyYXRpb25Ib3VyICBdLFxuICAgICAgWyAgaG91ciwgIDMsICAzICogZHVyYXRpb25Ib3VyICBdLFxuICAgICAgWyAgaG91ciwgIDYsICA2ICogZHVyYXRpb25Ib3VyICBdLFxuICAgICAgWyAgaG91ciwgMTIsIDEyICogZHVyYXRpb25Ib3VyICBdLFxuICAgICAgWyAgIGRheSwgIDEsICAgICAgZHVyYXRpb25EYXkgICBdLFxuICAgICAgWyAgIGRheSwgIDIsICAyICogZHVyYXRpb25EYXkgICBdLFxuICAgICAgWyAgd2VlaywgIDEsICAgICAgZHVyYXRpb25XZWVrICBdLFxuICAgICAgWyBtb250aCwgIDEsICAgICAgZHVyYXRpb25Nb250aCBdLFxuICAgICAgWyBtb250aCwgIDMsICAzICogZHVyYXRpb25Nb250aCBdLFxuICAgICAgWyAgeWVhciwgIDEsICAgICAgZHVyYXRpb25ZZWFyICBdXG4gICAgXTtcblxuICAgIGZ1bmN0aW9uIHRpY2tGb3JtYXQoZGF0ZSkge1xuICAgICAgcmV0dXJuIChzZWNvbmQoZGF0ZSkgPCBkYXRlID8gZm9ybWF0TWlsbGlzZWNvbmRcbiAgICAgICAgICA6IG1pbnV0ZShkYXRlKSA8IGRhdGUgPyBmb3JtYXRTZWNvbmRcbiAgICAgICAgICA6IGhvdXIoZGF0ZSkgPCBkYXRlID8gZm9ybWF0TWludXRlXG4gICAgICAgICAgOiBkYXkoZGF0ZSkgPCBkYXRlID8gZm9ybWF0SG91clxuICAgICAgICAgIDogbW9udGgoZGF0ZSkgPCBkYXRlID8gKHdlZWsoZGF0ZSkgPCBkYXRlID8gZm9ybWF0RGF5IDogZm9ybWF0V2VlaylcbiAgICAgICAgICA6IHllYXIoZGF0ZSkgPCBkYXRlID8gZm9ybWF0TW9udGhcbiAgICAgICAgICA6IGZvcm1hdFllYXIpKGRhdGUpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHRpY2tJbnRlcnZhbChpb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ZSA9PT0gbGVnZW5kRGlzcGF0Y2hlciA/IGxlZ2VuZCA6IHZhbHVlO1xuICB9XG5cbiAgcmV0dXJuIGxlZ2VuZDtcblxufTtcbiIsImltcG9ydCBjb2xvciBmcm9tICcuL2NvbG9yJ1xuaW1wb3J0IHNpemUgZnJvbSAnLi9zaXplJ1xuaW1wb3J0IHN5bWJvbCBmcm9tICcuL3N5bWJvbCdcbmltcG9ydCBoZWxwZXJzIGZyb20gJy4vaGVscGVycydcblxuZDMubGVnZW5kQ29sb3IgPSBjb2xvclxuZDMubGVnZW5kU2l6ZSA9IHNpemVcbmQzLmxlZ2VuZFN5bWJvbCA9IHN5bWJvbFxuZDMubGVnZW5kSGVscGVycyA9IGhlbHBlcnNcbiJdfQ==
diff --git a/d3-legend.min.js b/d3-legend.min.js
index 2ad66c5..aacc267 100644
--- a/d3-legend.min.js
+++ b/d3-legend.min.js
@@ -1,3 +1,3 @@
-!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g
"+g(m.message+"",!0)+"";throw m}}var m={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:j,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:j,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:j,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};m.bullet=/(?:[*+-]|\d+\.)/,m.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,m.item=i(m.item,"gm")(/bull/g,m.bullet)(),m.list=i(m.list)(/bull/g,m.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+m.def.source+")")(),m.blockquote=i(m.blockquote)("def",m.def)(),m._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",m.html=i(m.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/
'+(c?a:g(a,!0))+"\n
\n":""+(c?a:g(a,!0))+"\n
"},e.prototype.blockquote=function(a){return"\n"+a+"\n"},e.prototype.html=function(a){return a},e.prototype.heading=function(a,b,c){return"
"+a+"
\n"},e.prototype.table=function(a,b){return""+a+"
"},e.prototype.br=function(){return this.options.xhtml?""+g(n.message+"",!0)+"";throw n}}var m={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:j,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:j,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:j,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};m.bullet=/(?:[*+-]|\d+\.)/,m.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,m.item=i(m.item,"gm")(/bull/g,m.bullet)(),m.list=i(m.list)(/bull/g,m.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+m.def.source+")")(),m.blockquote=i(m.blockquote)("def",m.def)(),m._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",m.html=i(m.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/
'+(c?a:g(a,!0))+"\n
\n":""+(c?a:g(a,!0))+"\n
"},e.prototype.blockquote=function(a){return"\n"+a+"\n"},e.prototype.html=function(a){return a},e.prototype.heading=function(a,b,c){return"
"+a+"
\n"},e.prototype.table=function(a,b){return""+a+"
"},e.prototype.br=function(){return this.options.xhtml?"